1405/02/30-kashkool
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
value-name="title"
|
||||
size="large"
|
||||
placeholder="لطفا محصول را انتخاب کنید"
|
||||
:has-tooltip="false"/>
|
||||
:has-tooltip="true"/>
|
||||
<BasicButton :disabled-b="selectedProduct==null" type="primary" @click="handleAdd">افزودن</BasicButton>
|
||||
</div>
|
||||
<div class="h-70vh rounded-lg bg-white mt-2 border-gray-200 border-1 overflow-y-auto p-2">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="flex flex-col gap-4 pt-13 pb-35 px-2">
|
||||
<RequestItem v-for="item in requestItems" :item="item"></RequestItem>
|
||||
</div>
|
||||
<!-- <Transition mode="out-in" name="fade">
|
||||
<Transition mode="out-in" name="fade">
|
||||
<div
|
||||
class="wrap-fix bottom-0 h-[19vh] bg-[#FBFBFC] shadow-lg rounded-3xl flex justify-center pt-3 z-200"
|
||||
style="box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 26px 11px"
|
||||
@@ -17,7 +17,7 @@
|
||||
<BasicIcon icon="vuesax-linear:add" />
|
||||
<div class="cursor-pointer">افزودن درخواست جدید</div>
|
||||
</div>
|
||||
</Transition>-->
|
||||
</Transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,195 +4,193 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!--
|
||||
<template>
|
||||
<div class="bottom-0 fixed top-0">
|
||||
<img :src="img" alt="" class=" w-inherit "
|
||||
:style="{ backgroundRepeat: 'repeat', }"
|
||||
/>
|
||||
</div>
|
||||
<a-spin :spinning="loading">
|
||||
<!--<template>-->
|
||||
<!-- <div class="bottom-0 fixed top-0">-->
|
||||
<!-- <img :src="img" alt="" class=" w-inherit "-->
|
||||
<!-- :style="{ backgroundRepeat: 'repeat', }"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- <a-spin :spinning="loading">-->
|
||||
|
||||
<div class=" !h-full overflow-y-scroll">
|
||||
<!-- <div class=" !h-full overflow-y-scroll">-->
|
||||
|
||||
<div class="w-full flex justify-center top-0 py-5" style="align-self: center">
|
||||
<ARadioGroup @change="changeTab" v-model:value="activekey" button-style="solid">
|
||||
<ARadioButton class="cats" value="همه">همه</ARadioButton>
|
||||
<ARadioButton class="cats" v-for="item in typeItems.filter(a => a != 'آبشده')" :value="item">{{ item }}</ARadioButton>
|
||||
</ARadioGroup>
|
||||
</div>
|
||||
<!-- <div class="w-full flex justify-center top-0 py-5" style="align-self: center">-->
|
||||
<!-- <ARadioGroup @change="changeTab" v-model:value="activekey" button-style="solid">-->
|
||||
<!-- <ARadioButton class="cats" value="همه">همه</ARadioButton>-->
|
||||
<!-- <ARadioButton class="cats" v-for="item in typeItems.filter(a => a != 'آبشده')" :value="item">{{ item }}</ARadioButton>-->
|
||||
<!-- </ARadioGroup>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="mx-5 pb-30 pt-2" style="color: #1b2b07">
|
||||
<div class="mt-3" v-for="item in items?.filter(a => a.group_type != 'آبشده')">
|
||||
<ProductItem :ProductItem="item" @click="clickProduct(item)"></ProductItem>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
<!– <BasicActionSheet v-model:show="showFilter">–>
|
||||
<!– <indexGold ></indexGold>–>
|
||||
<!– </BasicActionSheet>–>
|
||||
<!-- <div class="mx-5 pb-30 pt-2" style="color: #1b2b07">-->
|
||||
<!-- <div class="mt-3" v-for="item in items?.filter(a => a.group_type != 'آبشده')">-->
|
||||
<!-- <ProductItem :ProductItem="item" @click="clickProduct(item)"></ProductItem>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-spin>-->
|
||||
<!-- <!– <BasicActionSheet v-model:show="showFilter">–>-->
|
||||
<!-- <!– <indexGold ></indexGold>–>-->
|
||||
<!-- <!– </BasicActionSheet>–>-->
|
||||
|
||||
<BasicActionSheet placement="bottom" v-model:show="showFilter">
|
||||
<div class="">
|
||||
<!– <indexGold v-if="selectedProduct?.group_type=='آبشده'" :ProductItem="selectedProduct"></indexGold>–>
|
||||
<ReceiveDealProduct :ProductItem="selectedProduct"></ReceiveDealProduct>
|
||||
</div>
|
||||
</BasicActionSheet>
|
||||
<!-- <BasicActionSheet placement="bottom" v-model:show="showFilter">-->
|
||||
<!-- <div class="">-->
|
||||
<!--<!– <indexGold v-if="selectedProduct?.group_type=='آبشده'" :ProductItem="selectedProduct"></indexGold>–>-->
|
||||
<!-- <ReceiveDealProduct :ProductItem="selectedProduct"></ReceiveDealProduct>-->
|
||||
<!-- </div>-->
|
||||
<!-- </BasicActionSheet>-->
|
||||
|
||||
</template>
|
||||
<!--</template>-->
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue'
|
||||
import router from '@/router'
|
||||
import ProductItem from '@/views/base/products/components/ProductItem.vue'
|
||||
import { getProducts } from '@/api/products'
|
||||
import {
|
||||
getLastPrices,
|
||||
lastPrice,
|
||||
stopPriceInterval
|
||||
} from '@/utils/price'
|
||||
import { loading } from '@/utils'
|
||||
import { Price } from '@/models/home'
|
||||
import type { Product } from '@/models/products'
|
||||
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import img from "@/assets/img/user_ly1.svg";
|
||||
import ReceiveDealProduct from '@/views/base/physicalReceive/components/ReceiveDealProduct.vue'
|
||||
<!--<script setup lang="ts">-->
|
||||
<!--import { onMounted, onUnmounted, ref, watch } from 'vue'-->
|
||||
<!--import router from '@/router'-->
|
||||
<!--import ProductItem from '@/views/base/products/components/ProductItem.vue'-->
|
||||
<!--import { getProducts } from '@/api/products'-->
|
||||
<!--import {-->
|
||||
<!-- getLastPrices,-->
|
||||
<!-- lastPrice,-->
|
||||
<!-- stopPriceInterval-->
|
||||
<!--} from '@/utils/price'-->
|
||||
<!--import { loading } from '@/utils'-->
|
||||
<!--import { Price } from '@/models/home'-->
|
||||
<!--import type { Product } from '@/models/products'-->
|
||||
<!--import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'-->
|
||||
<!--import { cloneDeep } from 'lodash'-->
|
||||
<!--import img from "@/assets/img/user_ly1.svg";-->
|
||||
<!--import ReceiveDealProduct from '@/views/base/physicalReceive/components/ReceiveDealProduct.vue'-->
|
||||
|
||||
const activekey = ref('آبشده')
|
||||
const showFilter = ref()
|
||||
const selectedProduct = ref<Product>()
|
||||
<!--const activekey = ref('آبشده')-->
|
||||
<!--const showFilter = ref()-->
|
||||
<!--const selectedProduct = ref<Product>()-->
|
||||
|
||||
function clickProduct(item: Product) {
|
||||
if(item?.show){
|
||||
showFilter.value = true
|
||||
selectedProduct.value = cloneDeep(item)
|
||||
}
|
||||
}
|
||||
<!--function clickProduct(item: Product) {-->
|
||||
<!-- if(item?.show){-->
|
||||
<!-- showFilter.value = true-->
|
||||
<!-- selectedProduct.value = cloneDeep(item)-->
|
||||
<!-- }-->
|
||||
<!--}-->
|
||||
|
||||
function changeTab() {
|
||||
if (activekey.value != 'همه') {
|
||||
items.value = firstItems.value?.filter((val) =>
|
||||
val.group_type == activekey.value
|
||||
)
|
||||
} else items.value = firstItems.value
|
||||
<!--function changeTab() {-->
|
||||
<!-- if (activekey.value != 'همه') {-->
|
||||
<!-- items.value = firstItems.value?.filter((val) =>-->
|
||||
<!-- val.group_type == activekey.value-->
|
||||
<!-- )-->
|
||||
<!-- } else items.value = firstItems.value-->
|
||||
|
||||
}
|
||||
<!--}-->
|
||||
|
||||
const firstItems = ref<Product[]>()
|
||||
const price = ref<Price>()
|
||||
const items = ref<Product[]>()
|
||||
const typeItems = ref([])
|
||||
onMounted(async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
items.value = await getProducts()
|
||||
items.value?.forEach((val, index) => {
|
||||
if (!typeItems.value.includes(val.group_type)){
|
||||
typeItems.value.push(val.group_type)
|
||||
}
|
||||
// typeItems.value[index] = val.group_type
|
||||
})
|
||||
firstItems.value = items.value
|
||||
await initPrice()
|
||||
// await setIntervalGetLastPrice()
|
||||
// console.log('run product')
|
||||
<!--const firstItems = ref<Product[]>()-->
|
||||
<!--const price = ref<Price>()-->
|
||||
<!--const items = ref<Product[]>()-->
|
||||
<!--const typeItems = ref([])-->
|
||||
<!--onMounted(async () => {-->
|
||||
<!-- try {-->
|
||||
<!-- loading.value = true-->
|
||||
<!-- items.value = await getProducts()-->
|
||||
<!-- items.value?.forEach((val, index) => {-->
|
||||
<!-- if (!typeItems.value.includes(val.group_type)){-->
|
||||
<!-- typeItems.value.push(val.group_type)-->
|
||||
<!-- }-->
|
||||
<!-- // typeItems.value[index] = val.group_type-->
|
||||
<!-- })-->
|
||||
<!-- firstItems.value = items.value-->
|
||||
<!-- await initPrice()-->
|
||||
<!-- // await setIntervalGetLastPrice()-->
|
||||
<!-- // console.log('run product')-->
|
||||
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
if (router.currentRoute.value.query.cat=="coin"){
|
||||
activekey.value="سکه"
|
||||
changeTab()
|
||||
}
|
||||
<!-- } catch (e) {-->
|
||||
<!-- console.log(e)-->
|
||||
<!-- } finally {-->
|
||||
<!-- loading.value = false-->
|
||||
<!-- if (router.currentRoute.value.query.cat=="coin"){-->
|
||||
<!-- activekey.value="سکه"-->
|
||||
<!-- changeTab()-->
|
||||
<!-- }-->
|
||||
|
||||
if (router.currentRoute.value.query.state) {
|
||||
if (router.currentRoute.value.query.product) {
|
||||
clickProduct(items.value?.find(x => x.title === 'سکه'))
|
||||
} else {
|
||||
clickProduct(items.value?.find(x => x.title === 'آبشده نقدی'))
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
onUnmounted(() => {
|
||||
stopPriceInterval()
|
||||
// console.log('stop product')
|
||||
})
|
||||
<!-- if (router.currentRoute.value.query.state) {-->
|
||||
<!-- if (router.currentRoute.value.query.product) {-->
|
||||
<!-- clickProduct(items.value?.find(x => x.title === 'سکه'))-->
|
||||
<!-- } else {-->
|
||||
<!-- clickProduct(items.value?.find(x => x.title === 'آبشده نقدی'))-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--})-->
|
||||
<!--onUnmounted(() => {-->
|
||||
<!-- stopPriceInterval()-->
|
||||
<!-- // console.log('stop product')-->
|
||||
<!--})-->
|
||||
|
||||
async function initPrice() {
|
||||
try {
|
||||
// chartLoading.value = true
|
||||
await getLastPrices()
|
||||
// await setIntervalGetPrice()
|
||||
loading.value = true
|
||||
price.value = lastPrice.value
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
// chartLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--async function initPrice() {-->
|
||||
<!-- try {-->
|
||||
<!-- // chartLoading.value = true-->
|
||||
<!-- await getLastPrices()-->
|
||||
<!-- // await setIntervalGetPrice()-->
|
||||
<!-- loading.value = true-->
|
||||
<!-- price.value = lastPrice.value-->
|
||||
<!-- } catch (e) {-->
|
||||
<!-- console.log(e)-->
|
||||
<!-- } finally {-->
|
||||
<!-- loading.value = false-->
|
||||
<!-- // chartLoading.value = false-->
|
||||
<!-- }-->
|
||||
<!--}-->
|
||||
<!--</script>-->
|
||||
|
||||
<style lang="less">
|
||||
.cats{
|
||||
font-size: x-small;
|
||||
}
|
||||
.cats:hover span {
|
||||
--un-text-opacity: 1;
|
||||
color: rgba(206, 163, 76, var(--un-text-opacity))!important;
|
||||
}
|
||||
<!--<style lang="less">-->
|
||||
<!--.cats{-->
|
||||
<!-- font-size: x-small;-->
|
||||
<!--}-->
|
||||
<!--.cats:hover span {-->
|
||||
<!-- --un-text-opacity: 1;-->
|
||||
<!-- color: rgba(206, 163, 76, var(--un-text-opacity))!important;-->
|
||||
<!--}-->
|
||||
|
||||
</style>
|
||||
<!--</style>-->
|
||||
|
||||
|
||||
<!–
|
||||
<template>
|
||||
<div style="max-height: calc(100vh - 50px)">
|
||||
<div class="bg-white py-3 px-3 z-100000 text-primary font-bold drop-shadow flex flex-col wrap-fix">
|
||||
<div class="flex">
|
||||
<div @click="router.back()">
|
||||
<BasicIcon icon="vuesax-linear:arrow-right-1"/>
|
||||
</div>
|
||||
<div v-if="route.name=='list'" class="mr-2">دریافت طلای فیزیکی</div>
|
||||
<div v-else class="mr-2">دریافت طلای فیزیکی-درخواست جدید</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--<!–-->
|
||||
<!--<template>-->
|
||||
<!-- <div style="max-height: calc(100vh - 50px)">-->
|
||||
<!-- <div class="bg-white py-3 px-3 z-100000 text-primary font-bold drop-shadow flex flex-col wrap-fix">-->
|
||||
<!-- <div class="flex">-->
|
||||
<!-- <div @click="router.back()">-->
|
||||
<!-- <BasicIcon icon="vuesax-linear:arrow-right-1"/>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="route.name=='list'" class="mr-2">دریافت طلای فیزیکی</div>-->
|
||||
<!-- <div v-else class="mr-2">دریافت طلای فیزیکی-درخواست جدید</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <router-view></router-view>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref} from "vue";
|
||||
import RequestList from "@/views/base/physicalReceive/components/RequestList.vue";
|
||||
import NewRequest from "@/views/base/physicalReceive/components/NewRequest.vue";
|
||||
import router from "@/router";
|
||||
import BasicIcon from "@/components/BasicPacks/BasicIcon.vue";
|
||||
import {useRoute} from "vue-router";
|
||||
<!--<script lang="ts" setup>-->
|
||||
<!--import {ref} from "vue";-->
|
||||
<!--import RequestList from "@/views/base/physicalReceive/components/RequestList.vue";-->
|
||||
<!--import NewRequest from "@/views/base/physicalReceive/components/NewRequest.vue";-->
|
||||
<!--import router from "@/router";-->
|
||||
<!--import BasicIcon from "@/components/BasicPacks/BasicIcon.vue";-->
|
||||
<!--import {useRoute} from "vue-router";-->
|
||||
|
||||
const activekey=ref(1)
|
||||
const route=useRoute()
|
||||
</script>
|
||||
<!--const activekey=ref(1)-->
|
||||
<!--const route=useRoute()-->
|
||||
<!--</script>-->
|
||||
|
||||
<style scoped>
|
||||
/*.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
<!--<style scoped>-->
|
||||
<!--/*.fade-enter-active,-->
|
||||
<!--.fade-leave-active {-->
|
||||
<!-- transition: opacity 0.2s ease;-->
|
||||
<!--}-->
|
||||
|
||||
.fade-enter-from,
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
}*/
|
||||
/*.trans{
|
||||
transition: height 1s;
|
||||
}*/
|
||||
</style>
|
||||
–>
|
||||
-->
|
||||
<!--.fade-enter-from,-->
|
||||
<!--.fade-leave-to {-->
|
||||
<!-- opacity: 0;-->
|
||||
<!--}*/-->
|
||||
<!--/*.trans{-->
|
||||
<!-- transition: height 1s;-->
|
||||
<!--}*/-->
|
||||
<!--</style>-->
|
||||
<!--–>-->
|
||||
|
||||
Reference in New Issue
Block a user