1405/02/12-dev banners feature
This commit is contained in:
+184
-85
@@ -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--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()" />
|
||||
<!– vuesax-linear:hierarchy-3–>
|
||||
<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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user