1405/04/10-fix bugs

This commit is contained in:
2026-07-01 18:16:12 +03:30
parent 4fa2c0d57d
commit c3aaeaf91a
33 changed files with 832 additions and 1051 deletions
+81 -61
View File
@@ -1,54 +1,68 @@
<template>
<div :class="isDesktop ? 'dpage products-page' : ''">
<div class="bottom-0 fixed top-0 -z-10 pointer-events-none">
<img :src="img" alt="" class=" w-inherit "
:style="{ backgroundRepeat: 'repeat', }"
/>
</div>
<a-spin :spinning="productsPageLoading">
<div class="relative z-0 !h-full overflow-y-scroll">
<div class="w-full flex justify-center top-0 py-5" style="align-self: center">
<ARadioGroup @change="changeProductsTab" v-model:value="productsActiveKey" button-style="solid">
<ARadioButton class="cats" value="همه">همه</ARadioButton>
<ARadioButton class="cats" v-for="item in productsTypeItems" :key="item" :value="item">{{ item }}</ARadioButton>
</ARadioGroup>
<div
class="products-page-root main-with-bottom-chrome-inner--contained"
:class="isDesktop ? 'dpage products-page' : ''"
>
<MobileProductsView v-if="!isDesktop" @select="clickProduct" />
<template v-else>
<div class="bottom-0 fixed top-0 -z-10 pointer-events-none">
<img :src="img" alt="" class="w-inherit" :style="{ backgroundRepeat: 'repeat' }" />
</div>
<div class="mx-5 flex justify-end" @click="viewVertical=!viewVertical">
<BasicIcon v-if="viewVertical" icon="vuesax-linear:row-vertical"></BasicIcon>
<BasicIcon v-else icon="vuesax-linear:element-3"></BasicIcon>
<a-spin :spinning="productsPageLoading">
<div class="relative z-0 !h-full overflow-y-scroll">
<div class="w-full flex justify-center top-0 py-5" style="align-self: center">
<ARadioGroup
v-model:value="productsActiveKey"
button-style="solid"
@change="changeProductsTab"
>
<ARadioButton class="cats" value="همه">همه</ARadioButton>
<ARadioButton
v-for="item in productsTypeItems"
:key="item"
class="cats"
:value="item"
>
{{ item }}
</ARadioButton>
</ARadioGroup>
</div>
<div class="mx-5 flex justify-end" @click="viewVertical = !viewVertical">
<BasicIcon v-if="viewVertical" icon="vuesax-linear:row-vertical" />
<BasicIcon v-else icon="vuesax-linear:element-3" />
</div>
<div class="mx-5 pb-30 pt-2 grid grid-cols-2 gap-3 items-stretch">
<template v-if="viewVertical">
<ProductItemVertical
v-for="item in productsItems"
:key="item.id"
class="h-full"
:ProductItem="item"
@click="clickProduct(item)"
/>
</template>
<template v-else>
<ProductItem
v-for="item in productsItems"
:key="item.id"
class="col-span-2 h-full"
:ProductItem="item"
@click="clickProduct(item)"
/>
</template>
</div>
</div>
</a-spin>
</template>
<BasicActionSheet placement="bottom" v-model:show="showFilter">
<div>
<indexGold v-if="selectedProduct?.group_type == 'آبشده'" :ProductItem="selectedProduct" />
<DealProduct v-else :ProductItem="selectedProduct" @close="showFilter = false" />
</div>
<div class="mx-5 pb-30 pt-2 grid grid-cols-2 gap-3 items-stretch">
<template v-if="viewVertical">
<ProductItemVertical
v-for="item in productsItems"
:key="item.id"
class="h-full"
:ProductItem="item"
@click="clickProduct(item)"
/>
</template>
<template v-else>
<ProductItem
v-for="item in productsItems"
:key="item.id"
class="col-span-2 h-full"
:ProductItem="item"
@click="clickProduct(item)"
/>
</template>
</div>
</div>
</a-spin>
<BasicActionSheet placement="bottom" v-model:show="showFilter">
<div class="">
<indexGold v-if="selectedProduct?.group_type=='آبشده'" :ProductItem="selectedProduct"></indexGold>
<DealProduct v-else :ProductItem="selectedProduct" @close="showFilter = false"></DealProduct>
</div>
</BasicActionSheet>
</BasicActionSheet>
</div>
</template>
@@ -61,9 +75,10 @@ import type { Product } from '@/models/products'
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
import indexGold from '@/views/base/gold/index.vue'
import DealProduct from '@/views/base/products/components/DealProduct.vue'
import img from "@/assets/img/user_ly1.svg";
import BasicIcon from "@/components/BasicPacks/BasicIcon.vue";
import ProductItemVertical from "@/views/base/products/components/ProductItemVertical.vue";
import img from '@/assets/img/user_ly1.svg'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import ProductItemVertical from '@/views/base/products/components/ProductItemVertical.vue'
import MobileProductsView from '@/views/base/products/mobile/MobileProductsView.vue'
import { isProductVisible } from '@/utils/productPrice'
import {
productsActiveKey,
@@ -76,7 +91,7 @@ import {
onProductsPageProviderUnmounted,
} from '@/views/base/products/composables/useProductsPageData'
const showFilter = ref()
const showFilter = ref<boolean>()
const selectedProduct = ref<Product>()
const viewVertical = ref(true)
const isDesktop = useDesktopBreakpoint()
@@ -98,9 +113,9 @@ onMounted(async () => {
if (router.currentRoute.value.query.state) {
if (router.currentRoute.value.query.product) {
clickProduct(productsItems.value?.find((x) => x.title === 'سکه'))
clickProduct(productsItems.value?.find((x) => x.title === 'سکه')!)
} else {
clickProduct(productsItems.value?.find((x) => x.title === 'آبشده نقدی'))
clickProduct(productsItems.value?.find((x) => x.title === 'آبشده نقدی')!)
}
}
})
@@ -110,13 +125,18 @@ onUnmounted(() => {
})
</script>
<style scoped>
.products-page-root {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
overflow: hidden;
}
</style>
<style lang="less">
.cats{
font-size: x-small;
.products-page-root.main-with-bottom-chrome-inner {
overflow: hidden !important;
}
.cats:hover span {
--un-text-opacity: 1;
color: rgba(206, 163, 76, var(--un-text-opacity))!important;
}
</style>