充值更新
This commit is contained in:
@@ -315,6 +315,7 @@
|
||||
});
|
||||
return false;
|
||||
}
|
||||
console.log(this.amount)
|
||||
if (this.amount == null || this.amount == '') {
|
||||
uni.showToast({
|
||||
title: '金额不能为空',
|
||||
@@ -331,15 +332,21 @@
|
||||
}
|
||||
let res = await this.api.paymemeberIn({
|
||||
shopId: this.shopId, // 判断显示哪家的作品,
|
||||
amount: this.amount // 判断显示哪家的作品,
|
||||
amount: this.amount ,// 判断显示哪家的作品,
|
||||
// #ifdef MP-WEIXIN
|
||||
payType: 'wechatPay',
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
payType: 'aliPay',
|
||||
// #endif
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.requestPayment({
|
||||
// #ifdef MP-WEIXIN
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.data.appId, // 微信支付商户号
|
||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||
@@ -347,26 +354,53 @@
|
||||
package: res.data.package, // 固定值
|
||||
signType: res.data.signType, //固定值
|
||||
paySign: res.data.paySign, //签名
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
provider: 'alipay', //支付类型-固定值
|
||||
orderInfo: res.data.tradeNo, // 微信支付商户号
|
||||
// #endif
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
uni.hideLoading()
|
||||
let pages = getCurrentPages()
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"],
|
||||
complete() {
|
||||
if ( pages.length > 1) {
|
||||
_this.shopInfo()
|
||||
if ( _this.type && _this.type == "topUpActivity") {
|
||||
uni.pro.navigateBack()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
if ( pages.length > 1) {
|
||||
_this.shopInfo()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if ( _this.type && _this.type == "topUpActivity") {
|
||||
uni.pro.navigateBack()
|
||||
} else {
|
||||
if ( pages.length > 1) {
|
||||
_this.shopInfo()
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
@@ -376,7 +410,6 @@
|
||||
}
|
||||
});
|
||||
uni.hideLoading()
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user