geer-builder 1.2.949 → 1.2.951
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/GCart.vue +15 -1
- package/GCheckout.vue +7 -0
- package/GProductPage.vue +13 -0
- package/GReferralLink.vue +55 -3
- package/package.json +2 -1
package/GCart.vue
CHANGED
|
@@ -551,6 +551,14 @@ export default {
|
|
|
551
551
|
},
|
|
552
552
|
async changeQuantity(cart_det)
|
|
553
553
|
{
|
|
554
|
+
let is_renewal = cart_det.product_details && cart_det.product_details.membership_kit && (cart_det.product_details.membership_kit.use_for_renew === true || cart_det.product_details.membership_kit.use_for_renew === 'Yes');
|
|
555
|
+
if(is_renewal && cart_det.quantity > 1)
|
|
556
|
+
{
|
|
557
|
+
cart_det.quantity = 1;
|
|
558
|
+
this.$_fbCall('memberChangeCartQuantity', cart_det);
|
|
559
|
+
this.computeSubtotal();
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
554
562
|
if (cart_det.product_id != this.temp_product)
|
|
555
563
|
{
|
|
556
564
|
let product_query = "";
|
|
@@ -578,13 +586,19 @@ export default {
|
|
|
578
586
|
this.$_fbCall('memberChangeCartQuantity', cart_det);
|
|
579
587
|
}
|
|
580
588
|
else
|
|
581
|
-
{
|
|
589
|
+
{
|
|
582
590
|
this.$_fbCall('memberChangeCartQuantity', cart_det);
|
|
583
591
|
}
|
|
584
592
|
this.computeSubtotal();
|
|
585
593
|
},
|
|
586
594
|
async increaseQuantity(cart_det)
|
|
587
595
|
{
|
|
596
|
+
let is_renewal = cart_det.product_details && cart_det.product_details.membership_kit && (cart_det.product_details.membership_kit.use_for_renew === true || cart_det.product_details.membership_kit.use_for_renew === 'Yes');
|
|
597
|
+
if(is_renewal && cart_det.quantity >= 1)
|
|
598
|
+
{
|
|
599
|
+
swal({ title: "Limit Reached", text: "Renewal products are limited to 1 per order.", icon: "info" });
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
588
602
|
if (cart_det.product_id != this.temp_product)
|
|
589
603
|
{
|
|
590
604
|
let product_query = "";
|
package/GCheckout.vue
CHANGED
|
@@ -2786,6 +2786,13 @@ export default {
|
|
|
2786
2786
|
},
|
|
2787
2787
|
async addQuantity(i, ind)
|
|
2788
2788
|
{
|
|
2789
|
+
let prod_item = this.groupedProducts[i].products[ind];
|
|
2790
|
+
let is_renewal = prod_item.product && prod_item.product.membership_kit && (prod_item.product.membership_kit.use_for_renew === true || prod_item.product.membership_kit.use_for_renew === 'Yes');
|
|
2791
|
+
if(is_renewal && prod_item.quantity >= 1)
|
|
2792
|
+
{
|
|
2793
|
+
this.$q.dialog({ title: 'Limit Reached', message: 'Renewal products are limited to 1 per order.' });
|
|
2794
|
+
return;
|
|
2795
|
+
}
|
|
2789
2796
|
if (this.groupedProducts[i].products[ind].product_id != this.temp_product)
|
|
2790
2797
|
{
|
|
2791
2798
|
let product_query = "";
|
package/GProductPage.vue
CHANGED
|
@@ -1037,6 +1037,11 @@ export default {
|
|
|
1037
1037
|
|
|
1038
1038
|
},
|
|
1039
1039
|
methods:{
|
|
1040
|
+
isRenewalProduct()
|
|
1041
|
+
{
|
|
1042
|
+
let pd = this.variant_product_details ? this.variant_product_details : this.product_details;
|
|
1043
|
+
return pd && pd.membership_kit && (pd.membership_kit.use_for_renew === true || pd.membership_kit.use_for_renew === 'Yes');
|
|
1044
|
+
},
|
|
1040
1045
|
async chooseVariant(index,name)
|
|
1041
1046
|
{
|
|
1042
1047
|
if(this.selected_arra.some(val => val.hasOwnProperty('name') && val.name.toLowerCase() == name.toLowerCase() && val.hasOwnProperty('type') && this.product_details.variation[index].variation_type == val.type))
|
|
@@ -1132,6 +1137,7 @@ export default {
|
|
|
1132
1137
|
},
|
|
1133
1138
|
async addtocart()
|
|
1134
1139
|
{
|
|
1140
|
+
if(this.isRenewalProduct()) { this.quantity = 1; }
|
|
1135
1141
|
this.add_to_cart = true;
|
|
1136
1142
|
if(this.user_info)
|
|
1137
1143
|
{
|
|
@@ -1196,6 +1202,7 @@ export default {
|
|
|
1196
1202
|
},
|
|
1197
1203
|
buyNow()
|
|
1198
1204
|
{
|
|
1205
|
+
if(this.isRenewalProduct()) { this.quantity = 1; }
|
|
1199
1206
|
this.add_to_cart = false;
|
|
1200
1207
|
if(this.user_info)
|
|
1201
1208
|
{
|
|
@@ -1246,6 +1253,7 @@ export default {
|
|
|
1246
1253
|
},
|
|
1247
1254
|
async changeQuantity()
|
|
1248
1255
|
{
|
|
1256
|
+
if(this.isRenewalProduct() && this.quantity > 1) { this.quantity = 1; return; }
|
|
1249
1257
|
if(this.product_details.hasOwnProperty("stockist"))
|
|
1250
1258
|
{
|
|
1251
1259
|
if((this.quantity<=0) || (this.quantity == "") || this.quantity > this.merchant_product_stock)
|
|
@@ -1263,6 +1271,11 @@ export default {
|
|
|
1263
1271
|
},
|
|
1264
1272
|
async increaseQuantity()
|
|
1265
1273
|
{
|
|
1274
|
+
if(this.isRenewalProduct() && this.quantity >= 1)
|
|
1275
|
+
{
|
|
1276
|
+
swal({ title: "Limit Reached", text: "Renewal products are limited to 1 per order.", icon: "info" });
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1266
1279
|
if(this.product_details.hasOwnProperty("stockist"))
|
|
1267
1280
|
{
|
|
1268
1281
|
if(this.quantity<this.merchant_product_stock)
|
package/GReferralLink.vue
CHANGED
|
@@ -7,18 +7,33 @@
|
|
|
7
7
|
<div v-else-if="change_label_1">{{change_label_1}}</div>
|
|
8
8
|
<div v-else>Copy Referral Link</div>
|
|
9
9
|
</q-btn>
|
|
10
|
+
<!-- QR Code Section -->
|
|
11
|
+
<div v-if="show_qr && qr_data_url" class="q-mt-md" style="text-align: center;">
|
|
12
|
+
<img :src="qr_data_url" alt="QR Code" style="max-width: 250px;" />
|
|
13
|
+
<div class="q-mt-sm">
|
|
14
|
+
<q-btn @click="downloadQR()" color="primary" outline size="sm" class="q-mr-sm">
|
|
15
|
+
<q-icon name="fas fa-download" size="14px" class="q-mr-xs"></q-icon>
|
|
16
|
+
Download QR
|
|
17
|
+
</q-btn>
|
|
18
|
+
<q-btn @click="shareQR()" color="primary" outline size="sm">
|
|
19
|
+
<q-icon name="fas fa-share-alt" size="14px" class="q-mr-xs"></q-icon>
|
|
20
|
+
Share
|
|
21
|
+
</q-btn>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
10
24
|
<input style="opacity: 0" v-model="replicated_link" id="referral_link" type="text">
|
|
11
25
|
</div>
|
|
12
26
|
</template>
|
|
13
27
|
<script>
|
|
14
28
|
import GlobalMixins from './mixins/global_mixins';
|
|
29
|
+
import QRCode from 'qrcode';
|
|
15
30
|
|
|
16
31
|
export default
|
|
17
32
|
{
|
|
18
33
|
name: "GReferralLinkComponent",
|
|
19
34
|
components: {},
|
|
20
35
|
mixins: [GlobalMixins],
|
|
21
|
-
props: ['ref_link', 'is_company_ultrapro','change_label_1'],
|
|
36
|
+
props: ['ref_link', 'is_company_ultrapro', 'change_label_1', 'show_qr'],
|
|
22
37
|
filters: {},
|
|
23
38
|
data: () => (
|
|
24
39
|
{
|
|
@@ -27,6 +42,7 @@ export default
|
|
|
27
42
|
public_settings: {},
|
|
28
43
|
link: '',
|
|
29
44
|
settings_link: false,
|
|
45
|
+
qr_data_url: '',
|
|
30
46
|
}),
|
|
31
47
|
async mounted() {
|
|
32
48
|
await this.$_getSlotInfo();
|
|
@@ -43,6 +59,13 @@ export default
|
|
|
43
59
|
this.replicated_link = `https://${window.location.host}/#/invite/${replace_space}`;
|
|
44
60
|
}
|
|
45
61
|
this.loading = false;
|
|
62
|
+
|
|
63
|
+
// Generate QR code if show_qr prop is enabled
|
|
64
|
+
if (this.show_qr) {
|
|
65
|
+
QRCode.toDataURL(this.replicated_link, { width: 250, margin: 2 })
|
|
66
|
+
.then(function(url) { this.qr_data_url = url; }.bind(this))
|
|
67
|
+
.catch(function(err) { console.error('QR generation failed:', err); });
|
|
68
|
+
}
|
|
46
69
|
},
|
|
47
70
|
methods:
|
|
48
71
|
{
|
|
@@ -77,10 +100,39 @@ export default
|
|
|
77
100
|
color: 'black'
|
|
78
101
|
});
|
|
79
102
|
}
|
|
103
|
+
},
|
|
104
|
+
downloadQR() {
|
|
105
|
+
var link = document.createElement('a');
|
|
106
|
+
link.download = 'referral-qr-code.png';
|
|
107
|
+
link.href = this.qr_data_url;
|
|
108
|
+
link.click();
|
|
109
|
+
},
|
|
110
|
+
shareQR() {
|
|
111
|
+
var self = this;
|
|
112
|
+
if (navigator.share) {
|
|
113
|
+
fetch(this.qr_data_url)
|
|
114
|
+
.then(function(response) { return response.blob(); })
|
|
115
|
+
.then(function(blob) {
|
|
116
|
+
var file = new File([blob], 'referral-qr-code.png', { type: 'image/png' });
|
|
117
|
+
return navigator.share({
|
|
118
|
+
title: 'My Referral Link',
|
|
119
|
+
text: self.replicated_link,
|
|
120
|
+
files: [file]
|
|
121
|
+
});
|
|
122
|
+
})
|
|
123
|
+
.catch(function() {
|
|
124
|
+
// Fallback: just share the link text
|
|
125
|
+
if (navigator.share) {
|
|
126
|
+
navigator.share({ title: 'My Referral Link', text: self.replicated_link });
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
// Desktop fallback: copy link
|
|
131
|
+
this.copyLink();
|
|
132
|
+
}
|
|
80
133
|
}
|
|
81
|
-
|
|
82
134
|
},
|
|
83
135
|
computed: {}
|
|
84
136
|
}
|
|
85
137
|
</script>
|
|
86
|
-
<style lang="scss" scoped></style>
|
|
138
|
+
<style lang="scss" scoped></style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geer-builder",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.951",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"lodash": "^4.17.21",
|
|
20
20
|
"moment-timezone": "^0.5.33",
|
|
21
21
|
"philippine-location-json-for-geer": "^1.1.11",
|
|
22
|
+
"qrcode": "^1.5.3",
|
|
22
23
|
"soap": "^0.43.0",
|
|
23
24
|
"sweetalert": "^2.1.2",
|
|
24
25
|
"validator": "^13.5.2",
|