From 6fcc5f70fdf5d7099d2abcd50e0b79eba70cc536 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Fri, 10 Dec 2021 13:38:45 +0800 Subject: [PATCH] 扬民扫码 --- config/index.js | 2 +- src/components/pay.vue | 29 +++++++++++++++++------------ src/components/plateNumber.vue | 23 ++++++++++++----------- src/utils/request.js | 4 +--- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/config/index.js b/config/index.js index b912637..a9addb1 100644 --- a/config/index.js +++ b/config/index.js @@ -59,7 +59,7 @@ module.exports = { * Source Maps */ - productionSourceMap: true, + productionSourceMap: false, // https://webpack.js.org/configuration/devtool/#production devtool: '#source-map', diff --git a/src/components/pay.vue b/src/components/pay.vue index 3bb11d3..5dfba19 100644 --- a/src/components/pay.vue +++ b/src/components/pay.vue @@ -92,21 +92,25 @@ export default { } }, created() { + let req = sessionStorage.getItem('req') + + let par = JSON.parse(req) + console.log(par) // this.carWrapBG = this.$route.query.carColor //车牌颜色 - this.carNumber = this.$route.query.plateno - this.parkName = this.$route.query.parkName - this.inparktime = this.$route.query.inparktime - this.outtime = this.$route.query.outtime - this.staytime = this.$route.query.staytime - this.orderFee = this.$route.query.orderFee - this.due = this.$route.query.due - this.discountFee = this.$route.query.discountFee + this.carNumber = par.plateno + this.parkName = par.parkName + this.inparktime = par.inparktime + this.outtime = par.outtime + this.staytime = par.staytime + this.orderFee = par.orderFee + this.due = par.due + this.discountFee = par.discountFee // this.arrearageTotalFee = this.$route.query.arrearageTotalFee // 应收 // this.arrearageDiscFee = this.$route.query.arrearageDiscFee // 优惠 // this.arrearageActFee = this.$route.query.arrearageActFee // 实收 this.clientBrowser = this.$utils.clientBrowser() //支付方式 // this.paySrcType = this.$route.query.codeType // 实收 - this.orderId = this.$route.query.orderId + this.orderId = par.orderId // console.log(this.orderId) // this.appOrderTimeout = this.$route.query.appOrderTimeout if (this.clientBrowser == "微信") { @@ -119,9 +123,10 @@ export default { var appID = this.$utils.myVxAppId; // alert(appID) var code = this.getUrlParam('code'); + console.log(code) var local = window.location.href; if (code == null || code === '') { - window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appID + '&redirect_uri=' + encodeURIComponent(local) + '&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect' + window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appID + '&redirect_uri=' + encodeURIComponent(local) + '&response_type=code&scope=snsapi_base&state=1#wechat_redirect' } else { return code; } @@ -239,7 +244,7 @@ export default { if (res.code == 0) { me.vxPay(res.data, this.orderId) } else if (res.code == 40163) { //code been used, hints[重复code问题] - me.$msgbox('提示', '请重新扫码') + me.$msgbox('提示', '微信code重复了,请重新扫码') console.log(res.message); } else { me.$msgbox('提示', '请重新扫码') @@ -310,7 +315,7 @@ export default { } else { console.log('失败') me.$msgbox('提示', '支付失败') - me.$router.go(-2); + // me.$router.go(-2); } } ) diff --git a/src/components/plateNumber.vue b/src/components/plateNumber.vue index f1c3560..ff003bc 100644 --- a/src/components/plateNumber.vue +++ b/src/components/plateNumber.vue @@ -315,16 +315,16 @@ export default { console.log(window.location) console.log(this.$route.query) - if (this.$utils.clientBrowser() == "微信") { - var appID = this.$utils.myVxAppId; - var code = this.getUrlParam('code'); - var local = window.location.href; - if (code == null || code === '') { - window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appID+'&redirect_uri='+encodeURIComponent(local)+'&response_type=code&scope=snsapi_userinfo&state=1,0#wechat_redirect' - } else { - return code; - } - } + // if (this.$utils.clientBrowser() == "微信") { + // var appID = this.$utils.myVxAppId; + // var code = this.getUrlParam('code'); + // var local = window.location.href; + // if (code == null || code === '') { + // window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+appID+'&redirect_uri='+encodeURIComponent(local)+'&response_type=code&scope=snsapi_userinfo&state=1,0#wechat_redirect' + // } else { + // return code; + // } + // } let params = this.$route.query @@ -381,12 +381,13 @@ export default { console.log(tmpObj) //判断是否需要支付 if (tmpObj.needPay) { + sessionStorage.setItem('req',JSON.stringify(tmpObj)) var queryParams = this.$utils.parseParams(tmpObj); console.log(queryParams) // // this.$router.push({ path: 'pay', - query: tmpObj + // query: tmpObj }) // window.location.href = "../pay.html?" + queryParams; } else { diff --git a/src/utils/request.js b/src/utils/request.js index eb9f690..8790573 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -8,12 +8,10 @@ const service = axios.create({ // https://pay.renniting.cn/ 赤峰正式环境 // http://pay.service.huangshiparking.com/ 黄石 - // 'http://39.98.58.92:8090'; 赤峰测试环境 - // https://dev.renniting.cn/pay/ 赤峰农行测试环境 - baseURL: 'https://pay.renniting.cn/', // url = base url + request url + baseURL: 'http://pay.service.renniting.cn/', // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests timeout: 6000 // request timeout }) -- libgit2 0.21.4