新增首页 AW炫彩回收入口,支持后台配置展示图

首页第三入口点击查看回收说明图;配置项 mobile.aw_recycle 可配标题/图片;aw-recycle 走公开文件链路,首页鉴权预览兼容旧私有地址。
This commit is contained in:
yml2213
2026-07-19 22:50:16 +08:00
parent dabcec45cb
commit 9b1ee445b7
14 changed files with 533 additions and 18 deletions
@@ -0,0 +1,43 @@
package systemconfig
import (
"encoding/json"
"strings"
)
const awRecycleConfigKey = "mobile.aw_recycle"
func defaultAWRecycle() AWRecycleConfig {
return AWRecycleConfig{
Title: "AW炫彩回收",
Subtitle: "点击查看回收说明",
ImageURL: "",
Enabled: true,
}
}
func defaultAWRecycleConfigValue() string {
raw, err := json.Marshal(defaultAWRecycle())
if err != nil {
return `{"title":"AW炫彩回收","subtitle":"点击查看回收说明","image_url":"","enabled":true}`
}
return string(raw)
}
func normalizeAWRecycle(item AWRecycleConfig) AWRecycleConfig {
def := defaultAWRecycle()
title := strings.TrimSpace(item.Title)
if title == "" {
title = def.Title
}
subtitle := strings.TrimSpace(item.Subtitle)
if subtitle == "" {
subtitle = def.Subtitle
}
return AWRecycleConfig{
Title: title,
Subtitle: subtitle,
ImageURL: strings.TrimSpace(item.ImageURL),
Enabled: item.Enabled,
}
}