Ver código fonte

Unit step back

master
Kobus 5 anos atrás
pai
commit
58824fcbe2

+ 1
- 1
src/components/processFlow/makeOffer.vue Ver arquivo

@@ -21,7 +21,7 @@
21 21
         <div class="form-group row">
22 22
           <div class="col-md-6 col-lg-5 section-md-t3">
23 23
             <div class="title-box-d">
24
-              <h3 class="title-d">{{ item.resort.resortName }}</h3>
24
+              <h3 class="title-d">{{ item ? item.resortName : '' }}</h3>
25 25
             </div>
26 26
           </div>
27 27
         </div>

+ 6
- 28
src/components/timeshare/buy/weekListComponent.vue Ver arquivo

@@ -29,30 +29,7 @@
29 29
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
30 30
             <td>
31 31
               <div class="col-md-12">
32
-                <button
33
-                  type="button"
34
-                  class="btn btn-b-n"
35
-                  data-toggle="modal"
36
-                  data-target="#myModal"
37
-                >Make an Offer</button>
38
-                <div id="myModal" class="modal fade" role="dialog">
39
-                  <div class="modal-dialog modal-lg">
40
-                    <!-- Modal content-->
41
-                    <div class="modal-content">
42
-                      <div class="modal-header">
43
-                        <button type="button" class="close" data-dismiss="modal">&times;</button>
44
-                      </div>
45
-                      <div padding-left="20px">
46
-                        <makeOffer
47
-                          name="MakeOffer"
48
-                          :isMakeOffer="true"
49
-                          :isProperty="false"
50
-                          :item="item"
51
-                        />
52
-                      </div>
53
-                    </div>
54
-                  </div>
55
-                </div>
32
+                <button type="button" class="btn btn-b-n" @click="View(item)">View</button>
56 33
               </div>
57 34
             </td>
58 35
           </tr>
@@ -71,15 +48,12 @@
71 48
 </template>
72 49
 <script>
73 50
 import { mapState, mapActions, mapGetters } from 'vuex';
74
-import makeOffer from '../../processFlow/makeOffer.vue';
75 51
 
76 52
 export default {
77 53
   props: {
78 54
     resortCode: undefined,
79 55
   },
80
-  components: {
81
-    makeOffer,
82
-  },
56
+  components: {},
83 57
   computed: {
84 58
     ...mapState('weekList', ['weeks']),
85 59
     ...mapGetters({
@@ -93,6 +67,10 @@ export default {
93 67
     this.getWeeks();
94 68
   },
95 69
   methods: {
70
+    View(item) {
71
+      console.log(item);
72
+      this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
73
+    },
96 74
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
97 75
   },
98 76
 };

+ 0
- 1
src/components/timeshare/resort/resortPage.vue Ver arquivo

@@ -40,7 +40,6 @@
40 40
           </div>
41 41
           {{description}}
42 42
           <hr />
43
-
44 43
           <div class="row">
45 44
             <div class="col-md-10 mb-4">
46 45
               <ul class="nav nav-tabs" id="myTab" role="tablist">

+ 26
- 56
src/components/timeshare/resort/unitPage.vue Ver arquivo

@@ -8,7 +8,10 @@
8 8
     <div class="row">
9 9
       <div class="col-md-12 col-lg-8">
10 10
         <div class="title-box-d">
11
-          <h1 class="title-d" style="text-align:left; font-size: 250%">{{resort.prName}}</h1>
11
+          <h1
12
+            class="title-d"
13
+            style="text-align:left; font-size: 250%"
14
+          >{{week ? week.resortName : ''}}</h1>
12 15
         </div>
13 16
         <br />
14 17
       </div>
@@ -41,7 +44,7 @@
41 44
             </ul>
42 45
           </div>
43 46
         </div>
44
-        <div class="col-md-6">
47
+        <div class="col-md-6" v-if="week">
45 48
           <form
46 49
             id="mainForm"
47 50
             method="POST"
@@ -66,7 +69,7 @@
66 69
                     type="text"
67 70
                     id="resort"
68 71
                     name="resortunit"
69
-                    :value="week.unit"
72
+                    :value="week ? week.unitNumber : ''"
70 73
                     disabled
71 74
                   />
72 75
                 </div>
@@ -84,7 +87,7 @@
84 87
                     type="text"
85 88
                     id="week"
86 89
                     name="resortWeek"
87
-                    :value="week.module"
90
+                    :value="week ? week.weekNumber : ''"
88 91
                     disabled
89 92
                   />
90 93
                 </div>
@@ -103,7 +106,7 @@
103 106
                     type="text"
104 107
                     id="levy"
105 108
                     name="levy"
106
-                    :value="formatPrice(week.currentLevy)"
109
+                    :value="formatPrice(week ? week.levyAmount : 0)"
107 110
                     disabled
108 111
                   />
109 112
                 </div>
@@ -115,7 +118,7 @@
115 118
                   <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
116 119
                     <!-- <div class="card-title-c align-self-center"> -->
117 120
                     <a class="justify-content-center" style="color: black; font-size: 250%">
118
-                      <b>R{{ formatPrice(week.price) }}</b>
121
+                      <b>R{{ formatPrice(week ? week.sellPrice : 0) }}</b>
119 122
                     </a>
120 123
                     <!-- </div> -->
121 124
                   </div>
@@ -124,44 +127,9 @@
124 127
               </div>
125 128
             </div>
126 129
             <br />
127
-            <div class="form-row">
128
-              <div>
129
-                <div class="input-group mb-3">
130
-                  <div class="input-group-prepend">
131
-                    <span class="input-group-text">
132
-                      <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
133
-                    </span>
134
-                    <input class="form-control" type="text" name="name" placeholder="Name" />
135
-                  </div>
136
-                </div>
137
-                <div class="input-group mb-3">
138
-                  <div class="input-group-prepend">
139
-                    <span class="input-group-text">
140
-                      <eva-icon name="phone-outline" fill="#60CBEB"></eva-icon>
141
-                    </span>
142
-                    <input
143
-                      class="form-control"
144
-                      type="number"
145
-                      name="mobile"
146
-                      placeholder="Contact Number"
147
-                    />
148
-                  </div>
149
-                </div>
150
-                <div class="input-group mb-3">
151
-                  <div class="input-group-prepend">
152
-                    <span class="input-group-text">
153
-                      <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
154
-                    </span>
155
-                    <input class="form-control" type="email" name="email" placeholder="Email" />
156
-                  </div>
157
-                </div>
158
-              </div>
159
-            </div>
160 130
           </form>
161 131
           <br />
162 132
 
163
-          <button class="btn btn-b-c even-width mr-auto" type="submit">Enquire Now</button>
164
-
165 133
           <!-- <a
166 134
               class="btn btn-b-n even-width mr-auto"
167 135
               href="/share-transfer-initiation-for-purchaser/"
@@ -172,20 +140,22 @@
172 140
             data-toggle="modal"
173 141
             data-target="#myModal"
174 142
           >Make an Offer</button>
175
-          <div id="myModal" class="modal fade" role="dialog">
176
-            <div class="modal-dialog modal-lg">
177
-              <!-- Modal content-->
178
-              <div class="modal-content">
179
-                <div class="modal-header">
180
-                  <button type="button" class="close" data-dismiss="modal">&times;</button>
181
-                </div>
182
-                <div padding-left="20px">
183
-                  <makeOffer
184
-                    name="MakeOffer"
185
-                    :isMakeOffer="true"
186
-                    :isProperty="false"
187
-                    :item="{resort: resort.prName, unit: week.unit, week: week.week, module: week.module, price: week.price}"
188
-                  />
143
+          <div class="col-md-12">
144
+            <div id="myModal" class="modal fade" role="dialog">
145
+              <div class="modal-dialog modal-lg">
146
+                <!-- Modal content-->
147
+                <div class="modal-content">
148
+                  <div class="modal-header">
149
+                    <button type="button" class="close" data-dismiss="modal">&times;</button>
150
+                  </div>
151
+                  <div padding-left="20px">
152
+                    <makeOffer
153
+                      name="MakeOffer"
154
+                      :isMakeOffer="true"
155
+                      :isProperty="false"
156
+                      :item="week"
157
+                    />
158
+                  </div>
189 159
                 </div>
190 160
               </div>
191 161
             </div>
@@ -223,7 +193,7 @@ export default {
223 193
       'image2',
224 194
       'image3',
225 195
     ]),
226
-    ...mapState('week', ['week', 'contactDetails']),
196
+    ...mapState('week', ['week']),
227 197
   },
228 198
   methods: {
229 199
     ...mapActions('resort', ['initResort']),

+ 1
- 9
src/main.js Ver arquivo

@@ -38,15 +38,7 @@ Vue.filter('toCurrency', (value) => {
38 38
   return `R ${formatter.format(value)}`;
39 39
 });
40 40
 
41
-const myPad = function (value, pattern) {
42
-  const val = '' + value;
43
-  return pattern.substring(0, pattern.length - val.length) + val;
44
-};
45
-
46
-Vue.filter('toDate', (value) => {
47
-  const date = new Date(value);
48
-  return `${date.getFullYear()}/${myPad(date.getMonth(), '00')}/${myPad(date.getDay(), '00')}`;
49
-});
41
+Vue.filter('toDate', value => value.substring(0, value.length > 9 ? 10 : value.length));
50 42
 
51 43
 new Vue({
52 44
   render: h => h(App),

+ 7
- 22
src/store/modules/timeshare/week.js Ver arquivo

@@ -1,3 +1,4 @@
1
+/* eslint-disable prefer-destructuring */
1 2
 /* eslint-disable no-restricted-syntax */
2 3
 /* eslint-disable guard-for-in */
3 4
 import axios from 'axios';
@@ -5,23 +6,13 @@ import axios from 'axios';
5 6
 export default {
6 7
   namespaced: true,
7 8
   state: {
8
-    week: {
9
-      id: '',
10
-      unit: '',
11
-      week: '',
12
-      module: '',
13
-      price: '',
14
-      currentLevy: '',
15
-    },
16
-    contactDetails: {
17
-      name: '',
18
-      number: '',
19
-      email: '',
20
-    },
9
+    week: undefined,
21 10
   },
22 11
   mutations: {
23 12
     setWeek(state, week) {
24
-      state.week = week;
13
+      if (week.length > 0) {
14
+        state.week = week[0];
15
+      }
25 16
     },
26 17
   },
27 18
   getters: {},
@@ -29,14 +20,8 @@ export default {
29 20
     initWeek({
30 21
       commit,
31 22
     }, weekId) {
32
-      commit('setWeek', {
33
-        id: weekId,
34
-        unit: '359',
35
-        week: 'N18',
36
-        module: '359/N18 River View',
37
-        price: 85000,
38
-        currentLevy: 5455,
39
-      });
23
+      axios.get(`/api/timeshareweek/${weekId}`).then(r => commit('setWeek', r.data)).catch(console
24
+        .error);
40 25
     },
41 26
   },
42 27
 };

Carregando…
Cancelar
Salvar