瀏覽代碼

Added provinces to map

master
Kobus 5 年之前
父節點
當前提交
4a7cbef427
共有 1 個檔案被更改,包括 22 行新增5 行删除
  1. 22
    5
      src/components/timeshare/buy/buyPage.vue

+ 22
- 5
src/components/timeshare/buy/buyPage.vue 查看文件

@@ -46,7 +46,10 @@
46 46
                 :aria-controls="'collapse' + region.id"
47 47
               >
48 48
                 <div :id="'header' + region.id">
49
-                  <h5 class="mb-0">{{ region.regionName }}</h5>
49
+                  <h5
50
+                    class="mb-0"
51
+                    @mouseover="updateMapProvince(region.regionName)"
52
+                  >{{ region.regionName }}</h5>
50 53
                 </div>
51 54
               </a>
52 55
               <div
@@ -61,7 +64,7 @@
61 64
                       class="cursor-pointer"
62 65
                       href="#"
63 66
                       @click="routerGoTo('/resort/' + resort.resortCode)"
64
-                      @mouseover="getResort(resort.resortCode)"
67
+                      @mouseover="updateMap(resort.resortCode)"
65 68
                     >{{resort.resortName}}</a>
66 69
                     <br />
67 70
                   </p>
@@ -115,13 +118,20 @@ import { mapState, mapActions } from 'vuex';
115 118
 
116 119
 export default {
117 120
   name: 'TimeshareToBuy',
121
+  data() {
122
+    return {
123
+      myMap: 'SouthAfrica',
124
+      myZoom: 5,
125
+    };
126
+  },
118 127
   mounted() {
119 128
     this.getRegions();
120 129
   },
121 130
   computed: {
122 131
     ...mapState('timeshareBuy', ['detailedRegion', 'resort']),
123 132
     mapUrl() {
124
-      return `http://maps.google.com/maps?q=${this.resort.prLatitude},${this.resort.prLongitude}&z=15&output=embed`;
133
+      // return 'http://maps.google.com/maps/place/Gauteng/';
134
+      return `http://maps.google.com/maps?q=${this.myMap}&z=${this.myZoom}&output=embed`;
125 135
     },
126 136
     regions() {
127 137
       return _.sortBy(this.detailedRegion, r => r.regionName);
@@ -133,8 +143,15 @@ export default {
133 143
       this.$router.push(goTo);
134 144
     },
135 145
     updateMap(resortCode) {
136
-      this.getGPS(resortCode);
137
-      alert(resortCode);
146
+      this.myMap = 'SouthAfrice';
147
+      this.getResort(resortCode);
148
+      // `http://maps.google.com/maps?q=${this.resort.prLatitude},${this.resort.prLongitude}&z=7&output=embed`;
149
+      this.myMap = `${this.resort.prLatitude},${this.resort.prLongitude}`;
150
+      this.myZoom = 10;
151
+    },
152
+    updateMapProvince(province) {
153
+      this.myMap = province.replace(/\s/g, '');
154
+      this.myZoom = 7;
138 155
     },
139 156
   },
140 157
 };

Loading…
取消
儲存