@lancom/shared 0.0.118 → 0.0.121
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/assets/js/api/admin.js
CHANGED
|
@@ -181,6 +181,18 @@ export default {
|
|
|
181
181
|
removeProductType(id) {
|
|
182
182
|
return _delete(`admin/product-types/${id}`);
|
|
183
183
|
},
|
|
184
|
+
fetchSubscribes() {
|
|
185
|
+
return _get('admin/subscribe');
|
|
186
|
+
},
|
|
187
|
+
fetchSubscribeById(id) {
|
|
188
|
+
return _get(`admin/subscribe/${id}`);
|
|
189
|
+
},
|
|
190
|
+
saveSubscribe(subscribe) {
|
|
191
|
+
return subscribe._id ? _put(`admin/subscribe/${subscribe._id}`, subscribe) : _post('admin/subscribe', subscribe);
|
|
192
|
+
},
|
|
193
|
+
removeSubscribe(id) {
|
|
194
|
+
return _delete(`admin/subscribe/${id}`);
|
|
195
|
+
},
|
|
184
196
|
fetchCoupons() {
|
|
185
197
|
return _get('admin/coupons');
|
|
186
198
|
},
|
package/assets/js/api/index.js
CHANGED
|
@@ -66,8 +66,8 @@ const api = {
|
|
|
66
66
|
fetchProductDetails(shop, alias) {
|
|
67
67
|
return _get(`shop/${shop}/products/${alias}/simple-products`);
|
|
68
68
|
},
|
|
69
|
-
fetchRelatedProducts(shop, alias) {
|
|
70
|
-
return _get(`shop/${shop}/products/${alias}/related-products
|
|
69
|
+
fetchRelatedProducts(shop, alias, params) {
|
|
70
|
+
return _get(`shop/${shop}/products/${alias}/related-products`, params);
|
|
71
71
|
},
|
|
72
72
|
fetchHelpMessages(shop, group) {
|
|
73
73
|
return _get(`shop/${shop}/help-messages/${group}`);
|
package/assets/js/utils/quote.js
CHANGED
|
@@ -3,7 +3,11 @@ export function convertQuoteToOrder(quote, option) {
|
|
|
3
3
|
paymentMethod: option.paymentMethod || 'deposit',
|
|
4
4
|
billingAddress: quote.address,
|
|
5
5
|
shippingAddress: quote.address,
|
|
6
|
-
products: option.products
|
|
6
|
+
products: option.products.map(p => ({
|
|
7
|
+
...p,
|
|
8
|
+
prints: p.prints.filter(print => !(option.prints || []).some(({ _id }) => print._id === _id))
|
|
9
|
+
})),
|
|
10
|
+
prints: option.prints,
|
|
7
11
|
total: option.total,
|
|
8
12
|
totalGST: option.totalGST,
|
|
9
13
|
productsTotal: option.productsTotal,
|
|
@@ -41,8 +41,8 @@ export default {
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
async mounted() {
|
|
44
|
-
const { products } = await api.fetchRelatedProducts(this.shop._id, this.product.alias);
|
|
45
|
-
this.products = products;
|
|
44
|
+
const { products } = await api.fetchRelatedProducts(this.shop._id, this.product.alias, { needShuffle: true });
|
|
45
|
+
this.products = products.splice(0, 6);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
</script>
|
package/package.json
CHANGED
package/store/page.js
CHANGED
|
@@ -11,7 +11,7 @@ export const getters = {
|
|
|
11
11
|
export const actions = {
|
|
12
12
|
async fetchRouteInfo({ commit }, { route, shop, fullPath }) {
|
|
13
13
|
const routeInfo = await api.fetchRouteInfo(route, shop, fullPath);
|
|
14
|
-
commit('setRouteInfo', routeInfo);
|
|
14
|
+
commit('setRouteInfo', !routeInfo.error ? routeInfo : {});
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
|
package/store/quote.js
CHANGED