|
|
@@ -9,19 +9,30 @@
|
|
|
</view>
|
|
|
<view class="payment">
|
|
|
<view class="nav acea-row row-around row-middle">
|
|
|
- <view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index"
|
|
|
- @click="navRecharges(index)">{{item}}</view>
|
|
|
+ <view class="item" :class="active==index?'on':''" v-if="showBroker[item.key]"
|
|
|
+ v-for="(item,index) in navRecharge" :key="index" @click="navRecharges(index)">{{item.title}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class='tip picList' v-if='!active'>
|
|
|
- <view class='input'><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
|
|
|
- placeholder="0.00" type='digit' placeholder-class='placeholder' :value="number"
|
|
|
- name="number"></input></view>
|
|
|
- </view>
|
|
|
- <view class="tip" v-else>
|
|
|
- <view class='input'><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
|
|
|
- placeholder="0.00" type='digit' placeholder-class='placeholder' :value="number"
|
|
|
- name="number"></input></view>
|
|
|
+ <!-- <view class='tip picList' v-if='!active'>
|
|
|
+ <view class='input'>
|
|
|
+ <text>¥</text>
|
|
|
+ <input @input='inputNum' :maxlength="moneyMaxLeng" placeholder="0.00" type='digit'
|
|
|
+ placeholder-class='placeholder' :value="number" name="number"></input>
|
|
|
+ </view>
|
|
|
+ </view> -->
|
|
|
+ <!-- <view class="tip picList" v-else> -->
|
|
|
+ <view class="tip picList">
|
|
|
+ <view class='input'>
|
|
|
+ <text>¥</text>
|
|
|
+ <input @input='inputNum' :maxlength="moneyMaxLeng" placeholder="0.00" type='digit'
|
|
|
+ placeholder-class='placeholder' :value="number" name="number"></input>
|
|
|
+ </view>
|
|
|
+ <view class='to_uid acea-row row-between' v-if="active==2">
|
|
|
+ <view class="title">用户UID</view>
|
|
|
+ <input class="uidbox" placeholder-class='placeholderUid' placeholder="请输入转入的用户uid" type='number' :value="uid" name="uid"></input>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
<view class="tips-title">
|
|
|
<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
|
|
|
<view style="margin-top: 10rpx;">当前可转佣金为 <text
|
|
|
@@ -44,7 +55,9 @@
|
|
|
getUserInfo,
|
|
|
rechargeRoutine,
|
|
|
rechargeWechat,
|
|
|
- energyImport
|
|
|
+ energyImport,
|
|
|
+ extractBank,
|
|
|
+ brokerageTrade
|
|
|
} from '@/api/user.js';
|
|
|
import {
|
|
|
toLogin
|
|
|
@@ -69,9 +82,22 @@
|
|
|
let that = this;
|
|
|
return {
|
|
|
now_money: 0,
|
|
|
- navRecharge: ['佣金转能量', '佣金转余额'],
|
|
|
+ navRecharge: [{
|
|
|
+ title: '佣金转能量',
|
|
|
+ key: "brokerage_to_energy_switch",
|
|
|
+ bool: true,
|
|
|
+ }, {
|
|
|
+ title: '佣金转余额',
|
|
|
+ key: "brokerage_to_money_switch",
|
|
|
+ bool: true,
|
|
|
+ }, {
|
|
|
+ title: '佣金互转',
|
|
|
+ key: "brokerage_trade_switch",
|
|
|
+ bool: true,
|
|
|
+ }],
|
|
|
active: 0,
|
|
|
number: '',
|
|
|
+ uid: '', //转入用户UID
|
|
|
userinfo: {},
|
|
|
placeholder: "0.00",
|
|
|
from: '',
|
|
|
@@ -112,7 +138,12 @@
|
|
|
// #endif
|
|
|
type: '',
|
|
|
rechargeAttention: [],
|
|
|
- moneyMaxLeng: 8
|
|
|
+ moneyMaxLeng: 8,
|
|
|
+ showBroker: {
|
|
|
+ brokerage_to_energy_switch: false,
|
|
|
+ brokerage_to_money_switch: false,
|
|
|
+ brokerage_trade_switch: false,
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
computed: mapGetters(['isLogin']),
|
|
|
@@ -184,6 +215,14 @@
|
|
|
let that = this;
|
|
|
getUserInfo().then(res => {
|
|
|
that.$set(that, 'userinfo', res.data);
|
|
|
+
|
|
|
+ })
|
|
|
+ extractBank().then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ that.showBroker.brokerage_to_energy_switch = !!(+data.brokerage_to_energy_switch);
|
|
|
+ that.showBroker.brokerage_to_money_switch = !!(+data.brokerage_to_money_switch);
|
|
|
+ that.showBroker.brokerage_trade_switch = !!(+data.brokerage_trade_switch);
|
|
|
})
|
|
|
},
|
|
|
submitSub: function(e) {
|
|
|
@@ -194,8 +233,9 @@
|
|
|
title: '请输入转换金额'
|
|
|
});
|
|
|
}
|
|
|
+ const type = that.navRecharge[that.active].key;
|
|
|
// 转入余额
|
|
|
- if (that.active) {
|
|
|
+ if (type == "brokerage_to_money_switch") {
|
|
|
uni.showModal({
|
|
|
title: '转入余额',
|
|
|
content: '转入余额后无法再次转出,确认是否转入余额',
|
|
|
@@ -235,37 +275,67 @@
|
|
|
}
|
|
|
},
|
|
|
})
|
|
|
- } else {
|
|
|
- uni.showModal({
|
|
|
- title: '转入能量',
|
|
|
- content: '转入能量后无法再次转出,确认是否转入能量',
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- energyImport({
|
|
|
- price: parseFloat(value),
|
|
|
- }).then(res => {
|
|
|
- // that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
|
|
|
- return that.$util.Tips({
|
|
|
- title: '转入成功',
|
|
|
- icon: 'success'
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: '/pages/user/index'
|
|
|
- });
|
|
|
- }).catch(err => {
|
|
|
- return that.$util.Tips({
|
|
|
- title: err
|
|
|
- })
|
|
|
+ } else if (type == "brokerage_to_energy_switch") {
|
|
|
+ uni.showModal({
|
|
|
+ title: '转入能量',
|
|
|
+ content: '转入能量后无法再次转出,确认是否转入能量',
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ energyImport({
|
|
|
+ price: parseFloat(value),
|
|
|
+ }).then(res => {
|
|
|
+ // that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: '转入成功',
|
|
|
+ icon: 'success'
|
|
|
+ }, {
|
|
|
+ tab: 5,
|
|
|
+ url: '/pages/user/index'
|
|
|
});
|
|
|
-
|
|
|
- } else if (res.cancel) {
|
|
|
+ }).catch(err => {
|
|
|
return that.$util.Tips({
|
|
|
- title: '已取消'
|
|
|
+ title: err
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ } else if (res.cancel) {
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: '已取消'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ } else if (type == "brokerage_trade_switch") {
|
|
|
+ uni.showModal({
|
|
|
+ title: '佣金互转',
|
|
|
+ content: '佣金转出后无法撤回,确认是否转出佣金',
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ brokerageTrade({
|
|
|
+ to_uid: '',
|
|
|
+ num: parseFloat(value),
|
|
|
+ }).then(res => {
|
|
|
+ // that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: '转入成功',
|
|
|
+ icon: 'success'
|
|
|
+ }, {
|
|
|
+ tab: 5,
|
|
|
+ url: '/pages/user/index'
|
|
|
});
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
-
|
|
|
+ }).catch(err => {
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: err
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ } else if (res.cancel) {
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: '已取消'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -381,42 +451,7 @@
|
|
|
}
|
|
|
|
|
|
.picList {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
margin: 30rpx 0;
|
|
|
-
|
|
|
- .pic-box {
|
|
|
- width: 32%;
|
|
|
- height: auto;
|
|
|
- border-radius: 20rpx;
|
|
|
- margin-top: 21rpx;
|
|
|
- padding: 20rpx 0;
|
|
|
- margin-right: 12rpx;
|
|
|
-
|
|
|
- &:nth-child(3n) {
|
|
|
- margin-right: 0;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .pic-box-color {
|
|
|
- background-color: #f4f4f4;
|
|
|
- color: #656565;
|
|
|
- }
|
|
|
-
|
|
|
- .pic-number {
|
|
|
- font-size: 22rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .pic-number-pic {
|
|
|
- font-size: 38rpx;
|
|
|
- margin-right: 10rpx;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-
|
|
|
- .pic-box-color-active {
|
|
|
- background-color: var(--view-theme) !important;
|
|
|
- color: #fff !important;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.tips-box {
|
|
|
@@ -445,4 +480,24 @@
|
|
|
font-size: 24rpx;
|
|
|
color: #333;
|
|
|
}
|
|
|
+
|
|
|
+ .to_uid {
|
|
|
+ padding: 20rpx;
|
|
|
+ width: 100%;
|
|
|
+ line-height: 1;
|
|
|
+ font-size: 28rpx;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ border-bottom:1px solid #dddddd;
|
|
|
+ .title {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .uidbox{
|
|
|
+ flex-grow: 1;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .placeholderUid{
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|