|
|
@@ -15,7 +15,7 @@
|
|
|
<view class="list">
|
|
|
<radio-group @change="tabRadio">
|
|
|
<!-- #ifndef APP-PLUS -->
|
|
|
- <label v-if="bool">
|
|
|
+ <!-- <label>
|
|
|
<view class="box">
|
|
|
<view class="icon iconfont iconweixin1"></view>
|
|
|
<view class="title-box">
|
|
|
@@ -23,10 +23,10 @@
|
|
|
</view>
|
|
|
<view class="right"><radio value="weixin" color=" #456ffb" :checked="type == 'weixin'" /></view>
|
|
|
</view>
|
|
|
- </label>
|
|
|
+ </label> -->
|
|
|
<!-- #endif -->
|
|
|
<!-- #ifdef APP-PLUS -->
|
|
|
- <label>
|
|
|
+ <!-- <label>
|
|
|
<view class="box">
|
|
|
<view class="icon iconfont iconzhifubao"></view>
|
|
|
<view class="title-box">
|
|
|
@@ -34,14 +34,14 @@
|
|
|
</view>
|
|
|
<view class="right"><radio value="ali" color=" #456ffb" :checked="type == 'ali'" /></view>
|
|
|
</view>
|
|
|
- </label>
|
|
|
+ </label> -->
|
|
|
<!-- #endif -->
|
|
|
<label>
|
|
|
<view class="box">
|
|
|
<view class="icon iconfont"><image class="yongjing" src="http://xmpt.liuniu946.com/img/yongjing.png"></image></view>
|
|
|
<view class="title-box">
|
|
|
<view class="title"><text>佣金充值</text></view>
|
|
|
- <view class="node">可用佣金¥{{ yongMoney }}</view>
|
|
|
+ <view class="node">可用佣金¥{{ yongMoney?yongMoney:0 }}</view>
|
|
|
</view>
|
|
|
<view class="right"><radio value="yongjing" color=" #456ffb" :checked="type == 'yongjing'" /></view>
|
|
|
</view>
|
|
|
@@ -57,7 +57,7 @@
|
|
|
import { getMoneyStyle } from '@/utils/rocessor.js';
|
|
|
// #ifdef H5
|
|
|
import { rechargeWechat,userBalance,extractBank} from '@/api/wallet.js';
|
|
|
-import weixinBJ from "@/utils/wxAuthorized.js";
|
|
|
+import weixinObj from "@/plugin/jweixin-module/index.js";
|
|
|
// #endif
|
|
|
// #ifdef MP
|
|
|
import { rechargeRoutine } from '@/api/wallet.js';
|
|
|
@@ -68,15 +68,27 @@ export default {
|
|
|
getMoneyStyle
|
|
|
},
|
|
|
data() {
|
|
|
- return {
|
|
|
- type: 'weixin',
|
|
|
+ return {
|
|
|
+ // #ifdef H5
|
|
|
+ type: 'yongjing',
|
|
|
+ // #endif
|
|
|
+ // #ifndef H5
|
|
|
+ type: 'weixin',
|
|
|
+ // #endif
|
|
|
money: '', //充值金额
|
|
|
payLoding: false ,//是否加载中
|
|
|
yongMoney:'',
|
|
|
- nowmoney:'',
|
|
|
- bool: true
|
|
|
+ nowmoney:'',
|
|
|
+ typeText:1//默认支付方式
|
|
|
+
|
|
|
|
|
|
};
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ type(newValue, oldValue) {
|
|
|
+ console.log(newValue);
|
|
|
+ console.log(oldValue);
|
|
|
+ }
|
|
|
},
|
|
|
onShow() {
|
|
|
this.yongMoney = ''
|
|
|
@@ -90,14 +102,7 @@ export default {
|
|
|
this.disable= true
|
|
|
});
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
- this.bool = uni.getStorageSync('weichatBrowser');
|
|
|
- if(!this.bool) {
|
|
|
- // this.payType = 3
|
|
|
- this.type = 'yongjing'
|
|
|
- this.typeText = 1
|
|
|
- }
|
|
|
- },
|
|
|
+ onLoad(options) {},
|
|
|
computed: {
|
|
|
// #ifdef H5
|
|
|
...mapState(['weichatObj'])
|
|
|
@@ -112,7 +117,7 @@ export default {
|
|
|
},
|
|
|
// 切换选中对象
|
|
|
tabRadio(e) {
|
|
|
- console.log(e);
|
|
|
+ console.log(e,'选中');
|
|
|
if (e.detail.value == 'weixin') {
|
|
|
this.typeText = 0;
|
|
|
}
|
|
|
@@ -126,7 +131,7 @@ export default {
|
|
|
this.type = e.target.value
|
|
|
// #endif
|
|
|
// #ifndef APP-PLUS
|
|
|
- this.type = e;
|
|
|
+ this.type = e.detail.value;
|
|
|
// #endif
|
|
|
console.log(this.typeText);
|
|
|
},
|
|
|
@@ -195,35 +200,93 @@ export default {
|
|
|
obj.$api.msg('请输入充值金额');
|
|
|
obj.payLoding = false;
|
|
|
return;
|
|
|
+ }
|
|
|
+ if (obj.typeText == null) {
|
|
|
+ obj.$api.msg('请选择充值方式');
|
|
|
+ obj.payLoding = false;
|
|
|
+ return;
|
|
|
}
|
|
|
- if (obj.type == 'yongjin' && obj.money > parseInt(obj.yongMoney)) {
|
|
|
+ if (obj.type == 'yongjing' && obj.money > parseInt(obj.yongMoney)) {
|
|
|
obj.$api.msg('佣金不足');
|
|
|
obj.payLoding = false;
|
|
|
return;
|
|
|
}
|
|
|
- obj.payLoding = true
|
|
|
+ obj.payLoding = true
|
|
|
+ // // #ifdef H5
|
|
|
+ // rechargeWechat({ price: this.money, from: this.type })
|
|
|
+ // .then(e => {
|
|
|
+ // let da = e.data.data;
|
|
|
+ // obj.weichatObj.chooseWXPay({
|
|
|
+ // timestamp: da.timestamp,
|
|
|
+ // nonceStr: da.nonceStr,
|
|
|
+ // package: da.package,
|
|
|
+ // signType: da.signType,
|
|
|
+ // paySign: da.paySign,
|
|
|
+ // success: function(res) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '充值成功',
|
|
|
+ // duration: 2000,
|
|
|
+ // position: 'top'
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // obj.payLoding = false;
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // obj.payLoding = false;
|
|
|
+ // console.log(e);
|
|
|
+ // });
|
|
|
+ // // #endif
|
|
|
+ // // #ifdef MP
|
|
|
+ // rechargeRoutine({ price: this.money})
|
|
|
+ // .then(e => {
|
|
|
+ // let da = e.data;
|
|
|
+ // wx.requestPayment({
|
|
|
+ // timeStamp: da.timestamp,
|
|
|
+ // nonceStr: da.nonceStr,
|
|
|
+ // package: da.package,
|
|
|
+ // signType: da.signType,
|
|
|
+ // paySign: da.paySign,
|
|
|
+ // success: function(res) {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: '/pages/money/paySuccess'
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+
|
|
|
+ // })
|
|
|
+
|
|
|
+ // obj.payLoding = false;
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // obj.payLoding = false;
|
|
|
+ // console.log(e);
|
|
|
+ // });
|
|
|
+ // // #endif
|
|
|
// #ifdef APP-PLUS
|
|
|
- const pushDate = { price: this.money, from:this.typeText==2?'ali':'yongjing', type: this.typeText }
|
|
|
- console.log(pushDate);
|
|
|
+ const pushDate = { price: this.money, from:this.typeText==1?'yongjing':'ali', type: this.typeText }
|
|
|
+ console.log(pushDate,'徐浩岚');
|
|
|
rechargeWechat(pushDate)
|
|
|
.then(e => {
|
|
|
console.log(e,'返回数据');
|
|
|
let da = e.data;
|
|
|
- obj.money = '';
|
|
|
- obj.yongMoney = ''
|
|
|
+ // obj.money = '';
|
|
|
+ // obj.yongMoney = ''
|
|
|
console.log(obj.type,'ali');
|
|
|
- if (obj.type == 'ali') {
|
|
|
+ if (obj.type == 'yongjing') {
|
|
|
const url = e.data.data;
|
|
|
console.log(url,'url');
|
|
|
uni.requestPayment({
|
|
|
provider: 'alipay',
|
|
|
orderInfo: url,
|
|
|
success: res => {
|
|
|
- console.log(res);
|
|
|
+ console.log(res,'22222323232');
|
|
|
uni.showToast({
|
|
|
title: '充值成功',
|
|
|
duration: 2000,
|
|
|
- });
|
|
|
+ });
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'./paySuccess'
|
|
|
+ })
|
|
|
},
|
|
|
fail: e => {
|
|
|
console.log(e);
|
|
|
@@ -233,19 +296,10 @@ export default {
|
|
|
obj.payLoding = false;
|
|
|
}
|
|
|
if (obj.type == 'yongjing') {
|
|
|
- // uni.navigateTo({
|
|
|
- // url: '/pages/money/rechargeSuccess'
|
|
|
- // });
|
|
|
- obj.payLoding = false;
|
|
|
- uni.showToast({
|
|
|
- title: '充值成功',
|
|
|
- duration: 2000,
|
|
|
- });
|
|
|
- extractBank({}).then(({ data }) => {
|
|
|
- obj.yongMoney = (data.commissionCount * 1).toFixed(2); //累积佣金
|
|
|
- console.log(data,'wwwww');
|
|
|
- obj.disable= true
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/money/rechargeSuccess'
|
|
|
});
|
|
|
+ obj.payLoding = false;
|
|
|
console.log(e, '佣金');
|
|
|
}
|
|
|
})
|
|
|
@@ -263,7 +317,8 @@ export default {
|
|
|
console.log(e);
|
|
|
if (obj.type == 'weixin') {
|
|
|
let da = e.data.data;
|
|
|
- weixinBJ.weixinObj.chooseWXPay({
|
|
|
+ console.log(weixinObj, 'weixin');
|
|
|
+ weixinObj.chooseWXPay({
|
|
|
timestamp: da.timestamp,
|
|
|
nonceStr: da.nonceStr,
|
|
|
package: da.package,
|
|
|
@@ -278,11 +333,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
obj.payLoding = false;
|
|
|
- }
|
|
|
+ }
|
|
|
+ console.log(obj.type,'当前',obj.type == 'yongjing');
|
|
|
if (obj.type == 'yongjing') {
|
|
|
obj.yongMoney = ''
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/money/rechargeSuccess'
|
|
|
+ url: './paySuccess',
|
|
|
+
|
|
|
+ fail(e) {
|
|
|
+ console.log(e,'错误');
|
|
|
+ }
|
|
|
});
|
|
|
obj.payLoding = false;
|
|
|
console.log(e, '佣金');
|