Browse Source

产品类型

huangyan 1 month ago
parent
commit
49aa3c0bcb
98 changed files with 566 additions and 253 deletions
  1. 9 0
      controllers/about.go
  2. 9 0
      controllers/contact.go
  3. 8 0
      controllers/index.go
  4. 8 0
      controllers/new.go
  5. 8 0
      controllers/product-detail.go
  6. 122 0
      controllers/product.go
  7. 9 0
      controllers/recruit.go
  8. 9 0
      controllers/services-detail.go
  9. 9 0
      controllers/services.go
  10. 1 1
      controllers/uploadImage.go
  11. 2 2
      models/news.go
  12. 7 0
      models/products.go
  13. 7 1
      routers/router.go
  14. 38 2
      service/product.go
  15. 1 0
      static/assets/Welcome.59f01c9c.css
  16. BIN
      static/assets/avator.fb58564b.jpg
  17. BIN
      static/assets/bg.a2d5161d.jpg
  18. BIN
      static/assets/favicon.af4a0651.ico
  19. 0 0
      static/assets/index.501cf061.css
  20. BIN
      static/assets/index.805c2bae.gif
  21. 0 0
      static/assets/index.e56c5496.css
  22. 1 1
      static/css/style.css
  23. BIN
      static/file/c1114ecd-61f9-4cc7-9bdb-e20322648ee1.zip
  24. BIN
      static/upload/02bc9af5-6919-4839-b03e-88459d5fa34e.jpg
  25. BIN
      static/upload/05a00d63-7e09-4190-b44c-ebad3666e91b.jpg
  26. BIN
      static/upload/0c8466ae-54a0-43b0-8f26-77a6b97c92f6.jpg
  27. BIN
      static/upload/10a092b3-94a4-449e-aa61-0501e872fd92.jpg
  28. BIN
      static/upload/1830530b-2a37-45e5-9263-8832438600ac.jpg
  29. BIN
      static/upload/18ef3e02-9c34-47e1-8e04-72c92889eee7.jpg
  30. BIN
      static/upload/1ff73cb8-946a-4cb4-835f-8a4e58fd0f4a.jpg
  31. BIN
      static/upload/20240425104844_c27d0ed1-8589-48a7-9469-7d80f06cf4ac.jpg
  32. BIN
      static/upload/21d3f050-f01a-4d4c-a97e-df54cb18d1e1.png
  33. BIN
      static/upload/22d8a5e2-b0b6-41dc-9328-83492a3f8412.jpg
  34. BIN
      static/upload/234614f5-0191-4277-82b6-2816607f1cef.jpg
  35. BIN
      static/upload/2401d682-c6e8-43fb-aac4-64adabdcad54.png
  36. BIN
      static/upload/287586e7-3d03-465f-a585-898dae073e44.jpg
  37. BIN
      static/upload/2ae1d4cb-c31a-44e5-a562-d84729d97f5e.jpg
  38. BIN
      static/upload/2b3a6d09-75a2-4b11-960f-faf7e8d34eed.png
  39. BIN
      static/upload/32ba30d7-549c-46db-a0e0-1d714f4d6166.jpg
  40. BIN
      static/upload/3635cff9-80eb-4343-a934-413794b0b35f.jpg
  41. BIN
      static/upload/3905682c-1636-4280-bea5-910ce69fb90c.jpg
  42. BIN
      static/upload/3fff7b83-2724-476c-9123-19c094fe5f53.jpg
  43. BIN
      static/upload/42185a30-797f-4056-810b-7b3b30c197e7.jpg
  44. BIN
      static/upload/442bc34f-7db2-40ec-8a22-94d5417de851.jpg
  45. BIN
      static/upload/4ecfe030-134a-4a42-8ec0-f04663478a2b.jpg
  46. BIN
      static/upload/4edbe525-ea66-4378-a218-0eba624e4de1.jpg
  47. BIN
      static/upload/5209cf3c-d13b-4a1a-895c-0d6c1f2da8c7.jpg
  48. BIN
      static/upload/522716eb-4c16-4a16-aba6-2a682ecea69e.jpg
  49. BIN
      static/upload/56137575-15cc-4777-8778-3ff89d1b0c78.jpg
  50. BIN
      static/upload/56b322a6-6f41-41a2-96ad-e6b732bfc64d.jpg
  51. BIN
      static/upload/57554af8-f4e6-4ecb-9113-5c72840e18da.jpg
  52. BIN
      static/upload/5793dc64-20b2-42cf-a8f6-5803abe158f6.jpg
  53. BIN
      static/upload/5c173be5-8cd3-458b-9c9d-607fb60ef94e.jpg
  54. BIN
      static/upload/5e05bb77-ea8d-4d18-b1ab-ada2a751f685.jpg
  55. BIN
      static/upload/62fbb463-ab09-4eb1-b12f-9f7ef6b7a955.jpg
  56. BIN
      static/upload/63a7fab9-ee4f-4d8f-ab14-65afd9b0ce4e.jpg
  57. BIN
      static/upload/691644de-6c37-4bd7-8cd9-1d9405575352.jpg
  58. BIN
      static/upload/7833380f-6b1d-4615-afeb-e8f6eb6ace8c.jpg
  59. BIN
      static/upload/7888e0a2-e5a4-4cd5-aac6-a8d7bbc0afd4.jpg
  60. BIN
      static/upload/7cbb2184-11c1-45ca-ae69-7bb295e33d13.jpg
  61. BIN
      static/upload/7e3758e5-1f0c-4ae0-a6dc-8cb1ad77d10d.jpg
  62. BIN
      static/upload/aadc6733-59ec-4f9a-8658-6aecb330faa8.png
  63. BIN
      static/upload/b35e65ba-2752-4939-b0a2-b4ac802556a7.jpg
  64. BIN
      static/upload/bef781d2-5ae6-48ea-82fc-08365f78234e.png
  65. BIN
      static/upload/c196aba2-4798-4499-a994-b8e5a0f3f87b.jpg
  66. BIN
      static/upload/c22a5263-4f62-43dd-b285-333dd93d5732.png
  67. BIN
      static/upload/c57d1b23-bf51-4b1b-bd48-eb64199c27f5.jpg
  68. BIN
      static/upload/c851b609-55ff-418e-9a35-4c0477605229.png
  69. BIN
      static/upload/c8e4cde2-fe14-4f41-a786-d37914f1a2db.jpg
  70. BIN
      static/upload/cclod.png
  71. BIN
      static/upload/cd87a2ae-caf4-4ff3-a709-4fac8073f093.jpg
  72. BIN
      static/upload/d234a84c-6a81-48eb-80b7-20a817322968.jpg
  73. BIN
      static/upload/d9024aa8-4baa-4cb2-9a65-41feae6a45d4.jpg
  74. BIN
      static/upload/dae6d074-904f-4432-af24-99c53f339489.jpg
  75. BIN
      static/upload/e2e42ec0-2aef-4058-9f88-e119c8f3a482.zip
  76. BIN
      static/upload/e3ad84aa-d562-4b18-80b9-05d3719bc3cf.png
  77. BIN
      static/upload/e41a43f4-c9fb-4db6-9428-85cfbdb188e3.png
  78. BIN
      static/upload/eb22787d-25c2-4f25-b6f4-4236b2687b61.png
  79. BIN
      static/upload/eceb81ae-4173-4323-b21d-0ad0d91aa977.png
  80. BIN
      static/upload/efbe1681-7090-4f69-9604-f15d79608aca.jpg
  81. BIN
      static/upload/f5f49c8f-e8bc-4ce2-bbad-1cbf987dde2d.jpg
  82. BIN
      static/upload/programs.png
  83. BIN
      static/upload/wallhaven-wemdqr.jpg
  84. BIN
      static/upload/wechat.png
  85. BIN
      static/upload/懒羊羊睡觉4k壁纸_彼岸图网.jpg
  86. 19 0
      unity/unity.go
  87. 1 0
      utils/db.go
  88. 5 4
      views/about.html
  89. 2 2
      views/admin/index.html
  90. 5 4
      views/contact.html
  91. 48 28
      views/index.html
  92. 7 5
      views/news-detail.html
  93. 5 4
      views/news.html
  94. 5 4
      views/product-detail.html
  95. 10 10
      views/product.html
  96. 5 4
      views/recruit.html
  97. 5 4
      views/services-detail.html
  98. 201 177
      views/services.html

+ 9 - 0
controllers/about.go

@@ -22,6 +22,15 @@ func (a *AboutController) Get() {
 	for _, v := range exams {
 		success = append(success, v.Url)
 	}
+	//获取产品分类
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		a.Data["productFirst"] = "暂无产品分类"
+	} else {
+		a.Data["productFirst"] = productType[0].Name
+	}
+	a.Data["productType"] = productType
+
 	a.Data["example"] = success
 	a.TplName = "about.html"
 }

+ 9 - 0
controllers/contact.go

@@ -2,6 +2,7 @@ package controllers
 
 import (
 	"cc-officialweb/models"
+	"cc-officialweb/service"
 	"cc-officialweb/unity"
 	"encoding/json"
 	beego "github.com/beego/beego/v2/server/web"
@@ -15,6 +16,14 @@ type ContactController struct {
 
 func (c *ContactController) Get() {
 	c.Data["IsContact"] = true
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		c.Data["productFirst"] = "暂无产品分类"
+	} else {
+		c.Data["productFirst"] = productType[0].Name
+	}
+	c.Data["productType"] = productType
+
 	c.TplName = "contact.html"
 }
 

+ 8 - 0
controllers/index.go

@@ -43,6 +43,14 @@ func (c *MainController) Get() {
 	if links != nil {
 		c.Data["Links"] = links
 	}
+	//获取产品分类
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		c.Data["productFirst"] = "暂无产品分类"
+	} else {
+		c.Data["productFirst"] = productType[0].Name
+	}
+	c.Data["productType"] = productType
 	c.Data["honor"] = honor
 	c.Data["banner"] = banner
 	c.Data["example"] = success

+ 8 - 0
controllers/new.go

@@ -19,6 +19,14 @@ func (n *NewController) Get() {
 	types := n.GetString("types")
 	news := service.GetNews(types)
 	n.Data["News"] = news
+	//获取产品分类
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		n.Data["productFirst"] = "暂无产品分类"
+	} else {
+		n.Data["productFirst"] = productType[0].Name
+	}
+	n.Data["productType"] = productType
 	n.TplName = "news.html"
 }
 

+ 8 - 0
controllers/product-detail.go

@@ -17,6 +17,14 @@ func (d *DetailController) Get() {
 		d.Redirect("/", 302)
 	}
 	detail := service.GetProductDetail(atoi)
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		d.Data["productFirst"] = "暂无产品分类"
+	} else {
+		d.Data["productFirst"] = productType[0].Name
+	}
+	d.Data["productType"] = productType
+
 	d.Data["detail"] = detail
 	d.Data["showSection"] = true
 	d.TplName = "product-detail.html"

+ 122 - 0
controllers/product.go

@@ -32,6 +32,13 @@ func (s *ProductController) Get() {
 	} else {
 		s.Data["Datas"] = "未获得数据"
 	}
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		s.Data["productFirst"] = "暂无产品分类"
+	} else {
+		s.Data["productFirst"] = productType[0].Name
+	}
+	s.Data["productType"] = productType
 	s.Data["Products"] = product
 	s.Data["example"] = success
 	s.TplName = "product.html"
@@ -57,6 +64,100 @@ func (s *ProductController) AddProduct() {
 
 }
 
+// AddProductType 添加产品分类
+func (s *ProductController) AddProductType() {
+	var productType models.ProductType
+	err := json.Unmarshal(s.Ctx.Input.RequestBody, &productType)
+	if err != nil {
+		s.Data["json"] = &JSON{Code: 101, Msg: "json解析失败"}
+		s.ServeJSON()
+		return
+	}
+	if service.AddProductType(productType) {
+		s.Data["json"] = &JSON{Code: 200, Msg: "添加成功"}
+		s.ServeJSON()
+	} else {
+		s.Data["json"] = &JSON{Code: 102, Msg: "添加失败"}
+		s.ServeJSON()
+		return
+	}
+}
+
+// GetProductType 获取产品类型
+func (s *ProductController) GetProductType() {
+	productType := service.GetProductType()
+	s.Data["json"] = &JSON{Code: 200, Msg: "获取成功", Data: productType}
+	s.ServeJSON()
+}
+
+// DeleteProductTypeById 根据id删除产品类型
+func (s *ProductController) DeleteProductTypeById() {
+	id := s.GetString("id")
+	atoi, _ := strconv.Atoi(id)
+	validate := validator.New()
+	err2 := validate.Var(atoi, "required")
+	if err2 != nil {
+		s.Data["json"] = &JSON{Code: 103, Msg: "id不能为空"}
+		s.ServeJSON()
+		return
+	}
+	_, err := unity.DeleteById(atoi, models.ProductType{})
+	if err != nil {
+		s.Data["json"] = map[string]interface{}{"code": 101, "msg": "删除失败"}
+		s.ServeJSON()
+		return
+	} else {
+		s.Data["json"] = map[string]interface{}{"code": 200, "msg": "删除成功"}
+		s.ServeJSON()
+	}
+}
+
+// GetAllProductType 分页获取产品类型
+func (s *ProductController) GetAllProductType() {
+	var page unity.PageParams
+	err := json.Unmarshal(s.Ctx.Input.RequestBody, &page)
+	if err != nil {
+		s.Data["json"] = &JSON{Code: 101, Msg: "参数错误"}
+		s.ServeJSON()
+		return
+	}
+	result, total, current, err := unity.Paginate(page, models.ProductType{})
+	if err != nil {
+		s.Data["json"] = &JSON{Code: 101, Msg: "查询失败"}
+		s.ServeJSON()
+		return
+	} else {
+		s.Data["json"] = &JSON{Code: 200, Msg: "查询成功", Data: &JSONS{
+			Current: current,
+			Size:    total,
+			Data:    result,
+		}}
+		s.ServeJSON()
+		return
+	}
+}
+
+// UpdateProductType 根据id修改产品类型
+func (s *ProductController) UpdateProductType() {
+	var productType models.ProductType
+	err := json.Unmarshal(s.Ctx.Input.RequestBody, &productType)
+	if err != nil {
+		s.Data["json"] = &JSON{Code: 101, Msg: "json解析失败"}
+		s.ServeJSON()
+		return
+	}
+	_, err = unity.UpdateById(productType.ID, productType)
+	if err != nil {
+		s.Data["json"] = &JSON{Code: 101, Msg: "修改失败"}
+		s.ServeJSON()
+		return
+	} else {
+		s.Data["json"] = &JSON{Code: 200, Msg: "修改成功"}
+		s.ServeJSON()
+		return
+	}
+}
+
 // DeleteProductById 根据id删除产品
 func (s *ProductController) DeleteProductById() {
 	id := s.GetString("id")
@@ -159,6 +260,27 @@ func (s *ProductController) UpdateIsIndex() {
 	}
 }
 
+// UpdateIsSort 根据id修改排序
+func (s *ProductController) UpdateIsSort() {
+	var productDto models.ProductDto
+	var product models.Products
+	err := json.Unmarshal(s.Ctx.Input.RequestBody, &productDto)
+	if err != nil {
+		s.Data["json"] = &JSON{Code: 101, Msg: "json解析失败"}
+		s.ServeJSON()
+		return
+	}
+	tx := utils.DB.Model(&product).Where("id = ?", productDto.ID).Update("sort", productDto.Sort)
+	if tx.RowsAffected > 0 {
+		s.Data["json"] = &JSON{Code: 200, Msg: "修改成功"}
+		s.ServeJSON()
+		return
+	} else {
+		s.Data["json"] = &JSON{Code: 102, Msg: "修改失败"}
+		s.ServeJSON()
+	}
+}
+
 // GetProduct 根据id获取产品信息
 func (s *ProductController) GetProduct() {
 	getString := s.GetString("id")

+ 9 - 0
controllers/recruit.go

@@ -26,6 +26,15 @@ func (r *RecruitController) Get() {
 		r.Data["recruit"] = recruit
 	}
 	r.Data["example"] = success
+	//获取产品分类
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		r.Data["productFirst"] = "暂无产品分类"
+	} else {
+		r.Data["productFirst"] = productType[0].Name
+	}
+	r.Data["productType"] = productType
+
 	r.TplName = "recruit.html"
 }
 

+ 9 - 0
controllers/services-detail.go

@@ -27,6 +27,15 @@ func (s *ServicesDetailController) Get() {
 	detail := service.GetServiceDetail(atoi)
 	s.Data["example"] = success
 	s.Data["serveDetail"] = detail
+	//获取产品分类
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		s.Data["productFirst"] = "暂无产品分类"
+	} else {
+		s.Data["productFirst"] = productType[0].Name
+	}
+
+	s.Data["productType"] = productType
 	s.TplName = "services-detail.html"
 }
 

+ 9 - 0
controllers/services.go

@@ -34,6 +34,15 @@ func (s *ServicesController) Get() {
 	serves := service.GetIndexProductServe("serve")
 	//getService = service.GetService(atoi)
 	s.Data["GetService"] = getService
+	//获取产品分类
+	productType := service.GetProductType()
+	if len(productType) == 0 {
+		s.Data["productFirst"] = "暂无产品分类"
+	} else {
+		s.Data["productFirst"] = productType[0].Name
+	}
+	s.Data["productType"] = productType
+
 	s.Data["Serve"] = serve
 	s.Data["Serves"] = serves
 	s.Data["Products"] = product

+ 1 - 1
controllers/uploadImage.go

@@ -132,7 +132,7 @@ func (up *UploadImageController) GetResource() {
 		up.ServeJSON()
 		return
 	}
-	result, total, current, err := unity.Paginate(page, models.Resource{})
+	result, total, current, err := unity.PaginateResource(page, models.Resource{})
 	if err != nil {
 		up.Data["json"] = &JSON{Code: 101, Msg: "查询失败"}
 		up.ServeJSON()

+ 2 - 2
models/news.go

@@ -9,7 +9,7 @@ type News struct {
 	gorm.Model
 	Title    string        `json:"title"`
 	Synopsis template.HTML `json:"synopsis"`
-	Detail   template.HTML `json:"detail"`
+	Detail   string        `json:"detail"`
 	Types    string        `json:"types"`
 	IsActive bool          `json:"is_active"` // 是否激活
 	Image    string        `json:"image"`
@@ -18,7 +18,7 @@ type NewsDto struct {
 	ID       uint          `json:"id"`
 	Title    string        `json:"title"`
 	Synopsis template.HTML `json:"synopsis"`
-	Detail   template.HTML `json:"detail"`
+	Detail   string        `json:"detail"`
 	Types    string        `json:"types"`
 	IsActive bool          `json:"is_active"` // 是否激活
 	Image    string        `json:"image"`

+ 7 - 0
models/products.go

@@ -22,6 +22,7 @@ type Products struct {
 	OptionalAccessories *string        `json:"optional_accessories" gorm:"comment:'可选配件'"` //可选配件
 	IsActive            *bool          `json:"is_active" gorm:"comment:'是否激活'"`            //是否激活
 	ParentId            *int           `gorm:"comment:'父级id'" json:"parentId"`
+	Sort                *int           `gorm:"comment:'展示顺序'" json:"sort"`
 }
 type ProductDto struct {
 	ID                  uint          `json:"id"`
@@ -38,4 +39,10 @@ type ProductDto struct {
 	SupportingSoftware  string        `json:"supporting_software" `                       //配套软件
 	OptionalAccessories string        `json:"optional_accessories" gorm:"comment:'可选配件'"` //可选配件
 	IsActive            bool          `json:"is_active"`
+	Sort                int           `json:"sort"` //排序
+}
+type ProductType struct {
+	gorm.Model
+	Name string `json:"name"`
+	Url  string `json:"url"`
 }

+ 7 - 1
routers/router.go

@@ -51,6 +51,7 @@ func init() {
 	beego.Router("/api/product", &controllers.ProductController{}, "put:UpdateProductById")
 	beego.Router("/api/product", &controllers.ProductController{}, "get:GetProduct")
 	beego.Router("/api/productisindex", &controllers.ProductController{}, "put:UpdateIsIndex")
+	beego.Router("/api/productsort", &controllers.ProductController{}, "put:UpdateIsSort")
 	//服务管理
 	beego.Router("/api/service", &controllers.ServicesDetailController{}, "post:AddServices")
 	beego.Router("/api/service", &controllers.ServicesDetailController{}, "put:UpdateServices")
@@ -85,5 +86,10 @@ func init() {
 	beego.Router("/api/links", &controllers.LinksController{}, "delete:DeleteLinksById")
 	beego.Router("/api/links", &controllers.LinksController{}, "put:UpdateLinks")
 	beego.Router("/api/alllinks", &controllers.LinksController{}, "post:GetAllLinks")
-
+	//产品类型管理
+	beego.Router("/api/producttype", &controllers.ProductController{}, "post:AddProductType")
+	beego.Router("/api/producttype", &controllers.ProductController{}, "get:GetProductType")
+	beego.Router("/api/producttype", &controllers.ProductController{}, "delete:DeleteProductTypeById")
+	beego.Router("/api/allproducttype", &controllers.ProductController{}, "post:GetAllProductType")
+	beego.Router("/api/producttype", &controllers.ProductController{}, "put:UpdateProductType")
 }

+ 38 - 2
service/product.go

@@ -8,7 +8,7 @@ import (
 // GetIndexProductServe   首页获取产品服务
 func GetIndexProductServe(types string) []models.Products {
 	var serve []models.Products
-	tx := utils.DB.Where("type = ?", types).Where("is_index = ?", true).Find(&serve)
+	tx := utils.DB.Where("type = ?", types).Where("is_index = ?", true).Order("sort asc").Find(&serve)
 	if tx.Error != nil {
 		return nil
 	}
@@ -18,13 +18,14 @@ func GetIndexProductServe(types string) []models.Products {
 // GetProduct   获取所有产品
 func GetProduct(ptype string) []models.Products {
 	var serve []models.Products
-	tx := utils.DB.Where("type = ?", "product").Where("ptype = ?", ptype).Find(&serve)
+	tx := utils.DB.Where("type = ?", "product").Where("ptype = ?", ptype).Order("sort asc").Find(&serve)
 	if tx.Error != nil {
 		return nil
 	}
 	return serve
 }
 
+// GetProductDetail   获取产品详情
 func GetProductDetail(id int) models.Products {
 	var server models.Products
 	tx := utils.DB.Where("id = ?", id).First(&server)
@@ -57,3 +58,38 @@ func AddProduct(product models.ProductDto) bool {
 	}
 	return false
 }
+
+// AddProductType 添加分类
+func AddProductType(productType models.ProductType) bool {
+	tx := utils.DB.Create(&productType)
+	if tx.RowsAffected > 0 {
+		return true
+	}
+	return false
+}
+
+// GetProductType 获取所有分类
+func GetProductType() []models.ProductType {
+	var serve []models.ProductType
+	tx := utils.DB.Find(&serve)
+	if tx.Error != nil {
+		return nil
+	}
+	return serve
+}
+
+// UpdateProductType 修改分类
+func UpdateProductType(id int, productType models.ProductType) bool {
+	tx := utils.DB.Model(&productType).Where("id =?", id).Updates(&productType)
+	if tx.RowsAffected > 0 {
+		return true
+	}
+	return false
+}
+func DeleteProduct(id int) bool {
+	tx := utils.DB.Delete(&models.Products{}, id)
+	if tx.RowsAffected > 0 {
+		return true
+	}
+	return false
+}

+ 1 - 0
static/assets/Welcome.59f01c9c.css

@@ -0,0 +1 @@
+.main[data-v-bc0bc102]{text-align:center;padding:5px;background:white;height:100%;background-image:url(/assets/index.805c2bae.gif);background-repeat:no-repeat;background-size:100% 100%;background-position-y:bottom}

BIN
static/assets/avator.fb58564b.jpg


BIN
static/assets/bg.a2d5161d.jpg


BIN
static/assets/favicon.af4a0651.ico


File diff suppressed because it is too large
+ 0 - 0
static/assets/index.501cf061.css


BIN
static/assets/index.805c2bae.gif


File diff suppressed because it is too large
+ 0 - 0
static/assets/index.e56c5496.css


+ 1 - 1
static/css/style.css

@@ -1472,7 +1472,7 @@ p.help-block li {
   right: -100%; /* 初始位置完全在左侧 */
   width: 33.33%;
   height: 100%;
-  background-image: url('/image/blockchain-3448502_1280.png');
+  background-image: url('/image/blockchain-3448502_1280.jpg');
   background-size: cover;
   background-repeat: no-repeat;
   animation: slideIn 2s forwards;

BIN
static/file/c1114ecd-61f9-4cc7-9bdb-e20322648ee1.zip


BIN
static/upload/02bc9af5-6919-4839-b03e-88459d5fa34e.jpg


BIN
static/upload/05a00d63-7e09-4190-b44c-ebad3666e91b.jpg


BIN
static/upload/0c8466ae-54a0-43b0-8f26-77a6b97c92f6.jpg


BIN
static/upload/10a092b3-94a4-449e-aa61-0501e872fd92.jpg


BIN
static/upload/1830530b-2a37-45e5-9263-8832438600ac.jpg


BIN
static/upload/18ef3e02-9c34-47e1-8e04-72c92889eee7.jpg


BIN
static/upload/1ff73cb8-946a-4cb4-835f-8a4e58fd0f4a.jpg


BIN
static/upload/20240425104844_c27d0ed1-8589-48a7-9469-7d80f06cf4ac.jpg


BIN
static/upload/21d3f050-f01a-4d4c-a97e-df54cb18d1e1.png


BIN
static/upload/22d8a5e2-b0b6-41dc-9328-83492a3f8412.jpg


BIN
static/upload/234614f5-0191-4277-82b6-2816607f1cef.jpg


BIN
static/upload/2401d682-c6e8-43fb-aac4-64adabdcad54.png


BIN
static/upload/287586e7-3d03-465f-a585-898dae073e44.jpg


BIN
static/upload/2ae1d4cb-c31a-44e5-a562-d84729d97f5e.jpg


BIN
static/upload/2b3a6d09-75a2-4b11-960f-faf7e8d34eed.png


BIN
static/upload/32ba30d7-549c-46db-a0e0-1d714f4d6166.jpg


BIN
static/upload/3635cff9-80eb-4343-a934-413794b0b35f.jpg


BIN
static/upload/3905682c-1636-4280-bea5-910ce69fb90c.jpg


BIN
static/upload/3fff7b83-2724-476c-9123-19c094fe5f53.jpg


BIN
static/upload/42185a30-797f-4056-810b-7b3b30c197e7.jpg


BIN
static/upload/442bc34f-7db2-40ec-8a22-94d5417de851.jpg


BIN
static/upload/4ecfe030-134a-4a42-8ec0-f04663478a2b.jpg


BIN
static/upload/4edbe525-ea66-4378-a218-0eba624e4de1.jpg


BIN
static/upload/5209cf3c-d13b-4a1a-895c-0d6c1f2da8c7.jpg


BIN
static/upload/522716eb-4c16-4a16-aba6-2a682ecea69e.jpg


BIN
static/upload/56137575-15cc-4777-8778-3ff89d1b0c78.jpg


BIN
static/upload/56b322a6-6f41-41a2-96ad-e6b732bfc64d.jpg


BIN
static/upload/57554af8-f4e6-4ecb-9113-5c72840e18da.jpg


BIN
static/upload/5793dc64-20b2-42cf-a8f6-5803abe158f6.jpg


BIN
static/upload/5c173be5-8cd3-458b-9c9d-607fb60ef94e.jpg


BIN
static/upload/5e05bb77-ea8d-4d18-b1ab-ada2a751f685.jpg


BIN
static/upload/62fbb463-ab09-4eb1-b12f-9f7ef6b7a955.jpg


BIN
static/upload/63a7fab9-ee4f-4d8f-ab14-65afd9b0ce4e.jpg


BIN
static/upload/691644de-6c37-4bd7-8cd9-1d9405575352.jpg


BIN
static/upload/7833380f-6b1d-4615-afeb-e8f6eb6ace8c.jpg


BIN
static/upload/7888e0a2-e5a4-4cd5-aac6-a8d7bbc0afd4.jpg


BIN
static/upload/7cbb2184-11c1-45ca-ae69-7bb295e33d13.jpg


BIN
static/upload/7e3758e5-1f0c-4ae0-a6dc-8cb1ad77d10d.jpg


BIN
static/upload/aadc6733-59ec-4f9a-8658-6aecb330faa8.png


BIN
static/upload/b35e65ba-2752-4939-b0a2-b4ac802556a7.jpg


BIN
static/upload/bef781d2-5ae6-48ea-82fc-08365f78234e.png


BIN
static/upload/c196aba2-4798-4499-a994-b8e5a0f3f87b.jpg


BIN
static/upload/c22a5263-4f62-43dd-b285-333dd93d5732.png


BIN
static/upload/c57d1b23-bf51-4b1b-bd48-eb64199c27f5.jpg


BIN
static/upload/c851b609-55ff-418e-9a35-4c0477605229.png


BIN
static/upload/c8e4cde2-fe14-4f41-a786-d37914f1a2db.jpg


BIN
static/upload/cclod.png


BIN
static/upload/cd87a2ae-caf4-4ff3-a709-4fac8073f093.jpg


BIN
static/upload/d234a84c-6a81-48eb-80b7-20a817322968.jpg


BIN
static/upload/d9024aa8-4baa-4cb2-9a65-41feae6a45d4.jpg


BIN
static/upload/dae6d074-904f-4432-af24-99c53f339489.jpg


BIN
static/upload/e2e42ec0-2aef-4058-9f88-e119c8f3a482.zip


BIN
static/upload/e3ad84aa-d562-4b18-80b9-05d3719bc3cf.png


BIN
static/upload/e41a43f4-c9fb-4db6-9428-85cfbdb188e3.png


BIN
static/upload/eb22787d-25c2-4f25-b6f4-4236b2687b61.png


BIN
static/upload/eceb81ae-4173-4323-b21d-0ad0d91aa977.png


BIN
static/upload/efbe1681-7090-4f69-9604-f15d79608aca.jpg


BIN
static/upload/f5f49c8f-e8bc-4ce2-bbad-1cbf987dde2d.jpg


BIN
static/upload/programs.png


BIN
static/upload/wallhaven-wemdqr.jpg


BIN
static/upload/wechat.png


BIN
static/upload/懒羊羊睡觉4k壁纸_彼岸图网.jpg


+ 19 - 0
unity/unity.go

@@ -1,6 +1,7 @@
 package unity
 
 import (
+	"cc-officialweb/models"
 	"cc-officialweb/utils"
 	"errors"
 )
@@ -29,6 +30,24 @@ func Paginate[T any](params PageParams, model T) (result []T, total int64, curre
 	return result, count, params.Page, nil
 }
 
+// 针对resource不查询服务和产品得图片以免混淆
+func PaginateResource(params PageParams, resour models.Resource) (result []models.Resource, total int64, current int, err error) {
+	var count int64
+	if err = utils.DB.Model(resour).Where("type = ?", "banner").Or("type = ?", "honor").Or("type = ?", "example").Count(&count).Error; err != nil {
+		return nil, 0, 0, err
+	}
+
+	// 计算总页数
+	//	totalPages := int(math.Ceil(float64(count) / float64(params.Size)))
+	// 计算偏移量并设置分页大小
+	offset := (params.Page - 1) * params.Size
+	// 执行实际分页查询
+	if err = utils.DB.Where("type = ?", "banner").Or("type = ?", "honor").Or("type = ?", "example").Offset(offset).Limit(params.Size).Order(params.Desc).Find(&result).Error; err != nil {
+		return nil, 0, 0, err
+	}
+	return result, count, params.Page, nil
+}
+
 func PaginateWithCondition[T any](params PageParams, model T, queryCond interface{}, args ...interface{}) (result []T, total int64, err error) {
 	var count int64
 	// 根据模型和额外查询条件查询数据库中符合条件的数据总量

+ 1 - 0
utils/db.go

@@ -33,5 +33,6 @@ func init() {
 			&models.Data{},
 			&models.Contact{},
 			&models.Link{},
+			&models.ProductType{},
 			&models.DataMOdel{})
 }

+ 5 - 4
views/about.html

@@ -37,7 +37,7 @@
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <nav id="nav-menu-container">
                     <ul class="layui-nav layui-bg-gray">
@@ -52,10 +52,11 @@
                         </li>
                         <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>

+ 2 - 2
views/admin/index.html

@@ -4,8 +4,8 @@
     <meta charset="UTF-8" />
     <link rel="icon" type="image/svg+xml" href="/assets/favicon.af4a0651.ico" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>知否在线课堂</title>
-    <script type="module" crossorigin src="/assets/index.cc5eefde.js"></script>
+    <title>宝智达冷链官网后台管理系统</title>
+    <script type="module" crossorigin src="/assets/index.8d240d37.js"></script>
     <link rel="stylesheet" href="/assets/index.e56c5496.css">
   </head>
   <body>

+ 5 - 4
views/contact.html

@@ -38,7 +38,7 @@
       <div class="container">
         <div id="logo" class="pull-left">
           <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-          <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+          <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
         </div>
         <nav id="nav-menu-container">
           <ul class="layui-nav layui-bg-gray">
@@ -53,10 +53,11 @@
             </li>
             <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
             <li class="layui-nav-item">
-              <a href="/product?ptype=hardware">产品介绍</a>
+              <a href="/product?ptype={{.productFirst}}">产品介绍</a>
               <dl class="layui-nav-child">
-                <dd><a href="/product?ptype=software">软件</a></dd>
-                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                {{range .productType}}
+                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                {{end}}
               </dl>
             </li>
             <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>

+ 48 - 28
views/index.html

@@ -33,7 +33,7 @@
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <!-- 新增电话号码部分 -->
                 <!--<div id="phone-number" class="pull-right">-->
@@ -52,10 +52,11 @@
                         </li>
                         <li class="layui-nav-item"><a href="/services">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>
@@ -71,10 +72,6 @@ banner
         <div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel">
             <div class="carousel-inner">
                 {{range $index,$item:=.banner}}
-                <!--<div class="float-buttons">-->
-                <!--    <button class="btn btn-outline-primary btn-lg">校准</button>-->
-                <!--    <button class="btn btn-outline-info btn-lg">验证</button>-->
-                <!--</div>-->
                 <div class="carousel-item{{if eq $index 0}} active{{end}}">
                     <img src="{{$item}}" id="carousel-img-height" class="d-block w-100" alt="...">
                 </div>
@@ -116,36 +113,59 @@ banner
             <!--                    &lt;!&ndash; 数据点列表结束 &ndash;&gt;-->
             <!--                </div>-->
             <!--==========================
-服务介绍
+                        服务介绍
             ============================-->
+
+
+
             <section id="features" class="features py-5">
-                <div class="container">
-                    <div class="section-header text-center mb-5">
+                <div class="container d-flex flex-wrap justify-content-center">
+                    <div class="section-header text-center mb-5 w-100">
                         <h2 class="display-4">服务介绍</h2>
                         <p class="lead">宝智达提供全面的冷链解决方案,包括温湿度监测平台、专用陈列柜等,均拥有自主知识产权。</p>
                     </div>
-                    <div class="row">
-                        <div class="col-lg-12">
-                            <div class="service-description">
-                                {{range .Serves}}
-                                <div class="service-item mb-4 d-flex" style="background-image: url('{{.Url}}')">
-                                    <!--                                    <div class="service-image-container">-->
-                                    <!--                                        <img src="{{.Url}}" alt="{{.Title}} 图例" class="img-fluid">-->
-                                    <!--                                    </div>-->
-                                    <div class="service-info">
-                                        <h4><a class="text-decoration-none" href="services/{{.ID}}">{{.Title}}</a></h4>
-                                        <p class="text-muted">{{.Synopsis}}</p>
-                                    </div>
+                    <div class="d-flex flex-wrap justify-content-center w-100">
+                        {{range .Serves}}
+                        <div class="col-lg-3 col-md-6 mb-4 d-flex justify-content-center align-items-center">
+                            <div class="service-item d-flex flex-column h-100" style="
+                    background-image: url('{{.Url}}');
+                    background-size: cover;
+                    background-position: center;
+                    overflow: hidden;
+                    border-radius: 8px;
+                    width: 100%;
+                    display: flex;
+                    justify-content: center;
+                    align-items: flex-end;
+                ">
+                                <div class="service-info acrylic-border p-4 mt-auto" style="
+                        position: relative;
+                        background-color: rgba(255, 255, 255, 0.2);
+                        backdrop-filter: blur(10px);
+                        border-radius: 8px;
+                        padding: 16px;
+                        margin: 0 -16px -16px -16px;
+                        z-index: 1;
+                        width: calc(100% + 32px);
+                        box-sizing: border-box;
+                        display: flex;
+                        justify-content: center;
+                        align-items: center;
+                    ">
+                                    <h4 style="color: #f7f7f7; text-align: center;">
+                                        <a style="color: rgb(255,255,255) !important;" class="text-decoration-none text-dark" href="services/{{.ID}}">{{.Title}}</a>
+                                    </h4>
                                 </div>
-                                {{end}}
                             </div>
                         </div>
+                        {{end}}
                     </div>
-                    <div class="text-center mt-5">
+                    <div class="text-center mt-5 w-100">
                         <a href="/services/" class="btn btn-primary rounded-pill px-4">深入了解我们的服务</a>
                     </div>
                 </div>
-            </section><!-- End Features Section -->
+            </section>
+
             <!--==========================
 服务&产品
             ============================-->
@@ -157,7 +177,7 @@ banner
                     </div>
                     <div class="row">
                         {{range .Products}}
-                        <div class="col-lg-4" style="padding: 20px;">
+                        <div class="col-lg-4" style="padding: 20px;" onclick="location.href='product/{{.ID}}'">
                             <div class="box wow fadeInLeft" style="background-color: #fff; border: 1px solid #eee; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); width: 100%; height: 300px; display: flex; flex-direction: column; justify-content: space-between;">
                                 <div class="icon svgImg" style="height: 150px; overflow: hidden;">
                                     <img src="{{.Url}}" alt="" style="width: 100%; height: 100%; object-fit: contain;">
@@ -168,7 +188,7 @@ banner
                         </div>
                         {{end}}
                         <div class="text-center mt-5">
-                            <a class="btn btn-primary rounded-pill px-4" href='product?ptype=hardware' style="background-color: #007BFF; color: #fff; border: none; padding: 12px 24px; text-transform: uppercase; letter-spacing: 1px;">了解更多产品</a>
+                            <a class="btn btn-primary rounded-pill px-4" href='product?ptype={{.productFirst}}' style="background-color: #007BFF; color: #fff; border: none; padding: 12px 24px; text-transform: uppercase; letter-spacing: 1px;">了解更多产品</a>
                         </div>
                     </div>
                 </div>

+ 7 - 5
views/news-detail.html

@@ -38,7 +38,7 @@
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <nav id="nav-menu-container">
                     <ul class="layui-nav layui-bg-gray">
@@ -53,10 +53,11 @@
                         </li>
                         <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>
@@ -79,7 +80,8 @@ Page Banner Section
         </section><!-- #Page Banner -->
 
         <main id="main" style="display: flex; justify-content: center; align-items: center;">
-            <div>{{.detail.Detail}}</div>
+<!--            <div>{{.detail.Detail}}</div>-->
+            <img src="{{.detail.Detail}}">
         </main>
         <section id="clients" class="wow fadeInUp">
             <div class="container">

+ 5 - 4
views/news.html

@@ -38,7 +38,7 @@ Header
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <nav id="nav-menu-container">
                     <ul class="layui-nav layui-bg-gray">
@@ -53,10 +53,11 @@ Header
                         </li>
                         <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>

+ 5 - 4
views/product-detail.html

@@ -39,7 +39,7 @@
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="/static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <nav id="nav-menu-container">
                     <ul class="layui-nav layui-bg-gray">
@@ -54,10 +54,11 @@
                         </li>
                         <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>

+ 10 - 10
views/product.html

@@ -39,7 +39,7 @@
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <nav id="nav-menu-container">
                     <ul class="layui-nav layui-bg-gray">
@@ -54,10 +54,11 @@
                         </li>
                         <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>
@@ -152,16 +153,15 @@ Page Banner Section
             <section id="services" style="margin: -40px">
                 <div class="container">
                     <div class="btn-group" role="group" aria-label="Basic outlined example">
-                        <button type="button" class="btn btn-outline-primary btn-lg" onclick="location.href = 'product?ptype=hardware'">
-                            硬件
-                        </button>
-                        <button type="button" class="btn btn-outline-primary btn-lg" onclick="location.href = 'product?ptype=software'">
-                            软件
+                        {{range .productType}}
+                        <button type="button" class="btn btn-outline-primary btn-lg" onclick="location.href = 'product?ptype={{.Name}}'">
+                            {{.Name}}
                         </button>
+                        {{end}}
                     </div>
                     <div class="row">
                         {{range .Products}}
-                        <div class="col-lg-4" style="padding: 20px;">
+                        <div class="col-lg-4" style="padding: 20px;" onclick="location.href='product/{{.ID}}'">
                             <div class="box wow fadeInLeft" style="background-color: #fff; border: 1px solid #eee; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); width: 100%; height: 300px; display: flex; flex-direction: column; justify-content: space-between;">
                                 <div class="icon svgImg" style="height: 150px; overflow: hidden;">
                                     <img src="{{.Url}}" alt="" style="width: 100%; height: 100%; object-fit: contain;">

+ 5 - 4
views/recruit.html

@@ -61,7 +61,7 @@ Header
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <nav id="nav-menu-container">
                     <ul class="layui-nav layui-bg-gray">
@@ -76,10 +76,11 @@ Header
                         </li>
                         <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>

+ 5 - 4
views/services-detail.html

@@ -41,7 +41,7 @@ Header
             <div class="container">
                 <div id="logo" class="pull-left">
                     <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
+                    <h1><a href="/" class="scrollto"><span></span>智达冷链</a></h1>
                 </div>
                 <nav id="nav-menu-container">
                     <ul class="layui-nav layui-bg-gray">
@@ -56,10 +56,11 @@ Header
                         </li>
                         <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
                         <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
+                            <a href="/product?ptype={{.productFirst}}">产品介绍</a>
                             <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
+                                {{range .productType}}
+                                <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                                {{end}}
                             </dl>
                         </li>
                         <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>

+ 201 - 177
views/services.html

@@ -1,196 +1,220 @@
 <!DOCTYPE html>
 <html lang="en">
-    <head>
-        <meta charset="utf-8">
-        <title>宝智达冷链官网</title>
-        <meta content="width=device-width, initial-scale=1.0" name="viewport">
-        <meta content="" name="keywords">
-        <meta content="" name="description">
-        <meta content="Author" name="WebThemez">
-        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
-        <!-- Favicons -->
-        <link href="/static/img/favicon.png" rel="icon">
-        <link href="/static/img/apple-touch-icon.png" rel="apple-touch-icon">
-        <link href="../static/layui/css/layui.css" rel="stylesheet">
-
-        <!--字体 -->
-        <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700"
-              rel="stylesheet">
-
-        <!-- Bootstrap CSS File -->
-        <link href="/static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
-
-
-        <!-- Libraries CSS Files -->
-        <link href="/static/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
-        <link href="/static/lib/animate/animate.min.css" rel="stylesheet">
-        <link href="/static/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
-        <link href="/static/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
-        <link href="/static/lib/magnific-popup/magnific-popup.css" rel="stylesheet">
-        <link href="/static/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
-
-        <!-- Main Stylesheet File -->
-        <link href="/static/css/style.css" rel="stylesheet">
-    </head>
-
-    <body id="body">
-        <!--==========================
+<head>
+    <meta charset="utf-8">
+    <title>宝智达冷链官网</title>
+    <meta content="width=device-width, initial-scale=1.0" name="viewport">
+    <meta content="" name="keywords">
+    <meta content="" name="description">
+    <meta content="Author" name="WebThemez">
+    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
+    <!-- Favicons -->
+    <link href="/static/img/favicon.png" rel="icon">
+    <link href="/static/img/apple-touch-icon.png" rel="apple-touch-icon">
+    <link href="../static/layui/css/layui.css" rel="stylesheet">
+
+    <!--字体 -->
+    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700"
+          rel="stylesheet">
+
+    <!-- Bootstrap CSS File -->
+    <link href="/static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+
+
+    <!-- Libraries CSS Files -->
+    <link href="/static/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
+    <link href="/static/lib/animate/animate.min.css" rel="stylesheet">
+    <link href="/static/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
+    <link href="/static/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
+    <link href="/static/lib/magnific-popup/magnific-popup.css" rel="stylesheet">
+    <link href="/static/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
+
+    <!-- Main Stylesheet File -->
+    <link href="/static/css/style.css" rel="stylesheet">
+</head>
+
+<body id="body">
+<!--==========================
 Header
-        ============================-->
-        <header id="header">
-            <div class="container">
-                <div id="logo" class="pull-left">
-                    <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
-                    <h1><a href="/" class="scrollto"><span>宝</span>智达冷链</a></h1>
-                </div>
-                <nav id="nav-menu-container">
-                    <ul class="layui-nav layui-bg-gray">
-                        <li class="layui-nav-item"><a href="/">首页</a></li>
-                        <li class="layui-nav-item"><a href="/about">关于我们</a></li>
-                        <li class="layui-nav-item">
-                            <a href="/news?types=industry">新闻</a>
-                            <dl class="layui-nav-child">
-                                <dd><a href="/news?types=firm">公司新闻</a></dd>
-                                <dd><a href="/news?types=industry">行业新闻</a></dd>
-                            </dl>
-                        </li>
-                        <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
-                        <li class="layui-nav-item">
-                            <a href="/product?ptype=hardware">产品介绍</a>
-                            <dl class="layui-nav-child">
-                                <dd><a href="/product?ptype=software">软件</a></dd>
-                                <dd><a href="/product?ptype=hardware">硬件</a></dd>
-                            </dl>
-                        </li>
-                        <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>
-                        <li class="layui-nav-item"><a href="/contact">联系我们</a></li>
-                    </ul>
-                </nav>
-            </div>
-        </header>
-
-        <!--==========================
+============================-->
+<header id="header">
+    <div class="container">
+        <div id="logo" class="pull-left">
+            <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
+            <h1><a href="/" class="scrollto"><span></span>宝智达冷链</a></h1>
+        </div>
+        <nav id="nav-menu-container">
+            <ul class="layui-nav layui-bg-gray">
+                <li class="layui-nav-item"><a href="/">首页</a></li>
+                <li class="layui-nav-item"><a href="/about">关于我们</a></li>
+                <li class="layui-nav-item">
+                    <a href="/news?types=industry">新闻</a>
+                    <dl class="layui-nav-child">
+                        <dd><a href="/news?types=firm">公司新闻</a></dd>
+                        <dd><a href="/news?types=industry">行业新闻</a></dd>
+                    </dl>
+                </li>
+                <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
+                <li class="layui-nav-item">
+                    <a href="/product?ptype={{.productFirst}}">产品介绍</a>
+                    <dl class="layui-nav-child">
+                        {{range .productType}}
+                        <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
+                        {{end}}
+                    </dl>
+                </li>
+                <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>
+                <li class="layui-nav-item"><a href="/contact">联系我们</a></li>
+            </ul>
+        </nav>
+    </div>
+</header>
+
+<!--==========================
 Page Banner Section
-        ============================-->
-        <section id="innerBanner">
-            <div class="inner-content">
-                <h2><span>服务介绍</span></h2>
-                <div>
-                </div>
-            </div>
-        </section><!-- #Page Banner -->
-
-        <main id="main">
-
-            <!--==========================
+============================-->
+<section id="innerBanner">
+    <div class="inner-content">
+        <h2><span>服务介绍</span></h2>
+        <div>
+        </div>
+    </div>
+</section><!-- #Page Banner -->
+
+<main id="main">
+
+    <!--==========================
 Services Section
-            ============================-->
-            <section id="services">
-                <div class="container">
-                    <div class="btn-group btn-group-lg" role="group" aria-label="Large button group">
-                        {{range .Serves}}
-                        <button type="button" class="btn btn-outline-dark" onclick="location.href='/services/{{.ID}}'">{{.Title}}</button>
-                        {{end}}
-                    </div>
+    ============================-->
+    <section id="services">
+        <div class="container">
+            <div class="btn-group btn-group-lg" role="group" aria-label="Large button group">
+                {{range .Serves}}
+                <button type="button" class="btn btn-outline-dark" onclick="location.href='/services/{{.ID}}'">
+                    {{.Title}}
+                </button>
+                {{end}}
+            </div>
 
-                    <!--现在不需要显示冷链验证的具体内容目前冷链验证只是一个分类-->
-                    <!--<div class="row" style="margin-top: 10px;">-->
-                    <!--    <div class="div2 col-6" style="width: 300px;height: auto">-->
-                    <!--        <img src="{{.Serve.Url}}"-->
-                    <!--             class="img-fluid" alt="">-->
-                    <!--    </div>-->
-                    <!--    <div class="div1 col-6">{{.Serve.Detail}}</div>-->
-                    <!--</div>-->
-                    <div class="container" style="margin-top: 20px">
-                        <div class="section-header">
-                            <h2>{{.Serve.Title}}</h2>
-                        </div>
-                        <div class="row">
-                            {{range .GetService}}
-                            <div class="col-lg-4 card-with-image" style="background-image: url('{{.Image}}');background-position: center;background-size: cover;">
-                                <div class="box wow fadeInLeft" style="margin-top: 10%;background-color: rgba(0,0,0,0);justify-content: center">
-                                    <div class="icon svgImg" style="display: flex;align-content: center"></div>
-                                    <h4 class="title float-over-title" style="text-align: center;"><a href="/services-detail/{{.ID}}" style="color: black">{{.Title}}</a></h4>
-                                    <p style="color: black">{{.Synopsis}}</p>
-                                </div>
+            <!--现在不需要显示冷链验证的具体内容目前冷链验证只是一个分类-->
+            <!--<div class="row" style="margin-top: 10px;">-->
+            <!--    <div class="div2 col-6" style="width: 300px;height: auto">-->
+            <!--        <img src="{{.Serve.Url}}"-->
+            <!--             class="img-fluid" alt="">-->
+            <!--    </div>-->
+            <!--    <div class="div1 col-6">{{.Serve.Detail}}</div>-->
+            <!--</div>-->
+            <div class="container" style="margin-top: 20px">
+                <div class="section-header">
+                    <h2>{{.Serve.Title}}</h2>
+                </div>
+                <div class="row">
+                    {{range .GetService}}
+                    <div class="col-lg-3 col-md-6 mb-4">
+                        <div class="service-item d-flex h-100" style="
+        background-image: url('{{.Image}}');
+        background-size: cover;
+        background-position: center;
+        overflow: hidden;
+        border-radius: 8px;
+        display: flex;
+        justify-content: center; /* 水平居中 */
+        align-items: center; /* 垂直居中 */
+    ">
+                            <div class="service-info acrylic-border p-4" style="
+            position: relative;
+            background-color: rgba(255, 255, 255, 0.2);
+            backdrop-filter: blur(10px);
+            border-radius: 8px;
+            padding: 16px;
+            z-index: 1;
+            width: calc(100% - 32px); /* 确保背景颜色覆盖整个宽度 */
+            box-sizing: border-box; /* 包含padding和border在width内 */
+        ">
+                                <h4 style="color: #0f7dec; text-align: center;">
+                                    <a style="color: rgb(15,125,236) !important;" class="text-decoration-none text-dark"
+                                       href="/services-detail/{{.ID}}">{{.Title}}</a>
+                                </h4>
                             </div>
-                            {{end}}
                         </div>
                     </div>
+                    {{end}}
                 </div>
-            </section><!-- #services -->
-            <!--==========================
+            </div>
+        </div>
+    </section><!-- #services -->
+    <!--==========================
 Clients Section
-            ============================-->
-            <section id="clients" class="wow fadeInUp" style="margin-top: 10px;">
-                <div class="container">
-                    <div class="section-header">
-                        <h2>部分合作案例</h2>
-                        <!--                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores quae porro consequatur aliquam,-->
-                        <!--                    incidunt fugiat culpa esse aute nulla. duis fugiat culpa esse aute nulla ipsum velit export irure-->
-                        <!--                    minim illum fore</p>-->
-                    </div>
-                    <div class="owl-carousel clients-carousel">
-                        {{range $index,$exam:=.example}}
-                        <img src="{{$exam}}" alt="..." style="max-width: 100%; height: auto">
-                        {{end}}
-                    </div>
-                </div>
-            </section><!-- #clients -->
+    ============================-->
+    <section id="clients" class="wow fadeInUp" style="margin-top: 10px;">
+        <div class="container">
+            <div class="section-header">
+                <h2>部分合作案例</h2>
+                <!--                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolores quae porro consequatur aliquam,-->
+                <!--                    incidunt fugiat culpa esse aute nulla. duis fugiat culpa esse aute nulla ipsum velit export irure-->
+                <!--                    minim illum fore</p>-->
+            </div>
+            <div class="owl-carousel clients-carousel">
+                {{range $index,$exam:=.example}}
+                <img src="{{$exam}}" alt="..." style="max-width: 100%; height: auto">
+                {{end}}
+            </div>
+        </div>
+    </section><!-- #clients -->
 
 
-            <!--==========================
+    <!--==========================
 Call To Action Section
-            ============================-->
-            <section id="call-to-action" class="wow fadeInUp">
-                <div class="container">
-                    <div class="row">
-                        <div class="col-lg-9 text-center text-lg-left">
-                            <h3 class="cta-title">获取我们的服务</h3>
-                            <p class="cta-text">
-                                欢迎随时与我们联系!无论您有关于产品的问题,需要技术支持,或是想要探讨合作机会,我们的团队都乐意为您提供帮助</p>
-                        </div>
-                        <div class="col-lg-3 cta-btn-container text-center">
-                            <a class="cta-btn align-middle" href="/contact">联系我们</a>
-                        </div>
-                    </div>
-
+    ============================-->
+    <section id="call-to-action" class="wow fadeInUp">
+        <div class="container">
+            <div class="row">
+                <div class="col-lg-9 text-center text-lg-left">
+                    <h3 class="cta-title">获取我们的服务</h3>
+                    <p class="cta-text">
+                        欢迎随时与我们联系!无论您有关于产品的问题,需要技术支持,或是想要探讨合作机会,我们的团队都乐意为您提供帮助</p>
+                </div>
+                <div class="col-lg-3 cta-btn-container text-center">
+                    <a class="cta-btn align-middle" href="/contact">联系我们</a>
                 </div>
-            </section><!-- #call-to-action -->
+            </div>
+
+        </div>
+    </section><!-- #call-to-action -->
 
-        </main>
+</main>
 
-        <!--==========================
+<!--==========================
 Footer
-        ============================-->
-        <footer id="footer">
-            <div class="container">
-                <div class="copyright">
-                    Copyright &copy; 2018.Company name All rights reserved.<a target="_blank"
-                                                                              href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a>
-                </div>
-                <div class="credits">
-                </div>
-            </div>
-        </footer><!-- #footer -->
-
-        <a href="#" class="back-to-top"><i class="fa fa-chevron-up"></i></a>
-
-        <!-- JavaScript  -->
-        <script src="/static/lib/jquery/jquery.min.js"></script>
-        <script src="/static/lib/jquery/jquery-migrate.min.js"></script>
-        <script src="/static/lib/bootstrap/js/bootstrap.bundle.min.js"></script>
-        <script src="/static/lib/easing/easing.min.js"></script>
-        <script src="/static/lib/superfish/hoverIntent.js"></script>
-        <script src="/static/lib/superfish/superfish.min.js"></script>
-        <script src="/static/lib/wow/wow.min.js"></script>
-        <script src="/static/lib/owlcarousel/owl.carousel.min.js"></script>
-        <script src="/static/lib/magnific-popup/magnific-popup.min.js"></script>
-        <script src="/static/lib/sticky/sticky.js"></script>
-        <script src="/static/js/main.js"></script>
-        <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
-        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js"></script>
-        <script src="../static/layui/layui.js"></script>
-
-    </body>
+============================-->
+<footer id="footer">
+    <div class="container">
+        <div class="copyright">
+            Copyright &copy; 2018.Company name All rights reserved.<a target="_blank"
+                                                                      href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a>
+        </div>
+        <div class="credits">
+        </div>
+    </div>
+</footer><!-- #footer -->
+
+<a href="#" class="back-to-top"><i class="fa fa-chevron-up"></i></a>
+
+<!-- JavaScript  -->
+<script src="/static/lib/jquery/jquery.min.js"></script>
+<script src="/static/lib/jquery/jquery-migrate.min.js"></script>
+<script src="/static/lib/bootstrap/js/bootstrap.bundle.min.js"></script>
+<script src="/static/lib/easing/easing.min.js"></script>
+<script src="/static/lib/superfish/hoverIntent.js"></script>
+<script src="/static/lib/superfish/superfish.min.js"></script>
+<script src="/static/lib/wow/wow.min.js"></script>
+<script src="/static/lib/owlcarousel/owl.carousel.min.js"></script>
+<script src="/static/lib/magnific-popup/magnific-popup.min.js"></script>
+<script src="/static/lib/sticky/sticky.js"></script>
+<script src="/static/js/main.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js"></script>
+<script src="../static/layui/layui.js"></script>
+
+</body>
 </html>

Some files were not shown because too many files changed in this diff