@nuskin/product-components 3.18.0 → 4.0.0-cx15-11969.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/NsProductCarousel.vue +0 -38
- package/docs/CHANGELOG.md +1 -1
- package/gl-sbom-npm-yarn.cdx.json +169 -168
- package/index.js +1 -5
- package/package.json +1 -3
- package/assets/imageplaceholder.svg +0 -39
- package/components/NsProductRecsCarousel.vue +0 -155
- package/components/NuHomeCloneProductCarousel/Carousel.vue +0 -209
- package/components/NuHomeCloneProductCarousel/CarouselChevron.vue +0 -93
- package/components/NuHomeCloneProductCarousel/Loader.vue +0 -72
- package/components/NuHomeCloneProductCarousel/NuHomeCloneProductCarousel.vue +0 -1100
- package/components/NuHomeCloneProductCarousel/Price.vue +0 -147
- package/mixins/globalHelper.js +0 -66
- package/models/product.js +0 -140
- package/services/NsProductContentService.js +0 -147
- package/services/NsProductRecommendationClient.js +0 -66
package/.releaserc
CHANGED
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
<script>
|
|
33
33
|
import { PopularProductsService } from "@nuskin/ns-product";
|
|
34
|
-
import { getRecommendations } from "@nuskin/product-recommendation";
|
|
35
34
|
import { NsCarousel } from "@nuskin/design-components";
|
|
36
|
-
import { CartService } from "@nuskin/ns-shop";
|
|
37
35
|
|
|
38
36
|
import NsProductCard from "./NsProductCard.vue";
|
|
39
37
|
|
|
@@ -146,9 +144,6 @@ export default {
|
|
|
146
144
|
},
|
|
147
145
|
setSkusByType(type) {
|
|
148
146
|
switch (type) {
|
|
149
|
-
case "recommended":
|
|
150
|
-
this.setSkusWithRecommendedProducts();
|
|
151
|
-
break;
|
|
152
147
|
case "popular":
|
|
153
148
|
this.setSkusWithPopularProducts();
|
|
154
149
|
break;
|
|
@@ -156,39 +151,6 @@ export default {
|
|
|
156
151
|
this.localSkus = this.skus;
|
|
157
152
|
}
|
|
158
153
|
},
|
|
159
|
-
async setSkusWithRecommendedProducts() {
|
|
160
|
-
try {
|
|
161
|
-
let options = {};
|
|
162
|
-
let unique = [];
|
|
163
|
-
let cartSkus = [];
|
|
164
|
-
|
|
165
|
-
if (CartService.getItemData().length > 0) {
|
|
166
|
-
cartSkus = CartService.getItemData().map(item => item.sku);
|
|
167
|
-
options.productSkus = cartSkus;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
let recommendedProducts = await getRecommendations(options);
|
|
171
|
-
if (recommendedProducts) {
|
|
172
|
-
recommendedProducts.sort((a, b) => (a.type > b.type ? 1 : -1));
|
|
173
|
-
|
|
174
|
-
unique = Array.from(
|
|
175
|
-
new Set(recommendedProducts.map(item => item.sku))
|
|
176
|
-
)
|
|
177
|
-
.map(sku => {
|
|
178
|
-
return {
|
|
179
|
-
sku: sku,
|
|
180
|
-
type: recommendedProducts.find(item => item.sku === sku).type
|
|
181
|
-
};
|
|
182
|
-
})
|
|
183
|
-
.filter(item => !cartSkus.includes(item.sku));
|
|
184
|
-
|
|
185
|
-
this.localSkus = unique.map(recommendation => recommendation.sku);
|
|
186
|
-
}
|
|
187
|
-
} catch (err) {
|
|
188
|
-
console.log(err);
|
|
189
|
-
this.localSkus = [];
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
154
|
async setSkusWithPopularProducts() {
|
|
193
155
|
const popularProducts = await PopularProductsService.getPopularProducts();
|
|
194
156
|
if (popularProducts) {
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [4.0.0-cx15-11969.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v4.0.0-cx15-11969.1...v4.0.0-cx15-11969.2) (2025-04-14)
|