Files
supplier-dispatch-h5/node_modules/.cache/babel-loader/e5f5a28f527266d72547d4fba3757e4c5d9814c307b58cf7ae6b5adc261ea377.json
2023-08-11 10:45:20 +08:00

1 line
12 KiB
JSON

{"ast":null,"code":"import { myMixins } from '@/utils/myMixins.js';\nimport { getAmount, pay, getCurrentOrder } from '@/api/order';\nimport AttentionItem from '@/components/attentionItem';\nimport commonBtn from \"@/components/commonBtn\";\nimport operationBtn from \"@/components/operationBtn\";\nexport default {\n name: \"payPage\",\n data() {\n return {\n map: '',\n extraFee: 0,\n ticketId: '',\n orderInfo: '',\n marker: '',\n lat: '',\n lng: '',\n userPhone: '',\n plateNumber: ''\n };\n },\n mixins: [myMixins],\n components: {\n AttentionItem,\n commonBtn,\n operationBtn\n },\n async mounted() {\n alert('activated');\n this.ticketId = this.$route.query.ticketId;\n this.lat = this.$route.query.lat;\n this.lng = this.$route.query.lng;\n this.userPhone = this.$route.query?.userPhone || '';\n this.plateNumber = this.$route.query?.plateNumber || '';\n await this.initMap();\n await this.getAmountHandler();\n await this.getOrderInfo();\n // 事发地 marker\n if (this.lat && this.lng) {\n this.markerFn(this.lng, this.lat, this.marker, 'my-position');\n }\n },\n watch: {\n $route(to, from) {\n alert(111);\n window.location.reload(); //监测到路由发生跳转时刷新一次页面\n }\n },\n\n async activated() {\n alert('activated');\n await this.getOrderInfo();\n },\n methods: {\n markerFn(lng, lat, marker, markerCls) {\n if (marker) {\n this.map.remove(marker);\n }\n let content = `<div class=\"${markerCls}\"></div>`;\n marker = new AMap.Marker({\n position: new AMap.LngLat(lng, lat),\n content: content,\n offset: new AMap.Pixel(-13, -30)\n });\n this.map.add(marker);\n },\n callClient() {\n window.location.href = 'tel:' + localStorage.getItem('client');\n },\n initMap() {\n this.map = new AMap.Map('mapId', {\n viewMode: '2D',\n // 默认使用 2D 模式\n zoom: 13,\n //初始化地图层级\n center: [this.lng, this.lat] //初始化地图中心点\n });\n },\n\n async getAmountHandler() {\n let res = await getAmount({\n appCode: localStorage.getItem('appCode'),\n ticketId: this.ticketId\n });\n this.extraFee = res.extraFee;\n },\n async payHandler() {\n let res = await pay({\n // amount: this.extraFee,\n amount: 0.01,\n code: this.ticketId,\n appid: 'wxd6e70d02102c9cff'\n });\n if (res) {\n window.location.href = res;\n // window.location.replace(res)\n }\n },\n\n async getOrderInfo() {\n this.orderInfo = await getCurrentOrder({\n ticketId: this.ticketId,\n appCode: localStorage.getItem('appCode'),\n userPhone: this.userPhone,\n plateNumber: this.plateNumber\n });\n await this.goDetail(this.orderInfo);\n },\n goDetail(result) {\n if (result.orderStatus != 17) {\n // 代付款页\n this.goPage('orderStatus', {\n ticketId: result.ticketId,\n userPhone: this.userPhone,\n plateNumber: this.plateNumber\n });\n }\n }\n }\n};","map":{"version":3,"names":["myMixins","getAmount","pay","getCurrentOrder","AttentionItem","commonBtn","operationBtn","name","data","map","extraFee","ticketId","orderInfo","marker","lat","lng","userPhone","plateNumber","mixins","components","mounted","alert","$route","query","initMap","getAmountHandler","getOrderInfo","markerFn","watch","to","from","window","location","reload","activated","methods","markerCls","remove","content","AMap","Marker","position","LngLat","offset","Pixel","add","callClient","href","localStorage","getItem","Map","viewMode","zoom","center","res","appCode","payHandler","amount","code","appid","goDetail","result","orderStatus","goPage"],"sources":["src/views/index/pay.vue"],"sourcesContent":["<template>\r\n <div class=\"pay_wrap\">\r\n <div class=\"map_wrap\" id=\"mapId\">\r\n </div>\r\n <div class=\"pay_container\">\r\n <div class=\"top_wrap\">\r\n <div class=\"top_line\"></div>\r\n <attention-item attention=\"温馨提示:如果您的车子在马路上,请注意把车子停到路边打开双闪并远离车辆,谢谢。\"></attention-item>\r\n </div>\r\n <div class=\"pay_info\">\r\n <div class=\"fee_desc\">本次服务费用:</div>\r\n <div class=\"money_detail\">\r\n <img src=\"@/assets/money.png\" alt=\"\">\r\n <span class=\"money_count\">{{ extraFee }}</span>\r\n <span>元</span>\r\n </div>\r\n <div class=\"btn_wrap\">\r\n <common-btn title=\"支 付\" @ownClick=\"payHandler\"></common-btn>\r\n </div>\r\n <div >\r\n <a href=\"tel:15256085051\"><operation-btn title=\"联系客服\" :url=\"require('@/assets/callPhone.png')\"></operation-btn></a>\r\n<!-- @ownClick=\"callClient\"-->\r\n <operation-btn title=\"取消订单\" :url=\"require('@/assets/cancel.png')\" @ownClick=\"goPage('CancelPage', { ticketId: ticketId })\" :has-distance=\"true\"></operation-btn>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n import { myMixins } from '@/utils/myMixins.js'\r\n import { getAmount, pay, getCurrentOrder } from '@/api/order'\r\n import AttentionItem from '@/components/attentionItem'\r\n import commonBtn from \"@/components/commonBtn\";\r\n import operationBtn from \"@/components/operationBtn\";\r\n export default {\r\n name: \"payPage\",\r\n data() {\r\n return {\r\n map: '',\r\n extraFee: 0,\r\n ticketId: '',\r\n orderInfo: '',\r\n marker: '',\r\n lat: '',\r\n lng: '',\r\n userPhone: '',\r\n plateNumber: '',\r\n }\r\n },\r\n mixins: [ myMixins ],\r\n components: {\r\n AttentionItem,\r\n commonBtn,\r\n operationBtn\r\n },\r\n async mounted() {\r\n alert('activated')\r\n this.ticketId = this.$route.query.ticketId\r\n this.lat = this.$route.query.lat\r\n this.lng = this.$route.query.lng\r\n this.userPhone = this.$route.query?.userPhone || ''\r\n this.plateNumber = this.$route.query?.plateNumber || ''\r\n await this.initMap()\r\n await this.getAmountHandler()\r\n await this.getOrderInfo()\r\n // 事发地 marker\r\n if( this.lat && this.lng ) {\r\n this.markerFn(this.lng, this.lat, this.marker, 'my-position')\r\n }\r\n },\r\n watch: {\r\n $route(to, from) {\r\n alert(111)\r\n window.location.reload(); //监测到路由发生跳转时刷新一次页面\r\n },\r\n },\r\n async activated() {\r\n alert('activated')\r\n await this.getOrderInfo()\r\n },\r\n methods: {\r\n\r\n markerFn(lng, lat, marker , markerCls) {\r\n if(marker) {\r\n this.map.remove(marker)\r\n }\r\n let content = `<div class=\"${markerCls}\"></div>`;\r\n marker = new AMap.Marker({\r\n position: new AMap.LngLat( lng, lat ),\r\n content: content,\r\n offset: new AMap.Pixel(-13, -30)\r\n });\r\n this.map.add(marker)\r\n },\r\n callClient() {\r\n window.location.href = 'tel:' + localStorage.getItem('client');\r\n },\r\n initMap() {\r\n this.map = new AMap.Map('mapId', {\r\n viewMode: '2D', // 默认使用 2D 模式\r\n zoom:13, //初始化地图层级\r\n center: [this.lng, this.lat] //初始化地图中心点\r\n })\r\n },\r\n async getAmountHandler() {\r\n let res = await getAmount({\r\n appCode: localStorage.getItem('appCode'),\r\n ticketId: this.ticketId,\r\n })\r\n this.extraFee = res.extraFee;\r\n },\r\n async payHandler() {\r\n let res = await pay({\r\n // amount: this.extraFee,\r\n amount: 0.01,\r\n code: this.ticketId,\r\n appid: 'wxd6e70d02102c9cff'\r\n })\r\n if ( res ) {\r\n window.location.href = res\r\n // window.location.replace(res)\r\n }\r\n },\r\n async getOrderInfo() {\r\n this.orderInfo = await getCurrentOrder({\r\n ticketId: this.ticketId,\r\n appCode: localStorage.getItem('appCode'),\r\n userPhone: this.userPhone,\r\n plateNumber: this.plateNumber\r\n })\r\n await this.goDetail(this.orderInfo)\r\n },\r\n goDetail(result) {\r\n if( result.orderStatus != 17 ) { // 代付款页\r\n this.goPage('orderStatus', {\r\n ticketId: result.ticketId,\r\n userPhone: this.userPhone,\r\n plateNumber: this.plateNumber\r\n })\r\n }\r\n },\r\n }\r\n }\r\n</script>\r\n\r\n<style scoped lang=\"less\">\r\n.pay_wrap {\r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n box-sizing: border-box;\r\n .map_wrap {\r\n flex: 1;\r\n }\r\n .pay_container {\r\n background: #fff;\r\n .top_wrap {\r\n padding-top: 10px;\r\n background: #fafafa;\r\n .top_line {\r\n width: 34px;\r\n height: 3px;\r\n background: #9FA5B4;\r\n border-radius: 3px;\r\n opacity: 0.19;\r\n margin: 0 auto;\r\n }\r\n }\r\n .pay_info {\r\n padding: 40px 0;\r\n text-align: center;\r\n .fee_desc {\r\n color: rgba(0,0,0,0.7);\r\n font-size: 14px;\r\n }\r\n .money_detail {\r\n color: #2C2A53;\r\n font-size: 15px;\r\n img {\r\n width: 17px;\r\n height: 17px;\r\n }\r\n .money_count {\r\n font-size: 34px;\r\n }\r\n }\r\n .btn_wrap {\r\n width: 80%;\r\n margin: 15px auto 25px;\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n<style>\r\n @import '@/styles/common.css';\r\n</style>\r\n\r\n"],"mappings":"AA+BA,SAAAA,QAAA;AACA,SAAAC,SAAA,EAAAC,GAAA,EAAAC,eAAA;AACA,OAAAC,aAAA;AACA,OAAAC,SAAA;AACA,OAAAC,YAAA;AACA;EACAC,IAAA;EACAC,KAAA;IACA;MACAC,GAAA;MACAC,QAAA;MACAC,QAAA;MACAC,SAAA;MACAC,MAAA;MACAC,GAAA;MACAC,GAAA;MACAC,SAAA;MACAC,WAAA;IACA;EACA;EACAC,MAAA,GAAAlB,QAAA;EACAmB,UAAA;IACAf,aAAA;IACAC,SAAA;IACAC;EACA;EACA,MAAAc,QAAA;IACAC,KAAA;IACA,KAAAV,QAAA,QAAAW,MAAA,CAAAC,KAAA,CAAAZ,QAAA;IACA,KAAAG,GAAA,QAAAQ,MAAA,CAAAC,KAAA,CAAAT,GAAA;IACA,KAAAC,GAAA,QAAAO,MAAA,CAAAC,KAAA,CAAAR,GAAA;IACA,KAAAC,SAAA,QAAAM,MAAA,CAAAC,KAAA,EAAAP,SAAA;IACA,KAAAC,WAAA,QAAAK,MAAA,CAAAC,KAAA,EAAAN,WAAA;IACA,WAAAO,OAAA;IACA,WAAAC,gBAAA;IACA,WAAAC,YAAA;IACA;IACA,SAAAZ,GAAA,SAAAC,GAAA;MACA,KAAAY,QAAA,MAAAZ,GAAA,OAAAD,GAAA,OAAAD,MAAA;IACA;EACA;EACAe,KAAA;IACAN,OAAAO,EAAA,EAAAC,IAAA;MACAT,KAAA;MACAU,MAAA,CAAAC,QAAA,CAAAC,MAAA;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