Commit 6e9a3492b5d73533e0dd4a8eae84a114df835889
1 parent
943f9186
江阴支付
Showing
8 changed files
with
615 additions
and
107 deletions
src/assets/images/loseIcon.png
0 → 100644
4.98 KB
src/assets/images/successIcon.png
0 → 100644
6.08 KB
src/router/index.js
@@ -25,6 +25,17 @@ export default new Router({ | @@ -25,6 +25,17 @@ export default new Router({ | ||
25 | name: 'parkRecord', | 25 | name: 'parkRecord', |
26 | component: () => import("@/views/parkPay/parkRecord.vue") | 26 | component: () => import("@/views/parkPay/parkRecord.vue") |
27 | }, | 27 | }, |
28 | + | ||
29 | + { | ||
30 | + path: '/coupon', | ||
31 | + name: 'coupon', | ||
32 | + component: () => import("@/views/parkPay/coupon.vue") | ||
33 | + }, | ||
34 | + { | ||
35 | + path: '/couponPay', | ||
36 | + name: 'couponPay', | ||
37 | + component: () => import("@/views/parkPay/couponPay.vue") | ||
38 | + }, | ||
28 | { | 39 | { |
29 | path: '/plateNumber', | 40 | path: '/plateNumber', |
30 | name: 'plateNumber', | 41 | name: 'plateNumber', |
@@ -37,6 +48,8 @@ export default new Router({ | @@ -37,6 +48,8 @@ export default new Router({ | ||
37 | component: () => import("@/views/parkPay/orderPay.vue") | 48 | component: () => import("@/views/parkPay/orderPay.vue") |
38 | }, | 49 | }, |
39 | 50 | ||
51 | + | ||
52 | + | ||
40 | // //---------------- 个人页面导航 | 53 | // //---------------- 个人页面导航 |
41 | // { | 54 | // { |
42 | // path: '/selfNav', | 55 | // path: '/selfNav', |
src/utils/request.js
@@ -5,7 +5,7 @@ import axios from 'axios' | @@ -5,7 +5,7 @@ import axios from 'axios' | ||
5 | const service = axios.create({ | 5 | const service = axios.create({ |
6 | // https://dev.renniting.cn/pay/ 赤峰测试 | 6 | // https://dev.renniting.cn/pay/ 赤峰测试 |
7 | // http://pay.service.renniting.cn/ 赤峰 | 7 | // http://pay.service.renniting.cn/ 赤峰 |
8 | - baseURL: 'http://pay.service.renniting.cn/', // url = base url + request url | 8 | + baseURL: 'https://pay.jycrtc.com/', // url = base url + request url |
9 | // withCredentials: true, // send cookies when cross-domain requests | 9 | // withCredentials: true, // send cookies when cross-domain requests |
10 | timeout: 6000 // request timeout | 10 | timeout: 6000 // request timeout |
11 | }) | 11 | }) |
src/utils/utils.js
@@ -139,22 +139,15 @@ export default { | @@ -139,22 +139,15 @@ export default { | ||
139 | return '1' | 139 | return '1' |
140 | } | 140 | } |
141 | }, | 141 | }, |
142 | - // 0eca8f5373ca4866aec2f8e9d9367104 老的id | ||
143 | - // 14318527b13840c2a4af63fef52c2d6e 老的签名 | ||
144 | 142 | ||
145 | - // ud8yq5tv0inxupc05xfeau39jywlqoj2 新的id | ||
146 | - // ny1u72b6k374sg379z0kqjgfxe2ycnpw 新的签名 | ||
147 | 143 | ||
148 | - myVarAppid:'65grtq5tv0wewec05xfeau39jyghhjm',// 公共请求Appid | 144 | + myVarAppid:'0eca8f5373ca4866aec2f8e9d9367104',// 公共请求Appid |
149 | 145 | ||
150 | myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息 | 146 | myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息 |
151 | 147 | ||
152 | - myVxAppId: 'wx2af2bab90d433c86', | ||
153 | - // 测试环境 微信赤峰 appid wxff4cebaedbf4f886 | ||
154 | - // 微信赤峰 appid wx2af2bab90d433c86 | ||
155 | - // 黄石 appid wxa1a66cc7d263afe6 | 148 | + myVxAppId: 'wxfdc1af620d3ab750', |
156 | 149 | ||
157 | - myOrgId: '10003', // 归属地 赤峰id 10003 黄石 10079 | 150 | + myOrgId: '10107', // |
158 | 151 | ||
159 | myGetSign: function (objb) { // 获取签名 | 152 | myGetSign: function (objb) { // 获取签名 |
160 | var compare = function (obj1, obj2) { | 153 | var compare = function (obj1, obj2) { |
@@ -169,13 +162,13 @@ export default { | @@ -169,13 +162,13 @@ export default { | ||
169 | } | 162 | } |
170 | } | 163 | } |
171 | objb.sort(compare); | 164 | objb.sort(compare); |
172 | - var strmd5 = 'dfdf2b6k37r5y79z0kqjgfxe2wet3434'; | 165 | + var strmd5 = '14318527b13840c2a4af63fef52c2d6e'; |
173 | for(var i=0;i<objb.length;i++){ | 166 | for(var i=0;i<objb.length;i++){ |
174 | if(objb[i].value != null&&objb[i].value != ''){ | 167 | if(objb[i].value != null&&objb[i].value != ''){ |
175 | strmd5 += objb[i].keyname+objb[i].value; | 168 | strmd5 += objb[i].keyname+objb[i].value; |
176 | } | 169 | } |
177 | } | 170 | } |
178 | - strmd5 += 'dfdf2b6k37r5y79z0kqjgfxe2wet3434'; | 171 | + strmd5 += '14318527b13840c2a4af63fef52c2d6e'; |
179 | // console.log('strmd5-------->'+strmd5); | 172 | // console.log('strmd5-------->'+strmd5); |
180 | strmd5 = md5(strmd5); | 173 | strmd5 = md5(strmd5); |
181 | strmd5=strmd5.toUpperCase(); | 174 | strmd5=strmd5.toUpperCase(); |
src/views/parkPay/coupon.vue
0 → 100644
1 | +<template> | ||
2 | + <div> | ||
3 | + <img :src="successiconUrl" alt="" style="margin: 10px auto;width: 64px;height: 64px;"> | ||
4 | + <div style="padding: 10px 30px 50px"> | ||
5 | + <p>尊敬的车主您好:</p> | ||
6 | + <p>尊敬的车主您好:</p> | ||
7 | + <p>尊敬的车主您好:</p> | ||
8 | + </div> | ||
9 | + <div style="padding: 0 20px"> | ||
10 | + <mt-button size="large" type="primary" @click="toPay" style="margin-bottom: 20px;">去支付</mt-button> | ||
11 | + <mt-button size="large" type="danger" @click="toBackPage">返回</mt-button> | ||
12 | + </div> | ||
13 | + | ||
14 | + </div> | ||
15 | +</template> | ||
16 | + | ||
17 | +<script> | ||
18 | +export default { | ||
19 | + name: "coupon", | ||
20 | + data(){ | ||
21 | + return{ | ||
22 | + successiconUrl:require('../../assets/images/successIcon.png'), | ||
23 | + loseiconUrl:require('../../assets/images/loseIcon.png'), | ||
24 | + } | ||
25 | + }, | ||
26 | + methods:{ | ||
27 | + toPay(){ | ||
28 | + this.$router.push({ | ||
29 | + path:'couponPay' | ||
30 | + }) | ||
31 | + }, | ||
32 | + toBackPage(){ | ||
33 | + this.$router.back() | ||
34 | + } | ||
35 | + } | ||
36 | +}; | ||
37 | +</script> | ||
38 | + | ||
39 | +<style scoped> | ||
40 | + | ||
41 | +</style> |
src/views/parkPay/couponPay.vue
0 → 100644
1 | +<template> | ||
2 | + <div> | ||
3 | + <div class="car-wrap"> | ||
4 | + <div class="carBG" :class="carWrapBG | formateColor"> | ||
5 | + <p class="carNumber">{{carNumber}}</p> | ||
6 | + <p class="payFee">{{(arrearageActFee/100).toFixed(2)}}元</p> | ||
7 | + </div> | ||
8 | + </div> | ||
9 | + | ||
10 | + <ul class="fee-wrap"> | ||
11 | + <li> | ||
12 | + <span>停放车场</span> | ||
13 | + <span>{{parkName}}</span> | ||
14 | + </li> | ||
15 | + <li> | ||
16 | + <span>入场时间</span> | ||
17 | + <span>{{parkInTime}}</span> | ||
18 | + </li> | ||
19 | + <li> | ||
20 | + <span>出场时间</span> | ||
21 | + <span>{{parkOutTime}}</span> | ||
22 | + </li> | ||
23 | + <li> | ||
24 | + <span>停车时长</span> | ||
25 | + <span>{{$utils.dateFormat(parkDuration)}}</span> | ||
26 | + </li> | ||
27 | + <li> | ||
28 | + <span>应付金额</span> | ||
29 | + <span> ¥{{(totalFee/100).toFixed(2)}}元</span> | ||
30 | + </li> | ||
31 | + <li> | ||
32 | + <span>停车优惠</span> | ||
33 | + <p> | ||
34 | + ({{cardTypeFormat(carType)}}) <span style="color: #3cc51f">-20.00元</span> | ||
35 | + </p> | ||
36 | + </li> | ||
37 | + <li> | ||
38 | + <span>实际支付</span> | ||
39 | + <span style="color: red"> ¥{{(unPayFee/100).toFixed(2)}}元</span> | ||
40 | + </li> | ||
41 | + </ul> | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + <div style="padding: 20px 18px"> | ||
46 | + <div class="toPay" @click="toPay">{{clientBrowser}}支付</div> | ||
47 | + </div> | ||
48 | + | ||
49 | + <div v-if="appOrderTimeout.length>0"> | ||
50 | + <p class="tip"> | ||
51 | + 温馨提示: | ||
52 | + </p> | ||
53 | + <p style="color: #666;padding: 0 18px;"> | ||
54 | + {{appOrderTimeout}} | ||
55 | + </p> | ||
56 | + </div> | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + </div> | ||
61 | +</template> | ||
62 | + | ||
63 | +<script> | ||
64 | +// import CryptoJS from '../utils/AES.js' | ||
65 | +// let Base64 = require('js-base64').Base64 | ||
66 | +import { MessageBox } from 'mint-ui'; | ||
67 | +import { aliPay, getOpenId, vxPayQuery, bankH5Pay, queryParkingRecordPageByCarNumbers } from '@/api/orderPay/orderPay' | ||
68 | + | ||
69 | +export default { | ||
70 | + name: 'orderPay', | ||
71 | + data() { | ||
72 | + return { | ||
73 | + carWrapBG: 0, | ||
74 | + carNumber: '苏BB210V', | ||
75 | + parkName:'', | ||
76 | + parkInTime:'', | ||
77 | + parkOutTime:'', | ||
78 | + parkDuration:'', | ||
79 | + carType:1, | ||
80 | + arrearageActFee: 0, | ||
81 | + arrearageDiscFee: 0, | ||
82 | + arrearageActFee: 0, | ||
83 | + totalFee:0,// 应付 | ||
84 | + unPayFee:0,// 实付 | ||
85 | + parkingData: [], // 在停数据 | ||
86 | + historyList: [], // 历史欠费数据 | ||
87 | + clientBrowser: '', // 客户端 | ||
88 | + paySrcType: '', //支付的类型 101 是本次 103是历史欠费 | ||
89 | + orderId: '', //支付的订单 | ||
90 | + webAppCode: '', // 微信code | ||
91 | + appOrderTimeout: '', // 超时描述 | ||
92 | + } | ||
93 | + }, | ||
94 | + created() { | ||
95 | + // this.carWrapBG = this.$route.query.carColor //车牌颜色 | ||
96 | + // this.carNumber = this.$route.query.carNumber | ||
97 | + // this.arrearageTotalFee = this.$route.query.arrearageTotalFee // 应收 | ||
98 | + // this.arrearageDiscFee = this.$route.query.arrearageDiscFee // 优惠 | ||
99 | + // this.arrearageActFee = this.$route.query.arrearageActFee // 实收 | ||
100 | + this.clientBrowser = this.$utils.clientBrowser() //支付方式 | ||
101 | + // this.paySrcType = this.$route.query.paySrcType // 实收 | ||
102 | + // this.orderId = this.$route.query.ordeID | ||
103 | + // console.log(this.orderId) | ||
104 | + // this.appOrderTimeout = this.$route.query.appOrderTimeout | ||
105 | + if (this.clientBrowser == "微信") { | ||
106 | + this.webAppCode = this.getCode(); | ||
107 | + } | ||
108 | + | ||
109 | + this.parkRecordList() | ||
110 | + | ||
111 | + }, | ||
112 | + mounted(){ | ||
113 | + | ||
114 | + }, | ||
115 | + methods: { | ||
116 | + parkRecordList() { // 获取停车记录数据 | ||
117 | + var salt = this.$utils.myCommonSalt(32); | ||
118 | + var jsondata = { | ||
119 | + app_id: this.$utils.myVarAppid, | ||
120 | + deviceInfo: this.$utils.myDeviceInfo, | ||
121 | + salt: salt, | ||
122 | + sign_type: "md5", | ||
123 | + pageNum: '1', | ||
124 | + pageSize: '1000', | ||
125 | + parkState: '10', | ||
126 | + terminalSource: '3', | ||
127 | + parkState:'10', | ||
128 | + carNumber: this.carNumber, | ||
129 | + carNumberColor: '0', | ||
130 | + orgId: this.$utils.myOrgId, | ||
131 | + | ||
132 | + } | ||
133 | + jsondata.sign = this.$utils.signObject(jsondata) | ||
134 | + | ||
135 | + // jsondata.sign = md5sign | ||
136 | + console.log('停车记录传参 ' + JSON.stringify(jsondata)); | ||
137 | + queryParkingRecordPageByCarNumbers(jsondata).then(response => { | ||
138 | + console.log(response) | ||
139 | + let res = response.data.dataList[0] | ||
140 | + this.parkName = res.parkName | ||
141 | + | ||
142 | + this.parkInTime = res.parkInTime | ||
143 | + this.parkOutTime = res.parkOutTime | ||
144 | + this.parkDuration = res.parkDuration | ||
145 | + this.carType = res.carType | ||
146 | + | ||
147 | + this.totalFee = res.totalFee | ||
148 | + this.unPayFee = res.unPayFee | ||
149 | + | ||
150 | + }) | ||
151 | + }, | ||
152 | + getCode() { | ||
153 | + var appID = this.$utils.myVxAppId; | ||
154 | + var code = this.getUrlParam('code'); | ||
155 | + var local = window.location.href; | ||
156 | + if (code == null || code === '') { | ||
157 | + 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' | ||
158 | + } else { | ||
159 | + return code; | ||
160 | + } | ||
161 | + }, | ||
162 | + getUrlParam(name) { | ||
163 | + var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); | ||
164 | + var r = window.location.search.substr(1).match(reg) | ||
165 | + if (r != null) return unescape(r[2]) | ||
166 | + return null | ||
167 | + }, | ||
168 | + toPay() { | ||
169 | + let me = this | ||
170 | + let _order = [] | ||
171 | + | ||
172 | + console.log(this.orderId) | ||
173 | + if (this.paySrcType == 103) { | ||
174 | + this.orderId = JSON.parse(this.orderId) | ||
175 | + this.orderId.forEach(item => { | ||
176 | + _order.push({ | ||
177 | + orderId: item | ||
178 | + }) | ||
179 | + }) | ||
180 | + this.orderId = [] | ||
181 | + this.orderId = _order | ||
182 | + } | ||
183 | + | ||
184 | + | ||
185 | + if (this.clientBrowser == '支付宝') { // 支付宝支付 | ||
186 | + let me = this | ||
187 | + var aliParams = {}; | ||
188 | + aliParams.orderId = this.orderId; | ||
189 | + aliParams.carNumber = this.carNumber; | ||
190 | + aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | ||
191 | + aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | ||
192 | + aliParams.paySrcType = this.paySrcType;//101停车支付 | ||
193 | + aliParams.orgId = this.$utils.myOrgId | ||
194 | + aliParams.backType = 2 | ||
195 | + aliParams.recordArreaInfos = JSON.stringify(this.orderId); | ||
196 | + console.log(aliParams) | ||
197 | + aliPay(aliParams).then(response => { | ||
198 | + console.log(response) | ||
199 | + if (response.code == 0) {//进场 | ||
200 | + document.write(response.data);//打开支付表单 | ||
201 | + } else if(response.code == 1002){//其他情况如【该卡号场内已存在】 | ||
202 | + console.log(response.message); | ||
203 | + MessageBox.confirm('', { | ||
204 | + message: response.message, | ||
205 | + title: '温馨提示', | ||
206 | + showCancelButton:false, | ||
207 | + confirmButtonText: '确定', | ||
208 | + }).then(action => { | ||
209 | + if (action == 'confirm') { //确认的回调 | ||
210 | + console.log('确定'); | ||
211 | + this.$router.go(-1) | ||
212 | + } | ||
213 | + }).catch(err => { | ||
214 | + if (err == 'cancel') { //取消的回调 | ||
215 | + console.log('取消'); | ||
216 | + } | ||
217 | + }); | ||
218 | + }else{ | ||
219 | + alert(response.message) | ||
220 | + } | ||
221 | + | ||
222 | + }) | ||
223 | + } | ||
224 | + | ||
225 | + | ||
226 | + if (this.clientBrowser == '微信') { // 微信支付 | ||
227 | + let _openId = sessionStorage.getItem('openIdData') | ||
228 | + if(_openId){ | ||
229 | + me.vxPay(_openId, this.orderId) | ||
230 | + }else{ | ||
231 | + //第一步获取openid | ||
232 | + var codeParams = { | ||
233 | + code: this.webAppCode, | ||
234 | + appId: this.$utils.myVxAppId | ||
235 | + }; | ||
236 | + getOpenId(codeParams).then(res => { | ||
237 | + if (res.code == 0) { | ||
238 | + me.vxPay(res.data, this.orderId) | ||
239 | + sessionStorage.setItem('openIdData',res.data) | ||
240 | + } else if (res.code == 40163) { //code been used, hints[重复code问题] | ||
241 | + alert('请重新支付!重复code问题') | ||
242 | + console.log(res.message); | ||
243 | + } else { | ||
244 | + alert('请重新支付') | ||
245 | + } | ||
246 | + }) | ||
247 | + } | ||
248 | + } | ||
249 | + }, | ||
250 | + vxPay(openIdData, orderIdData) { | ||
251 | + let vm = this | ||
252 | + var wxParams = {}; | ||
253 | + wxParams.orderId = orderIdData; | ||
254 | + wxParams.backType = 2, | ||
255 | + wxParams.orgId = this.$utils.myOrgId, | ||
256 | + wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | ||
257 | + wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | ||
258 | + wxParams.carNumber = this.carNumber; | ||
259 | + wxParams.paySrcType = this.paySrcType;//101停车支付 | ||
260 | + wxParams.recordArreaInfos = JSON.stringify(orderIdData); | ||
261 | + wxParams.openId = openIdData; | ||
262 | + wxParams.appId = this.$utils.myVxAppId; | ||
263 | + vxPayQuery(wxParams).then(res => { | ||
264 | + if (res.code == 0) { // | ||
265 | + if (res.data) { | ||
266 | + var data = res.data; | ||
267 | + console.log(JSON.stringify(data)); | ||
268 | + if (typeof WeixinJSBridge === 'undefined') { // 微信浏览器内置对象。参考微信官方文档 | ||
269 | + if (document.addEventListener) { | ||
270 | + document.addEventListener('WeixinJSBridgeReady', vm.onBridgeReady(data), false) | ||
271 | + } else if (document.attachEvent) { | ||
272 | + document.attachEvent('WeixinJSBridgeReady', vm.onBridgeReady(data)) | ||
273 | + document.attachEvent('onWeixinJSBridgeReady', vm.onBridgeReady(data)) | ||
274 | + } | ||
275 | + } else { | ||
276 | + console.log('准备调用微信支付') | ||
277 | + vm.onBridgeReady(data) | ||
278 | + } | ||
279 | + } else { | ||
280 | + alert("没有找到返回值"); | ||
281 | + } | ||
282 | + } else if(res.code == 1002){//其他情况如【该卡号场内已存在】 | ||
283 | + console.log(res.message); | ||
284 | + MessageBox.confirm('', { | ||
285 | + message: res.message, | ||
286 | + title: '温馨提示', | ||
287 | + showCancelButton:false, | ||
288 | + confirmButtonText: '确定', | ||
289 | + }).then(action => { | ||
290 | + if (action == 'confirm') { //确认的回调 | ||
291 | + console.log('确定'); | ||
292 | + this.$router.go(-1) | ||
293 | + } | ||
294 | + }).catch(err => { | ||
295 | + if (err == 'cancel') { //取消的回调 | ||
296 | + console.log('取消'); | ||
297 | + } | ||
298 | + }); | ||
299 | + }else{ | ||
300 | + alert(res.message) | ||
301 | + } | ||
302 | + }) | ||
303 | + }, | ||
304 | + onBridgeReady(params) { | ||
305 | + let me = this | ||
306 | + console.log('调用微信支付WeixinJSBridge') | ||
307 | + WeixinJSBridge.invoke( | ||
308 | + 'getBrandWCPayRequest', params, | ||
309 | + // | ||
310 | + // 'getBrandWCPayRequest', { // 下面参数内容都是后台返回的 | ||
311 | + // 'appId': data.appId, // 公众号名称,由商户传入 | ||
312 | + // 'timeStamp': data.timeStamp, // 时间戳 | ||
313 | + // 'nonceStr': data.nonceStr, // 随机串 | ||
314 | + // 'package': data.package, // 预支付id | ||
315 | + // 'signType': data.signType, // 微信签名方式 | ||
316 | + // 'paySign': data.paySign // 微信签名 | ||
317 | + // }, | ||
318 | + function (res) { | ||
319 | + // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 | ||
320 | + if (res.err_msg === 'get_brand_wcpay_request:ok') { | ||
321 | + console.log('成功') | ||
322 | + var salt = me.$utils.myCommonSalt(32); | ||
323 | + let wxparams = { | ||
324 | + pageNum: 1, | ||
325 | + pageSize: 10000, | ||
326 | + parkState: 10, | ||
327 | + terminalSource: 7, | ||
328 | + carNumber: me.carNumber, | ||
329 | + app_id: me.$utils.myVarAppid, | ||
330 | + deviceInfo: me.$utils.myDeviceInfo, | ||
331 | + salt: salt, | ||
332 | + sign_type: "md5", | ||
333 | + token:'', | ||
334 | + } | ||
335 | + wxparams.sign = me.$utils.signObject(wxparams) | ||
336 | + queryParkingRecordPageByCarNumbers(wxparams).then(response => { | ||
337 | + console.log(response) | ||
338 | + me.parkList = response.data.dataList | ||
339 | + | ||
340 | + // alert(JSON.stringify(me.parkList)) | ||
341 | + // alert(me.parkList.length) | ||
342 | + if(me.parkList.length == 0){ | ||
343 | + me.$router.push({ | ||
344 | + path:'parkRecord', | ||
345 | + query:{ | ||
346 | + carNumber: me.carNumber, | ||
347 | + carNumberColor: me.carWrapBG, | ||
348 | + parkFlag: 0 // 0表示在停 1表示历史 | ||
349 | + } | ||
350 | + }) | ||
351 | + | ||
352 | + }else{ | ||
353 | + me.parkingData = me.parkList.filter(item => { | ||
354 | + return item.parkState == '10' | ||
355 | + }) | ||
356 | + console.log(me.parkingData) | ||
357 | + me.historyList = me.parkList.filter(item => { | ||
358 | + return item.parkState == '20' | ||
359 | + }) | ||
360 | + console.log(me.historyList) | ||
361 | + | ||
362 | + if(me.historyList.length>0){ | ||
363 | + MessageBox.confirm('', { | ||
364 | + message: '您当前有历史欠费 是否立即补缴?', | ||
365 | + title: '温馨提示', | ||
366 | + confirmButtonText: '去补缴', | ||
367 | + cancelButtonText: '取消' | ||
368 | + }).then(action => { | ||
369 | + if (action == 'confirm') { //确认的回调 | ||
370 | + console.log('确定'); | ||
371 | + me.$router.push({ | ||
372 | + path:'parkRecord', | ||
373 | + query:{ | ||
374 | + carNumber: me.carNumber, | ||
375 | + carNumberColor: me.carWrapBG, | ||
376 | + parkFlag: 1 // 0表示在停 1表示历史 | ||
377 | + } | ||
378 | + }) | ||
379 | + } | ||
380 | + }).catch(err => { | ||
381 | + if (err == 'cancel') { //取消的回调 | ||
382 | + console.log('取消'); | ||
383 | + } | ||
384 | + }); | ||
385 | + }else{ | ||
386 | + | ||
387 | + if(me.paySrcType==101){ //缴费了本次 | ||
388 | + me.$router.push({ | ||
389 | + path:'parkRecord', | ||
390 | + query:{ | ||
391 | + carNumber: me.carNumber, | ||
392 | + carNumberColor: me.carWrapBG, | ||
393 | + parkFlag: 0 // 0表示在停 1表示历史 | ||
394 | + } | ||
395 | + }) | ||
396 | + }else{ | ||
397 | + MessageBox.confirm('', { | ||
398 | + message: '您当前有在停订单 是否立即支付?', | ||
399 | + title: '温馨提示', | ||
400 | + confirmButtonText: '去支付', | ||
401 | + cancelButtonText: '取消' | ||
402 | + }).then(action => { | ||
403 | + if (action == 'confirm') { //确认的回调 | ||
404 | + console.log('确定'); | ||
405 | + me.$router.push({ | ||
406 | + path:'parkRecord', | ||
407 | + query:{ | ||
408 | + carNumber: me.carNumber, | ||
409 | + carNumberColor: me.carWrapBG, | ||
410 | + parkFlag: 0 // 0表示在停 1表示历史 | ||
411 | + } | ||
412 | + }) | ||
413 | + } | ||
414 | + }).catch(err => { | ||
415 | + if (err == 'cancel') { //取消的回调 | ||
416 | + console.log('取消'); | ||
417 | + } | ||
418 | + }); | ||
419 | + } | ||
420 | + | ||
421 | + } | ||
422 | + } | ||
423 | + | ||
424 | + | ||
425 | + | ||
426 | + }) | ||
427 | + | ||
428 | + | ||
429 | + | ||
430 | + } else { | ||
431 | + console.log('失败') | ||
432 | + alert('支付失败') | ||
433 | + me.$router.go(-2); | ||
434 | + } | ||
435 | + } | ||
436 | + ) | ||
437 | + }, | ||
438 | + cardTypeFormat : function(num){ | ||
439 | + if(num == '1'){ | ||
440 | + return '单次券' | ||
441 | + } | ||
442 | + if(num == 2){ | ||
443 | + return '时长券' | ||
444 | + } | ||
445 | + if(num == 3){ | ||
446 | + return '满减券' | ||
447 | + } | ||
448 | + if(num == 4){ | ||
449 | + return '金额券' | ||
450 | + } | ||
451 | + if(num == 5){ | ||
452 | + return '包天券' | ||
453 | + } | ||
454 | + if(num == 6){ | ||
455 | + return '折扣券' | ||
456 | + } | ||
457 | + } | ||
458 | + }, | ||
459 | + filters: { | ||
460 | + } | ||
461 | +} | ||
462 | +</script> | ||
463 | + | ||
464 | +<style scoped lang="scss"> | ||
465 | + .car-wrap { | ||
466 | + padding: 7px 7px; | ||
467 | + background: #FFF; | ||
468 | + } | ||
469 | + | ||
470 | + .carBG { | ||
471 | + width: 100%; | ||
472 | + height: 130px; | ||
473 | + } | ||
474 | + | ||
475 | + .carBlue { | ||
476 | + background: url("../../assets/images/blueBG.png") no-repeat; | ||
477 | + background-size: 100% 100%; | ||
478 | + } | ||
479 | + | ||
480 | + .carYellow { | ||
481 | + background: url("../../assets/images/yellowBG.png") no-repeat; | ||
482 | + background-size: 100% 100%; | ||
483 | + } | ||
484 | + | ||
485 | + .carGreen { | ||
486 | + background: url("../../assets/images/greenBG.png") no-repeat; | ||
487 | + background-size: 100% 100%; | ||
488 | + } | ||
489 | + | ||
490 | + .carWhite { | ||
491 | + background: url("../../assets/images/whiteBG.png") no-repeat; | ||
492 | + background-size: 100% 100%; | ||
493 | + } | ||
494 | + | ||
495 | + .carBlack { | ||
496 | + background: url("../../assets/images/blackBG.png") no-repeat; | ||
497 | + background-size: 100% 100%; | ||
498 | + } | ||
499 | + | ||
500 | + .carNumber { | ||
501 | + padding: 20px 0 10px; | ||
502 | + font-size: 30px; | ||
503 | + color: #fff; | ||
504 | + text-align: center; | ||
505 | + } | ||
506 | + | ||
507 | + .payFee { | ||
508 | + font-size: 24px; | ||
509 | + color: #FF7B7B; | ||
510 | + text-align: center; | ||
511 | + } | ||
512 | + | ||
513 | + .fee-wrap { | ||
514 | + background: #FFF; | ||
515 | + padding: 0 18px; | ||
516 | + > li { | ||
517 | + display: flex; | ||
518 | + justify-content: space-between; | ||
519 | + height: 30px; | ||
520 | + line-height: 30px; | ||
521 | + border-bottom: 1px solid #EAEAEA; | ||
522 | + &:last-child { | ||
523 | + border-bottom: 0; | ||
524 | + } | ||
525 | + } | ||
526 | + | ||
527 | + } | ||
528 | + | ||
529 | + .toPay { | ||
530 | + width: 100%; | ||
531 | + height: 44px; | ||
532 | + margin: 0 auto; | ||
533 | + line-height: 44px; | ||
534 | + text-align: center; | ||
535 | + background: linear-gradient(180deg, #3885D9 0%, #4194EF 100%); | ||
536 | + border-radius: 4px; | ||
537 | + border: 1px solid #0D72E2; | ||
538 | + font-size: 20px; | ||
539 | + color: #FFF; | ||
540 | + cursor: pointer; | ||
541 | + } | ||
542 | + | ||
543 | + .tip { | ||
544 | + padding-left: 40px; | ||
545 | + background: url("../../assets/images/tip.png") no-repeat 18px center; | ||
546 | + background-size: 16px 16px; | ||
547 | + color: #666; | ||
548 | + } | ||
549 | +</style> |
src/views/parkPay/plateNumber.vue
1 | <template> | 1 | <template> |
2 | <div id="page"> | 2 | <div id="page"> |
3 | 3 | ||
4 | - <div class="swiper-container" style="height: 260px"> | ||
5 | - <div class="swiper-wrapper"> | ||
6 | - <div class="swiper-slide" v-for="item in swiperData" :key="item.id" | ||
7 | - :style="{backgroundImage:'url(' + item.url + ')'}" | ||
8 | - @click="openImgUrl(item)" | ||
9 | - ></div> | ||
10 | - </div> | ||
11 | - <!-- 如果需要分页器 --> | ||
12 | - <div class="swiper-pagination"></div> | ||
13 | 4 | ||
14 | - <!-- 如果需要滚动条 --> | ||
15 | - <!-- <div class="swiper-scrollbar"></div>--> | ||
16 | - </div> | ||
17 | 5 | ||
18 | <div class="wrap"> | 6 | <div class="wrap"> |
19 | - <!--<p style="margin-bottom: 18px;margin-top: 18px;">请选择车牌颜色</p>--> | 7 | + <p style="margin-bottom: 18px;margin-top: 18px;">请选择车牌颜色</p> |
20 | 8 | ||
21 | <ul class="color-choose"> | 9 | <ul class="color-choose"> |
22 | <li v-for="(i,index) in colorList" :key="i.name" @click="chooseColor(index)" | 10 | <li v-for="(i,index) in colorList" :key="i.name" @click="chooseColor(index)" |
@@ -31,7 +19,7 @@ | @@ -31,7 +19,7 @@ | ||
31 | 19 | ||
32 | 20 | ||
33 | <p style="margin-bottom: 18px;margin-top: 18px;"></p> | 21 | <p style="margin-bottom: 18px;margin-top: 18px;"></p> |
34 | - <!--<p style="margin-bottom: 18px;margin-top: 18px;">请输入车牌号码</p>--> | 22 | + <p style="margin-bottom: 18px;margin-top: 18px;">请输入车牌号码</p> |
35 | <div class="num-box"> | 23 | <div class="num-box"> |
36 | <div class="num0" @click="clickFirstWrap()"> | 24 | <div class="num0" @click="clickFirstWrap()"> |
37 | <span>{{formData.num0}}</span> | 25 | <span>{{formData.num0}}</span> |
@@ -74,18 +62,7 @@ | @@ -74,18 +62,7 @@ | ||
74 | 62 | ||
75 | 63 | ||
76 | <div class="submit-box" @click="submitFn()"> | 64 | <div class="submit-box" @click="submitFn()"> |
77 | - 查询 | ||
78 | - </div> | ||
79 | - | ||
80 | - <div> | ||
81 | - <p style="margin-bottom: 18px;margin-top: 18px;">查询记录</p> | ||
82 | - <ul class="bound-list" v-if="boundList.length>0"> | ||
83 | - <li v-for="i in boundList" :key="i" @click="boundHandle(i)"> | ||
84 | - <span>{{ i }}</span> | ||
85 | - </li> | ||
86 | - </ul> | ||
87 | - <div v-else style="text-align: center;padding: 10px 0;">暂无查询记录</div> | ||
88 | - <!--<div class="addCarNum"><span></span>添加车辆</div>--> | 65 | + 领取 |
89 | </div> | 66 | </div> |
90 | 67 | ||
91 | 68 | ||
@@ -355,12 +332,10 @@ export default { | @@ -355,12 +332,10 @@ export default { | ||
355 | submitConfirm: false, | 332 | submitConfirm: false, |
356 | submitConfirmFalse: false, | 333 | submitConfirmFalse: false, |
357 | submitConfirmText: '', | 334 | submitConfirmText: '', |
358 | - swiperData: [], // 轮播数据 | ||
359 | - boundList:[] // 历史记录 | ||
360 | } | 335 | } |
361 | }, | 336 | }, |
362 | created(){ | 337 | created(){ |
363 | - this.initSWiper() | 338 | + |
364 | }, | 339 | }, |
365 | mounted () { | 340 | mounted () { |
366 | // | 341 | // |
@@ -375,54 +350,9 @@ export default { | @@ -375,54 +350,9 @@ export default { | ||
375 | // } | 350 | // } |
376 | // } | 351 | // } |
377 | 352 | ||
378 | - this.boundList = JSON.parse(localStorage.getItem('parkRecordList')) ? JSON.parse(localStorage.getItem('parkRecordList')) : [] | ||
379 | - console.log(this.boundList) | ||
380 | }, | 353 | }, |
381 | methods: { | 354 | methods: { |
382 | - initSWiper() { | ||
383 | - var salt = this.$utils.myCommonSalt(32) | ||
384 | - var jsondata = { | ||
385 | - app_id: this.$utils.myVarAppid, | ||
386 | - deviceInfo: this.$utils.myDeviceInfo, | ||
387 | - salt: salt, | ||
388 | - sign_type: 'md5', | ||
389 | - sign: '1', | ||
390 | - orgId: this.$utils.myOrgId, | ||
391 | - jumpType: '7' // 7 微信公众号 8小票 | ||
392 | - }; | ||
393 | - // jsondata = JSON.stringify(jsondata); | ||
394 | - swiperQuery(jsondata).then(res => { | ||
395 | - this.swiperData = res.data | ||
396 | - console.log(this.swiperData) | ||
397 | - new Swiper('.swiper-container', { | ||
398 | - pagination: '.swiper-pagination', | ||
399 | - paginationClickable: true, | ||
400 | - centeredSlides: true, | ||
401 | - notNextTick: true, | ||
402 | - autoplay: 5000, | ||
403 | - autoplayDisableOnInteraction: true, | ||
404 | - | ||
405 | - observer: true, //修改swiper自己或子元素时,自动初始化swiper | ||
406 | - observeParents: true, //修改swiper的父元素时,自动初始化swiper | ||
407 | - onSlideChangeStart: function (swiper) { | ||
408 | - //console.log(swiper.activeIndex) | ||
409 | - } | ||
410 | - }) | ||
411 | - }) | ||
412 | - }, | ||
413 | - openImgUrl(i) { // 点击图片跳转 | ||
414 | - window.open(i.jumpUrl) | ||
415 | - }, | ||
416 | - boundHandle(i) { // 记录点击事件 | ||
417 | - console.log(i) | ||
418 | - this.$router.push({ | ||
419 | - path:'parkRecord', | ||
420 | - query:{ | ||
421 | - carNumber:i, | ||
422 | - carNumberColor: this.currentColor | ||
423 | - } | ||
424 | - }) | ||
425 | - }, | 355 | + |
426 | chooseColor (index){ // 颜色选择 0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色 | 356 | chooseColor (index){ // 颜色选择 0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色 |
427 | this.currentColor = index | 357 | this.currentColor = index |
428 | switch (this.currentColor) { | 358 | switch (this.currentColor) { |
@@ -519,15 +449,7 @@ export default { | @@ -519,15 +449,7 @@ export default { | ||
519 | this.$emit('getPlateLicense',plateLicense) | 449 | this.$emit('getPlateLicense',plateLicense) |
520 | console.log(plateLicense); | 450 | console.log(plateLicense); |
521 | 451 | ||
522 | - // boundList | ||
523 | - if(this.boundList.indexOf(plateLicense) == -1 ){ | ||
524 | - if(this.boundList.length == 3){ | ||
525 | - this.boundList.pop() | ||
526 | - } | ||
527 | - this.boundList.unshift(plateLicense) | ||
528 | - } | ||
529 | - localStorage.setItem('parkRecordList',JSON.stringify(this.boundList)) | ||
530 | - console.log(this.boundList) | 452 | + |
531 | 453 | ||
532 | this.$router.push({ | 454 | this.$router.push({ |
533 | path:'parkRecord', | 455 | path:'parkRecord', |
@@ -631,16 +553,6 @@ export default { | @@ -631,16 +553,6 @@ export default { | ||
631 | </script> | 553 | </script> |
632 | <style lang="scss" scoped> | 554 | <style lang="scss" scoped> |
633 | 555 | ||
634 | - .swiper-container { | ||
635 | - height: 206px; | ||
636 | - } | ||
637 | - | ||
638 | - .swiper-slide { | ||
639 | - /*width: 100%;*/ | ||
640 | - height: 206px; | ||
641 | - background-repeat: no-repeat; | ||
642 | - background-size: 100% 100%; | ||
643 | - } | ||
644 | 556 | ||
645 | .flex-items-center { | 557 | .flex-items-center { |
646 | display: flex; | 558 | display: flex; |