Commit 5478746ae1870c552e363b6735eaa121fa9d8f96

Authored by liuqimichale
1 parent 8910837d

赤峰动态码

src/components/dynCodePay.vue
... ... @@ -3,23 +3,33 @@
3 3 <div class="car-wrap">
4 4 <div class="carBG" :class="carWrapBG | formateColor">
5 5 <p class="carNumber">{{carNumber}}</p>
6   - <p class="payFee">{{(arrearageActFee/100).toFixed(2)}}元</p>
  6 + <p class="payFee">{{(orderFee/100).toFixed(2)}}元</p>
7 7 </div>
8 8 </div>
9 9  
10 10 <ul class="fee-wrap">
11 11 <li>
12   - <span>待缴金额</span>
13   - <span>{{(arrearageActFee/100).toFixed(2)}}</span>
  12 + <span>停车场</span>
  13 + <span>{{ parkName }}</span>
14 14 </li>
15 15 <li>
16   - <span>优惠金额</span>
17   - <span>{{(arrearageDiscFee/100).toFixed(2)}}</span>
  16 + <span>入场时间</span>
  17 + <span>{{ inparktime }}</span>
18 18 </li>
19 19 <li>
20   - <span>应付金额</span>
21   - <span>{{(arrearageActFee/100).toFixed(2)}}</span>
  20 + <span>出场时间</span>
  21 + <span>{{ outtime }}</span>
22 22 </li>
  23 +
  24 + <li>
  25 + <span>停车时长</span>
  26 + <span>{{ $utils.dateFormat(staytime) }}</span>
  27 + </li>
  28 + <li>
  29 + <span>待缴金额</span>
  30 + <span>{{(orderFee/100).toFixed(2)}}</span>
  31 + </li>
  32 +
23 33 </ul>
24 34 <div style="padding: 20px 18px">
25 35 <div class="toPay" @click="toPay">{{clientBrowser}}支付</div>
... ... @@ -43,19 +53,24 @@
43 53  
44 54 let Base64 = require('js-base64').Base64
45 55  
46   -import { aliPay, getOpenId, vxPayQuery, bankH5Pay } from '@/api/orderPay/orderPay'
  56 +import {aliPay, getOpenId, vxPayQuery, bankH5Pay} from '@/api/orderPay/orderPay'
47 57  
48 58 export default {
49 59 name: 'dynCodePay',
50 60 data() {
51 61 return {
52 62 carWrapBG: 0,
53   - carNumber: '',
  63 + carNumber: '', // 车牌
  64 + parkName: '', // 停车场名称
  65 + inparktime: '', // 入场时间
  66 + outtime: '', // 出场时间
  67 + staytime: '', // 停车时长
  68 + orderFee: '', // 需要支付的费用
54 69 arrearageActFee: 0,
55 70 arrearageDiscFee: 0,
56 71 arrearageActFee: 0,
57 72 clientBrowser: '', // 客户端
58   - paySrcType: '', //支付的类型 101 是本次 103是历史欠费
  73 + paySrcType: 101, //支付的类型 101 是本次 103是历史欠费
59 74 orderId: '', //支付的订单
60 75 webAppCode: '', // 微信code
61 76 appOrderTimeout: '', // 超时描述
... ... @@ -63,13 +78,18 @@ export default {
63 78 },
64 79 created() {
65 80 // this.carWrapBG = this.$route.query.carColor //车牌颜色
66   - // this.carNumber = this.$route.query.carNumber
  81 + this.carNumber = this.$route.query.plateno
  82 + this.parkName = this.$route.query.parkName
  83 + this.inparktime = this.$route.query.inparktime
  84 + this.outtime = this.$route.query.outtime
  85 + this.staytime = this.$route.query.staytime
  86 + this.orderFee = this.$route.query.orderFee
67 87 // this.arrearageTotalFee = this.$route.query.arrearageTotalFee // 应收
68 88 // this.arrearageDiscFee = this.$route.query.arrearageDiscFee // 优惠
69 89 // this.arrearageActFee = this.$route.query.arrearageActFee // 实收
70   - // this.clientBrowser = this.$utils.clientBrowser() //支付方式
71   - // this.paySrcType = this.$route.query.paySrcType // 实收
72   - // this.orderId = this.$route.query.ordeID
  90 + this.clientBrowser = this.$utils.clientBrowser() //支付方式
  91 + // this.paySrcType = this.$route.query.codeType // 实收
  92 + this.orderId = this.$route.query.orderId
73 93 // console.log(this.orderId)
74 94 // this.appOrderTimeout = this.$route.query.appOrderTimeout
75 95 // if (this.clientBrowser == "微信") {
... ... @@ -80,7 +100,7 @@ export default {
80 100 methods: {
81 101 getCode() {
82 102 var appID = this.$utils.myVxAppId;
83   - alert(appID)
  103 + // alert(appID)
84 104 var code = this.getUrlParam('code');
85 105 var local = window.location.href;
86 106 if (code == null || code === '') {
... ... @@ -114,13 +134,13 @@ export default {
114 134 if (this.clientBrowser == '支付宝') { // 支付宝支付
115 135 var aliParams = {};
116 136 aliParams.orderId = this.orderId;
117   - aliParams.carNumber = this.carNumber;
  137 + // aliParams.carNumber = this.carNumber;
118 138 aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
119 139 aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
120 140 aliParams.paySrcType = this.paySrcType;//101停车支付
121   - aliParams.orgId = this.$utils.myOrgId,
122   - aliParams.backType = 2,
123   - aliParams.recordArreaInfos = JSON.stringify(this.orderId);
  141 + // aliParams.orgId = this.$utils.myOrgId,
  142 + // aliParams.backType = 2,
  143 + // aliParams.recordArreaInfos = JSON.stringify(this.orderId);
124 144 console.log(aliParams)
125 145 aliPay(aliParams).then(response => {
126 146 console.log(response)
... ... @@ -133,7 +153,6 @@ export default {
133 153 })
134 154 }
135 155  
136   - console.log(this.clientBrowser)
137 156 if (this.clientBrowser == '农行') { // 农行支付
138 157 var bankabcParams = {};
139 158 bankabcParams.orderId = this.orderId;
... ... @@ -149,41 +168,39 @@ export default {
149 168  
150 169 bankH5Pay(bankabcParams).then(response => {
151 170 console.log(response)
152   - if(response.code=='0'){
  171 + if (response.code == '0') {
153 172 let res = response.data.PaymentURL
154 173 let _token = res.split('TOKEN=')[1]
155 174 let OrderNo = response.data.OrderNo
156   - localStorage.setItem('OrderNum',OrderNo)
157   -
  175 + localStorage.setItem('OrderNum', OrderNo)
158 176  
159   - if(window.navigator.userAgent.indexOf('Bankabc/Portal') > -1) {
  177 + if (window.navigator.userAgent.indexOf('Bankabc/Portal') > -1) {
160 178 // alert('当前页面在新容器');
161   - AlipayJSBridge.call('startApp',{
162   - appId:'30603024', // 固定值
163   - param:{
164   - type:"3", // 3: 掌银内H5页面,
165   - tokenId:_token, //商户传过来的tokenId
166   - paySystem:"", //商户传过来的paySystem, 没有则传空字符串
167   - payType:"1111", //商户传过来的payType,没有则传'1111'
168   - webviewURL:"https://wxgzh.renniting.cn/wechatwuxi/Chifeng/TEST/sweeping_payment/codepay/index.html#/payResult", //商户传过来的回跳地址
169   - remark:"其他参数", //扩展备用
170   - showProgress:'NO',
171   - backBehavior:'back'
  179 + AlipayJSBridge.call('startApp', {
  180 + appId: '30603024', // 固定值
  181 + param: {
  182 + type: "3", // 3: 掌银内H5页面,
  183 + tokenId: _token, //商户传过来的tokenId
  184 + paySystem: "", //商户传过来的paySystem, 没有则传空字符串
  185 + payType: "1111", //商户传过来的payType,没有则传'1111'
  186 + webviewURL: "https://wxgzh.renniting.cn/wechatwuxi/Chifeng/TEST/sweeping_payment/codepay/index.html#/payResult", //商户传过来的回跳地址
  187 + remark: "其他参数", //扩展备用
  188 + showProgress: 'NO',
  189 + backBehavior: 'back'
172 190 },
173   - },function(result){
  191 + }, function (result) {
174 192  
175 193 });
176 194 } else {
177 195 // alert('当前页面在旧容器');
178 196 // 旧支付方式
179   - 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":""}}');
  197 + 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":""}}');
180 198  
181 199 }
182   - }else{
  200 + } else {
183 201 alert('支付失败')
184 202 }
185 203  
186   -
187 204 // console.log(_token)
188 205 // let _data = 'method=invokePayFromBrowser&tokenID='+_token
189 206 // let cryData = CryptoJS.encrypt(_data, 'G9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvM3', 'EkpTEA3FbZFGGq8Y')
... ... @@ -196,12 +213,6 @@ export default {
196 213 })
197 214 }
198 215  
199   -
200   -
201   -
202   -
203   -
204   -
205 216 if (this.clientBrowser == '微信') { // 微信支付
206 217 //第一步获取openid
207 218 var codeParams = {
... ... @@ -226,13 +237,13 @@ export default {
226 237 let vm = this
227 238 var wxParams = {};
228 239 wxParams.orderId = orderIdData;
229   - wxParams.backType = 2,
230   - wxParams.orgId = this.$utils.myOrgId,
  240 + // wxParams.backType = 2,
  241 + // wxParams.orgId = this.$utils.myOrgId,
231 242 wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
232 243 wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
233   - wxParams.carNumber = this.carNumber;
234   - wxParams.paySrcType = this.paySrcType;//101停车支付
235   - wxParams.recordArreaInfos = JSON.stringify(orderIdData);
  244 + // wxParams.carNumber = this.carNumber;
  245 + // wxParams.paySrcType = this.paySrcType;//101停车支付
  246 + // wxParams.recordArreaInfos = JSON.stringify(orderIdData);
236 247 wxParams.openId = openIdData;
237 248 wxParams.appId = this.$utils.myVxAppId;
238 249 vxPayQuery(wxParams).then(res => {
... ... @@ -288,8 +299,7 @@ export default {
288 299 )
289 300 },
290 301 },
291   - filters: {
292   - }
  302 + filters: {}
293 303 }
294 304 </script>
295 305  
... ... @@ -332,7 +342,6 @@ export default {
332 342 .carNumber {
333 343 padding: 20px 0 10px;
334 344 font-size: 30px;
335   - color: #fff;
336 345 text-align: center;
337 346 }
338 347  
... ...
src/router/index.js
... ... @@ -2,7 +2,7 @@ import Vue from &#39;vue&#39;
2 2 import Router from 'vue-router'
3 3 import plateNumber from '@/components/plateNumber'
4 4 import parkRecord from '@/components/parkRecord'
5   -import navigation from '@/components/navigation'
  5 +import dynCodePay from '@/components/dynCodePay'
6 6  
7 7 Vue.use(Router)
8 8  
... ... @@ -11,14 +11,14 @@ export default new Router({
11 11 {
12 12 path: '/',
13 13 redirect: {
14   - name: 'navigation'
  14 + name: 'dynCodePay'
15 15 }
16 16 },
17   - {
18   - path: '/navigation',
19   - name: 'navigation',
20   - component: navigation
21   - },
  17 + // {
  18 + // path: '/navigation',
  19 + // name: 'navigation',
  20 + // component: navigation
  21 + // },
22 22 {
23 23 path: '/plateNumber',
24 24 name: 'plateNumber',
... ...