This commit is contained in:
2026-07-21 10:57:54 +03:30
parent a60f1fbc68
commit bc642e91ed
10 changed files with 159 additions and 33 deletions
@@ -30,13 +30,14 @@
<div
class="flex items-center gap-1"
:class="variant === 'desktop' ? 'dpr-cart-row__input' : 'pr-cart-row__input'"
@focusin="selectCountInput"
>
<BasicInput
v-model:value="item.count"
:addon-before="quantityUnit"
:addon-bg-color="config.config?.color"
addon-text-color="white"
type="text"
type="number"
:inputmode="isCountBased ? 'numeric' : 'decimal'"
@update:value="onCountInput"
/>
@@ -91,6 +92,13 @@ const displayGold = computed(() => {
const config = useConfigStore()
function selectCountInput(e: FocusEvent) {
const el = e.target as HTMLInputElement | null
if (!el || el.tagName !== 'INPUT' || typeof el.select !== 'function') return
// تا کاربر با تایپ عدد جدید، مقدار قبلی را جایگزین کند
requestAnimationFrame(() => el.select())
}
function onCountInput(raw: string | number) {
countError.value = ''
const normalized = persianToEnglishDigits(String(raw ?? '').trim())
@@ -1,6 +1,8 @@
<template>
<MobileRequestListView v-show="!isDesktop" />
<DesktopRequestListView v-show="isDesktop" />
<div class="physical-receive-list-root">
<MobileRequestListView v-show="!isDesktop" />
<DesktopRequestListView v-show="isDesktop" />
</div>
</template>
<script setup lang="ts">
@@ -12,3 +14,20 @@ import MobileRequestListView from '../mobile/MobileRequestListView.vue'
const { isDesktop } = usePhysicalReceiveShellContext()
usePhysicalReceiveList()
</script>
<style scoped>
.physical-receive-list-root {
flex: 1 1 0;
min-height: 0;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.physical-receive-list-root > * {
flex: 1 1 0;
min-height: 0;
height: 100%;
}
</style>
+6
View File
@@ -44,6 +44,12 @@ const { isDesktop } = usePhysicalReceiveShell()
overflow: hidden;
}
.physical-receive-page-root__content > :deep(.physical-receive-list-root),
.physical-receive-page-root__content > :deep(.physical-new-request) {
flex: 1 1 0;
min-height: 0;
}
.physical-receive-page-root--desktop {
height: auto;
min-height: 0;
@@ -1,9 +1,11 @@
<template>
<div>
<div
class="flex flex-col gap-4 mpage-content 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 class="physical-receive-list">
<div class="physical-receive-list__scroll mpage-content px-2">
<div
class="flex flex-col gap-4 pb-[calc(var(--app-add-card-height,88px)+1.25rem)]"
>
<RequestItem v-for="item in requestItems" :key="item.id" :item="item" />
</div>
</div>
<Teleport to="body">
<div class="add-request app-dock-add-bar" @click="openAdd()">
@@ -21,3 +23,21 @@ import { usePhysicalReceiveListContext } from '../composables/usePhysicalReceive
const { requestItems, openAdd } = usePhysicalReceiveListContext()
</script>
<style scoped>
.physical-receive-list {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
overflow: hidden;
}
.physical-receive-list__scroll {
flex: 1 1 0;
min-height: 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
overscroll-behavior-y: contain;
}
</style>