From 2c3614061cfa88fc0a7d653f02238e3e23f16ec5 Mon Sep 17 00:00:00 2001 From: xuxueyang <xuxy@fengyuntec.com> Date: 星期三, 28 八月 2024 18:34:43 +0800 Subject: [PATCH] 1 --- sub_pages/customer/shopping/confirm.vue | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/sub_pages/customer/shopping/confirm.vue b/sub_pages/customer/shopping/confirm.vue index 95923cb..db02471 100644 --- a/sub_pages/customer/shopping/confirm.vue +++ b/sub_pages/customer/shopping/confirm.vue @@ -2,6 +2,7 @@ import { mapState } from 'vuex' + import environments from '@/environments' export default { name: "订单详情", @@ -57,12 +58,12 @@ params: { // id: this.currentInfo.customerDTO.partnerId } - }).then(res => { + }).then(async res => { if (res.code == 0) { this.partnerInfo = res.data || {} if (this.partnerInfo.id !== this.currentInfo.customerDTO.partnerId) { //刷新用户信息 - await dispatch('getCurrentInfo') + await this.$store.dispatch('getCurrentInfo') } } }) @@ -176,16 +177,25 @@ if (code === 0) { //提交信息 console.log('pay,', data) - if (data && data['_testOrderId']) { + // /api/pub/init/callback?orderId= + // if(env.pro) + if (false && data && (data['_testV2OrderId'] || data['_testOrderId']) && + environments.httpBaseUri.startsWith( + 'http://47.99.58.211/flower')) { //回调 tmp.$message.showLoading() const res2 = await tmp.$http.request('get', - '/api/customer/flower/order/callback/tmp', { + '/api/pub/init/callback', { params: { - id: res2.data['_testOrderId'] + orderId: data['_testV2OrderId'] || data[ + '_testOrderId'] || '' } }) tmp.$message.hideLoading() + tmp.$message.showToast('支付成功') + //返回上一页 + await tmp.$store.dispatch('sign_add', 'shopping') + uni.navigateBack() } else if (data) { wx.requestPayment({ ...data, @@ -194,13 +204,18 @@ tmp.$message.showToast('支付成功') //返回上一页 await tmp.$store.dispatch('sign_add', 'shopping') - uni.navigateBack() + // setTimeout(() => { + // uni.navigateBack() + // }, 500) + await tmp.$message.showToast('支付成功') + + }, async fail(err) { console.error('pay fail', err) tmp.$message.showToast('支付失败') - await tmp.$store.dispatch('sign_add', 'shopping') - uni.navigateBack() + // await tmp.$store.dispatch('sign_add', 'shopping') + // uni.navigateBack() } }) -- Gitblit v1.9.3