{"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.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":["\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{form.address}}\r\n \r\n \r\n \r\n \r\n {{form.destAddress || '您的拖车目的地'}}\r\n \r\n \r\n \r\n \r\n \r\n 车辆位于\r\n \r\n 地面\r\n 地库\r\n 高架\r\n \r\n \r\n \r\n \r\n \r\n 预约时间\r\n \r\n {{form.appointTime}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n"],"mappings":";AAyDA,SAAAA,aAAA;AACA,SAAAC,UAAA;AACA,OAAAC,MAAA;AACA,OAAAC,UAAA;AACA,OAAAC,aAAA;AACA,OAAAC,SAAA;AACA,SAAAC,QAAA,EAAAC,UAAA;AACA;EACAC,IAAA;EACAC,KAAA;IACA;MACAC,GAAA;MACAC,QAAA;MACAC,SAAA;MACAX,UAAA,EAAAA,UAAA;MACAY,KAAA;MACAC,IAAA;MAAA;MACAC,IAAA;QACAC,OAAA;QACAC,WAAA;QACAC,WAAA;MACA;MACAC,OAAA;IACA;EACA;EACAC,UAAA;IACAjB,UAAA;IACAD,MAAA;IACAE,aAAA;IACAC;EACA;EACA,MAAAgB,QAAA;IACA,WAAAC,OAAA;IACA,KAAAH,OAAA,GAAAnB,aAAA,KAAAuB,IAAA;IACA,KAAAZ,QAAA,SAAAL,QAAA,MAAAI,GAAA;IACA,KAAAA,GAAA,CAAAc,SAAA,MAAAb,QAAA;IACA,IAAAc,GAAA,SAAAlB,UAAA,MAAAI,QAAA;IACA;IACAe,KAAA,CAAAC,IAAA,CAAAC,SAAA,CAAAH,GAAA;EACA;EACAI,OAAA;IACAP,QAAA;MAAA;MACA,KAAAZ,GAAA,OAAAoB,IAAA,CAAAC,GAAA;QACAC,QAAA;QAAA;QACAC,IAAA;MACA;IACA;;IACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IAEAC,OAAAC,IAAA;MACA,KAAAC,OAAA,CAAAC,IAAA;QACA7B,IAAA,EAAA2B;MACA;IACA;IACAG,iBAAAC,KAAA;MAAA;MACA,KAAA3B,SAAA,GAAA2B,KAAA;IACA;IACAC,eAAAC,KAAA,EAAAF,KAAA;MACAG,OAAA,CAAAC,GAAA,CAAAF,KAAA;MACAC,OAAA,CAAAC,GAAA,CAAAJ,KAAA;MACA,KAAAzB,IAAA;MACA,KAAA8B,MAAA,QAAAH,KAAA,UAAAF,KAAA;IACA;EACA;AACA"},"metadata":{},"sourceType":"module","externalDependencies":[]}