@lancom/shared 0.0.145 → 0.0.148

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.
@@ -46,7 +46,8 @@
46
46
  :key="simpleProduct._id"
47
47
  :simple-product="simpleProduct"
48
48
  :entity="entity"
49
- :display-unit-price="displayUnitPrice" />
49
+ :display-unit-price="displayUnitPrice"
50
+ @change="onChangeQty" />
50
51
  </div>
51
52
  <div class="CartEntityColorSimpleProducts__totals">
52
53
  <div class="CartEntityColorSimpleProducts__total">
@@ -119,6 +119,7 @@ export default {
119
119
  if (this.$refs.input) {
120
120
  this.$refs.input.blur();
121
121
  }
122
+ this.$emit('change');
122
123
  },
123
124
  onFocus() {
124
125
  this.defaultValue = '';
@@ -135,6 +136,7 @@ export default {
135
136
  amount: this.formatAmount(this.model + 1),
136
137
  shop: this.shop
137
138
  });
139
+ this.$emit('change');
138
140
  },
139
141
  decrease() {
140
142
  this.setSimpleProductAmount({
@@ -142,6 +144,7 @@ export default {
142
144
  amount: this.formatAmount(this.model - 1),
143
145
  shop: this.shop
144
146
  });
147
+ this.$emit('change');
145
148
  }
146
149
  }
147
150
  };
@@ -22,6 +22,9 @@ export default {
22
22
  },
23
23
  },
24
24
  computed: {
25
+ couponTotal() {
26
+ return Math.abs(this.order.couponTotal || 0);
27
+ },
25
28
  model() {
26
29
  return this.invoice || this.order;
27
30
  },
@@ -136,11 +136,16 @@
136
136
  Shipping Total: <b>{{ model.shippingTotal | price }}</b>
137
137
  </div>
138
138
  <div class="lc_regular16">
139
- Total ex GST: <b>{{ model.total | price }}</b>
139
+ Total ex GST: <b>{{ (model.total + couponTotal) | price }}</b>
140
140
  </div>
141
141
  <div class="lc_regular16">
142
142
  GST: <b>{{ model.totalGST - model.total | price }}</b>
143
143
  </div>
144
+ <div
145
+ v-if="!invoice && order.couponCode"
146
+ class="lc_regular16">
147
+ Coupon: <b>{{ couponTotal | price }}</b>
148
+ </div>
144
149
  <div class="lc_regular16">
145
150
  Total inc GST: <b>{{ model.totalGST | price }}</b>
146
151
  </div>
package/nuxt.config.js CHANGED
@@ -45,7 +45,7 @@ module.exports = (config, axios, { raygunClient } = {}) => ({
45
45
  '@/node_modules/@lancom/shared/plugins/vee-validate',
46
46
  { src: '@/node_modules/@lancom/shared/plugins/vue-toastr', ssr: false },
47
47
  { src: '@/node_modules/@lancom/shared/plugins/vue-hummer', ssr: false },
48
- '@/node_modules/@lancom/shared/plugins/vue-multiselect',
48
+ // '@/node_modules/@lancom/shared/plugins/vue-multiselect',
49
49
  '@/node_modules/@lancom/shared/plugins/vue-tooltip',
50
50
  { src: '@/node_modules/@lancom/shared/plugins/lazy', ssr: false },
51
51
  '@/node_modules/@lancom/shared/plugins/vue-click-outside',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.145",
3
+ "version": "0.0.148",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
@@ -1,5 +1,7 @@
1
1
  import Vue from 'vue';
2
2
 
3
+ let interval = null;
4
+
3
5
  export default () => {
4
6
  Vue.mixin({
5
7
  methods: {
@@ -9,7 +11,17 @@ export default () => {
9
11
  },
10
12
  async preloadReCaptcha() {
11
13
  if (!this.$recaptcha) {
14
+ clearInterval(interval);
12
15
  await this.loadReCaptcha();
16
+ await new Promise((resolve, reject) => {
17
+ interval = setInterval(() => {
18
+ console.log('check recaptcha...');
19
+ if (this.$recaptcha) {
20
+ clearInterval(interval);
21
+ resolve()
22
+ }
23
+ }, 100);
24
+ });
13
25
  }
14
26
  },
15
27
  async loadReCaptcha() {
package/store/cart.js CHANGED
@@ -49,7 +49,7 @@ export const getters = {
49
49
  suburb: ({ suburb }) => suburb,
50
50
  cartPricing: ({ cartPricing }) => cartPricing,
51
51
  cartProductsPricing: ({ cartPricing }) => (cartPricing && cartPricing.products) || {},
52
- isEmpty: (state, { simpleProductsQuantity }) => simpleProductsQuantity === 0,
52
+ isEmpty: (state, { entities }) => (entities || []).length === 0,
53
53
  quantities: ({ entities }) => ({
54
54
  products: getProductsQuantities(entities),
55
55
  prints: getPrintsQuantities(entities)