Explorar el Código

Unit step back

master
Kobus hace 5 años
padre
commit
58824fcbe2

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

21
         <div class="form-group row">
21
         <div class="form-group row">
22
           <div class="col-md-6 col-lg-5 section-md-t3">
22
           <div class="col-md-6 col-lg-5 section-md-t3">
23
             <div class="title-box-d">
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
             </div>
25
             </div>
26
           </div>
26
           </div>
27
         </div>
27
         </div>

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

29
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
29
             <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
30
             <td>
30
             <td>
31
               <div class="col-md-12">
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
               </div>
33
               </div>
57
             </td>
34
             </td>
58
           </tr>
35
           </tr>
71
 </template>
48
 </template>
72
 <script>
49
 <script>
73
 import { mapState, mapActions, mapGetters } from 'vuex';
50
 import { mapState, mapActions, mapGetters } from 'vuex';
74
-import makeOffer from '../../processFlow/makeOffer.vue';
75
 
51
 
76
 export default {
52
 export default {
77
   props: {
53
   props: {
78
     resortCode: undefined,
54
     resortCode: undefined,
79
   },
55
   },
80
-  components: {
81
-    makeOffer,
82
-  },
56
+  components: {},
83
   computed: {
57
   computed: {
84
     ...mapState('weekList', ['weeks']),
58
     ...mapState('weekList', ['weeks']),
85
     ...mapGetters({
59
     ...mapGetters({
93
     this.getWeeks();
67
     this.getWeeks();
94
   },
68
   },
95
   methods: {
69
   methods: {
70
+    View(item) {
71
+      console.log(item);
72
+      this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
73
+    },
96
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
74
     ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
97
   },
75
   },
98
 };
76
 };

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

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

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

8
     <div class="row">
8
     <div class="row">
9
       <div class="col-md-12 col-lg-8">
9
       <div class="col-md-12 col-lg-8">
10
         <div class="title-box-d">
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
         </div>
15
         </div>
13
         <br />
16
         <br />
14
       </div>
17
       </div>
41
             </ul>
44
             </ul>
42
           </div>
45
           </div>
43
         </div>
46
         </div>
44
-        <div class="col-md-6">
47
+        <div class="col-md-6" v-if="week">
45
           <form
48
           <form
46
             id="mainForm"
49
             id="mainForm"
47
             method="POST"
50
             method="POST"
66
                     type="text"
69
                     type="text"
67
                     id="resort"
70
                     id="resort"
68
                     name="resortunit"
71
                     name="resortunit"
69
-                    :value="week.unit"
72
+                    :value="week ? week.unitNumber : ''"
70
                     disabled
73
                     disabled
71
                   />
74
                   />
72
                 </div>
75
                 </div>
84
                     type="text"
87
                     type="text"
85
                     id="week"
88
                     id="week"
86
                     name="resortWeek"
89
                     name="resortWeek"
87
-                    :value="week.module"
90
+                    :value="week ? week.weekNumber : ''"
88
                     disabled
91
                     disabled
89
                   />
92
                   />
90
                 </div>
93
                 </div>
103
                     type="text"
106
                     type="text"
104
                     id="levy"
107
                     id="levy"
105
                     name="levy"
108
                     name="levy"
106
-                    :value="formatPrice(week.currentLevy)"
109
+                    :value="formatPrice(week ? week.levyAmount : 0)"
107
                     disabled
110
                     disabled
108
                   />
111
                   />
109
                 </div>
112
                 </div>
115
                   <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
118
                   <div style="width: 260px; height: 70px; border-style: solid; color: #60CBEB;">
116
                     <!-- <div class="card-title-c align-self-center"> -->
119
                     <!-- <div class="card-title-c align-self-center"> -->
117
                     <a class="justify-content-center" style="color: black; font-size: 250%">
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
                     </a>
122
                     </a>
120
                     <!-- </div> -->
123
                     <!-- </div> -->
121
                   </div>
124
                   </div>
124
               </div>
127
               </div>
125
             </div>
128
             </div>
126
             <br />
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
           </form>
130
           </form>
161
           <br />
131
           <br />
162
 
132
 
163
-          <button class="btn btn-b-c even-width mr-auto" type="submit">Enquire Now</button>
164
-
165
           <!-- <a
133
           <!-- <a
166
               class="btn btn-b-n even-width mr-auto"
134
               class="btn btn-b-n even-width mr-auto"
167
               href="/share-transfer-initiation-for-purchaser/"
135
               href="/share-transfer-initiation-for-purchaser/"
172
             data-toggle="modal"
140
             data-toggle="modal"
173
             data-target="#myModal"
141
             data-target="#myModal"
174
           >Make an Offer</button>
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
                 </div>
159
                 </div>
190
               </div>
160
               </div>
191
             </div>
161
             </div>
223
       'image2',
193
       'image2',
224
       'image3',
194
       'image3',
225
     ]),
195
     ]),
226
-    ...mapState('week', ['week', 'contactDetails']),
196
+    ...mapState('week', ['week']),
227
   },
197
   },
228
   methods: {
198
   methods: {
229
     ...mapActions('resort', ['initResort']),
199
     ...mapActions('resort', ['initResort']),

+ 1
- 9
src/main.js Ver fichero

38
   return `R ${formatter.format(value)}`;
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
 new Vue({
43
 new Vue({
52
   render: h => h(App),
44
   render: h => h(App),

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

1
+/* eslint-disable prefer-destructuring */
1
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable no-restricted-syntax */
2
 /* eslint-disable guard-for-in */
3
 /* eslint-disable guard-for-in */
3
 import axios from 'axios';
4
 import axios from 'axios';
5
 export default {
6
 export default {
6
   namespaced: true,
7
   namespaced: true,
7
   state: {
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
   mutations: {
11
   mutations: {
23
     setWeek(state, week) {
12
     setWeek(state, week) {
24
-      state.week = week;
13
+      if (week.length > 0) {
14
+        state.week = week[0];
15
+      }
25
     },
16
     },
26
   },
17
   },
27
   getters: {},
18
   getters: {},
29
     initWeek({
20
     initWeek({
30
       commit,
21
       commit,
31
     }, weekId) {
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
 };

Loading…
Cancelar
Guardar