geer-builder 1.2.601 → 1.2.604
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 +88 -19
- package/GEcomStorePage.vue +299 -42
- package/GLogin.vue +30 -15
- package/components/UnplacedSlot/ManualPlaceDialog.vue +13 -8
- package/dialogs/SlotPlaceDialog.vue +4 -2
- package/models/DB_SLOT.js +17 -0
- package/package.json +1 -1
package/GCheckout.vue
CHANGED
|
@@ -439,6 +439,7 @@ export default {
|
|
|
439
439
|
gcash_fee:0,
|
|
440
440
|
show_gcash_fee:false,
|
|
441
441
|
online_payment_only:false,
|
|
442
|
+
package_free_shipping:false,
|
|
442
443
|
}),
|
|
443
444
|
async mounted()
|
|
444
445
|
{
|
|
@@ -451,18 +452,19 @@ export default {
|
|
|
451
452
|
this.payment_method_list = await this.$_getData('payment_method_list');
|
|
452
453
|
this.online_payment_index = this.payment_method_list.map(function(e) { return e.payment_method_id; }).indexOf('online_payment');
|
|
453
454
|
this.payment_account_list = await this.$_getData('payment_account_list');
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
455
|
+
|
|
456
|
+
// if( this.user_info.slot_owned > 0 && this.public_settings.hasOwnProperty('registration_sponsor') && this.public_settings.registration_sponsor.active)
|
|
457
|
+
// {
|
|
458
|
+
// if(this.user_info.hasOwnProperty('sponsor'))
|
|
459
|
+
// {
|
|
460
|
+
// sessionStorage.setItem('referral_slot_code', this.user_info.sponsor);
|
|
461
|
+
// }
|
|
462
|
+
// else
|
|
463
|
+
// {
|
|
464
|
+
// sessionStorage.setItem('referral_slot_code', this.public_settings.registration_sponsor.default_sponsor);
|
|
465
|
+
// }
|
|
466
|
+
// }
|
|
467
|
+
if(this.user_info.slot_owned >0)
|
|
466
468
|
{
|
|
467
469
|
if(sessionStorage.referral_slot_code)
|
|
468
470
|
{
|
|
@@ -475,9 +477,29 @@ export default {
|
|
|
475
477
|
{
|
|
476
478
|
sessionStorage.setItem('referral_slot_code', this.user_info.sponsor);
|
|
477
479
|
}
|
|
478
|
-
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if(this.public_settings.hasOwnProperty('registration_sponsor') && this.public_settings.registration_sponsor.active)
|
|
483
|
+
{
|
|
484
|
+
if(this.user_info.slot_owned > 0 )
|
|
485
|
+
{
|
|
486
|
+
let slot = await new DB_SLOT().getSponsor(this.user_info.active_slot);
|
|
487
|
+
if(slot.length>0)
|
|
488
|
+
{
|
|
489
|
+
let sponsor = slot[0].sponsor;
|
|
490
|
+
sessionStorage.setItem('reseller_slot_code', sponsor);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
else
|
|
479
494
|
{
|
|
480
|
-
|
|
495
|
+
if(this.user_info.hasOwnProperty('sponsor'))
|
|
496
|
+
{
|
|
497
|
+
sessionStorage.setItem('reseller_slot_code', this.user_info.sponsor);
|
|
498
|
+
}
|
|
499
|
+
else
|
|
500
|
+
{
|
|
501
|
+
sessionStorage.setItem('referral_slot_code', this.public_settings.registration_sponsor.default_sponsor);
|
|
502
|
+
}
|
|
481
503
|
}
|
|
482
504
|
}
|
|
483
505
|
|
|
@@ -486,6 +508,13 @@ export default {
|
|
|
486
508
|
this.product_list = Object.assign([], this.checkout_list);
|
|
487
509
|
await this.$_getSlotInfo();
|
|
488
510
|
await this.getordersbymerchant();
|
|
511
|
+
|
|
512
|
+
if(this.public_settings.hasOwnProperty('entry_package_free_shipping_fee') && this.public_settings.entry_package_free_shipping_fee)
|
|
513
|
+
{
|
|
514
|
+
await this.getFreePackageList();
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
|
|
489
518
|
await this.$bind('all_address', new DB_USER_SHIPPING_ADDRESS(this.user_info.uid).collection().where("archive","==",false));
|
|
490
519
|
|
|
491
520
|
let oneTime_checker = localStorage.getItem("oneTime_checker");
|
|
@@ -608,6 +637,27 @@ export default {
|
|
|
608
637
|
},
|
|
609
638
|
methods:
|
|
610
639
|
{
|
|
640
|
+
async getFreePackageList()
|
|
641
|
+
{
|
|
642
|
+
if(this.product_list.length !== 1) return
|
|
643
|
+
if(this.product_list.length > 0 && this.product_list[0].product.type !== 'Membership Kit') return
|
|
644
|
+
if(!this.product_list[0].product.membership_kit.free_shipping) return
|
|
645
|
+
this.package_free_shipping = true;
|
|
646
|
+
console.log('Free Shipping');
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
// if(this.product_list.length > 0 && this.product_list.length == 1)
|
|
650
|
+
// {
|
|
651
|
+
// if(this.product_list[0].product.type === 'Membership Kit')
|
|
652
|
+
// {
|
|
653
|
+
// if(this.product_list[0].product.membership_kit.hasOwnProperty('free_shipping') && this.product_list[0].product.membership_kit.free_shipping)
|
|
654
|
+
// {
|
|
655
|
+
// this.package_free_shipping = true;
|
|
656
|
+
// console.log('Free Shipping');
|
|
657
|
+
// }
|
|
658
|
+
// }
|
|
659
|
+
// }
|
|
660
|
+
},
|
|
611
661
|
async addGcashFee(product_list)
|
|
612
662
|
{
|
|
613
663
|
this.gcash_fee = 0;
|
|
@@ -1714,6 +1764,17 @@ export default {
|
|
|
1714
1764
|
voucher_total -= Number(voucher_deductions);
|
|
1715
1765
|
}
|
|
1716
1766
|
}
|
|
1767
|
+
|
|
1768
|
+
if(this.package_free_shipping)
|
|
1769
|
+
{
|
|
1770
|
+
for(let orders of this.checkout_info.orders)
|
|
1771
|
+
{
|
|
1772
|
+
orders.shipping_fee = 0;
|
|
1773
|
+
// orders.order_total -= orders.shipping_fee;
|
|
1774
|
+
shipping_total = 0;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1717
1778
|
this.checkout_info.grand_total = shipping_total + merchandise_subtotal + voucher_total;
|
|
1718
1779
|
this.checkout_info.sub_total = merchandise_subtotal;
|
|
1719
1780
|
this.checkout_info.voucher_total = voucher_total;
|
|
@@ -1840,6 +1901,10 @@ export default {
|
|
|
1840
1901
|
try
|
|
1841
1902
|
{
|
|
1842
1903
|
this.$q.loading.show();
|
|
1904
|
+
if(this.package_free_shipping)
|
|
1905
|
+
{
|
|
1906
|
+
this.checkout_info.package_free_shipping = this.package_free_shipping;
|
|
1907
|
+
}
|
|
1843
1908
|
if (!this.checkout_info["shipping_address"])
|
|
1844
1909
|
{
|
|
1845
1910
|
this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Shipping Address" }).onOk(async data =>
|
|
@@ -1881,9 +1946,9 @@ export default {
|
|
|
1881
1946
|
{
|
|
1882
1947
|
this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Insufficient GC" });
|
|
1883
1948
|
}
|
|
1884
|
-
else if(this.online_payment_only && !this.public_settings.
|
|
1949
|
+
else if(this.online_payment_only && !this.public_settings.membership_payment_method.includes(this.checkout_info.payment_method.payment_method_id))
|
|
1885
1950
|
{
|
|
1886
|
-
this.$q.dialog({ html: true, title: `Something's not quite right`, message: "
|
|
1951
|
+
this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Entry pacakge can only be purchased using wallet payment, dragon pay or manual pay" });
|
|
1887
1952
|
}
|
|
1888
1953
|
else
|
|
1889
1954
|
{
|
|
@@ -1891,6 +1956,10 @@ export default {
|
|
|
1891
1956
|
{
|
|
1892
1957
|
this.checkout_info.referral_slot_code = sessionStorage.referral_slot_code;
|
|
1893
1958
|
}
|
|
1959
|
+
if(sessionStorage.reseller_slot_code && this.payment_method.payment_method_id != "gc_points")
|
|
1960
|
+
{
|
|
1961
|
+
this.checkout_info.reseller_slot_code = sessionStorage.reseller_slot_code;
|
|
1962
|
+
}
|
|
1894
1963
|
if(this.checkout_info.payment_method.payment_method_id == "wallet")
|
|
1895
1964
|
{
|
|
1896
1965
|
this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
|
|
@@ -2055,15 +2124,15 @@ export default {
|
|
|
2055
2124
|
this.payment_method = this.payment_method_list[0];
|
|
2056
2125
|
|
|
2057
2126
|
this.product_list.forEach(element => {
|
|
2058
|
-
if(element.product.hasOwnProperty('membership_kit')
|
|
2127
|
+
if(element.product.hasOwnProperty('membership_kit'))
|
|
2059
2128
|
{
|
|
2060
2129
|
this.online_payment_only = true;
|
|
2061
2130
|
for( var i = 0; i < this.payment_method_list.length; i++)
|
|
2062
2131
|
{
|
|
2063
2132
|
// if (this.payment_method_list[i].payment_method_id == 'dragon_pay' || this.payment_method_list[i].payment_method_id == 'online_payment')
|
|
2064
|
-
if(this.public_settings.hasOwnProperty('
|
|
2133
|
+
if(this.public_settings.hasOwnProperty('membership_payment_method'))
|
|
2065
2134
|
{
|
|
2066
|
-
if(this.public_settings.
|
|
2135
|
+
if(this.public_settings.membership_payment_method.includes(this.payment_method_list[i].payment_method_id))
|
|
2067
2136
|
{
|
|
2068
2137
|
|
|
2069
2138
|
}
|
package/GEcomStorePage.vue
CHANGED
|
@@ -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
|
-
<
|
|
10
|
-
<div class="
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
29
|
-
<q-icon size="14px" class="q-mr-sm" name="fas fa-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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:
|
|
393
|
+
grid-template-columns: 1fr 1fr;
|
|
165
394
|
grid-gap: 10px;
|
|
166
395
|
padding: 10px;
|
|
167
396
|
.profile_holder
|
|
168
397
|
{
|
|
169
|
-
width:
|
|
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:
|
|
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
|
-
|
|
422
|
+
width: 90px;
|
|
423
|
+
border: 3px solid white;
|
|
197
424
|
}
|
|
198
|
-
.
|
|
425
|
+
.merchant__name
|
|
199
426
|
{
|
|
200
|
-
|
|
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/GLogin.vue
CHANGED
|
@@ -193,7 +193,7 @@ export default
|
|
|
193
193
|
|
|
194
194
|
/* start login */
|
|
195
195
|
const AccountClass = new FAccountClass();
|
|
196
|
-
|
|
196
|
+
let disable_login = false;
|
|
197
197
|
try
|
|
198
198
|
{
|
|
199
199
|
if(!this.is_submitting)
|
|
@@ -218,23 +218,38 @@ export default
|
|
|
218
218
|
disable_verified = true;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
if(this.public_settings.hasOwnProperty("functions") && this.public_settings.functions.login == false)
|
|
222
222
|
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
disable_login = true;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if(disable_login)
|
|
227
|
+
{
|
|
228
|
+
this.$q.dialog(
|
|
228
229
|
{
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
title: 'Ann Error Has Occured',
|
|
231
|
+
message: 'Login is currently disabled.'
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
else
|
|
234
235
|
{
|
|
235
|
-
this
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
await AccountClass.signIn(this.form_data.email, this.form_data.password, disable_verified).then((res) =>
|
|
237
|
+
{
|
|
238
|
+
if(res.hasOwnProperty('verified') && !res.verified && disable_verified == false)
|
|
239
|
+
{
|
|
240
|
+
this.is_resend_dialog = true;
|
|
241
|
+
}
|
|
242
|
+
else
|
|
243
|
+
{
|
|
244
|
+
this.$emit('success', this.form_data);
|
|
245
|
+
}
|
|
246
|
+
// let login = this.$_fbCall('loginAuditTrail', this.form_data);
|
|
247
|
+
|
|
248
|
+
}).catch((err) =>
|
|
249
|
+
{
|
|
250
|
+
this.$q.dialog({ title: `Invalid Login`, message: err });
|
|
251
|
+
});
|
|
252
|
+
}
|
|
238
253
|
this.is_submitting = false;
|
|
239
254
|
}
|
|
240
255
|
}
|
|
@@ -57,7 +57,7 @@ import DB_SLOT from '../../models/DB_SLOT';
|
|
|
57
57
|
await this.$_getSlotInfo()
|
|
58
58
|
this.loading = true;
|
|
59
59
|
this.public_settings = await this.$_getData('public_settings');
|
|
60
|
-
this.getDisableSlotList();
|
|
60
|
+
await this.getDisableSlotList();
|
|
61
61
|
this.getListOfUnplacedSlots();
|
|
62
62
|
this.field.placement = this.placement;
|
|
63
63
|
this.field.position = this.position;
|
|
@@ -67,12 +67,13 @@ import DB_SLOT from '../../models/DB_SLOT';
|
|
|
67
67
|
unplaced_slots()
|
|
68
68
|
{
|
|
69
69
|
this.disable_submit = false;
|
|
70
|
-
|
|
71
70
|
if(this.hide_slot)
|
|
72
71
|
{
|
|
72
|
+
console.log(this.hide_slot_list, 'log');
|
|
73
73
|
for( var i = 0; i < this.unplaced_slots.length; i++)
|
|
74
74
|
{
|
|
75
|
-
if ( this.hide_slot_list.includes(this.unplaced_slots[i].membership_id))
|
|
75
|
+
if (this.hide_slot_list.length > 0 && this.hide_slot_list.includes(this.unplaced_slots[i].membership_id))
|
|
76
|
+
{
|
|
76
77
|
this.unplaced_slots.splice(i, 1);
|
|
77
78
|
i--;
|
|
78
79
|
}
|
|
@@ -108,11 +109,15 @@ import DB_SLOT from '../../models/DB_SLOT';
|
|
|
108
109
|
{
|
|
109
110
|
async getDisableSlotList()
|
|
110
111
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
let membership_list = await this.$_getData('membership_list');
|
|
113
|
+
membership_list.map(mem => mem.hasOwnProperty('disable_binary') ? this.hide_slot_list.push(mem.membership_id) : '');
|
|
114
|
+
this.hide_slot = true;
|
|
115
|
+
|
|
116
|
+
// if(this.public_settings.hasOwnProperty('disable_slot_placement') && this.public_settings.disable_slot_placement.active)
|
|
117
|
+
// {
|
|
118
|
+
// this.hide_slot_list = this.public_settings.disable_slot_placement.membership_id ? this.public_settings.disable_slot_placement.membership_id : [];
|
|
119
|
+
// this.hide_slot = true;
|
|
120
|
+
// }
|
|
116
121
|
},
|
|
117
122
|
async getListOfUnplacedSlots()
|
|
118
123
|
{
|
|
@@ -56,7 +56,7 @@ export default
|
|
|
56
56
|
await this.$_getSlotInfo()
|
|
57
57
|
this.public_settings = await this.$_getData('public_settings');
|
|
58
58
|
this.loading = true;
|
|
59
|
-
this.getDisableSlotList();
|
|
59
|
+
await this.getDisableSlotList();
|
|
60
60
|
this.getListOfUnplacedSlots();
|
|
61
61
|
this.field.placement = this.placement;
|
|
62
62
|
this.field.position = this.position;
|
|
@@ -103,8 +103,10 @@ export default
|
|
|
103
103
|
{
|
|
104
104
|
if(this.public_settings.hasOwnProperty('disable_slot_placement') && this.public_settings.disable_slot_placement.active)
|
|
105
105
|
{
|
|
106
|
-
|
|
106
|
+
let membership_list = await this.$_getData('membership_list');
|
|
107
|
+
membership_list.map(mem => mem.hasOwnProperty('disable_binary') ? this.hide_slot_list.push(mem.membership_id) : '');
|
|
107
108
|
this.hide_slot = true;
|
|
109
|
+
console.log(this.hide_slot);
|
|
108
110
|
}
|
|
109
111
|
},
|
|
110
112
|
async getListOfUnplacedSlots()
|
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
|
}
|