diff --git a/subPackages/order/orderPay.vue b/subPackages/order/orderPay.vue index 5583f78..cc390c1 100644 --- a/subPackages/order/orderPay.vue +++ b/subPackages/order/orderPay.vue @@ -223,46 +223,66 @@ title: '加载中' }) if(this.payType == 1) { + // uni.request({ + // method: 'POST', + // url: "/api/api/order/pay", + // header: { + // 'content-type': 'application/json', + // 'token': "35cda449-d338-46d8-b95a-20a19bd1e58f" + // }, + // data: { + // order_id: "46022510201010554631", + // pay_method: "ICBC_WECHAT", + // pay_platform: "JSAPI", + // return_url: "https://m.cloud.sz-trip.com/OrderWaiting", + // token: "35cda449-d338-46d8-b95a-20a19bd1e58f" + // }, + // success: (resTwo) => { + // let resObj = {} + // try { + // resObj = JSON.parse(resTwo) + // } catch(e) {} + // WeixinJSBridge.invoke('getBrandWCPayRequest', { + // "appId": resObj.appId || resObj.appid, //公众号ID,由商户传入 + // "timeStamp": resObj.timeStamp || resObj.timestamp, //时间戳,自1970年以来的秒数 + // "nonceStr": resObj.nonceStr || resObj.noncestr, //随机串 + // "package": resObj.package, + // "signType": resObj.signType, //微信签名方式: + // "paySign": resObj.paySign|| resObj.sign, //微信签名 + // }, + // function(res) { + // console.log(res) + // }); + // } + // }) + // return + // 微信支付 - uni.request({ - method: 'POST', - url: this.JDSZAPIURL + '/api/order/pay', - header: { - 'content-type': 'application/json', - 'token': this.token - }, - data: { - order_id: this.id, - pay_method: "WEIXIN", - pay_platform: "MINI", - app_name: "WxXcxConfig" - }, - success: res => { - uni.hideLoading() - if (res.data.code == 1) { - let data = JSON.parse(res.data.data) - uni.requestPayment({ - nonceStr: data.nonceStr || data.noncestr, - package: data.package, - paySign: data.paySign || data.sign, - signType: data.signType, - timeStamp: "" + (data.timeStamp || data.timestamp), - complete: function(res) { - // setTimeout(() => { - // uni.redirectTo({ - // url: '/subPackages/order/trades' - // }) - // }, 1000) - } - }); - } else { - uni.showToast({ - title:res.data.msg, - icon:'none' - }) - } + this.Post({ + order_id: this.id, + code: "", + pay_method: "ICBC_WECHAT", + pay_platform: "JSAPI", + return_url: "https://" + window.location.host + "/OrderWaiting", + }, "/api/order/pay").then(resTwo => { + let resObj = {} + try { + resObj = JSON.parse(resTwo) + } catch(e) {} + + WeixinJSBridge.invoke('getBrandWCPayRequest', { + "appId": resObj.appId || resObj.appid, //公众号ID,由商户传入 + "timeStamp": resObj.timeStamp || resObj.timestamp, //时间戳,自1970年以来的秒数 + "nonceStr": resObj.nonceStr || resObj.noncestr, //随机串 + "package": resObj.package, + "signType": resObj.signType, //微信签名方式: + "paySign": resObj.paySign|| resObj.sign, //微信签名 }, + function(res) { + // that.$router.push('/OrderWaiting') + }); }) + }else if(this.payType == 2) { // 数币支付 uni.request({