Commit c1186b6f authored by 黄媛媛's avatar 黄媛媛

修改酒店地图

parent 76180d54
...@@ -114,12 +114,12 @@ ...@@ -114,12 +114,12 @@
</div> </div>
<div style="padding:20px"> <div style="padding:20px">
<div class="f12"> <div class="f12">
<div style="margin-bottom:20px"> <div style="margin-bottom:20px;line-height:2">
{{dataDetail.prod_desc}} {{dataDetail.prod_desc}}
</div> </div>
<p class="f14 pfR" style="color:#000000;margin-bottom:15px" v-if="dataDetail.tour_list.length>0">行程列表</p> <p class="f14 pfR" style="color:#000000;margin-bottom:15px" v-if="dataDetail.tour_list.length>0">行程列表</p>
<div v-for="(item,index) in dataDetail.tour_list" :key="index+100"> <div v-for="(item,index) in dataDetail.tour_list" :key="index+100">
<p>{{item.tour_day}}</p> <p style="margin-top:10px">{{item.tour_day}}</p>
<p style="padding:8px 0">说明{{item.tour_desc}}</p> <p style="padding:8px 0">说明{{item.tour_desc}}</p>
<div v-if="item.photo_url&&item.photo_url!=''"> <div v-if="item.photo_url&&item.photo_url!=''">
<img style="width:100%;height: auto;display:block" :src="item.photo_url" alt=""> <img style="width:100%;height: auto;display:block" :src="item.photo_url" alt="">
......
...@@ -67,6 +67,8 @@ ...@@ -67,6 +67,8 @@
}, },
// 地图实例 // 地图实例
mapBuild(){ mapBuild(){
if(this.dataList.length>1){
let lat = parseFloat(this.dataList[0].lat) let lat = parseFloat(this.dataList[0].lat)
let lng = parseFloat(this.dataList[0].lng) let lng = parseFloat(this.dataList[0].lng)
let center = {lng: lng, lat: lat} let center = {lng: lng, lat: lat}
...@@ -78,6 +80,28 @@ ...@@ -78,6 +80,28 @@
}); });
this.directionsDisplay.setMap(this.map); this.directionsDisplay.setMap(this.map);
this.calcRoute() this.calcRoute()
}
else{
this.ptcenter = {
        lat: parseFloat(this.dataList[0].lat),
        lng: parseFloat(this.dataList[0].lng)
      }
this.ptstart = {
lat: parseFloat(this.dataList[0].lat),
        lng: parseFloat(this.dataList[0].lng)
}
      this.map = new google.maps.Map(document.getElementById('map_canvas'), {
        center: this.ptcenter,
        zoom: 15,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      })
var markerStart = new google.maps.Marker({
position: this.ptstart
})
markerStart.setMap(this.map)
}
}, },
calcRoute: function() { // 创建路径规划 calcRoute: function() { // 创建路径规划
// 分解数据 获得起 止 以及中间数据 // 分解数据 获得起 止 以及中间数据
......
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