You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

buyPage.vue 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <!-- eslint-disable max-len -->
  3. <section class="collapse-items">
  4. <div class="container">
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <div class="tobuy-img-box">
  8. <img src="img/buy2.jpg" alt="Timeshare To Buy" class="img-fluid title-img" />
  9. </div>
  10. <div class="sinse-box title-title">
  11. <h3 class="sinse-title">Timeshare To Buy</h3>
  12. </div>
  13. </div>
  14. <div class="container col-md-10">
  15. <hr />
  16. <div class="row">
  17. <div class="col-md-12 text-left">
  18. <p>
  19. The resorts have been listed in their relevant provinces.
  20. Please select the resort for which you would like to view
  21. the available weeks and then select the weeks that interest
  22. you on the resort page.
  23. </p>
  24. <p>
  25. Arrival and departure dates are indicated but please note
  26. that these dates may vary annually.
  27. </p>
  28. <p>
  29. As with any property related sale, upon purchasing the holiday
  30. of your choice, there will be a transfer fee payable for the
  31. change of ownership. This fee will depend on the relevant resort
  32. or managing agent.
  33. </p>
  34. </div>
  35. </div>
  36. <hr />
  37. <div class="row mb-4">
  38. <div class="container col-md-4">
  39. <div class="accordion" id="accordionExample">
  40. <div class="card" v-for="(region, r) in availRegion" :key="r">
  41. <a
  42. class="mb-0 color-text-a"
  43. data-toggle="collapse"
  44. :data-target="'#collapse' + region.regionCode"
  45. aria-expanded="false"
  46. :aria-controls="'collapse' + region.regionCode"
  47. @mouseover="updateMapProvince(region.regionName)"
  48. >
  49. <div :id="'header' + region.regionCode">
  50. <h5
  51. class="btn btn-link font-weight-bold color-b"
  52. >{{ region.regionName + ' (' + region.available + ')' }}</h5>
  53. </div>
  54. </a>
  55. <div
  56. :id="'collapse' + region.regionCode"
  57. class="collapse secondary"
  58. :aria-labelledby="'header' + region.regionCode"
  59. data-parent="#accordionExample"
  60. style="background-color:#E3E3E3"
  61. >
  62. <div class="card-body">
  63. <div
  64. v-for="(resort, i) in region.resorts"
  65. :key="i"
  66. @click="routerGoTo('/resort/' + resort.resortCode)"
  67. @mouseover="updateMap(resort)"
  68. >
  69. <p class="mb-0 card-item">
  70. <a
  71. class="cursor-pointer"
  72. href="#"
  73. >{{resort.resortName + ' (' + resort.available + ')'}}</a>
  74. <br />
  75. </p>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="col-md-8">
  83. <div class="tab-content" id="myTabContent">
  84. <div
  85. class="tab-pane fade show active"
  86. id="directions"
  87. role="tabpanel"
  88. aria-labelledby="directions-tab"
  89. >
  90. <iframe
  91. :src="mapUrl"
  92. width="100%"
  93. height="600"
  94. frameborder="0"
  95. style="border-radius:10px"
  96. allowfullscreen
  97. ></iframe>
  98. <br />
  99. <small>
  100. <a :href="mapUrl" class="map-url" target="_blank">See map bigger</a>
  101. </small>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </section>
  110. </template>
  111. <script>
  112. import { mapState, mapActions } from 'vuex';
  113. export default {
  114. name: 'TimeshareToBuy',
  115. data() {
  116. return {
  117. myMap: 'SouthAfrica',
  118. myZoom: 5,
  119. };
  120. },
  121. mounted() {
  122. console.log(4);
  123. this.init();
  124. },
  125. computed: {
  126. ...mapState('timeshareBuy', ['detailedRegion', 'resort', 'availRegion']),
  127. mapUrl() {
  128. return `http://maps.google.com/maps?q=${this.myMap}&z=${this.myZoom}&output=embed`;
  129. },
  130. regions() {
  131. return _.sortBy(this.detailedRegion, r => r.regionName);
  132. },
  133. },
  134. methods: {
  135. ...mapActions('timeshareBuy', [
  136. 'init',
  137. 'getAvail',
  138. 'getRegions',
  139. 'getResort',
  140. ]),
  141. routerGoTo(goTo) {
  142. this.$router.push(goTo);
  143. },
  144. updateMap(resort) {
  145. this.myMap = 'SouthAfrica';
  146. this.myMap = `${resort.lat},${resort.long}`;
  147. this.myZoom = 10;
  148. },
  149. updateMapProvince(province) {
  150. this.myMap = province.replace(/\s/g, '');
  151. this.myZoom = 7;
  152. },
  153. },
  154. };
  155. </script>
  156. <style scoped>
  157. .map-url {
  158. color: #60cbeb;
  159. text-align: left;
  160. }
  161. .card-item {
  162. font-size: 100%;
  163. }
  164. .card-item:hover {
  165. background-color: rgba(255, 255, 255, 0.75);
  166. border-radius: 5px;
  167. cursor: pointer;
  168. }
  169. </style>