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

1 line
13 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\nimport { getAppointFun } from '@/utils/appointTime';\nimport { serverList } from '@/utils/serverMap';\nimport tabBar from \"@/components/tabBar\";\nimport BottomItem from '@/components/bottomItem';\nimport AttentionItem from '@/components/attentionItem';\nimport commonBtn from \"@/components/commonBtn\";\nimport { getLocal, getAddress } from '@/utils/map';\nexport default {\n name: \"Home\",\n data() {\n return {\n map: '',\n location: [],\n activeTab: 0,\n serverList: serverList,\n radio: '',\n show: false,\n // 预约时间弹框\n form: {\n address: '上海市浦东新区高科西路650号',\n destAddress: '',\n appointTime: '立即出发'\n },\n columns: []\n };\n },\n components: {\n BottomItem,\n tabBar,\n AttentionItem,\n commonBtn\n },\n async mounted() {\n await this.initMap();\n this.columns = getAppointFun(new Date());\n this.location = await getLocal(this.map);\n this.map.setCenter(this.location);\n let res = await getAddress(this.map, this.location);\n // console.log('rerer', res)\n alert(JSON.stringify(res));\n },\n methods: {\n initMap() {\n // 初始化地图\n this.map = new AMap.Map('mapId', {\n viewMode: '2D',\n // 默认使用 2D 模式\n zoom: 11 //初始化地图层级\n });\n },\n\n /*getLocal() { // 获取定位\r\n let that = this;\r\n this.map.plugin('AMap.Geolocation', function () {\r\n var geolocation = new AMap.Geolocation({\r\n enableHighAccuracy: true, // 是否使用高精度定位默认true\r\n timeout: 10000, // 设置定位超时时间,默认:无穷大\r\n offset: [10, 20], // 定位按钮的停靠位置的偏移量\r\n zoomToAccuracy: true, // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见默认false\r\n position: 'RB' // 定位按钮的排放位置, RB表示右下\r\n })\r\n geolocation.getCurrentPosition(function(status, result){\r\n if(status == 'complete'){\r\n that.location = result.position\r\n that.map.setCenter(that.location)\r\n }else{\r\n alert(JSON.stringify(result))\r\n console.log(result)\r\n }\r\n });\r\n })\r\n },*/\n goPage(page) {\n this.$router.push({\n name: page\n });\n },\n changeTabHandler(index) {\n //切换 tab\n this.activeTab = index;\n },\n appointHandler(value, index) {\n console.log(value);\n console.log(index);\n this.show = false;\n this.$toast(`当前值:${value}, 当前索引:${index}`);\n }\n }\n};","map":{"version":3,"names":["getAppointFun","serverList","tabBar","BottomItem","AttentionItem","commonBtn","getLocal","getAddress","name","data","map","location","activeTab","radio","show","form","address","destAddress","appointTime","columns","components","mounted","initMap","Date","setCenter","res","alert","JSON","stringify","methods","AMap","Map","viewMode","zoom","goPage","page","$router","push","changeTabHandler","index","appointHandler","value","console","log","$toast"],"sources":["src/views/index/index.vue"],"sourcesContent":["<template>\r\n <div class=\"main_wrap\">\r\n <div class=\"map_wrap\" id=\"mapId\">\r\n </div>\r\n <!--服务信息-->\r\n <div class=\"server_wrap\">\r\n <tab-bar @changeTab=\"changeTabHandler\" :click-flag=\"true\" :active-tab=\"activeTab\" :server-list=\"serverList\"></tab-bar>\r\n <div class=\"server_main\">\r\n <div class=\"address_item pt15\">\r\n <img class=\"address_icon\" src=\"@/assets/addressPoint.png\" alt=\"\">\r\n <div class=\"address\">{{form.address}}</div>\r\n <img class=\"arrow_icon\" src=\"@/assets/arrow.png\" alt=\"\">\r\n </div>\r\n <div class=\"address_item pb15 border_bottom\" v-if=\"serverList[activeTab].serverId == 1041\">\r\n <img class=\"address_icon\" src=\"@/assets/destionAddress.png\" alt=\"\">\r\n <div class=\"address\" :class=\"{ 'placeholder': !form.destAddress }\">{{form.destAddress || '您的拖车目的地'}}</div>\r\n <img class=\"arrow_icon\" src=\"@/assets/arrow.png\" alt=\"\">\r\n </div>\r\n <!--车辆位置-->\r\n <div class=\"form_item border_bottom\">\r\n <img class=\"radio\" src=\"@/assets/radio.png\" alt=\"\">\r\n <div class=\"form_label\">车辆位于</div>\r\n <van-radio-group class=\"flex_right\" v-model=\"radio\" icon-size=\"16px\" direction=\"horizontal\">\r\n <van-radio name=\"1\">地面</van-radio>\r\n <van-radio name=\"2\">地库</van-radio>\r\n <van-radio name=\"3\">高架</van-radio>\r\n </van-radio-group>\r\n </div>\r\n <!--预约时间-->\r\n <div class=\"form_item border_bottom\" @click=\"show = true\">\r\n <img class=\"appoint_time\" src=\"@/assets/appointTime.png\" alt=\"\">\r\n <div class=\"form_label\">预约时间</div>\r\n <div class=\"form_time\">\r\n <div>{{form.appointTime}}</div>\r\n <img class=\"arrow_icon\" src=\"@/assets/arrow.png\" alt=\"\">\r\n </div>\r\n </div>\r\n <attention-item color=\"#939393\"></attention-item>\r\n </div>\r\n <div class=\"btn_wrap\">\r\n <common-btn></common-btn>\r\n </div>\r\n </div>\r\n <!-- 底部按钮 -->\r\n <div class=\"bottom_wrap\">\r\n <div class=\"wrap\">\r\n <bottom-item server-name=\"叫服务\" :active=\"true\"></bottom-item>\r\n <bottom-item server-name=\"查订单\" :url=\"require('@/assets/search_btn.png')\" page=\"Search\" @pageClick=\"goPage\"></bottom-item>\r\n </div>\r\n </div>\r\n <van-popup v-model=\"show\" v-if=\"show\" position=\"bottom\">\r\n <van-picker show-toolbar title=\"预约时间\" :columns=\"columns\" @cancel=\"show = false\" @confirm=\"appointHandler\" />\r\n </van-popup>\r\n </div>\r\n</template>\r\n\r\n<script>\r\n import { getAppointFun } from '@/utils/appointTime'\r\n import { serverList } from '@/utils/serverMap'\r\n import tabBar from \"@/components/tabBar\";\r\n import BottomItem from '@/components/bottomItem'\r\n import AttentionItem from '@/components/attentionItem'\r\n import commonBtn from \"@/components/commonBtn\";\r\n import { getLocal, getAddress } from '@/utils/map'\r\n export default {\r\n name: \"Home\",\r\n data() {\r\n return {\r\n map: '',\r\n location: [],\r\n activeTab: 0,\r\n serverList: serverList,\r\n radio: '',\r\n show: false, // 预约时间弹框\r\n form: {\r\n address: '上海市浦东新区高科西路650号',\r\n destAddress: '',\r\n appointTime: '立即出发'\r\n },\r\n columns: [],\r\n }\r\n },\r\n components: {\r\n BottomItem,\r\n tabBar,\r\n AttentionItem,\r\n commonBtn\r\n },\r\n async mounted() {\r\n await this.initMap()\r\n this.columns = getAppointFun(new Date())\r\n this.location = await getLocal(this.map)\r\n this.map.setCenter(this.location)\r\n let res = await getAddress(this.map,this.location)\r\n // console.log('rerer', res)\r\n alert(JSON.stringify(res))\r\n },\r\n methods: {\r\n initMap() { // 初始化地图\r\n this.map = new AMap.Map('mapId', {\r\n viewMode: '2D', // 默认使用 2D 模式\r\n zoom:11, //初始化地图层级\r\n })\r\n },\r\n /*getLocal() { // 获取定位\r\n let that = this;\r\n this.map.plugin('AMap.Geolocation', function () {\r\n var geolocation = new AMap.Geolocation({\r\n enableHighAccuracy: true, // 是否使用高精度定位默认true\r\n timeout: 10000, // 设置定位超时时间,默认:无穷大\r\n offset: [10, 20], // 定位按钮的停靠位置的偏移量\r\n zoomToAccuracy: true, // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见默认false\r\n position: 'RB' // 定位按钮的排放位置, RB表示右下\r\n })\r\n\r\n geolocation.getCurrentPosition(function(status, result){\r\n if(status == 'complete'){\r\n that.location = result.position\r\n that.map.setCenter(that.location)\r\n }else{\r\n alert(JSON.stringify(result))\r\n console.log(result)\r\n }\r\n });\r\n })\r\n },*/\r\n goPage(page) {\r\n this.$router.push({\r\n name: page,\r\n })\r\n },\r\n changeTabHandler(index) { //切换 tab\r\n this.activeTab = index\r\n },\r\n appointHandler(value, index) {\r\n console.log(value)\r\n console.log(index)\r\n this.show = false;\r\n this.$toast(`当前值:${value}, 当前索引:${index}`)\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style scoped lang=\"less\">\r\n .main_wrap {\r\n .map_wrap {\r\n width: 100%;\r\n height: 80vh;\r\n }\r\n .server_wrap {\r\n padding-bottom: 50px;\r\n position: fixed;\r\n width: 100%;\r\n bottom: 0;\r\n left: 0;\r\n background: #fff;\r\n z-index: 10000000 !important;\r\n .btn_wrap {\r\n width: 74%;\r\n margin: 5px auto 10px;\r\n }\r\n .server_main {\r\n .address_item {\r\n display: flex;\r\n padding: 10px 15px 10px 3px;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-left: 15px;\r\n .address_icon {\r\n width: 12px;\r\n height: 12px;\r\n margin-right: 10px;\r\n }\r\n .address {\r\n font-size: 15px;\r\n color: rgba( 0, 0, 0, 0.79);\r\n flex: 1;\r\n }\r\n .placeholder {\r\n color: rgba(147, 147, 147, 0.83);\r\n }\r\n }\r\n .arrow_icon {\r\n width: 12px;\r\n height: 11px;\r\n margin-left: 3px;\r\n }\r\n .form_item {\r\n display: flex;\r\n padding: 15px 15px 15px 3px;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-left: 15px;\r\n .radio {\r\n width: 10px;\r\n height: 11px;\r\n margin-right: 10px;\r\n }\r\n .appoint_time {\r\n width: 11px;\r\n height: 11px;\r\n margin-right: 10px;\r\n }\r\n .form_label {\r\n font-size: 14px;\r\n color: rgba( 0, 0, 0, 0.7 );\r\n }\r\n .flex_right {\r\n flex: 1;\r\n justify-content: flex-end;\r\n }\r\n .form_time {\r\n flex: 1;\r\n display: flex;\r\n justify-content: flex-end;\r\n align-items: center;\r\n }\r\n }\r\n .pb15 {\r\n padding-bottom: 15px;\r\n }\r\n .pt15 {\r\n padding-top: 15px;\r\n }\r\n .border_bottom {\r\n border-bottom: 1px solid #F1F2F5;\r\n }\r\n }\r\n }\r\n /*底部按钮*/\r\n .bottom_wrap {\r\n position: fixed;\r\n width: 100%;\r\n bottom: 0;\r\n background: #FFFFFF;\r\n box-shadow: 0px -2px 8px 0px rgba(74,74,74,0.08);\r\n z-index: 1000000000 !important;\r\n .wrap {\r\n width: 100%;\r\n display: flex;\r\n }\r\n }\r\n }\r\n</style>\r\n<style>\r\n .van-overlay {\r\n z-index: 9999999999 !important;\r\n }\r\n .van-popup--bottom {\r\n z-index: 10000000000 !important;\r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AAA,QAAAH,KAAA,UAAAF,KAAA;IACA;EACA;AACA"},"metadata":{},"sourceType":"module","externalDependencies":[]}