feat: 阿里云 OSS 资源桶接入,商品图与icon支持远程基址
This commit is contained in:
@@ -4,6 +4,7 @@ import { useState, useEffect, useCallback } from 'react'
|
||||
import './index.scss'
|
||||
import { getDesignList, removeDesigns, type DesignItem } 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'
|
||||
@@ -164,9 +165,10 @@ export default function DesignListPage() {
|
||||
<ScrollView className='design-list' scrollY>
|
||||
{filtered.map(item => {
|
||||
const style = STATUS_STYLE[item.status]
|
||||
const iconSrc = item.productIcon?.startsWith('/icon/')
|
||||
const rawIcon = item.productIcon?.startsWith('/icon/') || /^https?:/i.test(item.productIcon || '')
|
||||
? item.productIcon
|
||||
: PRODUCT_ICON_MAP[item.productId] || '/icon/四角星.png'
|
||||
const iconSrc = assetUrl(rawIcon)
|
||||
const isSelected = selected.has(item.id)
|
||||
return (
|
||||
<View
|
||||
|
||||
Reference in New Issue
Block a user