{"ast":null,"code":"import { myMixins } from '@/utils/myMixins.js';\nimport AttentionItem from '@/components/attentionItem';\nimport operationBtn from \"@/components/operationBtn\";\nimport commonBtn from \"@/components/commonBtn\";\nimport { getCurrentOrder } from '@/api/order';\nimport { orderStatus } from '@/utils/status';\nimport { operatorOrder } from '@/api/order';\nexport default {\n name: \"orderStatus\",\n mixins: [myMixins],\n data() {\n return {\n map: '',\n marker: '',\n destMarker: '',\n driverMarker: '',\n finishFlag: true,\n ticketId: '',\n orderInfo: null,\n userPhone: '',\n plateNumber: '',\n attentionStr: '',\n statusStr: ''\n };\n },\n components: {\n AttentionItem,\n operationBtn,\n commonBtn\n },\n async mounted() {\n this.ticketId = this.$route.query.ticketId;\n this.userPhone = this.$route.query.userPhone;\n this.plateNumber = this.$route.query.plateNumber;\n await this.initMap();\n await this.getOrderInfo();\n },\n methods: {\n callDriver() {\n window.location.href = 'tel:' + this.orderInfo?.driveinfo?.driverPhone;\n },\n callClient() {\n window.location.href = 'tel:' + localStorage.getItem('client');\n },\n async urgedOrder() {\n await operatorOrder({\n appCode: localStorage.getItem('appCode'),\n ticketId: this.ticketId,\n userPhone: this.userPhone,\n plateNumber: this.plateNumber,\n type: 1,\n content: '服务催促'\n });\n this.$toast('已催促');\n },\n getStatusStr() {\n let res = orderStatus(this.orderInfo.orderStatus, this.orderInfo.appraiseFlag);\n this.statusStr = res.name;\n this.attentionStr = res.tip;\n },\n initMap() {\n this.map = new AMap.Map('mapId', {\n viewMode: '2D',\n // 默认使用 2D 模式\n zoom: 11 //初始化地图层级\n });\n },\n\n markerFn(lng, lat, marker, markerCls) {\n if (marker) {\n this.map.remove(marker);\n }\n let content = `
`;\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 console.log('marker', marker);\n },\n // 事发地 marker\n addMarker(lng, lat) {\n if (this.marker) {\n this.map.remove(this.marker);\n }\n let content = '';\n this.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(this.marker);\n },\n // 目的地 marker\n addDestMarker() {\n if (this.destMarker) {\n this.map.remove(this.destMarker);\n }\n let content = '';\n this.destMarker = new AMap.Marker({\n position: new AMap.LngLat(this.form.endLng, this.form.endLat),\n content: content,\n offset: new AMap.Pixel(-13, -30)\n });\n this.map.add(this.destMarker);\n },\n // 司机 marker\n addDriverMarker(lng, lat) {\n if (this.driverMarker) {\n this.map.remove(this.driverMarker);\n }\n let content = '';\n this.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(this.driverMarker);\n },\n async getOrderInfo() {\n this.orderInfo = await getCurrentOrder({\n ticketId: this.ticketId,\n userPhone: this.userPhone,\n plateNumber: this.plateNumber\n });\n if (this.orderInfo.startLng && this.orderInfo.startLat) {\n this.markerFn(this.orderInfo.startLng, this.orderInfo.startLat, this.marker, 'my-position');\n }\n this.getStatusStr();\n }\n }\n};","map":{"version":3,"names":["myMixins","AttentionItem","operationBtn","commonBtn","getCurrentOrder","orderStatus","operatorOrder","name","mixins","data","map","marker","destMarker","driverMarker","finishFlag","ticketId","orderInfo","userPhone","plateNumber","attentionStr","statusStr","components","mounted","$route","query","initMap","getOrderInfo","methods","callDriver","window","location","href","driveinfo","driverPhone","callClient","localStorage","getItem","urgedOrder","appCode","type","content","$toast","getStatusStr","res","appraiseFlag","tip","AMap","Map","viewMode","zoom","markerFn","lng","lat","markerCls","remove","Marker","position","LngLat","offset","Pixel","add","console","log","addMarker","addDestMarker","form","endLng","endLat","addDriverMarker","startLng","startLat"],"sources":["src/views/index/orderStatus.vue"],"sourcesContent":["\r\n