Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

unitPage.vue 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <main id="main" style="margin-top:-20px">
  3. <div class="container pb-5">
  4. <div class="row">
  5. <div class="col">
  6. <div class="section-header">
  7. <h2>{{ week ? week.resort.resortName : "" }}</h2>
  8. </div>
  9. </div>
  10. </div>
  11. <div class="row mt-5">
  12. <div class="col-md-6">
  13. <gallerySection :images="images" />
  14. </div>
  15. <div class="col-md-6 summarySection">
  16. <h3>Summary</h3>
  17. <div class="row">
  18. <div align="center" class="col">
  19. <label for="unit">Unit: </label>
  20. <h5>{{ week ? week.unitNumber : "" }}</h5>
  21. </div>
  22. <div align="center" class="col">
  23. <label for="week">Module/Week: </label>
  24. <h5>{{ week ? week.weekNumber : "" }}</h5>
  25. </div>
  26. </div>
  27. <div class="row mt-3">
  28. <div align="center" class="col">
  29. <label for="levy">Current Year Levy: </label>
  30. <h5>R{{ formatPrice(week ? week.levyAmount : 0) }}</h5>
  31. </div>
  32. </div>
  33. <div class="row mt-5">
  34. <div align="center" class="col">
  35. <div class="intro-content">
  36. <h2>Price</h2>
  37. </div>
  38. <h4>R {{ formatPrice(week ? week.sellPrice : 0) }}</h4>
  39. </div>
  40. </div>
  41. <div class="row mt-3">
  42. <div class="col">
  43. <a href="javascript:history.back()" class="btn-white-border">Back</a>
  44. </div>
  45. <div class="col">
  46. <button
  47. class="btn-solid-blue"
  48. style="color:white"
  49. data-toggle="modal"
  50. data-target="#myModal"
  51. >
  52. Make an Offer
  53. </button>
  54. <div class="col-md-12">
  55. <div id="myModal" class="modal fade" role="dialog">
  56. <div class="modal-dialog modal-lg">
  57. <!-- Modal content-->
  58. <div class="modal-content">
  59. <div class="modal-header">
  60. <button type="button" class="close" data-dismiss="modal">&times;</button>
  61. </div>
  62. <div padding-left="20px">
  63. <makeOffer
  64. name="MakeOffer"
  65. :isMakeOffer="true"
  66. :isProperty="false"
  67. :item="week"
  68. />
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="row mt-5">
  79. <div class="col">
  80. <tabSection
  81. :resortCode="resortCode"
  82. :resortCoords="resort.prPostAdd1"
  83. :layoutImages="layouts"
  84. />
  85. </div>
  86. </div>
  87. </div>
  88. </main>
  89. </template>
  90. <script>
  91. /* eslint-disable */
  92. import { mapState, mapActions, mapGetters } from "vuex";
  93. import gallerySection from "../gallerySection";
  94. import tabSection from "./tabSection";
  95. export default {
  96. name: "unit",
  97. components: {
  98. makeOffer,
  99. gallerySection,
  100. tabSection
  101. },
  102. props: {
  103. resortCode: {},
  104. unitNumber: {}
  105. },
  106. mounted() {
  107. this.initResort(this.resortCode);
  108. if (this.resortCode) {
  109. this.applyResortFilter(this.resortCode);
  110. }
  111. this.layouts.push(this.layout);
  112. this.getWeeks();
  113. console.log(this.resort);
  114. },
  115. computed: {
  116. ...mapState("resort", ["resort", "description", "images", "layout"]),
  117. ...mapGetters({
  118. weekById: "weekList/weekById"
  119. }),
  120. week() {
  121. return this.weekById(this.resortCode, this.unitNumber);
  122. },
  123. layouts() {
  124. var layouts = [];
  125. layouts.push(this.layout);
  126. return layouts;
  127. }
  128. // ...mapState('week', ['currentWeek']),
  129. },
  130. methods: {
  131. ...mapActions("weekList", ["getWeeks", "applyResortFilter"]),
  132. ...mapActions("resort", ["initResort"]),
  133. // ...mapActions('week', ['initWeek']),
  134. formatPrice(value) {
  135. if (value) {
  136. const val = (value / 1).toFixed(2);
  137. return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
  138. }
  139. return "";
  140. }
  141. }
  142. };
  143. </script>
  144. <style lang="scss" scoped>
  145. .summarySection {
  146. margin-top: -50px;
  147. }
  148. /* Extra small devices (phones, 600px and down) */
  149. @media only screen and (max-width: 600px) {
  150. .summarySection {
  151. margin-top: 1px;
  152. }
  153. }
  154. /* Small devices (portrait tablets and large phones, 600px and up) */
  155. @media only screen and (min-width: 600px) {
  156. .summarySection {
  157. margin-top: 1px;
  158. }
  159. }
  160. /* Medium devices (landscape tablets, 768px and up) */
  161. @media only screen and (min-width: 768px) {
  162. .summarySection {
  163. margin-top: -50px;
  164. }
  165. }
  166. /* Large devices (laptops/desktops, 992px and up) */
  167. @media only screen and (min-width: 992px) {
  168. }
  169. /* Extra large devices (large laptops and desktops, 1200px and up) */
  170. @media only screen and (min-width: 1200px) {
  171. }
  172. </style>