feat: 阿里云 OSS 资源桶接入,商品图与icon支持远程基址
This commit is contained in:
@@ -4,6 +4,7 @@ import { useState, useEffect } from 'react'
|
||||
import './index.scss'
|
||||
import { getOrderList, type OrderItem } from '../../utils/store'
|
||||
import { PRODUCT_ICON_MAP } from '../../utils/productConfig'
|
||||
import { assetUrl } from '../../utils/asset'
|
||||
import { useThemeContext } from '../../context/ThemeContext'
|
||||
import { useSafeArea } from '../../hooks/useSafeArea'
|
||||
import { useStatusBar } from '../../hooks/useStatusBar'
|
||||
@@ -105,9 +106,10 @@ export default function OrdersPage() {
|
||||
<ScrollView className='orders-list' scrollY>
|
||||
{filteredOrders.map((order) => {
|
||||
const status = STATUS_MAP[order.statusCode] || STATUS_MAP.pending
|
||||
const iconSrc = order.productIcon?.startsWith('/icon/')
|
||||
const rawIcon = order.productIcon?.startsWith('/icon/') || /^https?:/i.test(order.productIcon || '')
|
||||
? order.productIcon
|
||||
: '/icon/四角星.png'
|
||||
const iconSrc = assetUrl(rawIcon)
|
||||
return (
|
||||
<View key={order.id} className='order-card dashed-card' onTap={() => goDetail(order)}>
|
||||
<View className='star-badge' />
|
||||
|
||||
Reference in New Issue
Block a user