merge(main): 同步主站最新 UI 与审核优化代码并保持分销多租户隔离
This commit is contained in:
@@ -401,3 +401,54 @@ function formatCompactNumber(value: number) {
|
||||
const rounded = Math.round(value * 10) / 10
|
||||
return Number.isInteger(rounded) ? `${rounded}` : rounded.toFixed(1)
|
||||
}
|
||||
|
||||
export function isTopTierInsurance(value: string | undefined | null): boolean {
|
||||
if (!value) return false
|
||||
const s = String(value).trim().toLowerCase()
|
||||
return (
|
||||
s.includes('3*3') || s.includes('3x3') || s.includes('3×3') || s === '9格' || s.includes('9格')
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账号封面图(优先公开缩略图接口,其次首张截图)
|
||||
*/
|
||||
export function getCoinScreenshotURL(item: Listing): string {
|
||||
return item.cover_url || item.screenshot_urls?.[0] || ''
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换截图为缩略图 URL(优先使用 16KB 极速缩略图,秒级加载)
|
||||
*/
|
||||
export function getScreenshotThumbURL(url: string | undefined | null): string {
|
||||
if (!url) return ''
|
||||
if (url.includes('/screenshots/')) {
|
||||
const separator = url.includes('?') ? '&' : '?'
|
||||
return `${url}${separator}variant=thumb`
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换截图为中等图 URL(1280px,100KB左右,清晰秒开)
|
||||
*/
|
||||
export function getScreenshotMediumURL(url: string | undefined | null): string {
|
||||
if (!url) return ''
|
||||
if (url.includes('/screenshots/')) {
|
||||
const separator = url.includes('?') ? '&' : '?'
|
||||
return `${url}${separator}variant=medium`
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换截图为原始高清原图 URL(用于全屏放大查看细节)
|
||||
*/
|
||||
export function getScreenshotRawURL(url: string | undefined | null): string {
|
||||
if (!url) return ''
|
||||
if (url.includes('/screenshots/')) {
|
||||
const separator = url.includes('?') ? '&' : '?'
|
||||
return `${url}${separator}variant=raw`
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user