Commit c76d2bd7 authored by 华国豪's avatar 华国豪 🙄

获取地理位置

parent 19b2a2b4
...@@ -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
......
...@@ -405,6 +405,7 @@ export default { ...@@ -405,6 +405,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")){
......
...@@ -336,7 +336,7 @@ export default { ...@@ -336,7 +336,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