添加:权重值中心及相关的明细页面

重构:权重值转账 - 添加手续费支持、添加密码支持;样式优化
This commit is contained in:
wuhui_zzw 2023-10-23 09:22:07 +08:00
parent c289076d49
commit 075bb41933
11 changed files with 880 additions and 559 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 KiB

View File

@ -10342,20 +10342,11 @@ const routes = [
},
// 权重值相关
{
path: "/member/weight_value",
name: "weight_value",
component:()=>import("../views/member/weight_value/index"),
path: "/member/weight_value_home",
name: "weight_value_home",
component:()=>import("../views/member/weight_value/home"),
meta: {
title: "权重值",
foot: true
}
},
{
path: "/member/weight_value_transfer",
name: "weight_value_transfer",
component:()=>import("../views/member/weight_value/transfer"),
meta: {
title: "权重值转账",
title: "权重值中心",
foot: true
}
},
@ -10364,10 +10355,32 @@ const routes = [
name: "weight_value_detailed",
component:()=>import("../views/member/weight_value/detailed"),
meta: {
title: "权重值明细",
title: "变更明细",
foot: true
}
},
{
path: "/member/weight_value",
name: "weight_value",
component:()=>import("../views/member/weight_value/index"),
meta: {
title: "我的权重值",
foot: true
}
},
{
path: "/member/weight_value_transfer",
name: "weight_value_transfer",
component:()=>import("../views/member/weight_value/transfer"),
meta: {
title: "权重值转赠",
foot: true
}
},
// 典藏室
{
path: "/member/collection_room",

View File

@ -1,28 +1,85 @@
<template>
<div id="member_balance_detailed_v2">
<c-title :hide="false" :text="'权重值明细'"></c-title>
<div class="background_box"></div>
<div class="statusBox">
<div class="statusBox_left">
<div class="txt" :class="change_type == -1 ? 'showtxt' : ''" @click="selectStatus(-1)">全部</div>
<div class="txt" :class="change_type == 1 ? 'showtxt' : ''" @click="selectStatus(1)">收入</div>
<div class="txt" :class="change_type == 0 ? 'showtxt' : ''" @click="selectStatus(0)">支出</div>
</div>
</div>
<div class="timeSelect">
<div class="totalNum">支出{{expenditure}} 收入{{ income }}</div>
</div>
<div class="list">
<div class="lis" v-for="(info, index) in list" :key="index">
<div class="lisTop">
<div class="txtName">{{ info.remark }}</div>
<div class="price">{{ info.change_type == 1 ? "+" : "-" }}{{ info.change_quantity }}</div>
</div>
<div class="lisTop dob">
<div class="time">{{ info.created_at }}</div>
<div class="balance">余额{{ info.change_after }}</div>
</div>
<div>
<c-title :hide="false" :text="page_title"></c-title>
<div class="details-content">
<div v-if="Object.values(list).length > 0" class="content-list">
<!--直推奖励&推荐代理-->
<template v-if="page_params.key_name === 'direct_push_give' || page_params.key_name === 'recommend_agent'">
<div class="list-block" v-for="(item,index) in list" :key="index">
<div class="left">
<div class="left-title">{{ item.name }}</div>
<div class="left-time">{{ item.created_at }}</div>
</div>
<div class="right">
<div class="right-increase">+ {{ item.commission_money }}</div>
</div>
</div>
</template>
<!--权重收益-->
<template v-if="page_params.key_name === 'weight_income'">
<div class="list-block" v-for="(item,index) in list" :key="index">
<div class="left">
<div class="left-title">{{ item.team_level_name }}</div>
<div class="left-time">{{ item.created_at }}</div>
</div>
<div class="right">
<div class="right-increase">+ {{ item.amount }}</div>
</div>
</div>
</template>
<!--团队收益&平级奖励-->
<template v-if="page_params.key_name === 'team_income' || page_params.key_name === 'peer_level_reward'">
<div class="list-block" v-for="(item,index) in list" :key="index">
<div class="left">
<div class="left-title">{{ item.type_name }}</div>
<div class="left-time">{{ item.created_at }}</div>
</div>
<div class="right">
<div class="right-increase">+ {{ item.dividend_amount }}</div>
</div>
</div>
</template>
<!--权重值-->
<template v-if="page_params.key_name === 'weight_value'">
<div class="list-block" v-for="(item,index) in list" :key="index">
<div class="left">
<div class="left-title">{{ item.remark }}</div>
<div class="left-time">{{ item.created_at }}</div>
</div>
<div class="right">
<div class="right-increase" v-if="item.change_type == 1">+ {{ item.change_quantity }}</div>
<div class="right-reduce" v-else>- {{ item.change_quantity }}</div>
</div>
</div>
</template>
<!--总订单金额&总订单数-->
<template v-if="page_params.key_name === 'order_money' || page_params.key_name === 'order_num'">
<div class="order-content">
<div class="order-block" v-for="(item,index) in list" :key="index">
<div class="top-info">
<div class="order-no">{{ item.order_sn }}</div>
<div class="order-status">{{ item.status_name }}</div>
</div>
<div class="goods-info">
<div class="goods-block" v-for="(goodsItem,goodsIndex) in item.order_goods" :key="goodsIndex">
<div class="goods-thumb">
<img class="goods-thumb-img" :src="goodsItem.thumb" />
</div>
<div class="goods-desc">
<div class="goods-title">{{ goodsItem.title }}</div>
<div class="good-num">× {{ goodsItem.total }}</div>
</div>
</div>
</div>
<div class="goods-footer">
<div class="create-time">{{ item.create_time }}</div>
<div class="payment-amount">¥{{ item.price }}</div>
</div>
</div>
</div>
</template>
</div>
<van-empty description="暂无数据" v-else/>
</div>
</div>
</template>
@ -32,40 +89,59 @@ export default {
mixins: [scrollMixin],
data() {
return {
page_title: '变更明细',
//
list: [],
isLoadMore: true,
page: 1,
total_page: 0,
expenditure: 0,//
income: 0,//
change_type: -1,
page_params: {},
};
},
activated() {
let _this = this;
_this.page_params = Object.assign(_this.$route.params, _this.$route.query);
_this.setPageTitle();
_this.getList();
},
methods: {
//
getData() {
//
setPageTitle(){
let titleKey = this.page_params.key_name || '';
let title = '变更明细';
console.log(titleKey);
switch (titleKey) {
case 'direct_push_give':title = '直推奖励明细';break;
case 'weight_income':title = '权重收益明细';break;
case 'team_income':title = '团队收益明细';break;
case 'recommend_agent':title = '推荐代理明细';break;
case 'peer_level_reward':title = '平级奖励明细';break;
case 'weight_value':title = '权重值明细';break;
case 'order_money':case 'order_num':title = '订单明细';break;
}
document.title = this.page_title = title;
},
//
getList() {
let _this = this;
let json = {
search: {
change_type: _this.change_type,// 0=1=
},
let params = {
team_level_id: _this.page_params.team_level_id,
key_name: _this.page_params.key_name,
page: _this.page
};
$http.post("finance.weight-value.record", json, "加载中...")
$http.post("plugin.weight-value.api.index.get-details", params, "加载中...")
.then(response => {
if (response.result === 1) {
_this.isLoadMore = true;
if(_this.page === 1){
_this.total_page = response.data.last_page;
_this.list = response.data.list;
_this.expenditure = response.data.expenditure;//
_this.income = response.data.income;//
let data = response.data;
if(parseInt(data.current_page) === 1){
_this.total_page = data.last_page;
_this.list = data.data;
}else{
_this.list = _this.list.concat(response.data.list);
if(Object.values(data.data).length > 0) _this.list = Object.values(_this.list).concat(Object.values(data.data));
}
} else {
_this.noneShow = true;
_this.isLoadMore = false; //
_this.list = [];
}
@ -83,233 +159,167 @@ export default {
return;
} else {
_this.page += 1;
_this.getData();
_this.getList();
}
},
//
selectStatus(key) {
this.isLoadMore = true;
this.page = 1;
this.total_page = 0;
this.list = [];
this.change_type = key;
this.getData();
},
},
activated() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.listTxt {
padding: 2rem 0;
}
@keyframes ident {
0% {
opacity: 0;
}
50% {
opacity: 0.75;
}
100% {
opacity: 1;
}
}
.showPosBox {
animation: ident 0.5s;
}
.background_box {
color: #382c0a;
background-color: #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(var(--themeBaseColor)), to(#f5f5f5));
background-image: -webkit-linear-gradient(var(--themeBaseColor), #f5f5f5);
background-image: linear-gradient(var(--themeBaseColor), #f5f5f5);
min-height: 9.25rem;
padding: 1.5938rem 1.0938rem 0 1.0938rem;
}
.statusBox {
margin: 0 0.625rem;
margin-top: -7rem;
margin-bottom: 0.625rem;
display: flex;
justify-content: space-between;
z-index: 1;
position: relative;
.statusBox_left {
display: flex;
font-size: 0.75rem;
color: #262626;
.txt {
line-height: 1.875rem;
width: 3.75rem;
}
.showtxt {
width: 3.75rem;
height: 1.875rem;
background: #fff;
border-radius: 0.9375rem;
}
}
.statusBox_right {
min-width: 5.3125rem;
height: 1.875rem;
background: #fdefbd;
border-radius: 0.3125rem;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.4688rem;
position: relative;
.txt {
flex: 1;
text-align: center;
}
.statusBox_right_pos {
background: #fdefbd;
position: absolute;
bottom: -4.3rem;
left: 0;
.details-content {
width: 100vw;
min-height: calc(100vh - 40px);
//background-image: linear-gradient(#fe9a51, #f5f5f5);
.content-list {
.list-block {
width: 100%;
z-index: 22222222;
border-radius: 0 0 0.3125rem 0.3125rem;
.postxt {
height: 1.5rem;
line-height: 1.5rem;
}
}
}
}
.list {
margin: 0 0.625rem;
padding: 0 0.875rem;
margin-top: 0.9375rem;
background: #fff;
border-radius: 0.625rem;
margin-bottom: 0.625rem;
.lis:first-child {
border: none;
}
.lis {
display: flex;
flex-direction: column;
padding: 0.9375rem 0;
border-bottom: 1px solid #f6f6f6;
.dob {
margin-top: 0.4688rem;
}
.lisTop {
display: flex;
padding: 10px 20px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #CCC;
.txtName {
font-size: 14px;
.left {
width: 70%;
text-align: left;
.left-title {
height: 30px;
line-height: 30px;
font-size: 15px;
color: #333;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.left-time {
height: 20px;
line-height: 20px;
color: #8c8c8c;
font-weight: 13px;
}
}
.price {
font-size: 14px;
font-weight: 500;
color: #f20606;
}
.right {
width: 30%;
font-size: 15px;
text-align: right;
.time {
font-size: 0.6875rem;
color: #999;
}
.right-increase {
color: #259b24;
}
.balance {
font-size: 0.6875rem;
font-weight: 400;
color: #666;
.right-reduce {
color: #fc6a70;
}
}
}
}
}
.timeSelect {
margin-top: -5rem;
}
.order-content{
--order-margin-: 15px;
padding-top: var(--order-margin-);
.order-block{
width: calc(100vw - (var(--order-margin-) * 2));
background: #FFFFFF;
margin: 0 var(--order-margin-) var(--order-margin-) var(--order-margin-);
border-radius: 10px;
box-shadow: 0 0 5px 0 #a0a3ae;
padding: 10px 15px;
.timeSelect {
height: 2.5rem;
background: #fff;
border-radius: 0.625rem;
margin: 0 0.625rem;
display: flex;
padding: 0 0.9063rem;
align-items: center;
position: sticky;
top: 40px;
.timeBox {
flex-shrink: 0;
display: flex;
align-items: center;
.time {
margin-right: 0.5rem;
font-size: 0.8125rem;
.top-info{
display: inline-flex;
width: 100%;
height: 25px;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.order-no{
font-weight: 400;
font-size: 14px;
color: #666;
}
.order-status{
font-size: 14px;
color: #f15353;
}
}
.goods-info{
.goods-block{
padding: 5px 0;
width: 100%;
height: 100px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.goods-thumb{
width: 90px;
height: 90px;
display: inline-flex;
.goods-thumb-img{
width: 80px;
height: 80px;
border-radius: 5px;
}
}
.goods-desc{
width: calc(100% - 90px);
height: 90px;
padding-left: 10px;
display: inline-flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
.goods-title{
font-size: 14px;
text-align: left;
color: #333;
margin-bottom: 0.625rem;
width: 100%;
height: 2.5rem;
line-height: 1.25rem;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.good-num{
font-size: 14px;
color: #333;
}
}
}
}
.goods-footer{
display: inline-flex;
width: 100%;
height: 25px;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.create-time{
font-size: 13px;
text-align: left;
color: #909090;
}
.payment-amount{
font-size: 18px;
font-weight: 600;
color: #666;
}
}
}
}
}
.totalNum {
flex: 1;
text-align: right;
font-size: 14px;
color: #333;
}
}
.typeBox {
overflow-y: scroll;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
padding: 0.625rem;
padding-top: 1rem;
.lis {
width: 30%;
padding: 0.6rem 0.625rem;
border-radius: 0.1563rem;
background: #9999;
margin-right: 1rem;
margin-bottom: 0.625rem;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
.txt {
font-size: 12px;
}
}
.lis:nth-child(3n) {
margin-right: 0;
}
.lisBg {
background: var(--themeBaseColor) !important;
}
}
</style>

View File

@ -0,0 +1,368 @@
<template>
<div>
<c-title :hide="false" :text="page_title" tolink="detailed"></c-title>
<div class="content-box" v-if="is_show">
<!--顶部用户信息-->
<div class="user box-item">
<div class="user-img">
<img class="user-img-icon" :src="user.avatar_image" />
</div>
<div class="user_name">{{ user.username }}</div>
<div class="user_id">ID{{ user.uid }}</div>
</div>
<!--可提现金额&团队人数-->
<div class="money-and-team box-item">
<div class="team-block" @click="goToPage('withdrawal')">
<div class="team-block-title">
可提现()<i class="fa fa-angle-right"></i>
</div>
<div class="team-block-money">{{ income }}</div>
</div>
<div class="team-block" @click="goToPage('myRelationship')">
<div class="team-block-title">
团队总数<i class="fa fa-angle-right"></i>
</div>
<div class="team-block-money">{{ team_total }}</div>
</div>
</div>
<!--统计信息-->
<div class="statistics box-item">
<!--顶部内容-->
<div class="statistics-top">
<div class="top-block">
<div class="top-title">累计收入()</div>
<div class="top-income">{{ total_income }}</div>
</div>
<div class="top-block">
<div class="top-title" @click="goToPage('incomedetails')">
收入明细<i class="fa fa-angle-right"></i>
</div>
</div>
</div>
<!--统计列表-->
<div class="statistic-list">
<div class="list-box" v-for="(item,index) in statistics" :key="index" @click="detailsGoToPage(item)">
<div class="box-title">{{ item.title }}</div>
<div class="box-num">{{ item.num }}</div>
</div>
</div>
</div>
<!--常用工具-->
<div class="tool-title">常用工具</div>
<div class="tool-content box-item">
<div class="tool-block" v-for="(item,index) in tool_list" :key="index" @click="toolGoToPage(item.path_name)">
<div class="tool-left">
<img class="tool-icon" :src="require('../../../assets/images/weight_value/' + item.icon)" />
</div>
<div class="tool-right">
<div class="right-title">{{ item.title }}</div>
<div class="right-desc">{{ item.sub_title }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
page_title: '',
page_params: {},
is_show: false,
user: {},
statistics: {},
income: 0,
total_income: 0,
team_total: 0,
//
tool_list:[
{ title: '我的权重值', sub_title: '查看权重值', icon: '001.png', path_name: 'weight_value' },
{ title: '我的典藏', sub_title: '我的画作', icon: '002.png', path_name: 'collection_room' },
{ title: '我的客户', sub_title: '团队客户明细', icon: '003.png', path_name: 'myRelationship' },
{ title: '分享二维码', sub_title: '生成分享码', icon: '004.png', path_name: '' },
{ title: '团队业绩', sub_title: '团队累计业绩', icon: '005.png', path_name: 'incomedetails' },
],
};
},
activated() {
let _this = this;
_this.page_params = Object.assign(_this.$route.params, _this.$route.query);
_this.getData();
},
methods: {
//
getData() {
let _this = this;
let params = {
team_level_id: _this.page_params.team_level_id
};
$http.get("plugin.weight-value.api.index.get-center-data", params, "加载中...").then((res) => {
if (parseInt(res.result) === 1) {
let data = res.data;
let title = data.level_name || '经纪人';
_this.page_title = document.title = (title + '中心');
_this.user = data.user;
_this.statistics = data.statistics;
_this.income = data.income;
_this.total_income = data.total_income;
_this.team_total = data.team_total;
_this.is_show = true;
}
}).catch((error) => {});
},
//
goToPage(key, params = {}, query = {}) {
if(key) this.$router.push(this.fun.getUrl(key, params, query));
},
//
detailsGoToPage(info){
let _this = this;
if(info.key_name){
let query = {
key_name: info.key_name || '',
team_level_id: _this.page_params.team_level_id
};
this.goToPage('weight_value_detailed',{},query);
}
},
//
toolGoToPage(pathName){
if(pathName === 'weight_value') this.goToPage('weight_value',{},{ team_level_id: this.page_params.team_level_id});
else this.goToPage(pathName);
}
}
};
</script>
<style lang="scss" scoped>
.content-box {
--item-about-margin-: 15px;
--item-width-: calc(100% - (var(--item-about-margin-) * 2));
background: rgba(255, 220, 47, 0.82);
width: 100vw;
padding-top: var(--item-about-margin-);
min-height: calc(100vh - 40px);
background: url('../../../assets/images/weight_value/home_bg.jpg') no-repeat;
background-size: 100% auto;
//
.box-item {
margin-left: var(--item-about-margin-);
margin-right: var(--item-about-margin-);
margin-bottom: var(--item-about-margin-);
width: var(--item-width-);
background: #fff;
padding: 15px 20px;
border-radius: 10px;
}
//
.user {
--user-height-: 30px;
--user-spacing-: 10px;
height: var(--user-height-);
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
background: none !important;
padding: 0!important;
.user-img {
width: var(--user-height-);
height: var(--user-height-);
border-radius: 50%;
overflow: hidden;
margin-right: var(--user-spacing-);
.user-img-icon {
width: 100% !important;
height: 100% !important;
}
}
.user_name {
margin-right: var(--user-spacing-);
font-size: 14px;
font-weight: bold;
}
.user_id {
margin-right: var(--user-spacing-);
background: #aa9884;
font-size: 13px;
padding: 0 10px;
height: 20px;
line-height: 20px;
border-radius: 50px;
color: #ffffff;
}
}
// &
.money-and-team {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
.team-block {
width: 50%;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: flex-start;
.team-block-title{
font-size: 12px;
height: 20px;
line-height: 20px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
color: #606060;
i{
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
font-size: 20px;
}
}
.team-block-money{
font-weight: bold;
font-size: 17px;
}
}
}
//
.statistics {
.statistics-top {
width: 100%;
display: inline-flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
.top-block {
text-align: left;
.top-title {
font-size: 12px;
height: 20px;
line-height: 20px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
color: #606060;
i {
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
font-size: 20px;
}
}
.top-income {
font-weight: bold;
font-size: 17px;
}
}
}
.statistic-list {
width: calc(100% + 40px);
position: relative;
left: -20px;
display: inline-flex;
flex-direction: row;
flex-wrap: wrap;
.list-box {
width: calc(100% / 3);
height: 70px;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
.box-title {
font-size: 12px;
height: 20px;
line-height: 20px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
color: #606060;
}
.box-num {
font-weight: bold;
font-size: 17px;
}
}
}
}
//
.tool-title{
padding: 0 20px;
padding-bottom: 15px;
font-weight: bold;
font-size: 17px;
text-align: left;
}
.tool-content{
display: inline-flex;
flex-direction: row;
flex-wrap: wrap;
align-content: center;
justify-content: flex-start;
align-items: center;
.tool-block{
--tool-block-height-: 50px;
width: 50%;
height: var(--tool-block-height-);
margin-bottom: 15px;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
.tool-left{
width: var(--tool-block-height-);
height: var(--tool-block-height-);
display: inline-flex;
.tool-icon{
width: 45% !important;
height: 45% !important;
}
}
.tool-right{
text-align: left;
.right-title{
font-weight: 600;
font-size: 14px;
}
.right-desc{
font-size: 12px;
color: #a0a3ae;
}
}
}
/* 使用选择器重置最后一行的格子下边距为0 */
.tool-block:nth-child(2n+1):nth-last-child(-n+2),
.tool-block:nth-child(2n+1):nth-last-child(-n+2)~.tool-block{
margin-bottom: 0!important;
}
}
}
</style>

View File

@ -26,7 +26,7 @@
</div>
<div class="balanceDetail_lis_bottom">
<div class="time">{{ item.created_at }}</div>
<div class="balanceTxt">余额{{ item.change_after }}</div>
<div class="balanceTxt">持有{{ item.change_after }}</div>
</div>
</div>
</div>
@ -38,20 +38,26 @@
export default {
data() {
return {
page_params: {},
dataInfo: {
weight_value: 0,
list: []
list: [],
},
};
},
activated() {
let _this = this;
_this.page_params = Object.assign(_this.$route.params, _this.$route.query);
this.getData();
},
methods: {
//
getData() {
let _this = this;
$http.get("finance.weight-value.index", {}, "加载中...").then(
let params = {
team_level_id: _this.page_params.team_level_id
};
$http.get("plugin.weight-value.api.index.my-weight-value", params, "加载中...").then(
(response) => {
if (response.result == 1) _this.dataInfo = response.data;
else _this.$dialog.alert({ message: response.msg });
@ -63,11 +69,17 @@ export default {
},
//
goToPage(key, json = {}) {
this.$router.push(this.fun.getUrl(key, json));
let _this = this;
let query = {
team_level_id: _this.page_params.team_level_id
};
if (key === 'weight_value_detailed') {
query.key_name = 'weight_value';
_this.$router.push(_this.fun.getUrl(key, json, query));
} else {
_this.$router.push(_this.fun.getUrl(key, json, query));
}
},
}
};
</script>
@ -347,7 +359,6 @@ export default {
.transfer {
border: 1px solid #b3b3b3;
color: #262626;
margin-right: 1.5rem;
}
.withdraw {

View File

@ -1,179 +1,183 @@
<template>
<div id="balance_recharge">
<c-title :hide="false" text="权重值转账" tolink="detailed"></c-title>
<div class="background_box"></div>
<div class="main">
<div class="txt">当前权重值{{ weight_value }}</div>
<div class="detailBox">
<div class="zhbanlace">
<div class="title">受让人ID</div>
<input type="text" v-model.lazy="transfer_id" placeholder="请输入受让人ID" />
</div>
<ul class="personal_info" v-if="memberInfo">
<li v-if="memberInfo.nickname">
<span>昵称</span>
<span>{{ memberInfo.nickname }}</span>
</li>
<li v-if="memberInfo.realname">
<span>姓名</span>
<span>{{ memberInfo.realname }}</span>
</li>
</ul>
<div class="zzPrice">
<div class="title">转账权重值</div>
<div class="priceInpBox">
<input type="text" v-model="info_form.transfer_money" placeholder="0.00" />
<c-title :hide="false" :text="info.level_name + '权重值转赠'" tolink="detailed"></c-title>
<div class="transfer-content">
<div class="main-content">
<div class="hold-num">持有数量({{ info.level_name }}权重值){{ info.weight_value }}</div>
<div class="operate">
<div class="transfer-id">
<div class="title">受让人ID</div>
<input type="text" v-model="transfer_id" placeholder="请输入受让人用户ID" />
</div>
<div class="transfer-info" v-if="Object.values(memberInfo).length > 0">
<div class="user-avatar">
<img class="avatar-image" :src="memberInfo.avatar_image" />
</div>
<div class="user-info">
<div class="user-nickname">昵称{{memberInfo.nickname || ''}}</div>
<div class="user-status">姓名{{memberInfo.realname || ''}}</div>
</div>
</div>
<div class="transfer-num">
<div class="title">转赠权重值</div>
<div class="transfer-input">
<input type="text" v-model="transfer_money" placeholder="0.00" />
</div>
</div>
<div class="submit-btn" @click="beforeConfirm">确认转账</div>
</div>
<div class="btn" @click="beforeConfirm">确认转账</div>
</div>
</div>
<pay-keyboard :payKeyboardShow.sync="payKeyboardShow" @complete="payComplete"></pay-keyboard>
<van-dialog v-model="showConfirm" title="" show-cancel-button @confirm="confirm">
<div class="confirm-transfer-popup">
<div class="confirm-transfer-popup-li">受让人ID{{ transfer_id }}</div>
<div class="confirm-transfer-popup-li">受让人昵称{{ memberInfo.nickname }}</div>
<div class="confirm-transfer-popup-li">受让人姓名{{ memberInfo.realname }}</div>
<div class="confirm-transfer-popup-li">转账权重值{{ info_form.transfer_money }}</div>
<div class="confirm-transfer-popup-li">转账权重值{{ transfer_money }}</div>
<div class="confirm-transfer-popup-li" v-if="getCommission > 0">手续费{{ getCommission }}</div>
<div class="confirm-transfer-popup-warn">您是否确定转账</div>
</div>
</van-dialog>
</div>
</template>
<script>
import { Toast } from "vant";
import payKeyboard from "components/payKeyboard";
import { payKeyboardAsync } from "utils/payKeyboard";
import {payKeyboardAsync} from "utils/payKeyboard";
export default {
data() {
return {
weight_value: 0,
need_password: false, //
has_password: false, //
info_form: {
transfer_id: "",
transfer_money: ""
page_params: {},
//
info: {
is_open_commission: 0,//
commission: 0,//
has_password: false,//
need_password: 0,//
level_name: "",//
weight_value: 0//
},
transfer_id: "",
memberInfo: "",
//
transfer_id: 0,
transfer_money: 0,//
memberInfo: {},
timeout_id: null,
payKeyboardShow: false, //
showConfirm: false, //
deduct_point:{}
};
},
watch: {
transfer_id: function(new_transfer_id) {
var that = this;
$http
.get(
"member.member.memberInfo",
{
i: this.fun.getKeyByI(),
type: this.fun.getTyep(),
uid: this.transfer_id
},
"获取用户中"
)
.then(
function(response) {
if (response.result === 1) {
that.memberInfo = response.data;
} else {
Toast(response.msg);
}
},
function(response) {
Toast(response.msg);
}
);
transfer_id: function() {
let _this = this;
clearTimeout(_this.timeout_id);
_this.timeout_id = setTimeout(() => {
_this.getTransferUser();
}, 1000);
}
},
computed:{
countDeduct(){
let ratio = Number(this.deduct_point.deduct_point) / Number(this.deduct_point.deduct_balance) ;
return Number(this.info_form.transfer_money * ratio).toFixed(0);
getCommission(){
if(this.info.is_open_commission != 1 || this.info.commission <= 0) return 0;
//
let commission = Number(this.transfer_money) * Number(this.info.commission) / 100;
return Number(commission).toFixed(2);
}
},
activated() {
this.getData();
let _this = this;
_this.page_params = Object.assign(_this.$route.params, _this.$route.query);
_this.getData();
},
methods: {
//
getData() {
let _this = this;
$http.get("finance.weight-value.member-weight-value", {}, " ")
let params = {
team_level_id: _this.page_params.team_level_id
};
$http.get("plugin.weight-value.api.index.transfer-info", params, "加载中...")
.then(response => {
if (response.result === 1) {
_this.weight_value = response.data.weight_value;
_this.need_password = response.data.need_password;
_this.has_password = response.data.has_password;
_this.info = response.data;
} else {
_this.$dialog.alert({ message: response.msg }).then(() => {
_this.$router.go(-1);
_this.$dialog.alert({message: response.msg}).then(() => {
_this.$router.push(_this.fun.getUrl('weight_value', {}, params));
});
}
}).catch(error => {
})
.catch(error => {
console.log(error);
});
},
//
//
getTransferUser(){
let _this = this;
if(parseInt(_this.transfer_id) <= 0 || isNaN(parseInt(_this.transfer_id))) {
_this.memberInfo = {};
return;
}
$http.get("member.member.memberInfo", { uid: _this.transfer_id }, "加载中...")
.then(response => {
if (response.result === 1) {
_this.memberInfo = response.data;
} else {
_this.$dialog.alert({message: response.msg});
}
})
.catch(error => {
console.log(error);
});
},
//
beforeConfirm() {
//
if (parseFloat(this.info_form.transfer_money) > parseFloat(this.balance)) {
this.$dialog.alert({ message: "转让数量不可大于您的持有数量" });
let _this = this;
//
if (parseFloat(_this.transfer_money) > parseFloat(_this.info.weight_value)) {
_this.$dialog.alert({message: '转让数量不可大于您的持有数量!'});
return;
}
if (this.transfer_id == undefined || this.transfer_id <= 0 || this.transfer_id.length == 0) {
this.$dialog.alert({ message: "转让id不可为空" });
if (parseFloat(_this.transfer_id) <= 0 || isNaN(parseFloat(_this.transfer_id))) {
_this.$dialog.alert({message: '请输入正确的受让人id'});
return;
}
if (this.info_form.transfer_money == undefined || this.info_form.transfer_money <= 0 || this.info_form.length == 0) {
this.$dialog.alert({ message: "转让数量不可低于等于0" });
if (parseFloat(_this.transfer_money) <= 0) {
_this.$dialog.alert({message: '请输入转赠数量!'});
return;
}
if (_this.info.need_password && !_this.info.has_password) {
this.$dialog.confirm({ message: "请先设置支付密码" }).then(() => {
this.$router.push(this.fun.getUrl("set_balance_password", {}));
});
return;
}
// if (this.need_password == true && this.has_password == false) {
// this.$dialog.confirm({ message: "" }).then(() => {
// this.$router.push(this.fun.getUrl("set_balance_password", {}));
// });
// return;
// }
this.showConfirm = true;
},
//
async confirm() {
var that = this;
let _this = this;
let json = {
transfer_id: this.transfer_id,
transfer_money: this.info_form.transfer_money
transfer_id: _this.transfer_id,
transfer_money: _this.transfer_money,
team_level_id: _this.page_params.team_level_id
};
// if (this.need_password == true) {
// //
// let pass = await this.getPayKeyboardPassword();
// json.password = pass;
// }
$http.get("finance.weight-value.transfer", json, " ").then(
function(response) {
if (_this.info.need_password) json.password = await _this.getPayKeyboardPassword();//
$http.get("plugin.weight-value.api.index.transfer", json, "处理中...")
.then(response => {
if (response.result === 1) {
that.$dialog.alert({ message: response.msg }).then(() => {
that.$router.go(-1);
_this.$dialog.alert({message: response.msg}).then(() => {
_this.$router.go(-1);
});
} else {
that.$dialog.alert({ message: response.msg });
_this.$dialog.alert({message: response.msg});
}
}
).catch(error => {
console.log(error);
});
})
.catch(error => {
console.log(error);
});
},
payComplete(text) {
console.log(text, "页面");
@ -194,83 +198,37 @@ export default {
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#balance_recharge {
.background_box {
color: #382c0a;
background-color: #fff;
background-image: -webkit-gradient(linear, left top, left bottom, from(var(--themeBaseColor)), to(#f5f5f5));
background-image: -webkit-linear-gradient(var(--themeBaseColor), #f5f5f5);
background-image: linear-gradient(var(--themeBaseColor), #f5f5f5);
min-height: 12.125rem;
}
<style lang="scss" scoped>
.transfer-content {
width: 100vw;
min-height: 50vh;
background-image: linear-gradient(#fe9a51, #f5f5f5);
background-size: 100% 390px;
background-repeat: no-repeat;
display: inline-flex;
justify-content: center;
.main {
margin: 0 0.625rem;
margin-top: -5.5938rem;
.main-content {
width: calc(100vw - 30px);
padding-top: 110px;
.txt {
.hold-num {
width: 100%;
text-align: left;
margin-left: 0.4063rem;
height: 25px;
line-height: 25px;
}
.detailBox {
margin-top: 0.9375rem;
.operate {
margin-top: 5px;
background: #fff;
box-shadow: 0 0.0625rem 0.25rem 0 rgba(7, 11, 33, 0.11);
-webkit-box-shadow: 0 0.0625rem 0.25rem 0 rgba(7, 11, 33, .11);
box-shadow: 0 0.0625rem 0.25rem 0 rgba(7, 11, 33, .11);
border-radius: 0.3125rem;
padding: 1.25rem 1.3438rem;
padding-top: 0;
.btn {
width: 17.4688rem;
height: 2.4375rem;
background: #f15353;
border-radius: 0.375rem;
font-size: 0.9688rem;
text-align: center;
line-height: 2.4375rem;
color: #fff;
margin: 0 auto;
margin-top: 2.4063rem;
}
.zzPrice {
margin-top: 1rem;
.title {
font-size: 0.8125rem;
color: #333;
text-align: left;
}
.priceInpBox {
border-bottom: 1px solid #f5f6f8;
padding-top: 1.5625rem;
// padding-bottom: 0.8438rem;
display: flex;
.priceTxt {
line-height: 2.5rem;
font-size: 0.9375rem;
}
input {
height: 100%;
flex: 1;
border: none;
width: 15.625rem;
margin-left: 1rem;
font-size: 1.5625rem;
}
}
.deduct{
text-align: left;
color: #FA8647;
}
}
.zhbanlace {
.transfer-id {
height: 2.9063rem;
display: flex;
align-items: center;
@ -291,137 +249,98 @@ export default {
}
}
.personal_info {
width: 100%;
background: #fff;
display: flex;
.transfer-info {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
font-size: 0.8rem;
color: #f15353;
margin-top: 0.5625rem;
overflow: hidden;
height: 80px;
width: 100%;
li {
display: flex;
font-size: 0.5rem;
text-align: left;
.user-avatar {
height: 50px;
width: 50px;
margin-right: 5px;
border-radius: 50%;
overflow: hidden;
span:first-child {
display: block;
.avatar-image {
width: 100% !important;
height: 100% !important;
}
}
li:last-child {
margin-left: 0.625rem;
.user-info {
height: 50px;
text-align: left;
.user-nickname {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-status {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
}
.content {
.transfer_info {
background: #fff;
padding-left: 0.875rem;
font-size: 16px;
.transfer-num {
margin-top: 1rem;
.info_a,
.info_b {
line-height: 2.875rem;
border-bottom: solid 0.0625rem #ebebeb;
display: flex;
justify-content: flex-start;
span:first-child {
width: 6.875rem;
display: block;
.title {
font-size: 0.8125rem;
color: #333;
text-align: left;
}
input {
border: none;
width: 15.625rem;
.transfer-input {
border-bottom: 1px solid #f5f6f8;
padding-top: 1.5625rem;
display: flex;
input {
height: 100%;
flex: 1;
border: none;
width: 15.625rem;
margin-left: 1rem;
font-size: 1.5625rem;
}
}
}
}
.transfer_sum {
background: #fff;
padding: 0.625rem 0.875rem;
span {
display: block;
font-size: 16px;
line-height: 2.5rem;
text-align: left;
.submit-btn {
width: 17.4688rem;
height: 2.4375rem;
background: #f15353;
border-radius: 0.375rem;
font-size: 0.9688rem;
text-align: center;
line-height: 2.4375rem;
color: #fff;
margin: 0 auto;
margin-top: 2.4063rem;
}
.sum {
text-align: left;
font-size: 24px;
input {
margin-left: 0.375rem;
line-height: 3.75rem;
width: 90%;
font-size: 36px;
border: none;
}
}
}
.btn {
width: 21.5625rem;
margin: 1.25rem auto;
height: 2.875rem;
border-radius: 0.25rem;
font-size: 16px;
color: #fff;
background: #f15353;
border: none;
}
}
.my_wrapper {
background: #fff;
overflow: hidden;
display: flex;
padding: 0 0.875rem;
span {
text-align: left;
font-size: 16px;
/* line-height: 1; */
}
.my-value {
flex: 2;
text-align: left;
span {
color: #f15353;
}
}
}
#wrapper {
border-bottom: solid 0.0625rem #d9d9d9;
margin-top: 0.625rem;
}
.confirm-transfer-popup {
padding: 1rem;
.confirm-transfer-popup-li {
font-size: 12px;
text-align: left;
margin-bottom: 10px;
}
.confirm-transfer-popup-warn {
text-align: center;
color: #f15353;
font-size: 16px;
}
}
}
.confirm-transfer-popup{
padding: 1rem;
.confirm-transfer-popup-li{
font-size: 12px;
text-align: left;
margin-bottom: 10px;
}
.confirm-transfer-popup-warn{
text-align: center;
color: #f15353;
font-size: 16px;
}
}
</style>