@nuskin/product-components 3.19.2-mdigi-9080.2 → 3.20.0-mdigi-7127.2
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/.releaserc +1 -1
- package/components/NsProductList.vue +9 -1
- package/docs/CHANGELOG.md +1 -1
- package/mixins/NsProductMixin.js +0 -44
- package/package.json +1 -1
package/.releaserc
CHANGED
|
@@ -46,8 +46,9 @@
|
|
|
46
46
|
|
|
47
47
|
<script>
|
|
48
48
|
import { NsExpressiveLink, NsIcon, NsSpinner } from "@nuskin/design-components";
|
|
49
|
-
import { StringService } from "@nuskin/ns-util";
|
|
49
|
+
import { StringService, RunConfigService, events } from "@nuskin/ns-util";
|
|
50
50
|
import { fromJsonString } from "@nuskin/ns-common-lib";
|
|
51
|
+
import { CurrencyService } from "@nuskin/ns-shop";
|
|
51
52
|
|
|
52
53
|
import NsProductCard from "./NsProductCard.vue";
|
|
53
54
|
|
|
@@ -172,6 +173,13 @@ export default {
|
|
|
172
173
|
},
|
|
173
174
|
async mounted() {
|
|
174
175
|
await this.setCommonStrings();
|
|
176
|
+
const runConfig = RunConfigService.getRunConfig();
|
|
177
|
+
this.currencyCode = CurrencyService.getCurrency(runConfig.country).currencyCode;
|
|
178
|
+
events.publish(events.shop.PAGE_VIEW, {
|
|
179
|
+
event: 'pageView',
|
|
180
|
+
pageType: 'category',
|
|
181
|
+
currency: this.currencyCode
|
|
182
|
+
});
|
|
175
183
|
},
|
|
176
184
|
methods: {
|
|
177
185
|
handleProductUpdate(product) {
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
# [3.20.0-mdigi-7127.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.20.0-mdigi-7127.1...v3.20.0-mdigi-7127.2) (2026-01-02)
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -350,16 +350,6 @@ const NsProductMixin = {
|
|
|
350
350
|
},
|
|
351
351
|
methods: {
|
|
352
352
|
async init() {
|
|
353
|
-
const uniqueProduct = this.getUniqueProduct();
|
|
354
|
-
const productsList = Array.isArray(uniqueProduct.products)
|
|
355
|
-
? uniqueProduct.products
|
|
356
|
-
: [];
|
|
357
|
-
const idValue = productsList
|
|
358
|
-
.map(item => item.sku)
|
|
359
|
-
.filter(Boolean)
|
|
360
|
-
.map(String);
|
|
361
|
-
this.active = idValue.length ? idValue : this.sku;
|
|
362
|
-
console.log("the value is of Id is ...... " + this.sku);
|
|
363
353
|
this.setTranslations();
|
|
364
354
|
await this.$nextTick();
|
|
365
355
|
|
|
@@ -1622,40 +1612,6 @@ const NsProductMixin = {
|
|
|
1622
1612
|
});
|
|
1623
1613
|
}
|
|
1624
1614
|
return text || "";
|
|
1625
|
-
},
|
|
1626
|
-
|
|
1627
|
-
deepEqual(varientValue, variantData) {
|
|
1628
|
-
return JSON.stringify(varientValue) === JSON.stringify(variantData);
|
|
1629
|
-
},
|
|
1630
|
-
|
|
1631
|
-
getUniqueProduct() {
|
|
1632
|
-
if (
|
|
1633
|
-
typeof sessionStorage === "undefined" ||
|
|
1634
|
-
!sessionStorage.getItem("personalOffer")
|
|
1635
|
-
) {
|
|
1636
|
-
return { products: [] };
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
const variantCheck = JSON.parse(
|
|
1640
|
-
sessionStorage.getItem("personalOffer")
|
|
1641
|
-
) || { products: [] };
|
|
1642
|
-
|
|
1643
|
-
if (!variantCheck.products || !Array.isArray(variantCheck.products)) {
|
|
1644
|
-
return { products: [] };
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
const unique = [];
|
|
1648
|
-
variantCheck.products.forEach(product => {
|
|
1649
|
-
const exists = unique.some(
|
|
1650
|
-
u =>
|
|
1651
|
-
u.sku === product.sku &&
|
|
1652
|
-
this.deepEqual(u.variantSelected, product.variantSelected)
|
|
1653
|
-
);
|
|
1654
|
-
if (!exists) {
|
|
1655
|
-
unique.push(product);
|
|
1656
|
-
}
|
|
1657
|
-
});
|
|
1658
|
-
return { products: unique };
|
|
1659
1615
|
}
|
|
1660
1616
|
}
|
|
1661
1617
|
};
|