diff --git a/subPages/user/promote.vue b/subPages/user/promote.vue index c0f00b0..bf903ee 100644 --- a/subPages/user/promote.vue +++ b/subPages/user/promote.vue @@ -43,7 +43,7 @@ 推广人数 - {{ userInfo.price }} + {{ userInfo.commission }} 总佣金 @@ -68,7 +68,7 @@ 余额 - ¥88.32 + ¥{{ userInfo.price || 0 }} @@ -86,7 +86,32 @@ +{{ item.money }} - {{ getText(item.withdrawal) }} + + + + 领取 + + + {{ getText(item.withdrawal) }} + + + @@ -159,6 +184,33 @@ export default { this.userInfo = res.result } }, + requestMerchantTransfer(item) { + if (!wx.canIUse('requestMerchantTransfer')) { + wx.showModal({ + content: '你的微信版本过低,请更新至最新版本。', + showCancel: false, + }); + return + } + wx.requestMerchantTransfer({ + mchId: '1724993508',//万能墙商户号 + appId: wx.getAccountInfoSync().miniProgram.appId, + package: item.packageInfo, + success: (res) => { + // res.err_msg将在页面展示成功后返回应用时返回ok,并不代表提款成功 + console.log('success:', res); + this.getData() + + this.$api('requestMerchantTransfer', { + id : item.id, + }) + }, + fail: (res) => { + console.log('fail:', res); + this.getData() + }, + }); + }, // 去二维码 goQrcode() { uni.navigateTo({ @@ -396,13 +448,16 @@ background: linear-gradient(180deg, #DEFFFF 0%, #FBFEFF 22.65%, #F0FBFF 100%); .record-amount { flex: 2; text-align: center; + display: flex; + flex-direction: column; + align-items: center; + gap: 8rpx; .amount { display: block; font-size: 28rpx; font-weight: bold; color: #333; - margin-bottom: 8rpx; } .status {