@lancom/shared 0.0.383 → 0.0.385
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 +12 -0
- package/assets/js/api/index.js +11 -1
- package/assets/js/utils/scroll.js +11 -0
- package/components/checkout/cart/cart.mixin.js +5 -1
- package/components/checkout/cart/cart.vue +32 -19
- package/components/checkout/cart/cart_entity/cart-entity.mixin.js +4 -0
- package/components/checkout/cart/cart_entity/cart-entity.vue +2 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.vue +2 -0
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +8 -53
- package/components/checkout/cart/cart_pricing/cart-pricing.scss +11 -3
- package/components/checkout/cart/cart_pricing/cart-pricing.vue +6 -2
- package/components/checkout/cart/cart_products_kit_entity/cart-products-kit-entity.scss +24 -0
- package/components/checkout/cart/cart_products_kit_entity/cart-products-kit-entity.vue +66 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.scss +3 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +12 -2
- package/components/checkout/cart/cart_shipping/cart-shipping.scss +43 -0
- package/components/checkout/cart/cart_shipping/cart-shipping.vue +126 -0
- package/components/checkout/order/address-form/address-form.vue +5 -0
- package/components/checkout/order/order-billing-information/order-billing-information.vue +1 -0
- package/components/checkout/order/order-payment-information/order-payment-information.vue +9 -0
- package/components/common/number_input/number-input.scss +69 -0
- package/components/common/number_input/number-input.vue +97 -0
- package/components/common/payment/payment_card/applepay/applepay.scss +8 -0
- package/components/common/payment/payment_card/applepay/applepay.vue +16 -0
- package/components/common/payment/payment_card/payment-card.vue +7 -0
- package/components/common/postcode_select/postcode-select.scss +6 -0
- package/components/common/postcode_select/postcode-select.vue +16 -6
- package/components/common/pricing_discounts_table/pricing-discounts-table.vue +12 -2
- package/components/customer/customer_coupons/customer-coupons.scss +33 -0
- package/components/customer/customer_coupons/customer-coupons.vue +103 -0
- package/components/customer/customer_coupons/customer_coupon_apply/customer-coupon-apply.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_apply/customer-coupon-apply.vue +51 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer-coupon-prints.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer-coupon-prints.vue +33 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer_coupon_print/customer-coupon-print.scss +19 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer_coupon_print/customer-coupon-print.vue +82 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.vue +33 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer_coupon_product/customer-coupon-product.scss +17 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer_coupon_product/customer-coupon-product.vue +52 -0
- package/components/customer/customer_navigation_menu/customer-navigation-menu.vue +72 -0
- package/components/customer/customer_orders/customer-orders.scss +26 -12
- package/components/customer/customer_orders/customer-orders.vue +64 -33
- package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.scss +1 -0
- package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.vue +55 -0
- package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.scss +8 -0
- package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.vue +38 -0
- package/components/editor/editor.vue +4 -12
- package/components/editor/mobile_editor_product_details/mobile-editor-product-details.vue +2 -10
- package/components/products_kit/products_kit/products-kit.scss +54 -0
- package/components/products_kit/products_kit/products-kit.vue +47 -0
- package/components/products_kit/products_kit/products_kit_cart/products-kit-cart.scss +32 -0
- package/components/products_kit/products_kit/products_kit_cart/products-kit-cart.vue +132 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products-kit-cart-options.scss +15 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products-kit-cart-options.vue +31 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products_kit_cart_option/products-kit-cart-option.scss +41 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products_kit_cart_option/products-kit-cart-option.vue +89 -0
- package/components/products_kit/products_kit/products_kit_options/products-kit-options.scss +9 -0
- package/components/products_kit/products_kit/products_kit_options/products-kit-options.vue +32 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products-kit-option.scss +1 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products-kit-option.vue +36 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_color/products-kit-option-color.scss +1 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_color/products-kit-option-color.vue +88 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products-kit-option-products.scss +7 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products-kit-option-products.vue +36 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products_kit_option_product/products-kit-option-product.scss +20 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products_kit_option_product/products-kit-option-product.vue +127 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_size/products-kit-option-size.scss +1 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_size/products-kit-option-size.vue +87 -0
- package/components/products_kit/products_kits_list/products-kits-list.scss +68 -0
- package/components/products_kit/products_kits_list/products-kits-list.vue +50 -0
- package/components/products_kit/products_kits_list/products_kits_list_item/products-kits-list-item.scss +84 -0
- package/components/products_kit/products_kits_list/products_kits_list_item/products-kits-list-item.vue +52 -0
- package/components/quotes/quote_view/quote-view.vue +1 -0
- package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +4 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote-product-color-simple-products.vue +9 -2
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.scss +54 -1
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.vue +83 -5
- package/components/quotes/quote_view/quote_view_product/quote-view-product.scss +7 -0
- package/components/quotes/quote_view/quote_view_product/quote-view-product.vue +33 -11
- package/feeds/google-shopping.js +10 -4
- package/mixins/product-preview.js +6 -0
- package/package.json +1 -1
- package/pages/checkout/order.vue +13 -4
- package/pages/contact.vue +54 -0
- package/pages/customer/coupons.vue +39 -0
- package/pages/customer/orders.vue +39 -0
- package/pages/customer/settings.vue +4 -2
- package/pages/products-kit/_alias.vue +103 -0
- package/pages/products-kit/index.vue +59 -0
- package/routes/index.js +21 -1
- package/store/cart.js +2 -2
- package/store/productsKit.js +175 -0
- package/pages/customer/orders/index.vue +0 -29
package/components/customer/customer_coupons/customer_coupon_prints/customer-coupon-prints.vue
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerCouponPrints__wrapper">
|
|
3
|
+
<div class="lc_h5 mb-5 mt-5">Prints</div>
|
|
4
|
+
<CustomerCouponPrint
|
|
5
|
+
v-for="(print, index) in coupon.prints"
|
|
6
|
+
:key="index"
|
|
7
|
+
:coupon="coupon"
|
|
8
|
+
:print="print"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import CustomerCouponPrint from './customer_coupon_print/customer-coupon-print';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'CustomerCouponPrints',
|
|
18
|
+
components: {
|
|
19
|
+
CustomerCouponPrint
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
coupon: {
|
|
23
|
+
type: Object,
|
|
24
|
+
required: true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style lang="scss">
|
|
31
|
+
@import 'customer-coupon-prints';
|
|
32
|
+
</style>
|
|
33
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.CustomerCouponPrint {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
.lc_table {
|
|
6
|
+
tr {
|
|
7
|
+
height: 38px;
|
|
8
|
+
}
|
|
9
|
+
td, th {
|
|
10
|
+
padding: 2px 0px !important;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
&__print-types,
|
|
15
|
+
&__print-areas,
|
|
16
|
+
&__print-sizes {
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerCouponPrint__wrapper">
|
|
3
|
+
<div class="CustomerCouponPrint__print-types mb-4">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(printType, index) in printTypes"
|
|
6
|
+
:key="index">
|
|
7
|
+
{{ index > 0 ? ', ' : '' }}<b>{{ printType.name }}</b>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div v-for="(printArea, index) in printAreas" :key="index">
|
|
11
|
+
<div
|
|
12
|
+
v-if="printArea.freeSetupOver > 0"
|
|
13
|
+
class="mb-4">
|
|
14
|
+
Free Setup Over <b>{{ printArea.freeSetupOver | price(currency) }}</b>
|
|
15
|
+
</div>
|
|
16
|
+
<div
|
|
17
|
+
v-if="printArea.setupCost > 0"
|
|
18
|
+
class="mb-4">
|
|
19
|
+
Setup Cost <b>{{ printArea.setupCost | price(currency) }}</b>
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
v-if="printArea.printSizes"
|
|
23
|
+
class="CustomerCouponPrint__print-sizes mb-4">
|
|
24
|
+
<div class="mr-5">Size: </div>
|
|
25
|
+
<div
|
|
26
|
+
v-for="(printSize, index) in printArea.printSizes"
|
|
27
|
+
:key="index">
|
|
28
|
+
{{ index > 0 ? ', ' : '' }}<b>{{ printSize.name }}</b>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<pricing-discounts-table
|
|
32
|
+
class="mt-4"
|
|
33
|
+
:prices="printArea.printCost"
|
|
34
|
+
:bordered="true"
|
|
35
|
+
:with-gst="false" />
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import { mapGetters } from 'vuex';
|
|
43
|
+
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
44
|
+
import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
name: 'CustomerCouponPrint',
|
|
48
|
+
filters: {
|
|
49
|
+
price
|
|
50
|
+
},
|
|
51
|
+
components: {
|
|
52
|
+
PricingDiscountsTable
|
|
53
|
+
},
|
|
54
|
+
props: {
|
|
55
|
+
coupon: {
|
|
56
|
+
type: Object,
|
|
57
|
+
required: true
|
|
58
|
+
},
|
|
59
|
+
print: {
|
|
60
|
+
type: Object,
|
|
61
|
+
required: true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
computed: {
|
|
65
|
+
...mapGetters(['currency']),
|
|
66
|
+
printTypes() {
|
|
67
|
+
return this.print.printTypes || [];
|
|
68
|
+
},
|
|
69
|
+
printAreas() {
|
|
70
|
+
return this.print.printAreas || [];
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
mounted() {
|
|
74
|
+
console.log('print: ', this.print);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="scss">
|
|
80
|
+
@import 'customer-coupon-print';
|
|
81
|
+
</style>
|
|
82
|
+
|
package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.vue
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerCouponProducts__wrapper">
|
|
3
|
+
<div class="lc_h5 mb-5 mt-5">Products</div>
|
|
4
|
+
<CustomerCouponProduct
|
|
5
|
+
v-for="(product, index) in coupon.products"
|
|
6
|
+
:key="index"
|
|
7
|
+
:coupon="coupon"
|
|
8
|
+
:product="product"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import CustomerCouponProduct from './customer_coupon_product/customer-coupon-product';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'CustomerCouponProducts',
|
|
18
|
+
components: {
|
|
19
|
+
CustomerCouponProduct
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
coupon: {
|
|
23
|
+
type: Object,
|
|
24
|
+
required: true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style lang="scss">
|
|
31
|
+
@import 'customer-coupon-products';
|
|
32
|
+
</style>
|
|
33
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerCouponProduct__wrapper">
|
|
3
|
+
<div>
|
|
4
|
+
<ul class="CustomerCouponProduct__products">
|
|
5
|
+
<li v-for="(product, index) in products" :key="index">
|
|
6
|
+
{{ index > 0 ? ', ' : '' }}<b>{{ product.name }}</b>
|
|
7
|
+
</li>
|
|
8
|
+
</ul>
|
|
9
|
+
</div>
|
|
10
|
+
<div
|
|
11
|
+
v-if="product.onlyPrinted"
|
|
12
|
+
class="lc_regular14 mt-4">
|
|
13
|
+
Only Printed: <b>Yes</b>
|
|
14
|
+
</div>
|
|
15
|
+
<pricing-discounts-table
|
|
16
|
+
class="mt-4"
|
|
17
|
+
:prices="product.pricing"
|
|
18
|
+
:bordered="true"
|
|
19
|
+
:with-gst="false" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'CustomerCouponProduct',
|
|
28
|
+
components: {
|
|
29
|
+
PricingDiscountsTable
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
coupon: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
product: {
|
|
37
|
+
type: Object,
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
products() {
|
|
43
|
+
return this.product.products || [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style lang="scss">
|
|
50
|
+
@import 'customer-coupon-product';
|
|
51
|
+
</style>
|
|
52
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerMenu__wrapper">
|
|
3
|
+
<div
|
|
4
|
+
v-for="menuItem of menuItems"
|
|
5
|
+
:key="menuItem.key"
|
|
6
|
+
:class="{ 'active': menuItem.key === activeMenuItem }"
|
|
7
|
+
class="CustomerMenu__menu-item">
|
|
8
|
+
<a :href="menuItem.url">
|
|
9
|
+
{{ menuItem.label }}
|
|
10
|
+
</a>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'CustomerMenu',
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
menuItems: [{
|
|
21
|
+
label: 'Settings',
|
|
22
|
+
key: 'settings',
|
|
23
|
+
url: '/customer/settings'
|
|
24
|
+
}, {
|
|
25
|
+
label: 'Orders',
|
|
26
|
+
key: 'orders',
|
|
27
|
+
url: '/customer/orders'
|
|
28
|
+
}, {
|
|
29
|
+
label: 'Coupons',
|
|
30
|
+
key: 'coupons',
|
|
31
|
+
url: '/customer/coupons'
|
|
32
|
+
}]
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
activeMenuItem: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="scss" scoped>
|
|
45
|
+
@import "@/assets/scss/variables";
|
|
46
|
+
|
|
47
|
+
.CustomerMenu {
|
|
48
|
+
&__wrapper {
|
|
49
|
+
display: flex;
|
|
50
|
+
margin-bottom: 10px;
|
|
51
|
+
}
|
|
52
|
+
&__menu-item {
|
|
53
|
+
a {
|
|
54
|
+
display: inline-block;
|
|
55
|
+
padding: 10px 20px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
color: $black;
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
border: 1px solid $green;
|
|
60
|
+
margin-right: 5px;
|
|
61
|
+
&:hover {
|
|
62
|
+
background-color: #f0f0f0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
&.active a {
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
color: $black;
|
|
68
|
+
background-color: $green;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
@import "@/assets/scss/variables";
|
|
2
2
|
|
|
3
|
-
.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
.CustomerOrders__wrapper {
|
|
4
|
+
.VueTables {
|
|
5
|
+
&__table {
|
|
6
|
+
width: 100%;
|
|
7
|
+
border-collapse: collapse;
|
|
8
|
+
th, td {
|
|
9
|
+
padding: 10px;
|
|
10
|
+
text-align: left;
|
|
11
|
+
border-bottom: 1px solid $grey_2;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
&:nth-child(-n+3) {
|
|
14
|
+
width: 220px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
th {
|
|
18
|
+
background-color: $grey_3;
|
|
15
19
|
font-weight: bold;
|
|
16
20
|
}
|
|
21
|
+
a {
|
|
22
|
+
color: $black;
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
transition: color 0.2s ease;
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
color: darken($black, 10%);
|
|
28
|
+
text-decoration: underline;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
17
31
|
}
|
|
18
32
|
}
|
|
19
33
|
}
|
|
@@ -1,40 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="CustomerOrders__wrapper">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
3
|
+
<client-only>
|
|
4
|
+
<v-server-table
|
|
5
|
+
:key="uniqueKey"
|
|
6
|
+
ref="table"
|
|
7
|
+
:columns="columns"
|
|
8
|
+
:options="options">
|
|
9
|
+
<template #createdAt="{ row }">
|
|
10
|
+
{{ row.createdAt | date }}
|
|
11
|
+
</template>
|
|
12
|
+
<template #code="{ row }">
|
|
13
|
+
<a
|
|
14
|
+
:href="`/order/${row.token}`"
|
|
15
|
+
target="_blank">
|
|
16
|
+
{{ row.code }}
|
|
17
|
+
</a>
|
|
18
|
+
</template>
|
|
19
|
+
<template #tracking="{ row }">
|
|
20
|
+
<div class="CustomerOrders__trackings">
|
|
21
|
+
<customer-order-trackings :order="row" />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<template #reorder="{ row }">
|
|
25
|
+
<div class="CustomerOrders__reorder">
|
|
26
|
+
<customer-order-reorder :order="row" />
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
</v-server-table>
|
|
30
|
+
</client-only>
|
|
27
31
|
</div>
|
|
28
32
|
</template>
|
|
29
33
|
|
|
30
34
|
<script>
|
|
31
35
|
import { mapGetters } from 'vuex';
|
|
32
|
-
import
|
|
36
|
+
import Vue from 'vue';
|
|
37
|
+
import { ServerTable } from 'vue-tables-2';
|
|
33
38
|
import { date } from '@lancom/shared/assets/js/utils/filters';
|
|
39
|
+
import CustomerOrderTrackings from './customer_order_trackings/customer-order-trackings';
|
|
40
|
+
import CustomerOrderReorder from './customer_order_reorder/customer-order-reorder';
|
|
41
|
+
import { _get } from './../../../assets/js/api/helpers';
|
|
34
42
|
|
|
43
|
+
Vue.use(ServerTable);
|
|
35
44
|
|
|
36
45
|
export default {
|
|
37
46
|
name: 'CustomerOrders',
|
|
47
|
+
components: {
|
|
48
|
+
CustomerOrderTrackings,
|
|
49
|
+
CustomerOrderReorder
|
|
50
|
+
},
|
|
38
51
|
filters: {
|
|
39
52
|
date
|
|
40
53
|
},
|
|
@@ -46,19 +59,37 @@ export default {
|
|
|
46
59
|
},
|
|
47
60
|
data() {
|
|
48
61
|
return {
|
|
49
|
-
|
|
62
|
+
uniqueKey: Date.now(),
|
|
63
|
+
orders: [],
|
|
64
|
+
columns: ['createdAt', 'status', 'code', 'totalGST', 'tracking', 'reorder']
|
|
50
65
|
}
|
|
51
66
|
},
|
|
52
67
|
computed: {
|
|
53
|
-
...mapGetters(['
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
68
|
+
...mapGetters(['shop']),
|
|
69
|
+
url() {
|
|
70
|
+
return `shop/${this.shop._id}/customer/${this.customer._id}/orders`;
|
|
71
|
+
},
|
|
72
|
+
options() {
|
|
73
|
+
return {
|
|
74
|
+
query: null,
|
|
75
|
+
perPage: 15,
|
|
76
|
+
perPageValues: [15],
|
|
77
|
+
initialPage: 1,
|
|
78
|
+
filterable: false,
|
|
79
|
+
headings: { select: '' },
|
|
80
|
+
requestFunction: params => this.request(params),
|
|
81
|
+
columnsClasses: {
|
|
82
|
+
controls: 'controls-column'
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
57
86
|
},
|
|
58
87
|
methods: {
|
|
59
|
-
async
|
|
60
|
-
|
|
61
|
-
|
|
88
|
+
async request(params) {
|
|
89
|
+
const query = { ...params };
|
|
90
|
+
const result = await _get(this.url, query);
|
|
91
|
+
return result;
|
|
92
|
+
},
|
|
62
93
|
}
|
|
63
94
|
};
|
|
64
95
|
</script>
|
package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerOrderReorder__wrapper">
|
|
3
|
+
<btn
|
|
4
|
+
btn-class="green"
|
|
5
|
+
:btn-disabled="processing"
|
|
6
|
+
:btn-processing="processing"
|
|
7
|
+
btn-label="Re-order"
|
|
8
|
+
@onclick="reorder()">
|
|
9
|
+
</btn>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { mapActions } from 'vuex';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'CustomerOrderTrackings',
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
processing: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
order: {
|
|
25
|
+
type: Object,
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
...mapActions('cart', ['clearCart', 'addToCart']),
|
|
31
|
+
async reorder() {
|
|
32
|
+
try {
|
|
33
|
+
this.processing = true;
|
|
34
|
+
await this.clearCart();
|
|
35
|
+
await this.addToCart({
|
|
36
|
+
entities: this.order.products,
|
|
37
|
+
shop: this.order.shop,
|
|
38
|
+
country: this.order.country,
|
|
39
|
+
currency: this.order.currency
|
|
40
|
+
});
|
|
41
|
+
this.$router.push('/checkout/cart');
|
|
42
|
+
} catch (e) {
|
|
43
|
+
console.log(e);
|
|
44
|
+
} finally {
|
|
45
|
+
this.processing = false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style lang="scss">
|
|
53
|
+
@import 'customer-order-reorder';
|
|
54
|
+
</style>
|
|
55
|
+
|
package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.vue
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerOrderTrackings__wrapper">
|
|
3
|
+
<div
|
|
4
|
+
v-for="tracking of trackings"
|
|
5
|
+
:key="tracking._id"
|
|
6
|
+
class="CustomerOrderTrackings__item">
|
|
7
|
+
<a
|
|
8
|
+
:href="tracking.link"
|
|
9
|
+
target="_blank">
|
|
10
|
+
{{ tracking.code }}
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'CustomerOrderTrackings',
|
|
19
|
+
props: {
|
|
20
|
+
order: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
trackings() {
|
|
27
|
+
return (this.order.shipments || [])
|
|
28
|
+
.filter(s => !s.hasException)
|
|
29
|
+
.reduce((trackings, shipment) => [...trackings, ...(shipment.trackingNumbers || [])], []);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style lang="scss">
|
|
36
|
+
@import 'customer-order-trackings';
|
|
37
|
+
</style>
|
|
38
|
+
|
|
@@ -92,13 +92,14 @@ import confirmModal from '@lancom/shared/mixins/confirm';
|
|
|
92
92
|
import OfferScreenPrinting from '@lancom/shared/components/asides/offer_screen_printing/offer-screen-printing';
|
|
93
93
|
import ProductsListDropdown from '@lancom/shared/components/common/products_list_dropdown/products-list-dropdown';
|
|
94
94
|
import Tabs from '@lancom/shared/components/common/tabs';
|
|
95
|
+
import addToCartMixin from '@lancom/shared/mixins/add-to-cart';
|
|
96
|
+
import AddToCartBtn from '@lancom/shared/components/product/add-to-cart-btn';
|
|
97
|
+
import { scrollToElement } from '@lancom/shared/assets/js/utils/scroll';
|
|
95
98
|
import EditorWorkspace from './editor_workspace/editor-workspace';
|
|
96
99
|
import EditorProductDetails from './editor_product_details/editor-product-details';
|
|
97
100
|
import MobileEditorProductDetails from './mobile_editor_product_details/mobile-editor-product-details';
|
|
98
101
|
import EditorLayers from './editor_layers/editor-layers';
|
|
99
102
|
import EditorWizard from './editor_wizard/editor-wizard';
|
|
100
|
-
import addToCartMixin from '@lancom/shared/mixins/add-to-cart';
|
|
101
|
-
import AddToCartBtn from '@lancom/shared/components/product/add-to-cart-btn';
|
|
102
103
|
|
|
103
104
|
const MIN_SCREEN_AMOUNT = 125;
|
|
104
105
|
|
|
@@ -224,16 +225,7 @@ export default {
|
|
|
224
225
|
chooseProducts() {
|
|
225
226
|
this.selectTab('product');
|
|
226
227
|
setTimeout(() => {
|
|
227
|
-
|
|
228
|
-
if (element) {
|
|
229
|
-
const offset = 100;
|
|
230
|
-
const elementPosition = element.getBoundingClientRect().top;
|
|
231
|
-
const offsetPosition = elementPosition + window.pageYOffset - offset;
|
|
232
|
-
window.scrollTo({
|
|
233
|
-
top: offsetPosition,
|
|
234
|
-
behavior: 'smooth'
|
|
235
|
-
});
|
|
236
|
-
}
|
|
228
|
+
scrollToElement('EditorProductDetails');
|
|
237
229
|
}, 250);
|
|
238
230
|
}
|
|
239
231
|
}
|
|
@@ -91,6 +91,7 @@ import { createNamespacedHelpers } from 'vuex';
|
|
|
91
91
|
import throttle from 'lodash.throttle';
|
|
92
92
|
import { EventBus } from '@lancom/shared/assets/js/utils/event-bus';
|
|
93
93
|
import addToCartMixin from '@lancom/shared/mixins/add-to-cart';
|
|
94
|
+
import { scrollToElement } from '@lancom/shared/assets/js/utils/scroll';
|
|
94
95
|
import EditorWorkspace from '../editor_workspace/editor-workspace';
|
|
95
96
|
import EditorLayers from '../editor_layers/editor-layers';
|
|
96
97
|
import EditorPricing from '../../product/editor_pricing/editor-pricing';
|
|
@@ -137,16 +138,7 @@ export default {
|
|
|
137
138
|
chooseProducts() {
|
|
138
139
|
this.hide();
|
|
139
140
|
setTimeout(() => {
|
|
140
|
-
|
|
141
|
-
if (element) {
|
|
142
|
-
const offset = 100;
|
|
143
|
-
const elementPosition = element.getBoundingClientRect().top;
|
|
144
|
-
const offsetPosition = elementPosition + window.pageYOffset - offset;
|
|
145
|
-
window.scrollTo({
|
|
146
|
-
top: offsetPosition,
|
|
147
|
-
behavior: 'smooth'
|
|
148
|
-
});
|
|
149
|
-
}
|
|
141
|
+
scrollToElement('EditorProductDetails');
|
|
150
142
|
}, 250);
|
|
151
143
|
},
|
|
152
144
|
updateMobileMenuPosition() {
|