Commit 79b56567 authored by huangyuanyuan's avatar huangyuanyuan
parents ba7b8e63 26e6bae7
...@@ -810,6 +810,8 @@ ...@@ -810,6 +810,8 @@
}; };
google.maps.MarkerWithLabel = MarkerWithLabel; google.maps.MarkerWithLabel = MarkerWithLabel;
</script> </script>
<!-- <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script> -->
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=d4332e5adb8b584442266763d20b978c"></script>
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>athena</title> <title>athena</title>
</head> </head>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
</template> </template>
<script> <script>
import raffleTickets from './components/taskPage/IceCream/raffleTickets' import raffleTickets from './components/taskPage/IceCream/raffleTickets'
import { location } from "./assets/utils/getLocation";
export default { export default {
components: { components: {
raffleTickets raffleTickets
...@@ -54,6 +55,13 @@ export default { ...@@ -54,6 +55,13 @@ export default {
this.MsgBus.$on('openRaffleTickets', this.openRaffleTickets) this.MsgBus.$on('openRaffleTickets', this.openRaffleTickets)
}, },
methods: { methods: {
getLocation() {
let _that = this;
let geolocation = location.initMap("map-container"); //定位
AMap.event.addListener(geolocation, "complete", result => {
console.log(result)
});
},
openRaffleTickets: function (val) { openRaffleTickets: function (val) {
this.raffleTicketsData = val this.raffleTicketsData = val
this.raffleTicketsShow = true this.raffleTicketsShow = true
......
export const location = {
initMap(id) {
let mapObj = new AMap.Map(id, {})
let geolocation;
mapObj.plugin(['AMap.Geolocation'], function () {
geolocation = new AMap.Geolocation({
enableHighAccuracy: true, // 是否使用高精度定位,默认:true
timeout: 10000, // 超过10秒后停止定位,默认:无穷大
maximumAge: 0, // 定位结果缓存0毫秒,默认:0
convert: true, // 自动偏移坐标,偏移后的坐标为高德坐标,默认:true
showButton: true, // 显示定位按钮,默认:true
buttonPosition: 'LB', // 定位按钮停靠位置,默认:'LB',左下角
buttonOffset: new AMap.Pixel(10, 20), // 定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
showMarker: true, // 定位成功后在定位到的位置显示点标记,默认:true
showCircle: true, // 定位成功后用圆圈表示定位精度范围,默认:true
panToLocation: true, // 定位成功后将定位到的位置作为地图中心点,默认:true
zoomToAccuracy: true // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
})
mapObj.addControl(geolocation)
geolocation.getCurrentPosition()
})
return geolocation;
}
}
\ No newline at end of file
...@@ -407,6 +407,7 @@ export default { ...@@ -407,6 +407,7 @@ export default {
}, },
mounted() {}, mounted() {},
created() { created() {
this.isLogin=this.$store.state.isLogin; this.isLogin=this.$store.state.isLogin;
this.loading = true; this.loading = true;
if(sessionStorage.getItem("ChooseInfo")){ if(sessionStorage.getItem("ChooseInfo")){
......
...@@ -368,7 +368,7 @@ export default { ...@@ -368,7 +368,7 @@ export default {
} else if (this.select === '3') {// 机票 } else if (this.select === '3') {// 机票
let query={keywords:encodeURIComponent(this.searchText)} let query={keywords:encodeURIComponent(this.searchText)}
this.$router.push({ this.$router.push({
path:'search', path:'TicketList',
query query
}); });
} }
......
...@@ -16,6 +16,7 @@ import languageUtils from './assets/utils/languageUtils' //引入语言转换帮 ...@@ -16,6 +16,7 @@ import languageUtils from './assets/utils/languageUtils' //引入语言转换帮
import moment from 'moment' import moment from 'moment'
import co from 'co' import co from 'co'
import MsgBus from './plugins/event-bus' import MsgBus from './plugins/event-bus'
import { location } from "./assets/utils/getLocation"
// 使用Vue.use()方法就会调用工具方法中的install方法 // 使用Vue.use()方法就会调用工具方法中的install方法
Vue.use(htmlToPdf) Vue.use(htmlToPdf)
Vue.use(VueLazyload) Vue.use(VueLazyload)
...@@ -183,7 +184,15 @@ Vue.prototype.UploadSelfFileT = function (path, files, successCall) { ...@@ -183,7 +184,15 @@ Vue.prototype.UploadSelfFileT = function (path, files, successCall) {
console.log("上传文件出错" + err); console.log("上传文件出错" + err);
}); });
} }
} }
// // 获取地址
// Vue.prototype.getLocation = function () {
// let url = "http://ip.taobao.com/service/getIpInfo.php?ip=" + returnCitySN.cip
// let geolocation = location.initMap("map-container"); //定位
// AMap.event.addListener(geolocation, "complete", result => {
// console.log(result)
// });
// }
new Vue({ new Vue({
router, router,
store, store,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment