feat: 新增跨境电商D模板(shop4) - 古树动态壁纸+光追生命力+横向首页+商品表格+黑白模式切换

This commit is contained in:
admin
2026-07-11 16:00:20 +08:00
parent 07c506354d
commit be35490088
3 changed files with 881 additions and 3 deletions

12
main.go
View File

@@ -127,6 +127,7 @@ func main() {
log.Println(" 跨境电商 A (红色): http://localhost:8080/shop")
log.Println(" 跨境电商 B (暗黑): http://localhost:8080/shop2")
log.Println(" 跨境电商 C (北欧): http://localhost:8080/shop3")
log.Println(" 跨境电商 D (古树): http://localhost:8080/shop4")
log.Println(" 外卖平台 A (橙黄): http://localhost:8080/food1")
log.Println(" 外卖平台 B (深色): http://localhost:8080/food2")
log.Println(" 外卖平台 C (清新): http://localhost:8080/food3")
@@ -196,6 +197,7 @@ func setupFrontend(r *gin.Engine) {
shopIndex, _ := fs.ReadFile(distFS, "shop/index.html")
shop2Index, _ := fs.ReadFile(distFS, "shop2/index.html")
shop3Index, _ := fs.ReadFile(distFS, "shop3/index.html")
shop4Index, _ := fs.ReadFile(distFS, "shop4/index.html")
food1Index, _ := fs.ReadFile(distFS, "food1/index.html")
food2Index, _ := fs.ReadFile(distFS, "food2/index.html")
food3Index, _ := fs.ReadFile(distFS, "food3/index.html")
@@ -274,6 +276,11 @@ func setupFrontend(r *gin.Engine) {
c.Data(http.StatusOK, "text/html; charset=utf-8", shop3Index)
})
}
if len(shop4Index) > 0 {
r.GET("/shop4", func(c *gin.Context) {
c.Data(http.StatusOK, "text/html; charset=utf-8", shop4Index)
})
}
if len(food1Index) > 0 {
r.GET("/food1", func(c *gin.Context) {
c.Data(http.StatusOK, "text/html; charset=utf-8", food1Index)
@@ -375,6 +382,11 @@ func setupFrontend(r *gin.Engine) {
c.Data(http.StatusOK, "text/html; charset=utf-8", shop3Index)
return
}
case strings.HasPrefix(path, "/shop4"):
if len(shop4Index) > 0 {
c.Data(http.StatusOK, "text/html; charset=utf-8", shop4Index)
return
}
case strings.HasPrefix(path, "/shop"):
if len(shopIndex) > 0 {
c.Data(http.StatusOK, "text/html; charset=utf-8", shopIndex)