Use the Chabokan npm mirror and show admin min order in meters.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,7 @@ FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm config set registry https://mirror2.chabokan.net/npm/
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useCartStore } from '@/stores/cart'
|
||||
import { useCatalogStore } from '@/stores/catalog'
|
||||
import type { CatalogProductCard } from '@/types/crm'
|
||||
import type { Product } from '@/types'
|
||||
import { formatNumber } from '@/utils/format'
|
||||
import { formatMeterage, formatNumber } from '@/utils/format'
|
||||
import IconChevronBack from '@/components/icons/IconChevronBack.vue'
|
||||
import IconCart from '@/components/icons/IconCart.vue'
|
||||
import IconCatalog from '@/components/icons/IconCatalog.vue'
|
||||
@@ -35,10 +35,13 @@ const showAllSpecs = ref(false)
|
||||
|
||||
const rollMeters = computed(() => product.value?.rollMeters ?? 50)
|
||||
const orderMeters = computed(() => rolls.value * rollMeters.value)
|
||||
const minRolls = computed(() => {
|
||||
const min = product.value?.minMeterage ?? rollMeters.value
|
||||
return Math.max(1, Math.ceil(min / rollMeters.value))
|
||||
const minOrderMeters = computed(() => {
|
||||
const min = product.value?.minMeterage
|
||||
return min && min > 0 ? min : rollMeters.value
|
||||
})
|
||||
const minRolls = computed(() =>
|
||||
Math.max(1, Math.ceil(minOrderMeters.value / rollMeters.value)),
|
||||
)
|
||||
|
||||
async function load() {
|
||||
if (!productId.value) {
|
||||
@@ -295,7 +298,7 @@ function shareProduct() {
|
||||
<IconCart :size="18" color="#ffffff" />
|
||||
{{ adding ? 'در حال افزودن...' : 'افزودن به سفارش' }}
|
||||
</button>
|
||||
<p class="min-note">حداقل سفارش: {{ formatNumber(minRolls) }} طاقه</p>
|
||||
<p class="min-note">حداقل سفارش: {{ formatMeterage(minOrderMeters) }}</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user