geer-builder 1.2.599 → 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 +39 -14
- package/GEcomStorePage.vue +318 -38
- package/GProcessSale.vue +8 -3
- package/GProductList.vue +34 -15
- package/GRequestProduct.vue +1 -0
- package/models/DB_SLOT.js +17 -0
- package/package.json +1 -1
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
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
package/GEcomStorePage.vue
CHANGED
|
@@ -2,25 +2,86 @@
|
|
|
2
2
|
<div class="ecom_page">
|
|
3
3
|
<!-- <div class="section-seller-overview-horizontal__leading"><div class="section-seller-overview-horizontal__leading-background" :style="'background-image: url('+this.user_info.profile_picture+');'"></div><div class="section-seller-overview-horizontal__leading-background-mask"></div><div class="section-seller-overview-horizontal__leading-content"><div class="section-seller-overview-horizontal__seller-portrait"><a class="section-seller-overview-horizontal__seller-portrait-link" href="/smokocc1.ph"><div class="shopee-avatar"><div class="shopee-avatar__placeholder"><svg class="shopee-svg-icon icon-headshot" enable-background="new 0 0 15 15" viewBox="0 0 15 15" x="0" y="0"><g><circle cx="7.5" cy="4.5" fill="none" r="3.8" stroke-miterlimit="10"></circle><path d="m1.5 14.2c0-3.3 2.7-6 6-6s6 2.7 6 6" fill="none" stroke-linecap="round" stroke-miterlimit="10"></path></g></svg></div><img class="shopee-avatar__img" :src="this.user_info.profile_picture"></div><div class="section-seller-overview-horizontal__preferred-badge-wrapper"><div class="horizontal-badge shopee-preferred-seller-badge horizontal-badge--no-triangle">Preferred</div></div></a><div class="section-seller-overview-horizontal__portrait-info"><h1 class="section-seller-overview-horizontal__portrait-name">KPOP BTS BT21 Star</h1><div class="section-seller-overview-horizontal__portrait-status"><div class="section-seller-overview-horizontal__active-time">Active 40 minutes ago</div></div></div></div><div class="section-seller-overview-horizontal__buttons"><div class="section-seller-overview-horizontal__button"><button class="shopee-button-outline shopee-button-outline--complement shopee-button-outline--fill "><span class="section-seller-overview-horizontal__icon"><svg class="shopee-svg-icon icon-plus-sign" enable-background="new 0 0 10 10" viewBox="0 0 10 10" x="0" y="0"><polygon points="10 4.5 5.5 4.5 5.5 0 4.5 0 4.5 4.5 0 4.5 0 5.5 4.5 5.5 4.5 10 5.5 10 5.5 5.5 10 5.5"></polygon></svg></span>follow</button></div><div class="section-seller-overview-horizontal__button"><button class="shopee-button-outline shopee-button-outline--complement shopee-button-outline--fill shopee-button-outline-- "><span class="section-seller-overview-horizontal__icon"><svg class="shopee-svg-icon " viewBox="0 0 16 16"><g fill-rule="evenodd"><path d="M15 4a1 1 0 01.993.883L16 5v9.932a.5.5 0 01-.82.385l-2.061-1.718-8.199.001a1 1 0 01-.98-.8l-.016-.117-.108-1.284 8.058.001a2 2 0 001.976-1.692l.018-.155L14.293 4H15zm-2.48-4a1 1 0 011 1l-.003.077-.646 8.4a1 1 0 01-.997.923l-8.994-.001-2.06 1.718a.5.5 0 01-.233.108l-.087.007a.5.5 0 01-.492-.41L0 11.732V1a1 1 0 011-1h11.52zM3.646 4.246a.5.5 0 000 .708c.305.304.694.526 1.146.682A4.936 4.936 0 006.4 5.9c.464 0 1.02-.062 1.608-.264.452-.156.841-.378 1.146-.682a.5.5 0 10-.708-.708c-.185.186-.445.335-.764.444a4.004 4.004 0 01-2.564 0c-.319-.11-.579-.258-.764-.444a.5.5 0 00-.708 0z"></path></g></svg></span>chat</button></div></div></div></div> -->
|
|
4
4
|
<!-- <img :src="this.user_info.profile_picture"/> -->
|
|
5
|
-
<div class="
|
|
6
|
-
<div class="
|
|
7
|
-
<div class="profile_bg" :style="`background-image:url('`+this.merchant_info.profile_picture+`');`">
|
|
5
|
+
<div class="ecom_page_body">
|
|
6
|
+
<div class="profile_holder">
|
|
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>
|
|
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>
|
|
12
33
|
</div>
|
|
13
34
|
</div>
|
|
14
35
|
<div class="right">
|
|
15
|
-
<div class="product_list_div">
|
|
16
|
-
<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}}
|
|
17
38
|
</div>
|
|
18
|
-
<div
|
|
19
|
-
<q-icon size="14px" class="q-mr-sm" name="fas fa-
|
|
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})}}
|
|
46
|
+
</div>
|
|
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 "}}
|
|
20
53
|
</div>
|
|
21
54
|
</div>
|
|
22
55
|
</div>
|
|
23
|
-
<
|
|
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>
|
|
84
|
+
<!-- <div class="product-list-container">
|
|
24
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>
|
|
25
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>
|
|
26
87
|
<g-product-list height=100px width=100px image_size=98px background_color="white" product_per_page="6" :slot_code="slot_code" :category="category_choice" :sort_by="sortName" :sort_arrangement="this.arrangement" @click=getProductId></g-product-list>
|
|
@@ -37,7 +98,7 @@
|
|
|
37
98
|
</q-bar>
|
|
38
99
|
<g-product-page :product_id="productid" @addToCart="addCart"></g-product-page>
|
|
39
100
|
</div>
|
|
40
|
-
</q-dialog>
|
|
101
|
+
</q-dialog> -->
|
|
41
102
|
</div>
|
|
42
103
|
</template>
|
|
43
104
|
<script>
|
|
@@ -45,6 +106,7 @@ import GlobalMixins from './mixins/global_mixins.js';
|
|
|
45
106
|
import DB_PRODUCTS from './models/DB_PRODUCT';
|
|
46
107
|
import DB_CATEGORIES from './models/DB_CATEGORIES';
|
|
47
108
|
import DB_USER from './models/DB_USER';
|
|
109
|
+
import DB_SLOT from './models/DB_SLOT';
|
|
48
110
|
import GProductList from './GProductList';
|
|
49
111
|
import GProductPage from './GProductPage';
|
|
50
112
|
|
|
@@ -58,6 +120,8 @@ export default {
|
|
|
58
120
|
},
|
|
59
121
|
data: () =>
|
|
60
122
|
({
|
|
123
|
+
is_rating_dialog: false,
|
|
124
|
+
rate: 0,
|
|
61
125
|
product_list:"",
|
|
62
126
|
categories_list: [],
|
|
63
127
|
category_choice: "",
|
|
@@ -68,28 +132,122 @@ export default {
|
|
|
68
132
|
openInfo: false,
|
|
69
133
|
productid: "",
|
|
70
134
|
merchant_info: {created_date:{seconds: "", nanoseconds: ""}},
|
|
135
|
+
merchant_slot:{},
|
|
136
|
+
field:{},
|
|
137
|
+
ratings_data: {},
|
|
138
|
+
is_following: false,
|
|
139
|
+
mode:'follow',
|
|
71
140
|
}),
|
|
72
141
|
async mounted()
|
|
73
142
|
{
|
|
74
143
|
if(this.slot_code)
|
|
75
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'));
|
|
76
|
-
this.getCategories();
|
|
77
|
-
this.getUserInfo();
|
|
145
|
+
await this.getCategories();
|
|
146
|
+
await this.getUserInfo();
|
|
78
147
|
},
|
|
79
148
|
methods:
|
|
80
149
|
{
|
|
150
|
+
async openMerchantPage()
|
|
151
|
+
{
|
|
152
|
+
this.$router.push({ name: 'front_merchant_page', params: { 'stockist': this.slot_code}});
|
|
153
|
+
},
|
|
154
|
+
async openMerchantChat()
|
|
155
|
+
{
|
|
156
|
+
|
|
157
|
+
},
|
|
81
158
|
async getUserInfo()
|
|
82
159
|
{
|
|
83
160
|
if (this.slot_code)
|
|
84
161
|
{
|
|
85
|
-
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();
|
|
86
163
|
}
|
|
87
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
|
+
}
|
|
88
189
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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)";
|
|
92
246
|
},
|
|
247
|
+
// monthDiff(dateFrom, dateTo) {
|
|
248
|
+
// return dateTo.getMonth() - dateFrom.getMonth() +
|
|
249
|
+
// (12 * (dateTo.getFullYear() - dateFrom.getFullYear()))
|
|
250
|
+
// },
|
|
93
251
|
async getCategories()
|
|
94
252
|
{
|
|
95
253
|
let getCategories = await new DB_CATEGORIES().collection().get();
|
|
@@ -132,6 +290,96 @@ export default {
|
|
|
132
290
|
{
|
|
133
291
|
this.openInfo=false;
|
|
134
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
|
+
}
|
|
135
383
|
}
|
|
136
384
|
}
|
|
137
385
|
</script>
|
|
@@ -140,62 +388,74 @@ export default {
|
|
|
140
388
|
.ecom_page
|
|
141
389
|
{
|
|
142
390
|
width: 100%;
|
|
143
|
-
.
|
|
144
|
-
height:180px;
|
|
391
|
+
.ecom_page_body{
|
|
145
392
|
display: grid;
|
|
146
|
-
grid-template-columns:
|
|
393
|
+
grid-template-columns: 1fr 1fr;
|
|
147
394
|
grid-gap: 10px;
|
|
148
395
|
padding: 10px;
|
|
149
|
-
.
|
|
396
|
+
.profile_holder
|
|
150
397
|
{
|
|
151
|
-
|
|
152
|
-
|
|
398
|
+
width: 100%;
|
|
399
|
+
background-color: rgba(0,0,0,0.6);
|
|
400
|
+
height: 100%;
|
|
401
|
+
border-radius: 5px;
|
|
402
|
+
overflow: hidden;
|
|
153
403
|
.profile_bg
|
|
154
404
|
{
|
|
155
405
|
position: relative;
|
|
156
406
|
display: inline-block;
|
|
157
407
|
line-height: 0;
|
|
158
|
-
width:
|
|
159
|
-
height: 130px;
|
|
160
|
-
background-size: 90% auto;
|
|
161
|
-
background-position: center;
|
|
408
|
+
width: 100%;
|
|
162
409
|
background-repeat: no-repeat;
|
|
163
|
-
border: 1px solid #cccccc;
|
|
164
410
|
border-radius: 5px;
|
|
165
|
-
margin: 5px;
|
|
166
|
-
border-radius: 3%;
|
|
167
411
|
.dp
|
|
168
412
|
{
|
|
169
413
|
display:flex;
|
|
170
|
-
background-color: rgba(0,0,0,0.6);
|
|
171
414
|
height:130px;
|
|
172
|
-
border-radius: 3%;
|
|
173
415
|
text-align:left;
|
|
174
416
|
padding:15px;
|
|
417
|
+
background-color: rgba($color: #000000, $alpha: 0.6);
|
|
175
418
|
.circle_pic
|
|
176
419
|
{
|
|
177
420
|
border-radius:50%;
|
|
178
421
|
height:90px;
|
|
179
|
-
|
|
422
|
+
width: 90px;
|
|
423
|
+
border: 3px solid white;
|
|
180
424
|
}
|
|
181
|
-
.
|
|
425
|
+
.merchant__name
|
|
182
426
|
{
|
|
183
|
-
|
|
184
|
-
font-weight:700;
|
|
427
|
+
display: grid;
|
|
185
428
|
margin-left: 15px;
|
|
186
429
|
margin-top: 25px;
|
|
187
430
|
color:white;
|
|
431
|
+
.profile_name
|
|
432
|
+
{
|
|
433
|
+
font-size:20px;
|
|
434
|
+
font-weight:700;
|
|
435
|
+
}
|
|
188
436
|
}
|
|
189
437
|
}
|
|
190
438
|
}
|
|
439
|
+
.button-holder{
|
|
440
|
+
background-color: rgba($color: #000000, $alpha: 0.8);
|
|
441
|
+
display: grid;
|
|
442
|
+
grid-template-columns: 1fr 1fr;
|
|
443
|
+
padding:10px;
|
|
444
|
+
.btn-color
|
|
445
|
+
{
|
|
446
|
+
background-color: white;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
191
449
|
}
|
|
192
450
|
.right
|
|
193
451
|
{
|
|
452
|
+
display: grid;
|
|
453
|
+
align-items: center;
|
|
454
|
+
align-content: space-between;
|
|
455
|
+
padding: 5px 0;
|
|
194
456
|
.product_list_div
|
|
195
457
|
{
|
|
196
458
|
text-align:left;
|
|
197
|
-
padding:5px;
|
|
198
|
-
padding-top:15px;
|
|
199
459
|
}
|
|
200
460
|
}
|
|
201
461
|
}
|
|
@@ -206,4 +466,24 @@ export default {
|
|
|
206
466
|
}
|
|
207
467
|
|
|
208
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
|
+
}
|
|
209
489
|
</style>
|
package/GProcessSale.vue
CHANGED
|
@@ -237,6 +237,8 @@ import AddBatchDialog from "./components/AddBatchDialog";
|
|
|
237
237
|
import GlobalMixins from './mixins/global_mixins.js';
|
|
238
238
|
import SaleChooseSlotDialog from "./components/SaleChooseSlotDialog";
|
|
239
239
|
import ProductClass from './classes/ProductClass';
|
|
240
|
+
import DB_USER_SHIPPING_ADDRESS from './models/DB_USER_SHIPPING_ADDRESS';
|
|
241
|
+
|
|
240
242
|
|
|
241
243
|
|
|
242
244
|
export default
|
|
@@ -289,6 +291,7 @@ export default
|
|
|
289
291
|
show_address:false,
|
|
290
292
|
auto_fill_address:'',
|
|
291
293
|
auto_fill_contact:'',
|
|
294
|
+
all_address:[],
|
|
292
295
|
}),
|
|
293
296
|
props: ['stockist'],
|
|
294
297
|
components: { AddBatchDialog, GProduct, ProcessSaleConfirmDialog, DiscountDialog, AddPaymentDialog, SaleChooseSlotDialog,ManagerOverrideDialog },
|
|
@@ -475,12 +478,14 @@ export default
|
|
|
475
478
|
{
|
|
476
479
|
if(this.public_settings.hasOwnProperty('cashier_auto_fill_address') && this.public_settings.cashier_auto_fill_address)
|
|
477
480
|
{
|
|
481
|
+
|
|
478
482
|
let customer_info = await new DB_USER().collection().where("email", "==", this.field.email).get();
|
|
479
|
-
|
|
483
|
+
await this.$bind('all_address', new DB_USER_SHIPPING_ADDRESS(customer_info.docs[0].data().uid).collection().orderBy("default","desc"));
|
|
484
|
+
if(this.all_address.length > 0)
|
|
480
485
|
{
|
|
481
486
|
this.show_address = true;
|
|
482
|
-
this.auto_fill_address =
|
|
483
|
-
this.auto_fill_contact =
|
|
487
|
+
this.auto_fill_address = `${this.all_address[0].province.name}, ${this.all_address[0].city.name}`;
|
|
488
|
+
this.auto_fill_contact = this.all_address[0].phone_number;
|
|
484
489
|
}
|
|
485
490
|
}
|
|
486
491
|
|
package/GProductList.vue
CHANGED
|
@@ -15,15 +15,6 @@
|
|
|
15
15
|
<template v-if="cashback">
|
|
16
16
|
<div class="cashback-badge" v-if="field.item_pv>0"><div class="cashback-label">Cashback: </div> <div class="cashback-value">{{$_formatNumber((field.item_pv/12), { decimal: 2})}} </div></div>
|
|
17
17
|
</template>
|
|
18
|
-
<div class="product-ratings"v-if="show_ratings" :style="field.ratings <=0 ? 'width:45%' : ''">
|
|
19
|
-
<div class="ratings-total" :style="field.ratings <=0 ? 'color: gray;' : ''"><div style="margin-right:3px;">{{field.ratings >0 ? field.ratings : 'No Ratings yet' }}</div><q-rating v-if="field.total_reviews" v-model="field.ratings" size="15px" color="primary" readonly/> </div>
|
|
20
|
-
<div class="ratings-count" v-if="field.total_reviews"><div style="margin-right:3px;color:black">{{field.total_reviews? nFormatter(Number(field.total_reviews), 1) : '' }}</div><div>{{field.total_reviews ? 'Ratings' : '' }}</div></div>
|
|
21
|
-
<div class="product-sold">
|
|
22
|
-
<div style="margin-right:3px;color:black">{{field.sold_count? nFormatter(Number(field.sold_count), 1) : 0 }}</div>
|
|
23
|
-
<div>{{'Sold'}}</div>
|
|
24
|
-
</div>
|
|
25
|
-
<!-- <div class="product-sold"></div> -->
|
|
26
|
-
</div>
|
|
27
18
|
<template v-if="show_reseller_commission && field.referral_commission > 0 ">
|
|
28
19
|
<div class="commission-badge">
|
|
29
20
|
<div class="commission-label">rc: </div>
|
|
@@ -46,6 +37,33 @@
|
|
|
46
37
|
<div class="add-cart" v-if="show_button">View Product</div>
|
|
47
38
|
</div>
|
|
48
39
|
<div v-else class="prod_price price">GC {{$_formatNumber(field.gc_price, { decimal: 2})}}</div>
|
|
40
|
+
<div class="ratings-grid">
|
|
41
|
+
<div class="product-ratings" v-if="show_ratings">
|
|
42
|
+
<div class="ratings-total" :style="field.ratings <=0 ? 'color: gray;' : ''">
|
|
43
|
+
<div style="margin-right:3px;">{{field.ratings >0 ? field.ratings : 'No Ratings yet' }}</div>
|
|
44
|
+
<q-rating v-if="field.total_reviews" v-model="field.ratings" size="15px" color="primary" readonly/>
|
|
45
|
+
</div>
|
|
46
|
+
<!-- <div class="ratings-count" v-if="field.total_reviews">
|
|
47
|
+
<div style="margin-right:3px;color:black">{{field.total_reviews? nFormatter(Number(field.total_reviews), 1) : '' }}</div>
|
|
48
|
+
<div>{{field.total_reviews ? 'Ratings' : '' }}</div>
|
|
49
|
+
</div> -->
|
|
50
|
+
<div class="product-sold">
|
|
51
|
+
<div style="margin-right:3px;color:black">{{field.sold_count? nFormatter(Number(field.sold_count), 1) : 0 }}</div>
|
|
52
|
+
<div>{{'Sold'}}</div>
|
|
53
|
+
</div>
|
|
54
|
+
<!-- <div class="product-sold"></div> -->
|
|
55
|
+
</div>
|
|
56
|
+
<div class="merchant-details" v-if="field.merchant_details && show_merchant_details">
|
|
57
|
+
<div class="merchant-city">
|
|
58
|
+
{{field.merchant_details.pickup_address.city.name}}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="merchant-details" v-else>
|
|
62
|
+
<div class="merchant-city">
|
|
63
|
+
No Address Set
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
49
67
|
</div>
|
|
50
68
|
</div>
|
|
51
69
|
</div>
|
|
@@ -97,7 +115,9 @@ export default {
|
|
|
97
115
|
show_merchant_discount:Boolean,
|
|
98
116
|
show_ratings:Boolean,
|
|
99
117
|
show_button:Boolean,
|
|
100
|
-
is_membership_only:Boolean
|
|
118
|
+
is_membership_only:Boolean,
|
|
119
|
+
reseller_commission:Boolean,
|
|
120
|
+
show_merchant_details:Boolean
|
|
101
121
|
},
|
|
102
122
|
data: () =>
|
|
103
123
|
({
|
|
@@ -129,7 +149,7 @@ export default {
|
|
|
129
149
|
this.public_settings = await this.$_getData('public_settings');
|
|
130
150
|
this.main_currency = this.public_settings.main_currency;
|
|
131
151
|
this.prod_per_page = this.product_per_page;
|
|
132
|
-
if(this.public_settings.hasOwnProperty('referral_commission_earning'))
|
|
152
|
+
if(this.public_settings.hasOwnProperty('referral_commission_earning') && this.reseller_commission)
|
|
133
153
|
{
|
|
134
154
|
if(this.public_settings.referral_commission_earning) this.show_reseller_commission = true;
|
|
135
155
|
}
|
|
@@ -302,6 +322,7 @@ export default {
|
|
|
302
322
|
}
|
|
303
323
|
if(Number(limit+remove_prod_count)>0)
|
|
304
324
|
querry = querry.limit(Number(limit+remove_prod_count));
|
|
325
|
+
|
|
305
326
|
// querry = querry.limit(this.product_per_page)
|
|
306
327
|
if(loadmore)
|
|
307
328
|
{
|
|
@@ -344,8 +365,8 @@ export default {
|
|
|
344
365
|
{
|
|
345
366
|
this.first_load_done=false;
|
|
346
367
|
await this.$bind('new_product_list', querry);
|
|
347
|
-
let filt = this.new_product_list.map(prod =>
|
|
348
|
-
|
|
368
|
+
let filt = this.new_product_list.map(prod =>
|
|
369
|
+
{
|
|
349
370
|
if(prod.activated_only && this.user_info && !this.user_info.hasOwnProperty('active_slot') || prod.activated_only && !this.user_info)
|
|
350
371
|
{
|
|
351
372
|
return false;
|
|
@@ -355,12 +376,10 @@ export default {
|
|
|
355
376
|
return false;
|
|
356
377
|
}
|
|
357
378
|
return prod;
|
|
358
|
-
|
|
359
379
|
});
|
|
360
380
|
let filtered = filt.filter(Boolean);
|
|
361
381
|
this.new_product_list = filtered;
|
|
362
382
|
this.first_load_done=true;
|
|
363
|
-
console.log(this.new_product_list);
|
|
364
383
|
}
|
|
365
384
|
},
|
|
366
385
|
openproduct(product){
|
package/GRequestProduct.vue
CHANGED
|
@@ -461,6 +461,7 @@
|
|
|
461
461
|
this.product_details.transaction_fee = this.transaction_fee;
|
|
462
462
|
this.product_details.stockist = this.current_slot_info.slot_code;
|
|
463
463
|
this.product_details.user_info_uid = this.user_info.uid;
|
|
464
|
+
this.product_details.merchant_details = this.current_slot_info.merchant_details;
|
|
464
465
|
this.product_details.primary_picture=this.product_details.product_pictures[0];
|
|
465
466
|
this.$q.loading.show();
|
|
466
467
|
await this.$_fbCall('memberRequestProduct', this.product_details);
|
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
|
}
|