|
@@ -186,11 +186,47 @@
|
|
|
uni.hideLoading();
|
|
|
if (res.code == 0) {
|
|
|
if (res.data.needPay == 1) {
|
|
|
- $http.post('/api/v1/mp/user/deliver/order/pay', {
|
|
|
+ // #ifdef MP-ALIPAY
|
|
|
+ let data = {
|
|
|
+ orderId: res.data.orderId,
|
|
|
+ payType: 1
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ // #ifndef MP-ALIPAY
|
|
|
+ let data = {
|
|
|
orderId: res.data.orderId,
|
|
|
payType: 2
|
|
|
- }).then(ele => {
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ $http.post('/api/v1/mp/user/deliver/order/pay', data).then(ele => {
|
|
|
if (ele.code == 0) {
|
|
|
+ // #ifdef MP-ALIPAY
|
|
|
+ uni.requestPayment({
|
|
|
+ orderInfo: ele.data.pay_info,
|
|
|
+ success() {
|
|
|
+ uni.showToast({
|
|
|
+ title: '支付成功',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: `/packageGoods/order/index`
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ },
|
|
|
+ fail() {
|
|
|
+ payIng = false
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: `/packageGoods/order/index`
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifndef MP-ALIPAY
|
|
|
uni.requestPayment({
|
|
|
timeStamp: ele.data.timeStamp,
|
|
|
nonceStr: ele.data.nonceStr,
|
|
@@ -218,6 +254,8 @@
|
|
|
}, 500)
|
|
|
}
|
|
|
})
|
|
|
+ // #endif
|
|
|
+
|
|
|
} else if (ele.code == 1005) {
|
|
|
_this.authShow = true
|
|
|
} else {
|