Browse Source

优化支付

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

55
pages/order/confirm_atonce.vue

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

Loading…
Cancel
Save