xiaozhiyong 9 months ago
parent b2f723abaa
commit 0907abab72
  1. 33
      BagStation/pages/makeOrder/orderPaying.vue
  2. 8
      api/pay.js

@ -183,7 +183,7 @@
}, },
data() { data() {
return { return {
userIp:null, userIp: null,
showtitles: "", showtitles: "",
imgURL: this.global.imgURL, imgURL: this.global.imgURL,
order: uni.getStorageSync('orderMade'), order: uni.getStorageSync('orderMade'),
@ -225,7 +225,7 @@
const that = this const that = this
wx.request({ wx.request({
url: 'http://ip-api.com/json', url: 'http://ip-api.com/json',
success:function(e){ success: function(e) {
console.log(e.data.query); console.log(e.data.query);
that.userIp = e.data.query that.userIp = e.data.query
} }
@ -315,42 +315,35 @@
payCode: 'WECHAT_ORDER_PAY_WECHAT', //APPWECHAT_ORDER_PAY_APP payCode: 'WECHAT_ORDER_PAY_WECHAT', //APPWECHAT_ORDER_PAY_APP
orderId: this.order.orderSerialNumber, orderId: this.order.orderSerialNumber,
payClient: 'XOIL_DRIVER_WECHAT_APPLET', //"XOIL_DRIVER_ANDROID payClient: 'XOIL_DRIVER_WECHAT_APPLET', //"XOIL_DRIVER_ANDROID
userIp: (this.userIp?this.userIp:"36.57.160.59") , userIp: (this.userIp ? this.userIp : "36.57.160.59"),
merchantNo:'10089027856' merchantNo: '10089027856'
} }
console.log(payData,'payDatapayData') console.log(payData, 'payDatapayData')
oilPayApi.aggregatePay(payData).then(res => { oilPayApi.aggregatePay(payData).then(res => {
if (res.code == 20000) { if (res.code == 20000) {
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', provider: 'wxpay',
...res.data.baseWxOrderVo, ...res.data.baseWxOrderVo,
success: (res1) => { success: (_res) => {
console.log(res)
if (res.code == 20000) {
uni.showToast({ uni.showToast({
title: res.msg title: res.msg
}) })
oilPayApi.wxPayIntegral({
appId: 'wx2f203fde39b883bc',
orderId: this.order.orderSerialNumber
})
uni.redirectTo({ uni.redirectTo({
url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod=' + url: '/BagStation/pages/makeOrder/payResult?status=success&&payMethod=' +
this.payMethod, this.payMethod
fail: (err) => { })
// console.log(err) },
}
}) })
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: 'none'
}) })
} }
},
fail: function(err) {
}
})
} else {
}
}) })
}, },

@ -10,4 +10,12 @@ export default {
data: data data: data
}) })
}, },
// 积分处理
wxPayIntegral(data) {
return request({
url: '/oil-pay/yiBaoPay/wxPayIntegral',
method: 'post',
data: data
})
},
} }

Loading…
Cancel
Save