some works for admin
This commit is contained in:
@@ -30,6 +30,7 @@ export interface ZaarboxProductOption {
|
||||
id: string
|
||||
category: string
|
||||
active: boolean
|
||||
price: number
|
||||
}
|
||||
|
||||
export interface ZaarboxProductsResponse {
|
||||
|
||||
@@ -17,7 +17,11 @@
|
||||
:label="`${item.name} ${item.key}`"
|
||||
>
|
||||
<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>
|
||||
</a-select-option>
|
||||
@@ -48,11 +52,15 @@ const allOptions = computed(() => {
|
||||
}
|
||||
|
||||
return [
|
||||
{ key: current, name: current, id: '', category: '', active: true },
|
||||
{ key: current, name: current, id: '', category: '', active: true, price: 0 },
|
||||
...options.value,
|
||||
]
|
||||
})
|
||||
|
||||
function formatPrice(value: number): string {
|
||||
return value.toLocaleString('en-US')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void loadOptions()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user