@viur/shop-components 0.1.16 → 0.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viur/shop-components",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -88,12 +88,11 @@ async function nextStep(){
88
88
  }
89
89
 
90
90
  let result = await saveAddresses(addressState.billingIsShipping)
91
- if (result['action'] && result['action'].endsWith('Success')){
91
+ if (result?.['action'] && result['action'].endsWith('Success')){
92
92
  return true
93
93
  }
94
94
  return false
95
95
  } catch(error){
96
- console.log(error)
97
96
  return false
98
97
  }
99
98
  }
@@ -7,7 +7,7 @@
7
7
  :skelkey="state.skelkey"
8
8
  :values="{'address_type':state.address_type, 'customer_type':'private'}"
9
9
  :useCategories="false"
10
- :layout="AddressFormLayout"
10
+ :layout="shopStore.state.UserDataLayout"
11
11
  @change="formChange"
12
12
  :default-language="state.language"
13
13
  error-style="decent"
@@ -18,7 +18,6 @@
18
18
  <script setup>
19
19
  import {computed, reactive, watch} from 'vue'
20
20
  import LoadingHandler from './LoadingHandler.vue';
21
- import AddressFormLayout from './AddressFormLayout.vue';
22
21
  import ViForm from "@viur/vue-utils/forms/ViForm.vue";
23
22
  import {useViurShopStore} from "../shop";
24
23
  import {useAddress} from "../composables/address";
@@ -91,4 +90,4 @@ watch(()=>addressState.billingIsShipping, (newVal,oldVal)=>{
91
90
 
92
91
  <style scoped>
93
92
 
94
- </style>
93
+ </style>
@@ -47,13 +47,16 @@ export const useAddress = defineStore("useAddressStore", () => {
47
47
  state[`${type}IsUpdating`] = true
48
48
  return state[`${type}Form`].sendData().then(async (resp)=>{
49
49
  let data = await resp.json()
50
-
50
+
51
51
  if (['addSuccess','editSuccess'].includes(data['action'])){
52
52
  state[`${type}Data`] = data['values']
53
53
  await updateAddresses(type, billingIsShipping)
54
54
  }
55
55
  state[`${type}IsUpdating`] = undefined
56
56
  return data
57
+ }).catch(error=>{
58
+ state[`${type}Form`].state.loading = false
59
+ return {'action':"error"}
57
60
  })
58
61
  }
59
62
 
@@ -92,4 +95,4 @@ export const useAddress = defineStore("useAddressStore", () => {
92
95
  updateAddresses,
93
96
  saveAddresses
94
97
  }
95
- })
98
+ })
@@ -56,11 +56,9 @@ import { useI18n } from "vue-i18n"
56
56
  const emailBone2 = ref(null)
57
57
 
58
58
  function changeEvent(event) {
59
- console.dir(event.target)
60
59
  if(emailBone.value.value!==emailBone2.value.value){
61
- emailBone.value.setCustomValidity(i18n.t("messages.password_equal_error"))
60
+ emailBone.value.setCustomValidity(i18n.t("messages.email_equal_error"))
62
61
  emailBone.value.reportValidity()
63
- console.log(event.target.classList)
64
62
  if (!event.target.classList.contains('widget-bone-email-repeat')){
65
63
  emit("change", props.name, event.target.value, props.lang, props.index,false)
66
64
  }
@@ -68,9 +66,6 @@ import { useI18n } from "vue-i18n"
68
66
  emailBone.value.setCustomValidity('')
69
67
  emit("change", props.name, event.target.value, props.lang, props.index,true)
70
68
  }
71
-
72
-
73
-
74
69
  }
75
70
 
76
71
  watchEffect(() => {
@@ -91,7 +91,6 @@ import { useI18n } from "vue-i18n"
91
91
  if(stringBone.value.value!==stringBone2.value.value){
92
92
  stringBone.value.setCustomValidity(i18n.t("messages.phone_equal_error"))
93
93
  stringBone.value.reportValidity()
94
- console.log(event.target.classList)
95
94
  if (!event.target.classList.contains('widget-bone-string-repeat')){
96
95
  emit("change", props.name, event.target.value, props.lang, props.index,false)
97
96
  }
package/src/shop.js CHANGED
@@ -3,6 +3,7 @@ import { reactive, computed, watch, shallowRef } from "vue";
3
3
  import {ShopCart, ShopUserDataGuest, ShopShippingMethod, ShopPaymentProvider, ShopOrderComplete, ShopOrderConfirm} from './Steps/index'
4
4
  import { defineStore } from "pinia";
5
5
  import { useUrlSearchParams } from '@vueuse/core'
6
+ import AddressFormLayout from './components/AddressFormLayout.vue';
6
7
 
7
8
  import { Request } from "@viur/vue-utils";
8
9
 
@@ -119,8 +120,8 @@ export const useViurShopStore = defineStore("viurshopStore", () => {
119
120
 
120
121
 
121
122
  //checkout
122
- paymentProviderData:null
123
-
123
+ paymentProviderData:null,
124
+ UserDataLayout: shallowRef(AddressFormLayout)
124
125
  })
125
126
 
126
127
  function addTab({name, component, displayname, iconname, iconlibrary,active})
@@ -60,7 +60,7 @@ export default {
60
60
  wait_for_payment: 'Warte auf Zahlung...',
61
61
  remove_article_from_cart: 'Wollen sie den Artikel wirklich entfernen?',
62
62
  order_check_later: 'Sie können Ihre Bestellung am Ende noch einmal überprüfen.',
63
- password_equal_error: 'E-Mail-Adressen stimmen nicht überein.',
63
+ email_equal_error: 'E-Mail-Adressen stimmen nicht überein.',
64
64
  phone_equal_error: "Telefonnummern stimmen nicht überein."
65
65
  },
66
66
  };
@@ -54,7 +54,7 @@ export default {
54
54
  wait_for_payment: 'Warte auf Zahlung...',
55
55
  remove_article_from_cart: 'Désirez-vous vraiment supprimer cet article du panier?',
56
56
  order_check_later: 'Vous pourrez revérifier vos données avant de valider votre commande.',
57
- password_equal_error: "Les adresses e-mail ne correspondent pas.",
57
+ email_equal_error: "Les adresses e-mail ne correspondent pas.",
58
58
  phone_equal_error: "Les numéros de téléphone ne correspondent pas."
59
59
  },
60
60
  };