增加支付宝支付
This commit is contained in:
@@ -367,6 +367,33 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'alipay', //支付类型-固定值
|
||||||
|
orderInfo: item.id, // 微信支付商户号
|
||||||
|
|
||||||
|
success: (res) => {
|
||||||
|
let _this = this
|
||||||
|
uni.requestSubscribeMessage({
|
||||||
|
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||||
|
complete() {
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付成功"
|
||||||
|
})
|
||||||
|
// uni.cache.set('shopUser', '') //删除shopUser
|
||||||
|
_this.paymodfiyOrderInfo()
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/order/order_detail?orderId=' + _this
|
||||||
|
.listinfoid
|
||||||
|
});
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -171,7 +171,12 @@
|
|||||||
],
|
],
|
||||||
paymentMethodList:[
|
paymentMethodList:[
|
||||||
{ name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
{ name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
{ name: "支付宝支付", type: "3", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"},
|
||||||
|
// #endif
|
||||||
],
|
],
|
||||||
order: {
|
order: {
|
||||||
phone: "",
|
phone: "",
|
||||||
@@ -193,6 +198,7 @@
|
|||||||
listinfoid: null,
|
listinfoid: null,
|
||||||
paymentBtnText: "余额支付",
|
paymentBtnText: "余额支付",
|
||||||
isSocket: false,
|
isSocket: false,
|
||||||
|
socketTicket: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -202,13 +208,17 @@
|
|||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
console.log(this)
|
console.log(this)
|
||||||
this.socketTicket.Close()
|
if (this.socketTicket) {
|
||||||
uni.$off('getMessage')
|
this.socketTicket.Close()
|
||||||
|
uni.$off('message')
|
||||||
|
}
|
||||||
this.ispws = false
|
this.ispws = false
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.socketTicket.Close()
|
if (this.socketTicket) {
|
||||||
uni.$off('message')
|
this.socketTicket.Close()
|
||||||
|
uni.$off('message')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
console.log(JSON.parse(e.cartList))
|
console.log(JSON.parse(e.cartList))
|
||||||
@@ -499,6 +509,34 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP-ALIPAY
|
||||||
|
uni.requestPayment({
|
||||||
|
provider: 'alipay', //支付类型-固定值
|
||||||
|
orderInfo: res.data.appId, // 微信支付商户号
|
||||||
|
|
||||||
|
success: (res) => {
|
||||||
|
let _this = this
|
||||||
|
uni.requestSubscribeMessage({
|
||||||
|
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
|
||||||
|
complete() {
|
||||||
|
uni.showToast({
|
||||||
|
title: "支付成功"
|
||||||
|
})
|
||||||
|
// uni.cache.set('shopUser', '') //删除shopUser
|
||||||
|
_this.paymodfiyOrderInfo()
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/order/order_detail?orderId=' + _this
|
||||||
|
.listinfoid
|
||||||
|
});
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user