修复一些前端问题
This commit is contained in:
@@ -155,7 +155,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
LeftOutlined,
|
||||
@@ -169,20 +169,7 @@ import { tagApi, type TagVO } from '@/api/tag'
|
||||
import { cartApi } from '@/api/cart'
|
||||
import { fileApi } from '@/api/file'
|
||||
|
||||
// 格式化分钟数显示
|
||||
const formatDuration = (minutes: number): string => {
|
||||
if (minutes < 60) {
|
||||
return `${minutes} 分钟`
|
||||
} else {
|
||||
const hours = Math.floor(minutes / 60)
|
||||
const remainingMinutes = minutes % 60
|
||||
if (remainingMinutes === 0) {
|
||||
return `${hours} 小时`
|
||||
} else {
|
||||
return `${hours} 小时 ${remainingMinutes} 分钟`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -239,7 +226,9 @@ const loadImageUrls = async (productList: ProductVO[]) => {
|
||||
const response = await fileApi.getSignedUrl(Number(id)) as any
|
||||
imageIdCache.value[id] = response
|
||||
}
|
||||
urls.push(imageIdCache.value[id])
|
||||
if (imageIdCache.value[id]) {
|
||||
urls.push(imageIdCache.value[id] as string)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取签名链接失败:', error)
|
||||
urls.push(DEFAULT_PRODUCT_IMAGE)
|
||||
|
||||
Reference in New Issue
Block a user