Commit d8a108c6c957f881e0ddebd39411390fdbbc40d7
1 parent
db3690c6
本次订单与欠费补缴订单页面合成一个
Showing
7 changed files
with
143 additions
and
10 deletions
.babelrc
| ... | ... | @@ -8,5 +8,17 @@ |
| 8 | 8 | }], |
| 9 | 9 | "stage-2" |
| 10 | 10 | ], |
| 11 | - "plugins": ["transform-vue-jsx", "transform-runtime"] | |
| 11 | + "plugins": ["transform-vue-jsx", "transform-runtime", [ | |
| 12 | + "component", | |
| 13 | + { | |
| 14 | + "libraryName": "element-ui", | |
| 15 | + "styleLibraryName": "theme-chalk" | |
| 16 | + } | |
| 17 | + ]], | |
| 18 | + "env": { | |
| 19 | + "test": { | |
| 20 | + "presets": ["env", "stage-2"], | |
| 21 | + "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"] | |
| 22 | + } | |
| 23 | + } | |
| 12 | 24 | } | ... | ... |
package.json
| ... | ... | @@ -12,8 +12,10 @@ |
| 12 | 12 | "dependencies": { |
| 13 | 13 | "axios": "^0.21.1", |
| 14 | 14 | "css-loader": "^3.6.0", |
| 15 | + "element-ui": "^2.15.1", | |
| 15 | 16 | "js-base64": "^3.6.0", |
| 16 | 17 | "less-loader": "^4.1.0", |
| 18 | + "mint-ui": "^2.2.13", | |
| 17 | 19 | "sass-loader": "^7.3.1", |
| 18 | 20 | "vue": "^2.5.2", |
| 19 | 21 | "vue-h5-popup": "^1.0.2", |
| ... | ... | @@ -57,7 +59,8 @@ |
| 57 | 59 | "webpack": "^3.6.0", |
| 58 | 60 | "webpack-bundle-analyzer": "^2.9.0", |
| 59 | 61 | "webpack-dev-server": "^2.9.1", |
| 60 | - "webpack-merge": "^4.1.0" | |
| 62 | + "webpack-merge": "^4.1.0", | |
| 63 | + "babel-plugin-component": "^1.1.1" | |
| 61 | 64 | }, |
| 62 | 65 | "engines": { |
| 63 | 66 | "node": ">= 5.0.0", | ... | ... |
src/api/orderPay/orderPay.js
| ... | ... | @@ -34,6 +34,17 @@ export function bankH5Pay(params) { // 农行 |
| 34 | 34 | }) |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | +export function queryParkingRecordPageByCarNumbers(params) { // 支付完成后查询记录 | |
| 38 | + return request({ | |
| 39 | + url: 'queryParkOrder/queryParkingRecordPageByCarNumbers', | |
| 40 | + method: 'post', | |
| 41 | + data: params | |
| 42 | + }) | |
| 43 | +} | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 37 | 48 | |
| 38 | 49 | |
| 39 | 50 | ... | ... |
src/components/orderPay.vue
| ... | ... | @@ -42,8 +42,8 @@ |
| 42 | 42 | <script> |
| 43 | 43 | // import CryptoJS from '../utils/AES.js' |
| 44 | 44 | // let Base64 = require('js-base64').Base64 |
| 45 | - | |
| 46 | -import { aliPay, getOpenId, vxPayQuery, bankH5Pay } from '@/api/orderPay/orderPay' | |
| 45 | +import { MessageBox } from 'mint-ui'; | |
| 46 | +import { aliPay, getOpenId, vxPayQuery, bankH5Pay, queryParkingRecordPageByCarNumbers } from '@/api/orderPay/orderPay' | |
| 47 | 47 | |
| 48 | 48 | export default { |
| 49 | 49 | name: 'orderPay', |
| ... | ... | @@ -54,6 +54,8 @@ export default { |
| 54 | 54 | arrearageActFee: 0, |
| 55 | 55 | arrearageDiscFee: 0, |
| 56 | 56 | arrearageActFee: 0, |
| 57 | + parkingData: [], // 在停数据 | |
| 58 | + historyList: [], // 历史欠费数据 | |
| 57 | 59 | clientBrowser: '', // 客户端 |
| 58 | 60 | paySrcType: '', //支付的类型 101 是本次 103是历史欠费 |
| 59 | 61 | orderId: '', //支付的订单 |
| ... | ... | @@ -76,6 +78,11 @@ export default { |
| 76 | 78 | this.webAppCode = this.getCode(); |
| 77 | 79 | } |
| 78 | 80 | |
| 81 | + | |
| 82 | + | |
| 83 | + }, | |
| 84 | + mounted(){ | |
| 85 | + | |
| 79 | 86 | }, |
| 80 | 87 | methods: { |
| 81 | 88 | getCode() { |
| ... | ... | @@ -276,7 +283,99 @@ export default { |
| 276 | 283 | // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 |
| 277 | 284 | if (res.err_msg === 'get_brand_wcpay_request:ok') { |
| 278 | 285 | console.log('成功') |
| 279 | - alert('支付成功') | |
| 286 | + var salt = me.$utils.myCommonSalt(32); | |
| 287 | + let params = { | |
| 288 | + pageNum: 1, | |
| 289 | + pageSize: 10000, | |
| 290 | + parkState: 10, | |
| 291 | + terminalSource: 7, | |
| 292 | + carNumber: me.carNumber, | |
| 293 | + app_id: me.$utils.myVarAppid, | |
| 294 | + deviceInfo: me.$utils.myDeviceInfo, | |
| 295 | + salt: salt, | |
| 296 | + sign_type: "md5", | |
| 297 | + token:'', | |
| 298 | + } | |
| 299 | + params.sign = me.$utils.signObject(params) | |
| 300 | + queryParkingRecordPageByCarNumbers(params).then(response => { | |
| 301 | + console.log(response) | |
| 302 | + me.parkList = response.data.dataList | |
| 303 | + | |
| 304 | + if(me.parkList.length == 0){ | |
| 305 | + me.$router.push({ | |
| 306 | + path:'parkRecord', | |
| 307 | + query:{ | |
| 308 | + carNumber: me.carNumber, | |
| 309 | + carNumberColor: me.carWrapBG, | |
| 310 | + parkFlag: 0 // 0表示在停 1表示历史 | |
| 311 | + } | |
| 312 | + }) | |
| 313 | + } | |
| 314 | + | |
| 315 | + me.parkingData = me.parkList.filter(item => { | |
| 316 | + return item.parkState == '10' | |
| 317 | + }) | |
| 318 | + console.log(me.parkingData) | |
| 319 | + me.historyList = me.parkList.filter(item => { | |
| 320 | + return item.parkState == '20' | |
| 321 | + }) | |
| 322 | + console.log(me.historyList) | |
| 323 | + if(me.parkingData.length>0){ | |
| 324 | + MessageBox.confirm('', { | |
| 325 | + message: '您当前有在停订单 是否立即支付?', | |
| 326 | + title: '温馨提示', | |
| 327 | + confirmButtonText: '去支付', | |
| 328 | + cancelButtonText: '取消' | |
| 329 | + }).then(action => { | |
| 330 | + if (action == 'confirm') { //确认的回调 | |
| 331 | + console.log('确定'); | |
| 332 | + me.$router.push({ | |
| 333 | + path:'parkRecord', | |
| 334 | + query:{ | |
| 335 | + carNumber: me.carNumber, | |
| 336 | + carNumberColor: me.carWrapBG, | |
| 337 | + parkFlag: 0 // 0表示在停 1表示历史 | |
| 338 | + } | |
| 339 | + }) | |
| 340 | + } | |
| 341 | + }).catch(err => { | |
| 342 | + if (err == 'cancel') { //取消的回调 | |
| 343 | + console.log('取消'); | |
| 344 | + } | |
| 345 | + }); | |
| 346 | + } | |
| 347 | + | |
| 348 | + if(me.parkingData.length==0&&me.historyList.length>0){ | |
| 349 | + MessageBox.confirm('', { | |
| 350 | + message: '您当前有历史欠费 是否立即补缴?', | |
| 351 | + title: '温馨提示', | |
| 352 | + confirmButtonText: '去补缴', | |
| 353 | + cancelButtonText: '取消' | |
| 354 | + }).then(action => { | |
| 355 | + if (action == 'confirm') { //确认的回调 | |
| 356 | + console.log('确定'); | |
| 357 | + me.$router.push({ | |
| 358 | + path:'parkRecord', | |
| 359 | + query:{ | |
| 360 | + carNumber: me.carNumber, | |
| 361 | + carNumberColor: me.carWrapBG, | |
| 362 | + parkFlag: 1 // 0表示在停 1表示历史 | |
| 363 | + } | |
| 364 | + }) | |
| 365 | + } | |
| 366 | + }).catch(err => { | |
| 367 | + if (err == 'cancel') { //取消的回调 | |
| 368 | + console.log('取消'); | |
| 369 | + } | |
| 370 | + }); | |
| 371 | + } | |
| 372 | + | |
| 373 | + }) | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 280 | 379 | } else { |
| 281 | 380 | console.log('失败') |
| 282 | 381 | alert('支付失败') | ... | ... |
src/components/parkRecord.vue
| ... | ... | @@ -126,7 +126,7 @@ |
| 126 | 126 | <modal-alert ref="zeroAlert"> |
| 127 | 127 | <div class="trave-tip-content txt-l" slot="content"> |
| 128 | 128 | <div class="confirm-text"> |
| 129 | - <p>停车15分钟内无需缴费,请申请离场。</p> | |
| 129 | + <p>停车15分钟内无需缴费,申请成功。</p> | |
| 130 | 130 | </div> |
| 131 | 131 | </div> |
| 132 | 132 | <span slot="button">知道了</span> |
| ... | ... | @@ -149,7 +149,7 @@ export default { |
| 149 | 149 | { text: '离场待缴', id: 2 }, |
| 150 | 150 | ], |
| 151 | 151 | carColor: 1,// 车牌颜色 |
| 152 | - currentTabActive: 1, // 显示当前哪个 | |
| 152 | + currentTabActive: 0, // 显示当前哪个 | |
| 153 | 153 | carNumber: '', // 车牌号码 |
| 154 | 154 | parkingData: [], // 在停数据 |
| 155 | 155 | parkList: [], // 停车记录数据 |
| ... | ... | @@ -168,6 +168,8 @@ export default { |
| 168 | 168 | created() { |
| 169 | 169 | this.carNumber = this.$route.query.carNumber // 获取车牌号 |
| 170 | 170 | this.carColor = this.$route.query.carNumberColor // 获取颜色 0:蓝牌;1:黄牌;2:白牌;3:黑牌;4:绿色 |
| 171 | + this.currentTabActive = this.$route.query.parkFlag ? this.$route.query.parkFlag : 0 | |
| 172 | + console.log(this.currentTabActive) | |
| 171 | 173 | console.log(this.carNumber) |
| 172 | 174 | this.parkRecordList(this.carNumber) |
| 173 | 175 | }, |
| ... | ... | @@ -198,9 +200,9 @@ export default { |
| 198 | 200 | this.parkingData = this.parkList.filter(item => { |
| 199 | 201 | return item.parkState == '10' |
| 200 | 202 | }) |
| 201 | - if (this.parkingData.length > 0) { | |
| 202 | - this.currentTabActive = 0 | |
| 203 | - } | |
| 203 | + // if (this.parkingData.length > 0) { | |
| 204 | + // this.currentTabActive = 0 | |
| 205 | + // } | |
| 204 | 206 | console.log(this.parkingData) |
| 205 | 207 | this.historyList = this.parkList.filter(item => { |
| 206 | 208 | return item.parkState == '20' | ... | ... |
src/components/plateNumber.vue
src/main.js
| ... | ... | @@ -11,6 +11,11 @@ Vue.use(h5Popup) |
| 11 | 11 | |
| 12 | 12 | import utils from './utils/utils' // 工具类 |
| 13 | 13 | Vue.prototype.$utils = utils |
| 14 | +// | |
| 15 | +import Mint from 'mint-ui'; | |
| 16 | +import 'mint-ui/lib/style.css' | |
| 17 | +Vue.use(Mint); | |
| 18 | + | |
| 14 | 19 | |
| 15 | 20 | |
| 16 | 21 | import 'swiper/dist/css/swiper.min.css' // 轮播 | ... | ... |