geer-builder 1.2.601 → 1.2.602

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GCheckout.vue CHANGED
@@ -451,18 +451,19 @@ export default {
451
451
  this.payment_method_list = await this.$_getData('payment_method_list');
452
452
  this.online_payment_index = this.payment_method_list.map(function(e) { return e.payment_method_id; }).indexOf('online_payment');
453
453
  this.payment_account_list = await this.$_getData('payment_account_list');
454
- if( this.user_info.slot_owned > 0 && this.public_settings.hasOwnProperty('registration_sponsor') && this.public_settings.registration_sponsor.active)
455
- {
456
- if(this.user_info.hasOwnProperty('sponsor'))
457
- {
458
- sessionStorage.setItem('referral_slot_code', this.user_info.sponsor);
459
- }
460
- else
461
- {
462
- sessionStorage.setItem('referral_slot_code', this.public_settings.registration_sponsor.default_sponsor);
463
- }
464
- }
465
- else if(this.user_info.slot_owned >0)
454
+
455
+ // if( this.user_info.slot_owned > 0 && this.public_settings.hasOwnProperty('registration_sponsor') && this.public_settings.registration_sponsor.active)
456
+ // {
457
+ // if(this.user_info.hasOwnProperty('sponsor'))
458
+ // {
459
+ // sessionStorage.setItem('referral_slot_code', this.user_info.sponsor);
460
+ // }
461
+ // else
462
+ // {
463
+ // sessionStorage.setItem('referral_slot_code', this.public_settings.registration_sponsor.default_sponsor);
464
+ // }
465
+ // }
466
+ if(this.user_info.slot_owned >0)
466
467
  {
467
468
  if(sessionStorage.referral_slot_code)
468
469
  {
@@ -475,9 +476,29 @@ export default {
475
476
  {
476
477
  sessionStorage.setItem('referral_slot_code', this.user_info.sponsor);
477
478
  }
478
- else if(this.public_settings.hasOwnProperty('registration_sponsor') && this.public_settings.registration_sponsor.rc_sponsor)
479
+ }
480
+
481
+ if(this.public_settings.hasOwnProperty('registration_sponsor') && this.public_settings.registration_sponsor.active)
482
+ {
483
+ if(this.user_info.slot_owned > 0 )
484
+ {
485
+ let slot = await new DB_SLOT().getSponsor(this.user_info.active_slot);
486
+ if(slot.length>0)
487
+ {
488
+ let sponsor = slot[0].sponsor;
489
+ sessionStorage.setItem('reseller_slot_code', sponsor);
490
+ }
491
+ }
492
+ else
479
493
  {
480
- sessionStorage.setItem('referral_slot_code', this.public_settings.registration_sponsor.default_sponsor);
494
+ if(this.user_info.hasOwnProperty('sponsor'))
495
+ {
496
+ sessionStorage.setItem('reseller_slot_code', this.user_info.sponsor);
497
+ }
498
+ else
499
+ {
500
+ sessionStorage.setItem('referral_slot_code', this.public_settings.registration_sponsor.default_sponsor);
501
+ }
481
502
  }
482
503
  }
483
504
 
@@ -1891,6 +1912,10 @@ export default {
1891
1912
  {
1892
1913
  this.checkout_info.referral_slot_code = sessionStorage.referral_slot_code;
1893
1914
  }
1915
+ if(sessionStorage.reseller_slot_code && this.payment_method.payment_method_id != "gc_points")
1916
+ {
1917
+ this.checkout_info.reseller_slot_code = sessionStorage.reseller_slot_code;
1918
+ }
1894
1919
  if(this.checkout_info.payment_method.payment_method_id == "wallet")
1895
1920
  {
1896
1921
  this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
@@ -4,32 +4,83 @@
4
4
  <!-- <img :src="this.user_info.profile_picture"/> -->
5
5
  <div class="ecom_page_body">
6
6
  <div class="profile_holder">
7
- <div class="profile_bg" :style="`background-image:url('`+this.merchant_info.profile_picture+`');`">
7
+ <div class="profile_bg" :style="`background-image:url('`+this.merchant_info.profile_picture+`'); background-size: cover; background-position: center;`">
8
8
  <div class="dp">
9
- <img class="circle_pic" :src="this.merchant_info.profile_picture ? this.merchant_info.profile_picture : require('./assets/statics/default_profile.png')" alt="Avatar">
10
- <div class="profile_name" style="">{{this.merchant_info.full_name}}</div>
9
+ <div class="circle_pic" :style="this.merchant_info.profile_picture ? `background-image: url(${ this.merchant_info.profile_picture }); background-size: cover; background-position: center;` : ``"></div>
10
+ <div class="merchant__name">
11
+ <div class="profile_name" style="">{{this.merchant_info.full_name}}</div>
12
+ <div class="active__status">Active {{timeSince( new Date(this.merchant_info.last_login_date.seconds * 1000 + this.merchant_info.last_login_date.nanoseconds/1000000))+" ago"}}</div>
13
+ </div>
11
14
  </div>
12
- </div>
13
- <div class="button-holder" v-if="user_info">
14
- <q-btn class="q-mr-sm open-merchant-btn" @click="openMerchantPage()">
15
- <q-icon size="14px" color="primary" class="q-mr-sm" name="fa fa-store"></q-icon>
16
- View Page
17
- </q-btn>
18
- <q-btn class="q-mr-sm open-merchant-chat-btn" @click="openMerchantChat()">
19
- <q-icon size="14px" color="primary" class="q-mr-sm" name="fa fa-paper-plane"></q-icon>
20
- Send Message
21
- </q-btn>
15
+ <div class="button-holder" v-if="user_info">
16
+ <q-btn class="q-mr-sm hidden open-merchant-btn btn-color" @click="openMerchantPage()">
17
+ <q-icon size="14px" color="gray" class="q-mr-sm" name="fa fa-store"></q-icon>
18
+ View Page
19
+ </q-btn>
20
+ <q-btn v-if="!is_following" class="q-mr-sm btn-color open-merchant_follow_btn" @click="followMerchant('follow')">
21
+ <q-icon size="14px" color="gray" class="q-mr-sm" name="fa fa-user-plus"></q-icon>
22
+ Follow
23
+ </q-btn>
24
+ <q-btn v-else class="q-mr-sm btn-color open-merchant_follow_btn" @click="followMerchant('unfollow')">
25
+ <q-icon size="14px" color="gray" class="q-mr-sm" name="fa fa-user-minus"></q-icon>
26
+ Unfollow
27
+ </q-btn>
28
+ <q-btn class="q-mr-sm btn-color open-merchant-chat-btn" @click="openMerchantChat()">
29
+ <q-icon size="14px" color="gray" class="q-mr-sm" name="fa fa-paper-plane"></q-icon>
30
+ Send Message
31
+ </q-btn>
32
+ </div>
22
33
  </div>
23
34
  </div>
24
35
  <div class="right">
25
- <div class="product_list_div">
26
- <q-icon size="14px" class="q-mr-sm" name="fas fa-store"></q-icon>Products:{{product_list.length}}
36
+ <div class="product_list_div products">
37
+ <q-icon size="14px" class="q-mr-sm" name="fas fa-store"></q-icon>Products : {{product_list.length}}
38
+ </div>
39
+ <div class="product_list_div followers">
40
+ <q-icon size="14px" class="q-mr-sm" name="fas fa-users"></q-icon>
41
+ Follower(s) : {{merchant_slot.follower ? merchant_slot.follower: 0}}
42
+ </div>
43
+ <div class="product_list_div ratings">
44
+ <q-icon size="14px" class="q-mr-sm" name="fas fa-star"></q-icon>
45
+ Ratings : {{$_formatNumber(merchant_slot.rating, { decimal: 1})}}
27
46
  </div>
28
- <div style="text-align:left;padding:5px;">
29
- <q-icon size="14px" class="q-mr-sm" name="fas fa-user-check"></q-icon> Joined : {{monthDiff( new Date(this.merchant_info.created_date.seconds * 1000 + this.merchant_info.created_date.nanoseconds/1000000),new Date())+" Months Ago"}}
47
+ <!-- <div class="product_list_div chat-performance">
48
+ <q-icon size="14px" class="q-mr-sm" name="fas fa-comments"></q-icon>
49
+ Chat Performance : 100%
50
+ </div> -->
51
+ <div class="product_list_div joined">
52
+ <q-icon size="14px" class="q-mr-sm" name="fas fa-user-check"></q-icon> Joined : {{timeSince( new Date(this.merchant_info.created_date.seconds * 1000 + this.merchant_info.created_date.nanoseconds/1000000))+" ago "}}
30
53
  </div>
31
54
  </div>
32
55
  </div>
56
+ <q-dialog v-model="is_rating_dialog">
57
+ <q-card class="rating-main-container">
58
+ <q-card-section class="text-center">
59
+ <div class="message text-bold text-h5">Please, give us a rating!</div>
60
+ <div class="sub-message">We want to get your to further enhance our service and/or product!</div>
61
+ <div class="icon-btn-main-holder q-mt-md">
62
+ <span v-if='rate >= 1' @click="rating(1)" class="material-icons star-first">star</span>
63
+ <span v-else @click="rating(1)" class="material-icons star-first">star_outline</span>
64
+ <span v-if='rate >= 2' @click="rating(2)" class="material-icons star-second">star</span>
65
+ <span v-else @click="rating(2)" class="material-icons star-second">star_outline</span>
66
+ <span v-if='rate >= 3' @click="rating(3)" class="material-icons star-third">star</span>
67
+ <span v-else @click="rating(3)" class="material-icons star-third">star_outline</span>
68
+ <span v-if='rate >= 4' @click="rating(4)" class="material-icons star-fourth">star</span>
69
+ <span v-else @click="rating(4)" class="material-icons star-fourth">star_outline</span>
70
+ <span v-if='rate == 5' @click="rating(5)" class="material-icons star-fifth">star</span>
71
+ <span v-else @click="rating(5)" class="material-icons star-fifth">star_outline</span>
72
+ </div>
73
+ </q-card-section>
74
+ <q-separator class="seperator" />
75
+ <q-card-section>
76
+ <div align="right">
77
+ <q-btn @click="ignoreRating('later')" color="secondary" label="I'll Try Later!" class="q-mr-sm"/>
78
+ <q-btn v-if="rate != 0" @click="rating(rate, 'confirm')" label="confirm" color="primary"/>
79
+ <q-btn v-else @click="ignoreRating('ignored')" label="No, Thanks." color="primary"/>
80
+ </div>
81
+ </q-card-section>
82
+ </q-card>
83
+ </q-dialog>
33
84
  <!-- <div class="product-list-container">
34
85
  <div class="filter" style=""><q-select v-model="category_choice" dense :options="categories_list" option-label="category_identifier" map-options emit-value option-value="category_identifier" outlined></q-select>
35
86
  <q-select class="q-ml-sm" dense v-model="sort_choice" :options="['Price: High to Low', 'Price: Low to High']" @input="sortby" option-label="category_identifier" map-options emit-value option-value="category_identifier" outlined></q-select></div>
@@ -55,6 +106,7 @@ import GlobalMixins from './mixins/global_mixins.js';
55
106
  import DB_PRODUCTS from './models/DB_PRODUCT';
56
107
  import DB_CATEGORIES from './models/DB_CATEGORIES';
57
108
  import DB_USER from './models/DB_USER';
109
+ import DB_SLOT from './models/DB_SLOT';
58
110
  import GProductList from './GProductList';
59
111
  import GProductPage from './GProductPage';
60
112
 
@@ -68,6 +120,8 @@ export default {
68
120
  },
69
121
  data: () =>
70
122
  ({
123
+ is_rating_dialog: false,
124
+ rate: 0,
71
125
  product_list:"",
72
126
  categories_list: [],
73
127
  category_choice: "",
@@ -78,19 +132,23 @@ export default {
78
132
  openInfo: false,
79
133
  productid: "",
80
134
  merchant_info: {created_date:{seconds: "", nanoseconds: ""}},
135
+ merchant_slot:{},
136
+ field:{},
137
+ ratings_data: {},
138
+ is_following: false,
139
+ mode:'follow',
81
140
  }),
82
141
  async mounted()
83
142
  {
84
143
  if(this.slot_code)
85
144
  await this.$bind('product_list', new DB_PRODUCTS().collection().where("type", "in", ["Product", "Membership Kit", "Exclusive"]).where("stockist", "==", this.slot_code).orderBy('created_date', 'desc'));
86
- this.getCategories();
87
- this.getUserInfo();
145
+ await this.getCategories();
146
+ await this.getUserInfo();
88
147
  },
89
148
  methods:
90
149
  {
91
150
  async openMerchantPage()
92
151
  {
93
- console.log(this.slot_code, 'slot code');
94
152
  this.$router.push({ name: 'front_merchant_page', params: { 'stockist': this.slot_code}});
95
153
  },
96
154
  async openMerchantChat()
@@ -101,14 +159,95 @@ export default {
101
159
  {
102
160
  if (this.slot_code)
103
161
  {
104
- this.merchant_info = await new DB_USER().collection().where("slot_list", "array-contains", this.slot_code).get();
162
+ this.merchant_info = await new DB_USER().collection().where("slot_list", "array-contains", this.slot_code).get();
105
163
  }
106
164
  this.merchant_info = this.merchant_info.docs[0].data();
165
+ if(this.merchant_info.active_slot)
166
+ {
167
+ this.merchant_slot = await new DB_SLOT().collection().where("slot_code", "==", this.merchant_info.active_slot).get();
168
+ this.merchant_slot = this.merchant_slot.docs[0].data();
169
+ // console.log(this.merchant_slot);
170
+ // await this.$bind('merchant_slot', new DB_SLOT().collection().where('slot_code', '==', this.merchant_info.active_slot));
171
+ if(this.merchant_slot.hasOwnProperty('follower_list'))
172
+ {
173
+ this.is_following = false;
174
+ if(this.merchant_slot.follower_list.includes(this.user_info.uid)) this.is_following = true;
175
+ }
176
+ }
177
+ if (this.merchant_slot.rate_list)
178
+ {
179
+ let check_user_on_list = this.merchant_slot.rate_list.includes(this.user_info.uid)
180
+ if (!check_user_on_list)
181
+ {
182
+ this.is_rating_dialog = true;
183
+ }
184
+ }
185
+ else
186
+ {
187
+ this.is_rating_dialog = true;
188
+ }
107
189
  },
108
- monthDiff(dateFrom, dateTo) {
109
- return dateTo.getMonth() - dateFrom.getMonth() +
110
- (12 * (dateTo.getFullYear() - dateFrom.getFullYear()))
190
+ timeSince(date) {
191
+
192
+ var seconds = Math.floor((new Date() - date) / 1000);
193
+
194
+ var interval = seconds / 31536000;
195
+
196
+ if (interval > 1) {
197
+ if ((Math.floor(interval)) > 1) {
198
+ return Math.floor(interval) + " years";
199
+ }
200
+ else
201
+ {
202
+ return Math.floor(interval) + " year";
203
+ }
204
+ }
205
+ interval = seconds / 2592000;
206
+ if (interval > 1) {
207
+ if ((Math.floor(interval)) > 1) {
208
+ return Math.floor(interval) + " months";
209
+ }
210
+ else
211
+ {
212
+ return Math.floor(interval) + " month";
213
+ }
214
+ }
215
+ interval = seconds / 86400;
216
+ if (interval > 1) {
217
+ if ((Math.floor(interval)) > 1) {
218
+ return Math.floor(interval) + " days";
219
+ }
220
+ else
221
+ {
222
+ return Math.floor(interval) + " day";
223
+ }
224
+ }
225
+ interval = seconds / 3600;
226
+ if (interval > 1) {
227
+ if ((Math.floor(interval)) > 1) {
228
+ return Math.floor(interval) + " hours";
229
+ }
230
+ else
231
+ {
232
+ return Math.floor(interval) + " hour";
233
+ }
234
+ }
235
+ interval = seconds / 60;
236
+ if (interval > 1) {
237
+ if ((Math.floor(interval)) > 1) {
238
+ return Math.floor(interval) + " minutes";
239
+ }
240
+ else
241
+ {
242
+ return Math.floor(interval) + " minute";
243
+ }
244
+ }
245
+ return Math.floor(seconds) + " second(s)";
111
246
  },
247
+ // monthDiff(dateFrom, dateTo) {
248
+ // return dateTo.getMonth() - dateFrom.getMonth() +
249
+ // (12 * (dateTo.getFullYear() - dateFrom.getFullYear()))
250
+ // },
112
251
  async getCategories()
113
252
  {
114
253
  let getCategories = await new DB_CATEGORIES().collection().get();
@@ -151,6 +290,96 @@ export default {
151
290
  {
152
291
  this.openInfo=false;
153
292
  },
293
+ async followMerchant(method)
294
+ {
295
+ this.$q.loading.show();
296
+ try
297
+ {
298
+ if(method != 'follow')
299
+ {
300
+ this.mode = 'unfollow';
301
+ }
302
+ else
303
+ {
304
+ this.mode = 'follow';
305
+ }
306
+ this.field.mode = this.mode;
307
+ this.field.user_id = this.user_info.uid;
308
+ this.field.merchant_slot = this.merchant_info.active_slot;
309
+ // this.$q.loading.show();
310
+ await this.$_fbCall('memberFollowMerchant', this.field);
311
+ if (this.mode === 'follow') {
312
+ this.$q.dialog({
313
+ title: 'Congratulations',
314
+ message: `Successfully ${this.mode}.`
315
+ })
316
+ }
317
+ else
318
+ {
319
+ this.$q.dialog({
320
+ title: 'Unfollowed',
321
+ message: `Successfully ${this.mode}.`
322
+ })
323
+ }
324
+ // this.$emit('closeDialog');
325
+ }
326
+ catch (error)
327
+ {
328
+ this.$q.dialog({ html: true, title: `Something's not quite right`, message: error.message });
329
+ }
330
+ this.getUserInfo();
331
+ this.$q.loading.hide();
332
+ },
333
+ async rating(rate, action)
334
+ {
335
+ if (this.rate !== 0 && action && action === 'confirm')
336
+ {
337
+ this.$q.loading.show();
338
+ let merchant_slot = await this.merchant_info.active_slot;
339
+ try
340
+ {
341
+ this.ratings_data.user_id = this.user_info.uid;
342
+ this.ratings_data.rate = this.rate;
343
+ this.ratings_data.merchant_slot = merchant_slot;
344
+ if (this.ratings_data.merchant_slot != null)
345
+ {
346
+ let rate = await this.$_fbCall('memberRateMerchant', this.ratings_data);
347
+ this.$q.dialog({
348
+ title: 'Thank you!',
349
+ message: `You have successfully submitted your response.`
350
+ })
351
+ }
352
+ // this.$emit('closeDialog');
353
+ }
354
+ catch (error)
355
+ {
356
+ this.$q.dialog({ html: true, title: `Something's not quite right`, message: error.message });
357
+ }
358
+ // this.getUserInfo();
359
+ this.getUserInfo();
360
+ this.is_rating_dialog = false;
361
+ this.$q.loading.hide();
362
+ }
363
+ else
364
+ {
365
+ this.rate = rate;
366
+ }
367
+ },
368
+ ignoreRating(user_response)
369
+ {
370
+ this.is_rating_dialog = false;
371
+ if (user_response === later)
372
+ {
373
+ setTimeout(() =>
374
+ {
375
+ this.is_rating_dialog = true;
376
+ }, 900000);
377
+ }
378
+ else
379
+ {
380
+ this.is_rating_dialog = false;
381
+ }
382
+ }
154
383
  }
155
384
  }
156
385
  </script>
@@ -161,64 +390,72 @@ export default {
161
390
  width: 100%;
162
391
  .ecom_page_body{
163
392
  display: grid;
164
- grid-template-columns: 1fr 1fr;
393
+ grid-template-columns: 1fr 1fr;
165
394
  grid-gap: 10px;
166
395
  padding: 10px;
167
396
  .profile_holder
168
397
  {
169
- width: 120px;
398
+ width: 100%;
399
+ background-color: rgba(0,0,0,0.6);
400
+ height: 100%;
401
+ border-radius: 5px;
402
+ overflow: hidden;
170
403
  .profile_bg
171
404
  {
172
405
  position: relative;
173
406
  display: inline-block;
174
407
  line-height: 0;
175
- width: 370px;
176
- height: 130px;
177
- background-size: 90% auto;
178
- background-position: center;
408
+ width: 100%;
179
409
  background-repeat: no-repeat;
180
- border: 1px solid #cccccc;
181
410
  border-radius: 5px;
182
- margin: 5px;
183
- border-radius: 3%;
184
411
  .dp
185
412
  {
186
413
  display:flex;
187
- background-color: rgba(0,0,0,0.6);
188
414
  height:130px;
189
- border-radius: 3%;
190
415
  text-align:left;
191
416
  padding:15px;
417
+ background-color: rgba($color: #000000, $alpha: 0.6);
192
418
  .circle_pic
193
419
  {
194
420
  border-radius:50%;
195
421
  height:90px;
196
- border: 4px solid gray;
422
+ width: 90px;
423
+ border: 3px solid white;
197
424
  }
198
- .profile_name
425
+ .merchant__name
199
426
  {
200
- font-size:20px;
201
- font-weight:700;
427
+ display: grid;
202
428
  margin-left: 15px;
203
429
  margin-top: 25px;
204
430
  color:white;
431
+ .profile_name
432
+ {
433
+ font-size:20px;
434
+ font-weight:700;
435
+ }
205
436
  }
206
437
  }
207
438
  }
208
439
  .button-holder{
440
+ background-color: rgba($color: #000000, $alpha: 0.8);
209
441
  display: grid;
210
442
  grid-template-columns: 1fr 1fr;
211
- width: 370px;
212
443
  padding:10px;
444
+ .btn-color
445
+ {
446
+ background-color: white;
447
+ }
213
448
  }
214
449
  }
215
450
  .right
216
451
  {
452
+ display: grid;
453
+ align-items: center;
454
+ align-content: space-between;
455
+ padding: 5px 0;
217
456
  .product_list_div
218
457
  {
219
458
  text-align:left;
220
- padding:5px;
221
- padding-top:15px;
222
459
  }
223
460
  }
224
461
  }
@@ -229,4 +466,24 @@ export default {
229
466
  }
230
467
 
231
468
  }
469
+ .q-dialog
470
+ {
471
+ .rating-main-container
472
+ {
473
+ max-width: 400px;
474
+ padding: 10px 20px;
475
+ }
476
+ .icon-btn-main-holder
477
+ {
478
+ width: 100%;
479
+ display: flex;
480
+ justify-content: center;
481
+ grid-gap: 10px;
482
+ .material-icons
483
+ {
484
+ font-size: 40px;
485
+ cursor: pointer;
486
+ }
487
+ }
488
+ }
232
489
  </style>
package/models/DB_SLOT.js CHANGED
@@ -55,6 +55,23 @@ export default class DB_SLOT extends MODEL
55
55
  })
56
56
  }
57
57
 
58
+ return data;
59
+ }
60
+ async getSponsor(slot_code)
61
+ {
62
+ let res = await this.collection().where('slot_code', '==', slot_code).get();
63
+
64
+ let data = [];
65
+
66
+ if(!res.empty)
67
+ {
68
+ res.docs.forEach((d, i) =>
69
+ {
70
+ data[i] = d.data();
71
+ data[i].id = d.id;
72
+ })
73
+ }
74
+
58
75
  return data;
59
76
  }
60
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.601",
3
+ "version": "1.2.602",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {