Browse Source

Merge pull request 'feat: 接口对接;' (#7) from fox into master

Reviewed-on: http://175.178.51.79:3000/Augcl/studytour-front/pulls/7
master
Fox 1 month ago
parent
commit
c7239d3925
4 changed files with 68 additions and 6 deletions
  1. +8
    -0
      api/model/partner.js
  2. +3
    -0
      config.js
  3. +55
    -5
      pages_order/partner/withdraw.vue
  4. +2
    -1
      utils/share.js

+ 8
- 0
api/model/partner.js View File

@ -25,6 +25,14 @@ const api = {
limit : 500,
showLoading : true,
},
// 钱包-领取提现金额
getMoney: {
url: '/partner/getMoney',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
},
// 我的团队-获取直推用户列表
queryDirectList: {
url: '/partner/queryDirectList',


+ 3
- 0
config.js View File

@ -39,6 +39,9 @@ const defaultConfig = {
endpoint: 'oss-cn-shenzhen.aliyuncs.com',
}
},
//商户号
mchId : '1722176565',
appId : 'wxee64675d48680dd4',
}


+ 55
- 5
pages_order/partner/withdraw.vue View File

@ -97,19 +97,69 @@
transferAmount,
}
await this.$fetch('cashout', params)
const result = await this.$fetch('cashout', params)
uni.showToast({
icon: 'success',
title: '提交成功',
console.log('cashout', result)
//
if (!wx.canIUse('requestMerchantTransfer')) {
wx.showModal({
content: '你的微信版本过低,请更新至最新版本。',
showCancel: false,
});
return
}
// API
wx.requestMerchantTransfer({
mchId: this.$config.mchId,
appId: wx.getAccountInfoSync().miniProgram.appId,
package: result.packageInfo,
success: (res) => {
uni.showToast({
title: '提现申请已提交',
icon: 'success'
})
this.form.transferAmount = null
this.form.userName = null
this.$api('getMoney', {
id : result.outBillNo,
}).then(res => {
this.$store.commit('getUserInfo')
this.$store.commit('getUserCenterData')
})
},
fail: (res) => {
console.log('fail:', res);
uni.showToast({
title: '提现失败,请稍后再试',
icon: 'none'
})
},
complete: (res) => {
console.log('requestMerchantTransfer完成:', res);
}
});
// uni.showToast({
// icon: 'success',
// title: '',
// });
setTimeout(() => {
this.$utils.navigateBack()
}, 800)
} catch (err) {
console.log('onSave err', err)
console.log('cashout err', err)
const { message } = err
message && uni.showToast({
icon: 'none',
title: message,
});
}
},
},


+ 2
- 1
utils/share.js View File

@ -25,7 +25,8 @@ function share() { //微信分享
'updateTimelineShareData',
'updateAppMessageShareData',
'onMenuShareWeibo',
'getLocation'
'getLocation',
'requestMerchantTransfer',
]
});


Loading…
Cancel
Save