@viur/shop-components 0.5.0 → 0.6.2

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.5.0",
3
+ "version": "0.6.2",
4
4
  "description": "Frontend Vue components for the shop module of ViUR",
5
5
  "repository": {
6
6
  "type": "git",
@@ -63,7 +63,6 @@ function optionChanged(type){
63
63
  }
64
64
 
65
65
  onBeforeMount(()=>{
66
- // FIXME: Fetch this after ever country (address) change!
67
66
  fetchPaymentData().then(()=>{
68
67
  state.selection = shopStore.state.order?.['payment_provider']
69
68
  })
@@ -21,9 +21,12 @@ import LoadingHandler from './LoadingHandler.vue';
21
21
  import ViForm from "@viur/vue-utils/forms/ViForm.vue";
22
22
  import {useViurShopStore} from "../shop";
23
23
  import {useAddress} from "../composables/address";
24
+ import { usePayment } from '../composables/payment';
25
+
24
26
 
25
27
  const shopStore = useViurShopStore();
26
28
  const {state:addressState} = useAddress();
29
+ const {state:paymentState, fetchPaymentData} = usePayment()
27
30
 
28
31
  const props = defineProps({
29
32
  formtype:{
@@ -71,6 +74,9 @@ const state = reactive({
71
74
  function formChange(data){
72
75
  if (data.name === "country"){
73
76
  state.language = data.value
77
+ if (state.formtype === 'billing'){
78
+ fetchPaymentData()
79
+ }
74
80
  }
75
81
  }
76
82
 
@@ -271,10 +271,6 @@ function removeArticle(){
271
271
  margin: 0;
272
272
  }
273
273
 
274
- @media (max-width: 600px) {
275
- grid-column: span 2;
276
- }
277
-
278
274
  @media (max-width: 500px) {
279
275
  display: none;
280
276
  }
@@ -289,6 +285,9 @@ function removeArticle(){
289
285
 
290
286
  .viur-shop-cart-leaf-quantity {
291
287
  align-self: center;
288
+ @media (max-width: 600px) {
289
+ grid-column: span 2;
290
+ }
292
291
  }
293
292
 
294
293
  .viur-shop-cart-leaf-unitprice {
@@ -6,16 +6,16 @@
6
6
  type="currency"
7
7
  currency="EUR"
8
8
  :value="item.price.current * amount"
9
- :class="{pricetag_current:!retail}"
9
+ :class="{'viur-shop-cart-leaf-value--current':!retail}"
10
10
  >
11
11
  </sl-format-number>
12
- <div style="position: relative;" v-if="retail">
12
+ <div style="position: relative;" v-if="retail && (item.price.recommended > item.price.current)">
13
13
  <sl-format-number
14
- class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice pricetag_old"
14
+ class="viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice viur-shop-cart-leaf-value--recommended"
15
15
  lang="de"
16
16
  type="currency"
17
17
  currency="EUR"
18
- :value="item.price.retail * amount"
18
+ :value="item.price.recommended * amount"
19
19
  >
20
20
  </sl-format-number>
21
21
  </div>
@@ -42,24 +42,20 @@ const props = defineProps({
42
42
  </script>
43
43
 
44
44
  <style scoped>
45
- :is(.pricetag_old):before {
46
- content: " ";
47
- border-bottom: 2px solid var(--sl-color-primary-500);
48
- width: 100%;
49
- display: block;
50
- position: absolute;
51
- top:calc(0.7rem);
52
- }
53
45
 
54
- .pricetag_old{
46
+ .viur-shop-cart-leaf-value--recommended {
55
47
  font-size: 0.8rem;
56
-
48
+ &:before {
49
+ content: " ";
50
+ border-bottom: 2px solid var(--sl-color-primary-500);
51
+ width: 100%;
52
+ display: block;
53
+ position: absolute;
54
+ top:calc(0.7rem);
55
+ }
57
56
  }
58
- .pricetag_current{
57
+
58
+ .viur-shop-cart-leaf-value--current {
59
59
  margin-left:auto;
60
60
  }
61
-
62
-
63
61
  </style>
64
- <script setup lang="ts">
65
- </script>
package/src/shop.js CHANGED
@@ -160,6 +160,10 @@ export const useViurShopStore = defineStore("viurshopStore", () => {
160
160
 
161
161
  const params = useUrlSearchParams('hash')
162
162
  params['step'] = state.currentTab
163
+ window.scrollTo({
164
+ top: 0,
165
+ behavior: 'smooth'
166
+ });
163
167
  }
164
168
 
165
169
  function navigateToNext(){