diff --git a/dist 2.zip b/dist 2.zip deleted file mode 100644 index 77b471f..0000000 --- a/dist 2.zip +++ /dev/null diff --git a/dist.zip b/dist.zip index 90f4a42..15f9333 100644 --- a/dist.zip +++ b/dist.zip diff --git a/src/router/index.js b/src/router/index.js index 987e8af..41df084 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,7 @@ import Vue from 'vue' import Router from 'vue-router' import plateNumber from '@/views/parkPay/plateNumber' -import parkRecord from '@/views/parkPay/parkRecord' +// import parkRecord from '@/views/parkPay/parkRecord' // import selfNav from '@/views/mySelf/selfNav' Vue.use(Router) @@ -23,7 +23,7 @@ export default new Router({ { path: '/parkRecord', name: 'parkRecord', - component: parkRecord + component: () => import("@/views/parkPay/parkRecord.vue") }, { path: '/plateNumber', diff --git a/src/views/parkPay/orderPay.vue b/src/views/parkPay/orderPay.vue index b0656ee..d113889 100644 --- a/src/views/parkPay/orderPay.vue +++ b/src/views/parkPay/orderPay.vue @@ -117,123 +117,38 @@ export default { this.orderId = _order } - if (this.clientBrowser == '支付宝') { // 支付宝支付 - var aliParams = {}; - aliParams.orderId = this.orderId; - aliParams.carNumber = this.carNumber; - aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 - aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 - aliParams.paySrcType = this.paySrcType;//101停车支付 - aliParams.orgId = this.$utils.myOrgId, - aliParams.backType = 2, - aliParams.recordArreaInfos = JSON.stringify(this.orderId); - console.log(aliParams) - aliPay(aliParams).then(response => { - console.log(response) - if (response.code == 0) {//进场 - document.write(response.data);//打开支付表单 - } else {//其他情况如【该卡号场内已存在】 - console.log(response.message); - } - - }) - } - console.log(this.clientBrowser) - if (this.clientBrowser == '立即') { // 农行支付 - var bankabcParams = {}; - bankabcParams.orderId = this.orderId; - bankabcParams.carNumber = this.carNumber; - bankabcParams.payType = 34;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 34 农行 - bankabcParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 - bankabcParams.paySrcType = this.paySrcType;//101停车支付 - bankabcParams.orgId = this.$utils.myOrgId, - bankabcParams.backType = 2, - bankabcParams.PaymentLinkType = 1 - bankabcParams.recordArreaInfos = JSON.stringify(this.orderId); - console.log(bankabcParams) - bankH5Pay(bankabcParams).then(response => { - console.log(response) - if(response.code=='0'){ - let res = response.data.PaymentURL - let _token = res.split('TOKEN=')[1] - let OrderNo = response.data.OrderNo - localStorage.setItem('OrderNum',OrderNo) - - - if(window.navigator.userAgent.indexOf('Bankabc/Portal') > -1) { - // alert('当前页面在新容器'); - AlipayJSBridge.call('startApp',{ - appId:'30603024', // 固定值 - param:{ - type:"3", // 3: 掌银内H5页面, - tokenId:_token, //商户传过来的tokenId - paySystem:"", //商户传过来的paySystem, 没有则传空字符串 - payType:"1111", //商户传过来的payType,没有则传'1111' - webviewURL:"https://wxgzh.renniting.cn/wechatwuxi/Chifeng/TEST/sweeping_payment/codepay/index.html#/payResult", //商户传过来的回跳地址 - remark:"其他参数", //扩展备用 - showProgress:'NO', - backBehavior:'back' - }, - },function(result){ - - }); + if (this.clientBrowser == '微信') { // 微信支付 + let _openId = sessionStorage.getItem('openIdData') + if(_openId){ + me.vxPay(_openId, this.orderId) + }else{ + //第一步获取openid + var codeParams = { + code: this.webAppCode, + appId: this.$utils.myVxAppId + }; + getOpenId(codeParams).then(res => { + if (res.code == 0) { + me.vxPay(res.data, this.orderId) + sessionStorage.setItem('openIdData',res.data) + } else if (res.code == 40163) { //code been used, hints[重复code问题] + alert('请重新扫码重复code问题') + console.log(res.message); } else { - // alert('当前页面在旧容器'); - // 旧支付方式 - window.location.href = 'https://www.abchina.com/luascript/mobilePayLua/'+ encodeURI('{"return":{"tokenID":"'+_token+'","backURL":"https://wxgzh.renniting.cn/wechatwuxi/Chifeng/TEST/sweeping_payment/codepay/index.html#/payResult","payType":""}}'); - + alert('请重新扫码') } - }else{ - alert('支付失败') - } - - - // console.log(_token) - // let _data = 'method=invokePayFromBrowser&tokenID='+_token - // let cryData = CryptoJS.encrypt(_data, 'G9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvM3', 'EkpTEA3FbZFGGq8Y') - // - // let baseCRY = Base64.encode(cryData) - // console.log(baseCRY) - // window.location.href='bankabc:' + encodeURIComponent('{"method":"invokePayFromBrowser","param":'+baseCRY+'}') - // // 即为加密后的数据。其中paramsEncode是需要加密的数据、 - // // keyStr是加密时使用的key,与服务端一致、hash是偏移量,是一个随机生成的16位字符串。 - }) - } - - - - - - - - if (this.clientBrowser == '微信') { // 微信支付 - //第一步获取openid - var codeParams = { - code: this.webAppCode, - appId: this.$utils.myVxAppId - }; - getOpenId(codeParams).then(res => { - if (res.code == 0) { - me.vxPay(res.data, this.orderId) - } else if (res.code == 40163) { //code been used, hints[重复code问题] - alert('请重新扫码') - console.log(res.message); - } else { - alert('请重新扫码') - } - }) - + }) + } } - }, vxPay(openIdData, orderIdData) { let vm = this var wxParams = {}; wxParams.orderId = orderIdData; wxParams.backType = 2, - wxParams.orgId = this.$utils.myOrgId, - wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 + wxParams.orgId = this.$utils.myOrgId, + wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 wxParams.carNumber = this.carNumber; wxParams.paySrcType = this.paySrcType;//101停车支付 @@ -301,6 +216,8 @@ export default { console.log(response) me.parkList = response.data.dataList + // alert(JSON.stringify(me.parkList)) + // alert(me.parkList.length) if(me.parkList.length == 0){ me.$router.push({ path:'parkRecord', @@ -310,25 +227,43 @@ export default { parkFlag: 0 // 0表示在停 1表示历史 } }) - } - me.parkingData = me.parkList.filter(item => { - return item.parkState == '10' - }) - console.log(me.parkingData) - me.historyList = me.parkList.filter(item => { - return item.parkState == '20' - }) - console.log(me.historyList) - if(me.parkingData.length>0){ - MessageBox.confirm('', { - message: '您当前有在停订单 是否立即支付?', - title: '温馨提示', - confirmButtonText: '去支付', - cancelButtonText: '取消' - }).then(action => { - if (action == 'confirm') { //确认的回调 - console.log('确定'); + }else{ + me.parkingData = me.parkList.filter(item => { + return item.parkState == '10' + }) + console.log(me.parkingData) + me.historyList = me.parkList.filter(item => { + return item.parkState == '20' + }) + console.log(me.historyList) + + if(me.historyList.length>0){ + MessageBox.confirm('', { + message: '您当前有历史欠费 是否立即补缴?', + title: '温馨提示', + confirmButtonText: '去补缴', + cancelButtonText: '取消' + }).then(action => { + if (action == 'confirm') { //确认的回调 + console.log('确定'); + me.$router.push({ + path:'parkRecord', + query:{ + carNumber: me.carNumber, + carNumberColor: me.carWrapBG, + parkFlag: 1 // 0表示在停 1表示历史 + } + }) + } + }).catch(err => { + if (err == 'cancel') { //取消的回调 + console.log('取消'); + } + }); + }else{ + + if(me.paySrcType==101){ //缴费了本次 me.$router.push({ path:'parkRecord', query:{ @@ -337,42 +272,37 @@ export default { parkFlag: 0 // 0表示在停 1表示历史 } }) - } - }).catch(err => { - if (err == 'cancel') { //取消的回调 - console.log('取消'); - } - }); - } - - if(me.parkingData.length==0&&me.historyList.length>0){ - MessageBox.confirm('', { - message: '您当前有历史欠费 是否立即补缴?', - title: '温馨提示', - confirmButtonText: '去补缴', - cancelButtonText: '取消' - }).then(action => { - if (action == 'confirm') { //确认的回调 - console.log('确定'); - me.$router.push({ - path:'parkRecord', - query:{ - carNumber: me.carNumber, - carNumberColor: me.carWrapBG, - parkFlag: 1 // 0表示在停 1表示历史 + }else{ + MessageBox.confirm('', { + message: '您当前有在停订单 是否立即支付?', + title: '温馨提示', + confirmButtonText: '去支付', + cancelButtonText: '取消' + }).then(action => { + if (action == 'confirm') { //确认的回调 + console.log('确定'); + me.$router.push({ + path:'parkRecord', + query:{ + carNumber: me.carNumber, + carNumberColor: me.carWrapBG, + parkFlag: 0 // 0表示在停 1表示历史 + } + }) } - }) - } - }).catch(err => { - if (err == 'cancel') { //取消的回调 - console.log('取消'); + }).catch(err => { + if (err == 'cancel') { //取消的回调 + console.log('取消'); + } + }); } - }); + + } } - }) + }) diff --git a/src/views/parkPay/parkRecord.vue b/src/views/parkPay/parkRecord.vue index 6f93328..ea6224f 100644 --- a/src/views/parkPay/parkRecord.vue +++ b/src/views/parkPay/parkRecord.vue @@ -33,7 +33,7 @@
停车时长:{{ $utils.dateFormat(i.parkDuration)}}
¥{{(i.unPayFee/100).toFixed(2)}}
-申请离场
+申请离场
出场缴费