Split desktop and mobile layouts with shared page data so APIs fetch once per context.
Add layout shells, desktop views, module-level page caches, and UI fixes for auth, home, wallet, transactions, address, and related pages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div>
|
||||
<div ref="el" class="px-3 pt-15">
|
||||
<div class="flex gap-2">
|
||||
<BasicSelect
|
||||
v-model:value="selectedProduct"
|
||||
:items="items"
|
||||
class="w-full"
|
||||
key-name="id"
|
||||
:show-search="false"
|
||||
value-name="title"
|
||||
size="large"
|
||||
placeholder="لطفا محصول را انتخاب کنید"
|
||||
:has-tooltip="false"
|
||||
/>
|
||||
<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">
|
||||
<div
|
||||
v-for="val in selectedProducts"
|
||||
:key="val.product.id"
|
||||
class="rounded-lg p-2 bg-gray-100 mb-2"
|
||||
>
|
||||
<PhysicalReceiveCartRow :item="val" @remove="handleRemove" />
|
||||
</div>
|
||||
</div>
|
||||
<BasicButton
|
||||
:disabled-b="selectedProducts.length == 0"
|
||||
class="w-full absolute bottom-10 mt-2"
|
||||
@click="handelFirstSubmit()"
|
||||
>
|
||||
ثبت
|
||||
</BasicButton>
|
||||
</div>
|
||||
|
||||
<BasicActionSheet v-model:show="showAddress">
|
||||
<PhysicalReceiveAddressPicker
|
||||
v-model:selected-address-id="selectedAddressID"
|
||||
:addresses="address"
|
||||
@add-address="addAddressVisible = true; showAddress = false"
|
||||
@submit="handelsubmit"
|
||||
/>
|
||||
</BasicActionSheet>
|
||||
|
||||
<BasicActionSheet v-model:show="addAddressVisible">
|
||||
<New_EditAddress @onOk="handleAddress" />
|
||||
</BasicActionSheet>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BasicButton from '@/components/BasicPacks/BasicButton.vue'
|
||||
import BasicSelect from '@/components/BasicPacks/BasicSelect.vue'
|
||||
import BasicActionSheet from '@/components/BasicPacks/BasicActionSheet.vue'
|
||||
import New_EditAddress from '@/views/base/address/components/New_EditAddress.vue'
|
||||
import PhysicalReceiveCartRow from '../components/PhysicalReceiveCartRow.vue'
|
||||
import PhysicalReceiveAddressPicker from '../components/PhysicalReceiveAddressPicker.vue'
|
||||
import { useNewPhysicalRequestContext } from '../composables/useNewPhysicalRequestPage'
|
||||
|
||||
const {
|
||||
items,
|
||||
selectedProduct,
|
||||
selectedProducts,
|
||||
address,
|
||||
selectedAddressID,
|
||||
showAddress,
|
||||
addAddressVisible,
|
||||
handleAdd,
|
||||
handleRemove,
|
||||
handelFirstSubmit,
|
||||
handelsubmit,
|
||||
handleAddress,
|
||||
} = useNewPhysicalRequestContext()
|
||||
</script>
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<div class="physical-receive-mobile-chrome" 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>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import router from '@/router'
|
||||
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
</script>
|
||||
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<div>
|
||||
<div
|
||||
class="flex flex-col gap-4 pt-13 px-2 pb-[calc(var(--app-bottom-chrome-height)+var(--app-add-card-height)+1rem)]"
|
||||
>
|
||||
<RequestItem v-for="item in requestItems" :key="item.id" :item="item" />
|
||||
</div>
|
||||
<Teleport to="body">
|
||||
<div class="add-request app-dock-add-bar" @click="openAdd()">
|
||||
<div>افزودن درخواست جدید</div>
|
||||
<BasicIcon icon="vuesax-linear:add" />
|
||||
</div>
|
||||
</Teleport>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||
import RequestItem from '../components/RequestItem.vue'
|
||||
import { usePhysicalReceiveListContext } from '../composables/usePhysicalReceiveList'
|
||||
|
||||
const { requestItems, openAdd } = usePhysicalReceiveListContext()
|
||||
</script>
|
||||
Reference in New Issue
Block a user