({ ...defaultAWRecycleConfig })
const supportLoading = ref(false)
const showBackTop = ref(false)
const mobilePageSize = 10
@@ -457,6 +461,7 @@ async function loadHomeConfig() {
const config = await fetchMobileHomeConfig()
announcements.value = config.announcements
bannerSlides.value = config.banners
+ awRecycle.value = config.aw_recycle
publishOptions.value = config.publish_options
homeCache.saveHomeConfig({
announcements: config.announcements,
@@ -466,10 +471,39 @@ async function loadHomeConfig() {
} catch {
announcements.value = defaultHomeAnnouncements
bannerSlides.value = defaultHomeBanners
+ awRecycle.value = { ...defaultAWRecycleConfig }
publishOptions.value = emptyListingPublishOptions
}
}
+async function openAWRecycle() {
+ const source = awRecycle.value.image_url
+ if (!source) {
+ showToast({ message: '回收说明图片尚未配置', icon: 'warning-o' })
+ return
+ }
+ try {
+ // 私有 /api/files/object 需带鉴权拉取;公开 /api/public/files 可直接预览
+ let previewURL = source
+ if (
+ source.includes('/api/files/object') ||
+ source.includes('/api/admin/files/object')
+ ) {
+ const blob = await fetchFileBlobByURL(source)
+ previewURL = URL.createObjectURL(blob)
+ }
+ showImagePreview({
+ images: [previewURL],
+ closeable: true,
+ })
+ } catch {
+ showToast({
+ message: '图片加载失败,请在后台重新上传(需使用公开图)',
+ icon: 'cross',
+ })
+ }
+}
+
async function onRefresh() {
refreshing.value = true
try {
@@ -477,6 +511,7 @@ async function onRefresh() {
const [, nextHomeConfig] = await Promise.all([loadListings(true), fetchMobileHomeConfig()])
announcements.value = nextHomeConfig.announcements
bannerSlides.value = nextHomeConfig.banners
+ awRecycle.value = nextHomeConfig.aw_recycle
publishOptions.value = nextHomeConfig.publish_options
homeCache.saveHomeConfig({
announcements: nextHomeConfig.announcements,
@@ -842,6 +877,15 @@ syncMobileHomeQuery()
选购商品 · 一键找客服
NEW
+
diff --git a/frontend/src/shared/utils/imageUpload.ts b/frontend/src/shared/utils/imageUpload.ts
index 855e340..3389926 100644
--- a/frontend/src/shared/utils/imageUpload.ts
+++ b/frontend/src/shared/utils/imageUpload.ts
@@ -3,6 +3,7 @@ const IMAGE_UPLOAD_MAX_SIDE: Record = {
chat: 1280,
announcement: 1600,
'home-banner': 1920,
+ 'aw-recycle': 1920,
listing: 1920,
dispute: 1920,
handoff: 1920,
@@ -15,6 +16,7 @@ const IMAGE_UPLOAD_QUALITY: Record = {
chat: 0.8,
announcement: 0.84,
'home-banner': 0.84,
+ 'aw-recycle': 0.84,
listing: 0.84,
dispute: 0.86,
handoff: 0.86,