@lancom/shared 0.0.280 → 0.0.281
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 +3 -0
- package/assets/js/api/index.js +5 -2
- package/assets/js/models/print-area.js +5 -3
- package/assets/js/utils/colors.js +1 -1
- package/assets/js/utils/fabric-helper.js +1 -1
- package/assets/js/utils/filters.js +2 -2
- package/assets/scss/_common.scss +10 -0
- package/components/asides/contact_us/contact-us.vue +9 -2
- package/components/asides/menu/menu.vue +1 -25
- package/components/checkout/cart/cart.mixin.js +3 -3
- package/components/checkout/cart/cart.scss +8 -109
- package/components/checkout/cart/cart.vue +84 -46
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +7 -4
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +4 -5
- package/components/checkout/cart/cart_pricing/cart-pricing.scss +34 -0
- package/components/checkout/cart/cart_pricing/cart-pricing.vue +112 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
- package/components/checkout/order/address-form/address-form.scss +16 -0
- package/components/checkout/order/address-form/address-form.vue +199 -91
- package/components/checkout/order/order-billing-information/order-billing-information.scss +1 -1
- package/components/checkout/order/order-payment-information/order-payment-information.vue +15 -5
- package/components/checkout/order/order.vue +2 -1
- package/components/common/client_settings/client-settings.scss +6 -0
- package/components/common/client_settings/client-settings.vue +9 -1
- package/components/common/payment/payment_card/stripe/stripe.vue +1 -0
- package/components/common/payment/payment_success/payment-success.vue +8 -1
- package/components/common/postcode_select/postcode-select.vue +22 -12
- package/components/common/price.vue +1 -1
- package/components/common/pricing_table/pricing-table.vue +3 -2
- package/components/common/tabs.vue +17 -8
- package/components/editor/editor.scss +6 -0
- package/components/editor/editor.vue +22 -19
- package/components/editor/editor_layers/editor-layers.vue +3 -2
- package/components/editor/editor_print_area_options/editor-print-area-options.vue +2 -0
- package/components/editor/editor_product_details/editor-product-details.scss +8 -2
- package/components/editor/editor_product_details/editor-product-details.vue +22 -25
- package/components/editor/editor_wizard/editor-wizard.vue +2 -1
- package/components/editor/editor_workspace/editor-workspace.vue +3 -2
- package/components/modals/cart_modal/cart-modal.vue +1 -1
- package/components/modals/order_modal/order-modal.vue +6 -0
- package/components/modals/payment_modal/payment-modal.vue +4 -3
- package/components/order/order_payment/order-payment.vue +6 -6
- package/components/product/editor_pricing/editor-pricing.scss +75 -0
- package/components/product/editor_pricing/editor-pricing.vue +228 -0
- package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
- package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +118 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +102 -0
- package/components/product/product.vue +1 -1
- package/components/product/product_colors_selector/product-colors-selector.scss +117 -0
- package/components/product/product_colors_selector/product-colors-selector.vue +188 -0
- package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +3 -1
- package/components/product/product_size_selector/product_size_selector_color/product_size_selector_color_cell/product-size-selector-color-cell.vue +4 -5
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.scss +58 -0
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.vue +128 -0
- package/components/product/products_size_selector_color/products-size-selector-color.scss +12 -0
- package/components/product/products_size_selector_color/products-size-selector-color.vue +43 -0
- package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +2 -1
- package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +2 -1
- package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +2 -1
- package/components/products/product_list/product-list.scss +2 -2
- package/components/products/product_list_product/product-list-product.scss +7 -11
- package/components/products/product_list_product/product-list-product.vue +7 -15
- package/components/the_aside/the-aside.vue +1 -0
- package/feeds/google-shopping.js +4 -4
- package/layouts/error.vue +39 -0
- package/layouts/products.vue +386 -0
- package/mixins/payment.js +2 -1
- package/mixins/product-preview.js +1 -1
- package/mixins/product-view.js +313 -0
- package/nuxt.config.js +0 -5
- package/package.json +1 -1
- package/pages/checkout/cart.vue +40 -0
- package/pages/checkout/order.vue +72 -0
- package/pages/customer/create.vue +33 -0
- package/pages/customer/password/_token.vue +79 -0
- package/pages/customer/recovery.vue +33 -0
- package/pages/customer/settings.vue +33 -0
- package/pages/customer/signin.vue +33 -0
- package/routes/index.js +35 -0
- package/store/cart.js +11 -6
- package/store/order.js +2 -2
- package/store/product.js +0 -6
package/routes/index.js
CHANGED
|
@@ -24,5 +24,40 @@ module.exports = function(routes, resolve) {
|
|
|
24
24
|
path: '/order/:token/refund/:refund',
|
|
25
25
|
component: resolve('@lancom/shared/pages/order/_token/refund/_refund.vue'),
|
|
26
26
|
chunkName: 'pages/order/view/refund'
|
|
27
|
+
}, {
|
|
28
|
+
name: 'customer-signin',
|
|
29
|
+
path: '/customer/signin',
|
|
30
|
+
component: resolve('@lancom/shared/pages/customer/signin.vue'),
|
|
31
|
+
chunkName: 'pages/customer/signin'
|
|
32
|
+
}, {
|
|
33
|
+
name: 'customer-settings',
|
|
34
|
+
path: '/customer/settings',
|
|
35
|
+
component: resolve('@lancom/shared/pages/customer/settings.vue'),
|
|
36
|
+
chunkName: 'pages/customer/settings'
|
|
37
|
+
}, {
|
|
38
|
+
name: 'customer-recovery',
|
|
39
|
+
path: '/customer/recovery',
|
|
40
|
+
component: resolve('@lancom/shared/pages/customer/recovery.vue'),
|
|
41
|
+
chunkName: 'pages/customer/recovery'
|
|
42
|
+
}, {
|
|
43
|
+
name: 'customer-create',
|
|
44
|
+
path: '/customer/create',
|
|
45
|
+
component: resolve('@lancom/shared/pages/customer/create.vue'),
|
|
46
|
+
chunkName: 'pages/customer/create'
|
|
47
|
+
}, {
|
|
48
|
+
name: 'customer-password-reset',
|
|
49
|
+
path: '/customer/password/:token',
|
|
50
|
+
component: resolve('@lancom/shared/pages/customer/password/_token.vue'),
|
|
51
|
+
chunkName: 'pages/customer/password/reset'
|
|
52
|
+
}, {
|
|
53
|
+
name: 'checkout-cart',
|
|
54
|
+
path: '/checkout/cart',
|
|
55
|
+
component: resolve('@lancom/shared/pages/checkout/cart.vue'),
|
|
56
|
+
chunkName: 'pages/checkout/cart'
|
|
57
|
+
}, {
|
|
58
|
+
name: 'checkout-order',
|
|
59
|
+
path: '/checkout/order',
|
|
60
|
+
component: resolve('@lancom/shared/pages/checkout/order.vue'),
|
|
61
|
+
chunkName: 'pages/checkout/reset'
|
|
27
62
|
}];
|
|
28
63
|
}
|
package/store/cart.js
CHANGED
|
@@ -113,6 +113,7 @@ export const actions = {
|
|
|
113
113
|
}).filter(e => !!e);
|
|
114
114
|
const payload = {
|
|
115
115
|
_id: state.id || undefined,
|
|
116
|
+
currency: currency?._id,
|
|
116
117
|
entities: [...cartEntities, ...entities]
|
|
117
118
|
};
|
|
118
119
|
const cart = await api.saveCart(payload, shop._id);
|
|
@@ -124,27 +125,31 @@ export const actions = {
|
|
|
124
125
|
gtm.addToCart(addingEntities, pricing);
|
|
125
126
|
}
|
|
126
127
|
},
|
|
127
|
-
async removeSimpleProductsFromCart({ commit, state }, { simpleProducts, shop }) {
|
|
128
|
+
async removeSimpleProductsFromCart({ commit, state }, { simpleProducts, shop, currency }) {
|
|
128
129
|
const removeGuids = (simpleProducts || []).map(e => e.guid);
|
|
129
130
|
const entities = state.entities.map(entity => ({
|
|
130
131
|
...entity,
|
|
131
132
|
simpleProducts: entity.simpleProducts.filter(sp => !removeGuids.includes(sp.guid))
|
|
132
133
|
})).filter(({ simpleProducts }) => simpleProducts.length > 0);
|
|
133
|
-
const payload = {
|
|
134
|
+
const payload = {
|
|
135
|
+
_id: state.id,
|
|
136
|
+
entities,
|
|
137
|
+
currency: currency?._id
|
|
138
|
+
};
|
|
134
139
|
await api.saveCart(payload, shop._id);
|
|
135
140
|
commit('setEntities', entities);
|
|
136
141
|
if (state.cartPricing) {
|
|
137
142
|
gtm.removeFromCart(simpleProducts, state.cartPricing);
|
|
138
143
|
}
|
|
139
144
|
},
|
|
140
|
-
async removeSupplier({ commit, state }, { supplier, shop }) {
|
|
145
|
+
async removeSupplier({ commit, state }, { supplier, shop, currency }) {
|
|
141
146
|
const brands = supplier.brands.map(({ _id }) => _id);
|
|
142
147
|
const entities = state.entities.filter(entity => !brands.includes(entity.product.brand._id));
|
|
143
148
|
if (state.cartPricing) {
|
|
144
149
|
const simpleProducts = entities.reduce((items, entity) => [...items, ...entity.simpleProducts], []);
|
|
145
150
|
gtm.removeFromCart(simpleProducts, state.cartPricing);
|
|
146
151
|
}
|
|
147
|
-
const payload = { _id: state.id, entities };
|
|
152
|
+
const payload = { _id: state.id, entities, currency: currency?._id};
|
|
148
153
|
await api.saveCart(payload, shop._id);
|
|
149
154
|
commit('setEntities', entities);
|
|
150
155
|
},
|
|
@@ -164,7 +169,7 @@ export const actions = {
|
|
|
164
169
|
commit('setCartPricingCalculating', false);
|
|
165
170
|
}
|
|
166
171
|
},
|
|
167
|
-
async setSimpleProductAmount({ state, commit }, { guid, amount, shop }) {
|
|
172
|
+
async setSimpleProductAmount({ state, commit }, { guid, amount, shop, currency }) {
|
|
168
173
|
const entities = (state.entities || []).map(product => ({
|
|
169
174
|
...product,
|
|
170
175
|
simpleProducts: (product.simpleProducts || []).map(sp => ({
|
|
@@ -172,7 +177,7 @@ export const actions = {
|
|
|
172
177
|
amount: sp.guid === guid ? +amount : sp.amount
|
|
173
178
|
}))
|
|
174
179
|
}));
|
|
175
|
-
const payload = { _id: state.id, entities };
|
|
180
|
+
const payload = { _id: state.id, entities, currency: currency?._id };
|
|
176
181
|
await api.saveCart(payload, shop._id);
|
|
177
182
|
commit('setEntities', entities);
|
|
178
183
|
},
|
package/store/order.js
CHANGED
|
@@ -19,9 +19,9 @@ export const actions = {
|
|
|
19
19
|
const response = await api.createOrder({ ...order, recaptchaToken }, shop);
|
|
20
20
|
commit('setOrderData', response);
|
|
21
21
|
},
|
|
22
|
-
async submitPayment({ commit, state: { orderData } }, { card, payment, country, shop, recaptchaToken }) {
|
|
22
|
+
async submitPayment({ commit, state: { orderData } }, { card, payment, country, shop, currency, recaptchaToken }) {
|
|
23
23
|
const { _id } = orderData || {};
|
|
24
|
-
const response = await api.createOrderPayment(_id, { card, shop, country, payment, recaptchaToken });
|
|
24
|
+
const response = await api.createOrderPayment(_id, { card, shop, country, payment, currency, recaptchaToken });
|
|
25
25
|
commit('setOrderData', response);
|
|
26
26
|
return {};
|
|
27
27
|
},
|
package/store/product.js
CHANGED
|
@@ -162,12 +162,6 @@ export const actions = {
|
|
|
162
162
|
const product = await api.fetchProduct(shop, slug, query);
|
|
163
163
|
commit('setProduct', product);
|
|
164
164
|
commit('setPreSetPrint', (product.prints || []).find(({ _id }) => _id === print));
|
|
165
|
-
|
|
166
|
-
const [first] = (product.printAreas || []);
|
|
167
|
-
if (first) {
|
|
168
|
-
commit('setEditablePrintArea', first);
|
|
169
|
-
commit('setSelectedPrintArea', { printArea: first._id, size: first.printSize });
|
|
170
|
-
}
|
|
171
165
|
} catch (e) {
|
|
172
166
|
console.log(e);
|
|
173
167
|
const { status, data } = e?.response || {};
|