Skip to content

Commit

Permalink
fix: improve page display when the user changes the price or product …
Browse files Browse the repository at this point in the history
…order (#414)
  • Loading branch information
raphodn authored Mar 6, 2024
1 parent 6c6ae53 commit c0468bb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/views/BrandDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default {
initBrand() {
this.brand = this.$route.params.id
this.brandProductList = []
this.brandProductTotal = null
this.brandProductPage = 0
this.getBrandProducts()
},
Expand Down
1 change: 1 addition & 0 deletions src/views/CategoryDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default {
initCategory() {
this.category = this.$route.params.id
this.categoryProductList = []
this.categoryProductTotal = null
this.categoryProductPage = 0
this.getCategoryProducts()
},
Expand Down
1 change: 1 addition & 0 deletions src/views/LocationDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export default {
methods: {
initLocationPrices() {
this.locationPriceList = []
this.locationPriceTotal = null
this.locationPricePage = 0
this.getLocationPrices()
},
Expand Down
7 changes: 4 additions & 3 deletions src/views/ProductDetail.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<v-row>
<v-col cols="12" sm="6">
<ProductCard v-if="!loading && !productIsCategory" :product="product"></ProductCard>
<v-card v-if="!loading && productIsCategory" :title="getCategoryName" prepend-icon="mdi-fruit-watermelon" elevation="1"></v-card>
<ProductCard v-if="!productIsCategory" :product="product"></ProductCard>
<v-card v-else :title="getCategoryName" prepend-icon="mdi-fruit-watermelon" elevation="1"></v-card>
</v-col>
</v-row>

Expand Down Expand Up @@ -110,7 +110,7 @@ export default {
this.priceFilter = this.$route.query[constants.FILTER_PARAM] || this.priceFilter
this.priceOrder = this.$route.query[constants.ORDER_BY_PARAM] || this.priceOrder
this.getProduct(),
this.getProductPrices()
this.initProductPrices()
},
computed: {
productIsCategory() {
Expand Down Expand Up @@ -145,6 +145,7 @@ export default {
methods: {
initProductPrices() {
this.productPriceList = []
this.productPriceTotal = null
this.productPricePage = 0
this.getProductPrices()
},
Expand Down
1 change: 1 addition & 0 deletions src/views/ProductList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default {
methods: {
initProductList() {
this.productList = []
this.productTotal = null
this.productPage = 0
this.getProducts()
},
Expand Down
1 change: 1 addition & 0 deletions src/views/UserDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export default {
methods: {
initUserPrices() {
this.userPriceList = []
this.userPriceTotal = null
this.userPricePage = 0
this.getUserPrices()
},
Expand Down

0 comments on commit c0468bb

Please sign in to comment.