diff --git a/api/model/my.js b/api/model/my.js index 5940068..b32dac5 100644 --- a/api/model/my.js +++ b/api/model/my.js @@ -97,7 +97,6 @@ const api = { queryAmountLog: { url: '/teambuy/amount/queryAmountLog', method: 'POST', - limit: 500 }, // 钱包 - 提现 @@ -107,6 +106,18 @@ const api = { limit: 500 }, + // 钱包-领取提现金额 + getMoney: { + url: '/teambuy/amount/getMoney', + method: 'POST', + limit: 500 + }, + + // 钱包-提现记录列表 + queryCashoutLog: { + url: '/teambuy/amount/queryCashoutLog', + method: 'GET', + }, } diff --git a/config.js b/config.js index 6299105..803cf0b 100644 --- a/config.js +++ b/config.js @@ -6,7 +6,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'test' +const type = 'local' // 环境配置 @@ -43,6 +43,8 @@ const defaultConfig = { endpoint: 'oss-cn-guangzhou.aliyuncs.com', } }, + //商户号 + mchId : '1714087825', } diff --git a/manifest.json b/manifest.json index 1652766..b136b27 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "unapp模板", - "appid" : "__UNI__098D831", + "appid" : "__UNI__197A38F", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", diff --git a/pages_order/mine/runningWater.vue b/pages_order/mine/runningWater.vue index 089c18d..b0e6a3b 100644 --- a/pages_order/mine/runningWater.vue +++ b/pages_order/mine/runningWater.vue @@ -1,88 +1,53 @@ \ No newline at end of file diff --git a/pages_order/mine/wallet.vue b/pages_order/mine/wallet.vue index 39645d3..a6d31ac 100644 --- a/pages_order/mine/wallet.vue +++ b/pages_order/mine/wallet.vue @@ -22,6 +22,10 @@ 资产明细 > + + 提现记录 + > + @@ -41,7 +45,7 @@ - @@ -195,67 +199,51 @@ export default { }); return } + + let data = res.result + + this.$store.commit('getUserInfo') - // 判断是否在开发者工具中 - const systemInfo = uni.getSystemInfoSync(); - const isDevTools = systemInfo.platform === 'devtools'; - - if (isDevTools) { - // 在开发者工具中,显示提示信息 - console.log('开发者工具中无法调试此API,请在真机上测试'); - uni.showModal({ - title: '提示', - content: '当前在开发者工具中,无法调试支付相关API,请在真机上测试。', - showCancel: false, - success: () => { - // 模拟成功,方便开发调试 - this.$store.commit('getUserInfo') - this.withdrawAmount = '' - this.realName = '' - this.isFormValid = true - } - }); - } else { - // 在真机环境中,调用API - wx.requestMerchantTransfer({ - mchId: res.result.outBillNo, - appId: wx.getAccountInfoSync().miniProgram.appId, - package: res.result.packageInfo, - success: (res) => { - uni.showToast({ - title: '提现申请已提交', - icon: 'success' - }) - this.$store.commit('getUserInfo') - this.withdrawAmount = '' - this.realName = '' - }, - fail: (res) => { - console.log('fail:', res); - uni.showToast({ - title: '提现失败,请稍后再试', - icon: 'none' - }) - this.isFormValid = true - }, - complete: (res) => { - console.log('requestMerchantTransfer完成:', res); - } - }); - } + wx.requestMerchantTransfer({ + mchId: this.$config.mchId, + appId: wx.getAccountInfoSync().miniProgram.appId, + package: res.result.packageInfo, + success: (res) => { + // uni.showToast({ + // title: '提现申请已提交', + // icon: 'success' + // }) + this.withdrawAmount = '' + this.realName = '' + + this.$api('getMoney', { + id : data.outBillNo, + }) + }, + fail: (res) => { + console.log('fail:', res); + uni.showToast({ + title: '提现失败,请稍后再试', + icon: 'none' + }) + this.isFormValid = true + }, + complete: (res) => { + console.log('requestMerchantTransfer完成:', res); + } + }); } else { - uni.showToast({ - title: '提现成功', - icon: 'success' - }) - this.$store.commit('getUserInfo') - this.withdrawAmount = '' - this.realName = '' + uni.showToast({ + title: res.message, + icon: 'none' + }) + this.withdrawAmount = '' + this.realName = '' } }else { uni.showToast({ - title: 'res.message', - icon: 'error' + title: res.message, + icon: 'none' }) } this.isFormValid = true @@ -297,7 +285,13 @@ export default { console.log(err); } }) - } + }, + + toRunningWater() { + uni.navigateTo({ + url: "/pages_order/mine/runningWater" + }) + }, } }