Browse Source

优化支付

master
Enzo 4 years ago
parent
commit
2544d5d89a
  1. 27
      pages/order/confirm_atonce.vue

27
pages/order/confirm_atonce.vue

@ -10,13 +10,16 @@
timesIndex: 0, timesIndex: 0,
userInfo: {}, userInfo: {},
payErr: {}, payErr: {},
paySuccecc: {}
paySuccecc: {},
count: 0
} }
}, },
onShow(e) { onShow(e) {
// this.order_id = uni.getStorageSync('order_id') // this.order_id = uni.getStorageSync('order_id')
let that = this
uni.$once('order_id',function(data){
let that = this;
that.count++;
if(that.count == 1) {
uni.$on('order_id',function(data){
that.order_id = data.msg that.order_id = data.msg
if (that.order_id) { if (that.order_id) {
that.getUserProfile() that.getUserProfile()
@ -24,7 +27,10 @@
that.$msg('获取订单失败'); that.$msg('获取订单失败');
} }
}) })
}
},
onUnload() {
uni.$off('order_id');
}, },
methods: { methods: {
// //
@ -78,13 +84,6 @@
}) })
}, },
fail: (err) => { fail: (err) => {
uni.showModal({
title: '提示',
content: JSON.stringify(err),
confirmColor: '#1998FE',
showCancel: false,
success(res2) {
if (res2.confirm) {
wx.navigateBackMiniProgram({ wx.navigateBackMiniProgram({
extraData: { extraData: {
backPayState: false, backPayState: false,
@ -92,15 +91,13 @@
}, },
success(res) {} success(res) {}
}) })
}
}
});
}, },
}) })
}).catch(err => { }).catch(err => {
let that = this;
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: JSON.stringify(err),
content: '支付订单失败',
showCancel: false, showCancel: false,
confirmColor: '#1998FE', confirmColor: '#1998FE',
success(res2) { success(res2) {

Loading…
Cancel
Save