杂务:更新 YumiNail 工作区
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
|
||||
<div v-for="item in order.items" :key="item.id" class="item">
|
||||
<div class="thumb">
|
||||
<img v-if="item.productImage" :src="item.productImage" :alt="item.productTitle" />
|
||||
<img v-if="item.productImage" :src="item.productImage" :alt="item.productTitle" loading="lazy" decoding="async" />
|
||||
<span v-else>{{ item.productTitle[0] }}</span>
|
||||
</div>
|
||||
<div class="main">
|
||||
@@ -138,11 +138,11 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import { LeftOutlined } from '@ant-design/icons-vue'
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { userApi } from '@/api/user'
|
||||
import { fileApi } from '../api/index'
|
||||
import { orderApi } from '../api/order'
|
||||
import type { OrderArtistChangeOptionsVO, OrderArtistChangeRequestVO } from '../api/order'
|
||||
import type { IdType } from '@/utils/id'
|
||||
import { runWithGlobalLoading } from '@/utils/action-loading'
|
||||
import { extractLegacyFileId, getCachedSignedImageUrl, getCachedSignedImageUrlSync } from '@/utils/signed-image-cache'
|
||||
|
||||
/**
|
||||
* Purpose: router supports ArtistOrderView.vue by holding or executing the router page or API role.
|
||||
@@ -159,11 +159,6 @@ const route = useRoute()
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const orders = ref<any[]>([])
|
||||
/**
|
||||
* Purpose: imageIdCache supports ArtistOrderView.vue by holding or executing the image id cache page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const imageIdCache = ref<Record<string, string>>({})
|
||||
/**
|
||||
* Purpose: orderRefs supports ArtistOrderView.vue by holding or executing the order refs page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -352,15 +347,11 @@ const loadOrders = async () => {
|
||||
orders.value = (await orderApi.getArtistOrders() as unknown as any[]) || []
|
||||
for (const order of orders.value) {
|
||||
for (const item of order.items || []) {
|
||||
const match = item.productImage?.replace(/<[^>]*>/g, '').match(/\/api\/file\/get\/(\d+)/)
|
||||
if (!match?.[1]) continue
|
||||
const imageId = match[1]
|
||||
try {
|
||||
if (!imageIdCache.value[imageId]) imageIdCache.value[imageId] = await fileApi.getSignedUrl(imageId) as any
|
||||
item.productImage = imageIdCache.value[imageId]
|
||||
} catch {
|
||||
item.productImage = ''
|
||||
}
|
||||
const imageId = extractLegacyFileId(item.productImage)
|
||||
if (!imageId) continue
|
||||
const cachedUrl = getCachedSignedImageUrlSync(imageId)
|
||||
if (cachedUrl) item.productImage = cachedUrl
|
||||
item.productImage = await getCachedSignedImageUrl(imageId)
|
||||
}
|
||||
}
|
||||
await scrollToTargetOrder()
|
||||
|
||||
Reference in New Issue
Block a user