some works for admin
This commit is contained in:
@@ -30,6 +30,7 @@ export interface ZaarboxProductOption {
|
|||||||
id: string
|
id: string
|
||||||
category: string
|
category: string
|
||||||
active: boolean
|
active: boolean
|
||||||
|
price: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ZaarboxProductsResponse {
|
export interface ZaarboxProductsResponse {
|
||||||
|
|||||||
@@ -17,7 +17,11 @@
|
|||||||
:label="`${item.name} ${item.key}`"
|
:label="`${item.name} ${item.key}`"
|
||||||
>
|
>
|
||||||
<div class="leading-snug">
|
<div class="leading-snug">
|
||||||
<div>{{ item.name }}</div>
|
<div>
|
||||||
|
{{ item.name }}
|
||||||
|
<span v-if="item.price > 0" class="text-gray-500">({{ formatPrice(item.price) }} ریال)</span>
|
||||||
|
<span v-else class="text-gray-400">(بدون قیمت)</span>
|
||||||
|
</div>
|
||||||
<div class="text-xs text-gray-400 direction-ltr text-right">{{ item.key }}</div>
|
<div class="text-xs text-gray-400 direction-ltr text-right">{{ item.key }}</div>
|
||||||
</div>
|
</div>
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@@ -48,11 +52,15 @@ const allOptions = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{ key: current, name: current, id: '', category: '', active: true },
|
{ key: current, name: current, id: '', category: '', active: true, price: 0 },
|
||||||
...options.value,
|
...options.value,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function formatPrice(value: number): string {
|
||||||
|
return value.toLocaleString('en-US')
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
void loadOptions()
|
void loadOptions()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user