1405/02/12-dev banners feature

This commit is contained in:
2026-05-02 13:58:24 +03:30
parent 039bc49eca
commit f8beee7ba7
8 changed files with 452 additions and 204 deletions
-2
View File
@@ -8,7 +8,6 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
AButton: typeof import('ant-design-vue/es')['Button']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADivider: typeof import('ant-design-vue/es')['Divider']
AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem']
@@ -22,7 +21,6 @@ declare module 'vue' {
ASlider: typeof import('ant-design-vue/es')['Slider']
ASpin: typeof import('ant-design-vue/es')['Spin']
ATag: typeof import('ant-design-vue/es')['Tag']
ATextarea: typeof import('ant-design-vue/es')['Textarea']
ATooltip: typeof import('ant-design-vue/es')['Tooltip']
BaseDatePicker: typeof import('./src/components/BasicPacks/BaseDatePicker/src/BaseDatePicker.vue')['default']
Basic: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/basic.vue')['default']
+56 -2
View File
@@ -21,6 +21,7 @@
"moment-jalaali": "^0.10.0",
"odometer": "^0.4.8",
"pinia": "^2.1.4",
"quill": "^2.0.3",
"sass": "^1.69.4",
"swiper": "^12.1.2",
"unocss": "^0.55.1",
@@ -5025,6 +5026,12 @@
"node": ">=0.10.0"
}
},
"node_modules/eventemitter3": {
"version": "5.0.4",
"resolved": "https://mirror-npm.runflare.com/eventemitter3/-/eventemitter3-5.0.4.tgz",
"integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
"license": "MIT"
},
"node_modules/execa": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz",
@@ -5057,8 +5064,7 @@
"node_modules/fast-diff": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
"integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
"dev": true
"integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw=="
},
"node_modules/fast-glob": {
"version": "3.3.1",
@@ -6384,12 +6390,25 @@
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
},
"node_modules/lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://mirror-npm.runflare.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==",
"license": "MIT"
},
"node_modules/lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
"integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==",
"dev": true
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://mirror-npm.runflare.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
"deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.",
"license": "MIT"
},
"node_modules/lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@@ -6991,6 +7010,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/parchment": {
"version": "3.0.0",
"resolved": "https://mirror-npm.runflare.com/parchment/-/parchment-3.0.0.tgz",
"integrity": "sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==",
"license": "BSD-3-Clause"
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@@ -7303,6 +7328,35 @@
}
]
},
"node_modules/quill": {
"version": "2.0.3",
"resolved": "https://mirror-npm.runflare.com/quill/-/quill-2.0.3.tgz",
"integrity": "sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==",
"license": "BSD-3-Clause",
"dependencies": {
"eventemitter3": "^5.0.1",
"lodash-es": "^4.17.21",
"parchment": "^3.0.0",
"quill-delta": "^5.1.0"
},
"engines": {
"npm": ">=8.2.3"
}
},
"node_modules/quill-delta": {
"version": "5.1.0",
"resolved": "https://mirror-npm.runflare.com/quill-delta/-/quill-delta-5.1.0.tgz",
"integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==",
"license": "MIT",
"dependencies": {
"fast-diff": "^1.3.0",
"lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0"
},
"engines": {
"node": ">= 12.0.0"
}
},
"node_modules/randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
+1
View File
@@ -25,6 +25,7 @@
"moment-jalaali": "^0.10.0",
"odometer": "^0.4.8",
"pinia": "^2.1.4",
"quill": "^2.0.3",
"sass": "^1.69.4",
"swiper": "^12.1.2",
"unocss": "^0.55.1",
+2
View File
@@ -13,6 +13,7 @@
:cancel-text="props.cancelText"
:wrapClassName="props.wrapClassName"
:closable="props.closable"
:destroy-on-close="props.destroyOnClose"
>
<template v-if="props.customFooter" #footer> <slot name="footer" /></template>
<a-spin :spinning="props.loading">
@@ -41,6 +42,7 @@ interface Prop {
loading?: boolean
wrapClassName?: string
closable?: boolean
destroyOnClose?:boolean
}
const props = withDefaults(defineProps<Prop>(), {
+47
View File
@@ -0,0 +1,47 @@
export interface IBanner {
show: boolean
large: string | null
medium: string | null
small: string | null
banner1: string | null
banner2: string | null
banner3: string | null
banner4: string | null
banner5: string | null
banner6: string | null
banner_1_link: string | null
banner_2_link: string | null
banner_3_link: string | null
banner_4_link: string | null
banner_5_link: string | null
banner_6_link: string | null
}
export interface IBenefits {
show: boolean
icon: string | null
caption: string | null
link: string | null
typeClick:string | null
modalText:string|null
}
export interface countryCreator {
caption: string | null
key: string | null
value: string | null
}
export interface priceRange {
min: number | null
max: number | null
key: string | null
value: string | null
}
export interface Categories {
caption: number | null
key: string | null
value: string | null
link: string | null
}
export interface notificationBar {
notifBar_text: string
notifBar_show: boolean
}
+184 -85
View File
@@ -1,9 +1,9 @@
<template>
<div class=" mt-20 ">
<!-- <div class="flex gap-7 overflow-x-scroll px-5">
<ProductInventory v-for="item in productInventorys" :ProductItem="item" class="shadow-lg my-5" :key="item.id"></ProductInventory>
</div>-->
<!-- <div class="flex gap-7 overflow-x-scroll px-5">
<ProductInventory v-for="item in productInventorys" :ProductItem="item" class="shadow-lg my-5" :key="item.id"></ProductInventory>
</div>-->
<div>
<div
v-if="userStore.userInfo && !loading"
@@ -13,7 +13,7 @@
v-if="limitedPrice !== undefined && userStore?.userInfo.trade_active !== 1"
class="text-red text-xs flex gap-1 items-center justify-center mb-2"
>
<Icon icon="vuesax-linear:info-circle" size="16" />
<Icon icon="vuesax-linear:info-circle" size="16"/>
حداقل مبلغ اولیه برای ثبت سفارش
{{ usePriceWithoutType(limitedPrice.value as number ?? 0) }} ریال می باشد.
</div>
@@ -26,20 +26,20 @@
<div class="mt-5 p-1 shadow-lg from-primary rounded-lg p-px to-transparent">
<div class="p-2 py-3 rounded-lg bg-tertiary">
<div class="flex justify-between ">
<!-- <div
class="text-center w-full flex-flex-col items-center home_appear_fade_in_up"
style="text-align: -webkit-center"
@click="router.push({ name: 'buyProduct', query: { state: 'sell' } })"
>
<div
class="rounded-full w-[42px] h-[42px] bg-primary flex items-center justify-center"
style="border: solid 1px #0A1B37"
<!-- <div
class="text-center w-full flex-flex-col items-center home_appear_fade_in_up"
style="text-align: -webkit-center"
@click="router.push({ name: 'buyProduct', query: { state: 'sell' } })"
>
<div
class="rounded-full w-[42px] h-[42px] bg-primary flex items-center justify-center"
style="border: solid 1px #0A1B37"
>
<Icon class="text-tertiary" icon="vuesax-linear:money-send" />
</div>
<div class="text-primary">فروش</div>
</div>-->
>
<Icon class="text-tertiary" icon="vuesax-linear:money-send" />
</div>
<div class="text-primary">فروش</div>
</div>-->
<div
class="text-center w-full flex-flex-col items-center home_appear_fade_in_up"
style="text-align: -webkit-center"
@@ -50,7 +50,7 @@
style="border: solid 1px #0A1B37"
>
<Icon class="text-tertiary" icon="vuesax-linear:money-receive" />
<Icon class="text-tertiary" icon="vuesax-linear:money-receive"/>
</div>
<div class="text-primary">خرید و فروش</div>
</div>
@@ -65,7 +65,7 @@
style="border: solid 1px #0A1B37"
>
<Icon class="text-tertiary" icon="vuesax-linear:card-add" />
<Icon class="text-tertiary" icon="vuesax-linear:card-add"/>
</div>
<div class="text-primary">واریز نقدی</div>
</div>
@@ -79,7 +79,7 @@
class="rounded-full w-[50px] h-[50px] bg-primary flex items-center justify-center "
style="border: solid 1px #0A1B37"
>
<Icon class="text-tertiary" icon="vuesax-linear:receipt-item" />
<Icon class="text-tertiary" icon="vuesax-linear:receipt-item"/>
</div>
<div class="text-primary">موجودی</div>
</div>
@@ -93,7 +93,7 @@
style=" border: solid 1px #0A1B37"
>
<Icon class="text-tertiary font-bold" icon="vuesax-linear:cup" />
<Icon class="text-tertiary font-bold" icon="vuesax-linear:cup"/>
</div>
<div class="text-primary">دارایی ها</div>
</div>
@@ -105,17 +105,21 @@
<div class="bg-primary rounded-lg p-2 py-3 mt-2">
<div class="flex justify-center text-tertiary w-full z-20">
محصولات:
<div class="text-l mr-2 font-bold">{{ userStore?.userInfo?.wallet?.count_product ?? 0}}عدد</div>
<div class="text-l mr-2 font-bold">{{ userStore?.userInfo?.wallet?.count_product ?? 0 }}عدد</div>
</div>
<div class="flex mt-2 justify-center text-tertiary w-full z-20">
دارایی طلایی:
<div class="text-l mr-2 font-bold">{{ (userStore?.userInfo?.wallet?.count_gold ?? 0).toFixed(3)}}گرم</div>
<BasicIcon @click="openGoldModal" icon="vuesax-linear:info-circle" size="18" color="tertiary" />
<div class="text-l mr-2 font-bold">{{ (userStore?.userInfo?.wallet?.count_gold ?? 0).toFixed(3) }}گرم
</div>
<BasicIcon @click="openGoldModal" icon="vuesax-linear:info-circle" size="18" color="tertiary"/>
</div>
<div class="flex mt-2 justify-center text-tertiary w-full z-20">
دارایی ریالی:
<div class="text-l mr-2 font-bold">{{ usePriceWithoutType(userStore?.userInfo?.wallet?.count_cash ?? 0) }}ریال</div>
<BasicIcon @click="openRialModal" icon="vuesax-linear:info-circle" size="18" color="tertiary" />
<div class="text-l mr-2 font-bold">{{
usePriceWithoutType(userStore?.userInfo?.wallet?.count_cash ?? 0)
}}ریال
</div>
<BasicIcon @click="openRialModal" icon="vuesax-linear:info-circle" size="18" color="tertiary"/>
</div>
</div>
<!-- <div class="flex justify-center mt-2 w-full z-20">
@@ -219,10 +223,10 @@
</div>
</div>
</div>
<!-- <div class="flex mt-5 gap-1 bg-primary text-tertiary cursor-pointer font-bold justify-center rounded-lg py-5"
@click="router.push({ name: 'buyProduct' })">
<div>خرید و فروش</div>
</div>-->
<!-- <div class="flex mt-5 gap-1 bg-primary text-tertiary cursor-pointer font-bold justify-center rounded-lg py-5"
@click="router.push({ name: 'buyProduct' })">
<div>خرید و فروش</div>
</div>-->
<div
v-if="config.config.name === 'garoosi' && banners?.length > 0"
class="w-full relative mt-2 flex flex-col justify-center home_appear_fade_in overflow-hidden rounded-lg"
@@ -243,7 +247,7 @@
:src="banner.icon"
:alt="banner.caption || ''"
@click="handleBannerClick(banner)"
:style="banner.link ? 'cursor: pointer;' : ''"
:style="(banner.link || banner.typeClick=='share') ? 'cursor: pointer;' : ''"
/>
</swiper-slide>
</swiper>
@@ -295,7 +299,7 @@
</div>
</div>
</div>
<a-divider class="bg-gray-200 !h-auto !my-2" type="vertical" />
<a-divider class="bg-gray-200 !h-auto !my-2" type="vertical"/>
<div class="text-center w-full">
<div>پایین ترین قیمت امروز</div>
<div class="flex w-full mt-3 justify-evenly">
@@ -311,7 +315,7 @@
</div>
<div v-else class="bg-white w-screen md:w-auto h-[80vh] px-5 m-[-1px] flex justify-center ">
<HomeSkeleton class="w-full" />
<HomeSkeleton class="w-full"/>
</div>
<!-- <div class="relative pt-15 overflow-hidden ">-->
<!-- <div class="absolute left&#45;&#45;12 top-0">-->
@@ -338,7 +342,7 @@
class="z-100000 rounded-full border-1"
:class="y > 50 ? 'text-primary border-primary' : 'text-primary border-primary'"
>
<Icon icon="vuesax-linear:user" size="20" />
<Icon icon="vuesax-linear:user" size="20"/>
</div>
<div :class="y > 50 ? 'text-primary' : 'text-primary'" class="color-transition font-bold">
{{ userStore.userInfo?.name }}
@@ -404,21 +408,21 @@
is-line
:value="parseFloat((walletStore.walletInfo?.treasure_sum ?? 0)?.toFixed(3)) + ' گرم'"
/>-->
<a-divider class="!my-1" />
<a-divider class="!my-1"/>
<BasicInfoItem
class="flex justify-between"
title="دارایی کیف پول ریالی"
is-line
:value="usePrice(walletStore.walletInfo?.cash ?? 0)"
/>
<a-divider class="!my-1" />
<a-divider class="!my-1"/>
<BasicInfoItem
class="flex justify-between"
title="دارایی کیف پول طلایی"
is-line
:value="(walletStore.walletInfo?.count_gold_wallet ?? 0) + ' گرم'"
/>
<a-divider class="!my-1" />
<a-divider class="!my-1"/>
<BasicInfoItem
v-if="nameProject === 'goldsun'"
class="flex justify-between"
@@ -426,7 +430,7 @@
is-line
:value="(walletStore.walletInfo?.count_silver ?? 0) + ' گرم'"
/>
<a-divider v-if="nameProject === 'goldsun'" class="!my-1" />
<a-divider v-if="nameProject === 'goldsun'" class="!my-1"/>
<BasicInfoItem
v-if="nameProject === 'goldsun'"
class="flex justify-between"
@@ -434,7 +438,7 @@
is-line
:value="(walletStore.walletInfo?.count_copper ?? 0) + ' گرم'"
/>
<a-divider v-if="nameProject === 'goldsun'" class="!my-1" />
<a-divider v-if="nameProject === 'goldsun'" class="!my-1"/>
<BasicInfoItem
class="flex justify-between"
@@ -442,45 +446,91 @@
is-line
:value="usePrice(walletStore.walletInfo?.count_cash_total ?? 0)"
/>
<a-divider class="!my-1" />
<a-divider class="!my-1"/>
<!-- <BasicInfoItem class="flex justify-between" title="دارایی کیف پول(به گرم)" is-line
:value="((walletStore.walletInfo?.cash?? 0) / (goldVal?? 0)).toFixed(2)+ ' گرم'" />
<a-divider class="!my-1" />-->
<!-- <BasicInfoItem
class="flex justify-between"
title="ارزش کل دارایی شما"
is-line
:value="
usePrice(
(
(walletStore.walletInfo?.gold_sum ?? 0) * (goldVal ?? 0) +
(walletStore.walletInfo?.cash ?? 0)
).toFixed(0)
)
"
/>-->
<!-- <BasicInfoItem
class="flex justify-between"
title="ارزش کل دارایی شما"
is-line
:value="
usePrice(
(
(walletStore.walletInfo?.gold_sum ?? 0) * (goldVal ?? 0) +
(walletStore.walletInfo?.cash ?? 0)
).toFixed(0)
)
"
/>-->
</div>
</div>
</div>
</div>
</BasicActionSheet>
<BasicModal v-model:visible="showTextBanner" :custom-footer="true" destroyOnClose="true" >
<div class="max-h-[54vh]">
<div class="w-full ql-editor " v-html="TextBanner">
</div>
</div>
</BasicModal>
<BasicModal v-model:visible="showShare" :custom-footer="true" >
<div class="p-2">
<div
v-if="userStore.userInfo?.referral_id"
class="text-primary font-bold w-full text-center flex justify-between gap-2 items-center"
>
کد معرف:
<div class="flex gap-2">
<div class="mr-2">{{ userStore.userInfo?.referral_id }}</div>
<!-- <BasicIcon icon="vuesax-linear:copy" color="#2563EB" class="cursor-pointer" size="18"
@click.stop="copyCode()" />
&lt;!&ndash; vuesax-linear:hierarchy-3&ndash;&gt;
<BasicIcon icon="vuesax-linear:share" color="#2563EB" class="cursor-pointer" size="18"
@click.stop="shareCode()" />-->
</div>
</div>
<div class="w-full flex gap-2 mt-1">
<BasicButton
icon="vuesax-linear:share"
size="small"
class="flex-1"
icon-size="18"
@click.stop="shareCode()"
>
{{ getConfigApp('name') == 'garoosi' ? 'دعوت از دوستان' : ' اشتراک گذاری' }}
</BasicButton>
<BasicButton
icon="vuesax-linear:copy"
size="small"
class="flex-1"
icon-size="18"
@click.stop="copyCode()"
>
رونوشت
</BasicButton>
</div>
</div>
</BasicModal>
</template>
<script lang="tsx" setup>
import img from '@/assets/img/home_ly1.svg'
import Icon from '@/components/BasicPacks/BasicIcon.vue'
import { usePrice, usePriceWithoutType, useTowDecimal } from '../../../utils/usePrice'
import {usePrice, usePriceWithoutType, useTowDecimal} from '../../../utils/usePrice'
import {computed, onMounted, onUnmounted, ref, watch} from 'vue'
import router from '@/router'
import * as echarts from 'echarts'
import { useIntersectionObserver, useWindowScroll } from '@vueuse/core'
import { loading, removeToken } from '@/utils'
import { useUserStore } from '@/store/userStore'
import { useWalletStore } from '@/store/walletStore'
import {useIntersectionObserver, useWindowScroll} from '@vueuse/core'
import {loading, removeToken} from '@/utils'
import {useUserStore} from '@/store/userStore'
import {useWalletStore} from '@/store/walletStore'
import DialogVant from '@/components/DialogVant.vue'
import { getAllPrices, getChart } from '@/api/home'
import {getAllPrices, getChart} from '@/api/home'
import Vue3Odometer from 'vue3-odometer'
import 'odometer/themes/odometer-theme-default.css'
import 'quill/dist/quill.core.css';
import HomeSkeleton from '@/views/base/home/components/HomeSkeleton.vue'
import {
getLastPrices,
@@ -491,29 +541,33 @@ import {
setIntervalGetAllPrice,
stopPriceInterval
} from '@/utils/price'
import { DotLottieVue } from '@lottiefiles/dotlottie-vue'
import {DotLottieVue} from '@lottiefiles/dotlottie-vue'
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
import BasicInfoItem from '@/components/BasicPacks/BasicInfoItem.vue'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import type { PInventory } from '@/models/products'
import type { Fund } from '@/models/fund'
import type { TableOutput } from '@/models/table'
import { useFundUserStore } from '@/store/fundStore'
import {Modal} from "ant-design-vue";
import type {PInventory} from '@/models/products'
import type {Fund} from '@/models/fund'
import type {TableOutput} from '@/models/table'
import {useFundUserStore} from '@/store/fundStore'
import {message, Modal} from "ant-design-vue";
import {useConfigStore} from "@/store/configStore";
import { Swiper, SwiperSlide } from 'swiper/vue'
import { Autoplay, Pagination } from 'swiper/modules'
import {Swiper, SwiperSlide} from 'swiper/vue'
import {Autoplay, Pagination} from 'swiper/modules'
import 'swiper/swiper-bundle.css'
import 'swiper/css/pagination'
import { getConstByKey } from '@/api/const'
import {getConstByKey} from '@/api/const'
import type {IBenefits} from "@/models/banner";
import BasicModal from "@/components/BasicPacks/BasicModal.vue";
import {getConfigApp} from "@/utils/config";
import BasicButton from "@/components/BasicPacks/BasicButton.vue";
const bannerSwiperModules = [Autoplay, Pagination]
const nameProject = useConfigStore().config.name
const userStore = useUserStore()
const walletStore = useWalletStore()
const wholeBalanceVisible = ref<boolean>(false)
const { x, y } = useWindowScroll()
const series = ref<Chart[]>([{ data: [] }])
const {x, y} = useWindowScroll()
const series = ref<Chart[]>([{data: []}])
const key = ref<number>(0)
const main = ref(null)
const logoutLoading = ref(false)
@@ -524,7 +578,37 @@ const tableOutput = ref<TableOutput<Fund> | null>(null)
const inventory = ref<number>(0)
const sumGold = ref<number>(0)
const fundStore = useFundUserStore()
const config=useConfigStore()
const config = useConfigStore()
const showTextBanner = ref<boolean>(false)
const showShare = ref<boolean>(false)
const TextBanner = ref<string>('')
function shareCode() {
// nextTick(() => {
const val = `⭐️الان طلا بخر؛ آخر ماه سودشو ببر!
با خرید طلای آبشده در مقدارهای کم ولی مستمر، سود بیشتری ببر!
این دعوت نامه از طرف "${userStore.userInfo?.name}" عزیز برای شما ارسال شده تا شما هم از بازار طلای ${nameProject} جا نمونید.
روی لینک زیر کلیک کنید و ثبت نام خود را تکمیل کنید.
${window.location.hostname}/login?id=${userStore.userInfo?.referral_id}`
navigator.share({
title: nameProject,
text: val
})
// message.info('کد رونوشت شد')
// })
}
function copyCode() {
// nextTick(() => {
const val = userStore.userInfo?.referral_id
console.log(val)
navigator.clipboard.writeText(val)
message.info('کد رونوشت شد')
// })
}
async function initTable() {
try {
loading.value = true
@@ -537,7 +621,8 @@ async function initTable() {
}
}
const banners = ref<Array<{ icon: string; show: boolean; caption: string | null; link: string | null }>>([])
const banners = ref<Array<IBenefits>>([])
async function initBanners() {
try {
const response = await getConstByKey('header_banner')
@@ -570,14 +655,25 @@ async function initBanners() {
}
}
function handleBannerClick(banner: { icon: string; show: boolean; caption: string | null; link: string | null }) {
if (!banner.link) return
if (banner.link.startsWith('http://') || banner.link.startsWith('https://')) {
window.open(banner.link, '_blank')
} else {
router.push(banner.link)
function handleBannerClick(banner: IBenefits) {
if (banner.typeClick == 'share') {
showShare.value = true
}
if (banner.typeClick == 'modal') {
if (!banner.modalText) return
TextBanner.value = banner.modalText
showTextBanner.value = true
}
if (banner.typeClick == 'link') {
if (!banner.link) return
if (banner.link.startsWith('http://') || banner.link.startsWith('https://')) {
window.open(banner.link, '_blank')
} else {
router.push(banner.link)
}
}
}
onUnmounted(() => {
@@ -612,7 +708,7 @@ const targetIsVisible = ref(false)
const isHidden = ref<boolean>(false)
const { stop } = useIntersectionObserver(target, ([{ isIntersecting }], observerElement) => {
const {stop} = useIntersectionObserver(target, ([{isIntersecting}], observerElement) => {
targetIsVisible.value = isIntersecting
console.log('saaaaa', targetIsVisible.value)
})
@@ -840,7 +936,7 @@ async function initPrice() {
goldVal.value = 0
// console.log(price?.value.price_last)
if (userStore.isFirst) {
const timer = setInterval(function() {
const timer = setInterval(function () {
update()
// if (current == end) {
userStore.isFirst = false
@@ -912,7 +1008,7 @@ async function logout() {
/* userStore.$reset()
walletStore.$reset()*/
removeToken()
await router.push({ name: 'login' })
await router.push({name: 'login'})
logoutLoading.value = true
window.location.reload()
// console.log('salam')
@@ -924,16 +1020,16 @@ async function openGoldModal() {
title: `در این قسمت مجموع کل وزن طلای آبشده (${(walletStore.walletInfo?.gold ?? 0)?.toFixed(3)}) + ارزش دارایی ها (${(walletStore.walletInfo?.count_gold_wallets ?? 0)?.toFixed(3)} ) را مشاهده میفرمایید.`,
okText: 'متوجه شدم',
centered: true,
cancelButtonProps: { style: { display: 'none' } },
cancelButtonProps: {style: {display: 'none'}},
})
}
async function openRialModal() {
Modal.confirm({
title: `در این قسمت مجموع کیف پول ریالی (${usePrice(walletStore?.walletInfo?.count_cash_wallet ?? 0) }) + معادل ریالی محصولات (${ usePrice(walletStore?.walletInfo?.count_cash_wallets ?? 0)} ) را مشاهده میفرمایید.`,
title: `در این قسمت مجموع کیف پول ریالی (${usePrice(walletStore?.walletInfo?.count_cash_wallet ?? 0)}) + معادل ریالی محصولات (${usePrice(walletStore?.walletInfo?.count_cash_wallets ?? 0)} ) را مشاهده میفرمایید.`,
okText: 'متوجه شدم',
centered: true,
cancelButtonProps: { style: { display: 'none' } },
cancelButtonProps: {style: {display: 'none'}},
})
}
</script>
@@ -970,11 +1066,13 @@ apexchart {
/* بنر اسلایدر — ظاهر و نقطه‌های pagination مشابه نمونه */
.banner-swiper {
--swiper-pagination-bottom: 0.75rem;
.swiper-slide {
display: flex;
align-items: center;
justify-content: center;
}
.swiper-pagination-bullet {
width: 0.5rem;
height: 0.5rem;
@@ -982,6 +1080,7 @@ apexchart {
opacity: 1;
transition: background 0.2s;
}
.swiper-pagination-bullet-active {
background: #fff;
}
+121 -113
View File
@@ -2,17 +2,17 @@
<div class="relative">
<div>
<!-- <img :src="gr_bottom" alt="" class="absolute bottom-20">-->
<img :src="img" alt="" class="mt-2 w-full absolute bottom-0" />
<img :src="img" alt="" class="mt-2 w-full absolute bottom-0"/>
</div>
<div class="bg-white w-full py-3 px-3 text-primary font-bold drop-shadow flex">
<div @click="router.back()" class="cursor-pointer">
<BasicIcon icon="vuesax-linear:arrow-right-1" />
<BasicIcon icon="vuesax-linear:arrow-right-1"/>
</div>
<div class="mr-2 mt-2">اطلاعات حساب کاربری</div>
</div>
<div class="pt-16 pb-8 z-30 relative">
<div
class="border-gray-200 border-1 rounded-xl p-5 trans flex flex-col items-center mx-5 z-1000 relative bg-white shadow-lg"
class="border-gray-200 border-1 rounded-xl p-5 trans flex flex-col items-center mx-5 z-1000 relative bg-white shadow-lg"
>
<div class="text-primary font-bold w-full text-center flex justify-between">
نام و نام خانوادگی:
@@ -23,8 +23,8 @@
<div class="mr-2">{{ userStore.userInfo?.mobile }}</div>
</div>
<div
v-if="userStore.userInfo?.referral_id"
class="text-primary font-bold w-full text-center flex justify-between gap-2 items-center"
v-if="userStore.userInfo?.referral_id"
class="text-primary font-bold w-full text-center flex justify-between gap-2 items-center"
>
کد معرف:
<div class="flex gap-2">
@@ -38,131 +38,131 @@
</div>
<div class="w-full flex gap-2 mt-1">
<BasicButton
icon="vuesax-linear:share"
size="small"
class="flex-1"
icon-size="18"
@click.stop="shareCode()"
icon="vuesax-linear:share"
size="small"
class="flex-1"
icon-size="18"
@click.stop="shareCode()"
>
اشتراک گذاری
{{ getConfigApp('name') == 'garoosi' ? 'دعوت از دوستان' : ' اشتراک گذاری' }}
</BasicButton>
<BasicButton
icon="vuesax-linear:copy"
size="small"
class="flex-1"
icon-size="18"
@click.stop="copyCode()"
icon="vuesax-linear:copy"
size="small"
class="flex-1"
icon-size="18"
@click.stop="copyCode()"
>
رونوشت
</BasicButton>
</div>
<BasicButton
class="mt-5 w-full"
icon=""
iconSize="18"
size="large"
type="primary"
@click="editPassVisible = true"
class="mt-5 w-full"
icon=""
iconSize="18"
size="large"
type="primary"
@click="editPassVisible = true"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:eye" class="absolute right-8" />
<BasicIcon icon="vuesax-linear:eye" class="absolute right-8"/>
<div>ویرایش اطلاعات کاربری</div>
</div>
</BasicButton>
<div class="h-40vh overflow-y-auto mt-4">
<BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="editPasswordVisible = true"
:key="10"
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="editPasswordVisible = true"
:key="10"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:lock" class="absolute right-8" />
<BasicIcon icon="vuesax-linear:lock" class="absolute right-8"/>
<div>تغییر رمز عبور</div>
</div>
</BasicButton>
<BasicButton
class="w-full mt-2"
size="large"
@click="$router.push({ name: 'address' })"
class="w-full mt-2"
size="large"
@click="$router.push({ name: 'address' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:map" class="absolute right-8" />
<BasicIcon icon="vuesax-linear:map" class="absolute right-8"/>
<div>آدرس ها</div>
</div>
</BasicButton>
<BasicButton
class="w-full mt-2"
size="large"
@click="$router.push({ name: 'notifyTrigger' })"
class="w-full mt-2"
size="large"
@click="$router.push({ name: 'notifyTrigger' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:bill" class="absolute right-8" />
<BasicIcon icon="vuesax-linear:bill" class="absolute right-8"/>
<div>هشدار قیمت</div>
</div>
</BasicButton>
<BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'about' })"
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'about' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:info-circle" class="absolute right-8" />
<BasicIcon icon="vuesax-linear:info-circle" class="absolute right-8"/>
<div>درباره ما</div>
</div>
</BasicButton>
<BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'physicalReceive' })"
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'physicalReceive' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:direct-inbox" class="absolute right-8" />
<BasicIcon icon="vuesax-linear:direct-inbox" class="absolute right-8"/>
<div>دریافت طلای فیزیکی</div>
</div>
</BasicButton>
<BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'rules' })"
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'rules' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:task" class="absolute right-8" />
<BasicIcon icon="vuesax-linear:task" class="absolute right-8"/>
<div>قوانین و مقررات</div>
</div>
</BasicButton>
<!-- <BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'permissions' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:archive-book" class="absolute right-8" />
<div>مجوز ها</div>
</div>
</BasicButton>-->
<!-- <BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'earnMoney' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:dollar-circle" class="absolute right-8" />
<div>کسب درآمد</div>
</div>
</BasicButton>-->
<!-- <BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'permissions' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:archive-book" class="absolute right-8" />
<div>مجوز ها</div>
</div>
</BasicButton>-->
<!-- <BasicButton
class="mt-2 w-full"
icon=""
iconSize="18"
size="large"
@click="$router.push({ name: 'earnMoney' })"
>
<div class="flex">
<BasicIcon icon="vuesax-linear:dollar-circle" class="absolute right-8" />
<div>کسب درآمد</div>
</div>
</BasicButton>-->
</div>
</div>
</div>
@@ -171,37 +171,38 @@
<div class="flex justify-center justify-between">
<div class="font-bold text-lg">ویرایش اطلاعات</div>
<div class="flex flex-col justify-center items-center">
<BasicIcon :icon="isLegal.icon" size="30" :class="isLegal.color" />
<BasicIcon :icon="isLegal.icon" size="30" :class="isLegal.color"/>
<p class="text-[10px] mt-1" :class="isLegal.color">{{ isLegal.title }}</p>
</div>
</div>
<div class="h60vh overflow-y-auto pb20">
<a-form ref="formRef" :model="userFormState" class="!mt-5" name="basic" @finish="ok">
<a-form-item :rules="[isValidPersian()]" label="نام" name="fname">
<BasicInput v-model:value="userFormState.fname" />
<BasicInput v-model:value="userFormState.fname"/>
</a-form-item>
<a-form-item :rules="[isValidPersian()]" label="نام خانوادگی" name="lname">
<BasicInput v-model:value="userFormState.lname" />
<BasicInput v-model:value="userFormState.lname"/>
</a-form-item>
<a-form-item label="تاریخ تولد" name="birth_date">
<BaseDatePicker v-model:value="userFormState.birth_date" class="w-full" inputReadOnly />
<BaseDatePicker v-model:value="userFormState.birth_date" class="w-full" inputReadOnly/>
</a-form-item>
<a-form-item :rules="[requireNationalCode()]" label="شماره ملی" name="n_code">
<BasicInput v-model:value="userFormState.n_code" type="number" :disabled="userFormState.is_legal == 1 || userFormState.is_legal == 2" />
<BasicInput v-model:value="userFormState.n_code" type="number"
:disabled="userFormState.is_legal == 1 || userFormState.is_legal == 2"/>
</a-form-item>
<a-form-item label="نام شهر" name="city">
<BasicInput v-model:value="userFormState.city" />
<BasicInput v-model:value="userFormState.city"/>
</a-form-item>
<a-form-item>
<div class="wrap-fix md:w-[395px] bottom-5 px-3">
<BasicButton
:disabled="loading"
class="w-full py-2 mb-20"
html-type="submit"
type="primary"
:disabled="loading"
class="w-full py-2 mb-20"
html-type="submit"
type="primary"
>
<div>
<a-spin v-if="loading" size="small" />
<a-spin v-if="loading" size="small"/>
<div v-else>ثبت</div>
</div>
</BasicButton>
@@ -214,20 +215,20 @@
<div class="font-bold text-lg">ویرایش رمزعبور</div>
<div class="h30vh overflow-y-auto pb20">
<a-form
ref="formPassRef"
:model="userPassForm"
class="!mt-5"
name="basic"
@finish="submitPassForm"
ref="formPassRef"
:model="userPassForm"
class="!mt-5"
name="basic"
@finish="submitPassForm"
>
<a-form-item label="کلمه عبور جدید" :rules="passwordRules()" name="password">
<BasicInput v-model:value="userPassForm.password" isPassword place-holder="کلمه عبور " />
<BasicInput v-model:value="userPassForm.password" isPassword place-holder="کلمه عبور "/>
<div
:class="[
:class="[
guideTypePassword.color,
userPassForm.password.length >= 6 ? 'block' : 'hidden'
]"
class="text-[12px] mt-1"
class="text-[12px] mt-1"
>
{{ guideTypePassword.text }}
</div>
@@ -235,13 +236,13 @@
<a-form-item>
<div class="wrap-fix md:w-[395px] bottom-5 px-3">
<BasicButton
:disabled="loading"
class="w-full py-2 mb-20"
html-type="submit"
type="primary"
:disabled="loading"
class="w-full py-2 mb-20"
html-type="submit"
type="primary"
>
<div>
<a-spin v-if="loading" size="small" />
<a-spin v-if="loading" size="small"/>
<div v-else>ثبت</div>
</div>
</BasicButton>
@@ -254,10 +255,10 @@
</template>
<script lang="ts" setup>
import { onMounted, reactive, ref, computed } from 'vue'
import {onMounted, reactive, ref, computed} from 'vue'
import img from '@/assets/img/user_ly1.svg'
import gr_bottom from './assets/img/gr_bottom_white.svg'
import { loading } from '@/utils'
import {loading} from '@/utils'
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
import {
@@ -269,15 +270,17 @@ import {
isValidPersian,
} from '@/utils/inputRules'
import BasicInput from '@/components/BasicPacks/BasicInput.vue'
import type { User, Password } from '@/models/login'
import type {User, Password} from '@/models/login'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import router from '@/router'
import type { FormInstance } from 'ant-design-vue'
import { message } from 'ant-design-vue'
import { updateMe, updatePass } from '@/api/me'
import { useUserStore } from '@/store/userStore'
import type {FormInstance} from 'ant-design-vue'
import {message} from 'ant-design-vue'
import {updateMe, updatePass} from '@/api/me'
import {useUserStore} from '@/store/userStore'
import BaseDatePicker from '@/components/BasicPacks/BaseDatePicker'
import {useConfigStore} from "@/store/configStore";
import {getConfigApp} from "../../../utils/config";
const userFormState = ref<User>({
fname: '',
lname: '',
@@ -292,7 +295,7 @@ const userPassForm = ref<Password>({
const formRef = ref<FormInstance>()
const formPassRef = ref<FormInstance>()
const userStore = useUserStore()
const nameProject= useConfigStore().config.name_fa
const nameProject = useConfigStore().config.name_fa
// const editPassVisible = ref<boolean>(false)
const editPassVisible = ref<boolean>(false)
@@ -309,6 +312,7 @@ function copyCode() {
message.info('کد رونوشت شد')
// })
}
const isLegal = computed(() => {
const result = {
title: '',
@@ -386,6 +390,7 @@ function ok() {
}
})
}
function submitPassForm() {
formPassRef.value?.validateFields().then(async () => {
try {
@@ -427,13 +432,16 @@ onMounted(() => {
.midLevel {
color: orange;
}
.week,
.reject {
color: red;
}
.success {
color: green;
}
.background-image-container {
position: absolute;
bottom: 0;
@@ -455,7 +463,7 @@ onMounted(() => {
.relative {
overflow-y: auto;
max-height: 100vh;
//scroll-behavior: smooth;
//scroll-behavior: smooth;
}
.fixed {
+41 -2
View File
@@ -2707,6 +2707,11 @@ esutils@^2.0.2:
resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
eventemitter3@^5.0.1:
version "5.0.4"
resolved "https://mirror-npm.runflare.com/eventemitter3/-/eventemitter3-5.0.4.tgz"
integrity sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==
execa@^5.0.0:
version "5.1.1"
resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz"
@@ -2757,7 +2762,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
fast-diff@^1.1.2:
fast-diff@^1.1.2, fast-diff@^1.3.0:
version "1.3.0"
resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz"
integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==
@@ -3505,16 +3510,26 @@ locate-path@^6.0.0:
dependencies:
p-locate "^5.0.0"
lodash-es@^4.17.15:
lodash-es@^4.17.15, lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://mirror-npm.runflare.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz"
integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==
lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz"
integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://mirror-npm.runflare.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz"
integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==
lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz"
@@ -3896,6 +3911,11 @@ p-locate@^5.0.0:
dependencies:
p-limit "^3.0.2"
parchment@^3.0.0:
version "3.0.0"
resolved "https://mirror-npm.runflare.com/parchment/-/parchment-3.0.0.tgz"
integrity sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==
parent-module@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz"
@@ -4079,6 +4099,25 @@ queue-microtask@^1.2.2:
resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
quill-delta@^5.1.0:
version "5.1.0"
resolved "https://mirror-npm.runflare.com/quill-delta/-/quill-delta-5.1.0.tgz"
integrity sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==
dependencies:
fast-diff "^1.3.0"
lodash.clonedeep "^4.5.0"
lodash.isequal "^4.5.0"
quill@^2.0.3:
version "2.0.3"
resolved "https://mirror-npm.runflare.com/quill/-/quill-2.0.3.tgz"
integrity sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==
dependencies:
eventemitter3 "^5.0.1"
lodash-es "^4.17.21"
parchment "^3.0.0"
quill-delta "^5.1.0"
randombytes@^2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz"