longping před 1 rokem
rodič
revize
d5b43a3c3c
28 změnil soubory, kde provedl 2106 přidání a 45 odebrání
  1. 10 1
      .drone.yml
  2. 140 0
      modules/shop/api/v1/admin/banner_api.go
  3. 140 0
      modules/shop/api/v1/admin/express_api.go
  4. 140 0
      modules/shop/api/v1/client/banner_api.go
  5. 140 0
      modules/shop/api/v1/client/express_api.go
  6. 109 0
      modules/shop/dao/baner_dao.go
  7. 85 0
      modules/shop/dao/express_dao.go
  8. 48 0
      modules/shop/models/model/banner.go
  9. 36 0
      modules/shop/models/model/express.go
  10. 58 0
      modules/shop/models/req/banner_request.go
  11. 44 0
      modules/shop/models/req/express_request.go
  12. 18 0
      modules/shop/models/response/banner_response.go
  13. 14 0
      modules/shop/models/response/express_response.go
  14. 29 0
      modules/shop/router/admin/shop/banner_router.go
  15. 29 0
      modules/shop/router/admin/shop/express_router.go
  16. 4 0
      modules/shop/router/admin/shop/shop.go
  17. 29 0
      modules/shop/router/client/shop/banner_router.go
  18. 29 0
      modules/shop/router/client/shop/express_router.go
  19. 4 0
      modules/shop/router/client/shop/shop.go
  20. 41 0
      modules/shop/service/banner_service.go
  21. 50 0
      modules/shop/service/express_service.go
  22. 44 0
      yudao-ui/src/api/shop/banner/index.ts
  23. 44 0
      yudao-ui/src/api/shop/express/index.ts
  24. 0 44
      yudao-ui/src/api/shop/订����单管理/index.ts
  25. 242 0
      yudao-ui/src/views/shop/banner/BannerForm.vue
  26. 214 0
      yudao-ui/src/views/shop/banner/index.vue
  27. 172 0
      yudao-ui/src/views/shop/express/ExpressForm.vue
  28. 193 0
      yudao-ui/src/views/shop/express/index.vue

+ 10 - 1
.drone.yml

@@ -11,8 +11,17 @@ steps:
   commands:
   - export GOOS=linux
   - export GOARCH=amd64
-  - go build -mod=vendor -o /root/waimai
+  - go build -mod=vendor -o waimai
 
+- name: Docker打包 (正式版本)
+  image: plugins/docker
+  settings:
+    repo: 8.137.121.180:5000/waimai
+    registry: registry.cn-hangzhou.aliyuncs.com
+    mirror: https://yb01u5tg.mirror.aliyuncs.com
+  when:
+    branch:
+      - master
 trigger:
   branch:
     - master

+ 140 - 0
modules/shop/api/v1/admin/banner_api.go

@@ -0,0 +1,140 @@
+package admin
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+	"ulink-admin/modules/shop/models/response"
+	"ulink-admin/modules/shop/service"
+	"ulink-admin/pkg/excels"
+	"ulink-admin/pkg/file"
+	"ulink-admin/pkg/page"
+	"ulink-admin/utils"
+)
+
+type BannerApi struct {
+	BannerService *service.BannerService `inject:""`
+}
+
+// List 查询轮播管理分页数据
+// @Summary 分页查询轮播管理数据接口
+// @Description 分页查询轮播管理数据接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.BannerQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=page.Page{list=model.Banner},msg=string} "分页获取轮播管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /banner/page [get]
+func (this BannerApi) Page(c *frame.Context) {
+	query := &req.BannerQuery{}
+	c.ValidteError(c.ShouldBind(query), query)
+	list := make([]response.BannerResponse, 0)
+	i := this.BannerService.Page(query, &list)
+	c.Ok(page.Page{List: list, Total: i, Size: query.PageSize})
+}
+
+// List 查询轮播管理所有数据
+// @Summary 查询全部数据轮播管理数据接口
+// @Description 查询全部数据轮播管理数据接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.BannerQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Banner,msg=string} "分页获取轮播管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /banner/list [get]
+func (this BannerApi) List(c *frame.Context) {
+	query := &req.BannerQuery{}
+	list := make([]response.BannerResponse, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.BannerService.List(query, &list)
+	c.Ok(list)
+}
+
+// Get 根据轮播管理Id获取详细信息
+// @Summary 轮播管理详情查询接口
+// @Description 轮播管理详情查询接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id query   int true "id" id
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Banner,msg=string} "返回轮播管理详情查询"
+// @Router /banner [get]
+func (this BannerApi) Get(c *frame.Context) {
+	var req struct {
+		Id int64 `form:"id" binding:"required"  msg:"id不存在" ` //id
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	c.Ok(this.BannerService.Get(req.Id))
+}
+
+// Add 新增轮播管理
+// @Summary 新增轮播管理接口
+// @Description 新增轮播管理接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Banner true "轮播管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /banner/add [post]
+func (this BannerApi) Add(c *frame.Context) {
+	params, banner := &req.BannerAdd{}, &model.Banner{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(banner, params)
+	this.BannerService.Insert(banner)
+}
+
+// Edit 修改轮播管理数据接口
+// @Summary 修改轮播管理接口
+// @Description 新增轮播管理接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Banner true "轮播管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /banner/edit [put]
+func (this BannerApi) Edit(c *frame.Context) {
+	params, banner := &req.BannerEdit{}, &model.Banner{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(banner, params)
+	this.BannerService.Edit(banner, c.Cols())
+}
+
+// Delete 删除轮播管理数据
+// @Summary 删除轮播管理接口
+// @Description 删除轮播管理接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id path   int true "id" id
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /banner [delete]
+func (a BannerApi) Delete(c *frame.Context) {
+	var req struct {
+		Ids []int64 `form:"ids" binding:"required"  msg:"ids不存在"` //ids
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	a.BannerService.Delete(req.Ids)
+}
+
+// Export 导出excel
+func (this BannerApi) Export(c *frame.Context) {
+	query := &req.BannerQuery{}
+	list := make([]model.Banner, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.BannerService.List(query, list)
+	excelList := make([]interface{}, 0)
+	for _, banner := range list {
+		excelList = append(excelList, banner)
+	}
+	_, files := excels.ExportExcel(excelList, "轮播管理数据表")
+	file.DownloadExcel(c, files)
+}

+ 140 - 0
modules/shop/api/v1/admin/express_api.go

@@ -0,0 +1,140 @@
+package admin
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+	"ulink-admin/modules/shop/models/response"
+	"ulink-admin/modules/shop/service"
+	"ulink-admin/pkg/excels"
+	"ulink-admin/pkg/file"
+	"ulink-admin/pkg/page"
+	"ulink-admin/utils"
+)
+
+type ExpressApi struct {
+	ExpressService *service.ExpressService `inject:""`
+}
+
+// List 查询快递管理分页数据
+// @Summary 分页查询快递管理数据接口
+// @Description 分页查询快递管理数据接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.ExpressQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=page.Page{list=model.Express},msg=string} "分页获取快递管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /express/page [get]
+func (this ExpressApi) Page(c *frame.Context) {
+	query := &req.ExpressQuery{}
+	c.ValidteError(c.ShouldBind(query), query)
+	list := make([]response.ExpressResponse, 0)
+	i := this.ExpressService.Page(query, &list)
+	c.Ok(page.Page{List: list, Total: i, Size: query.PageSize})
+}
+
+// List 查询快递管理所有数据
+// @Summary 查询全部数据快递管理数据接口
+// @Description 查询全部数据快递管理数据接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.ExpressQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Express,msg=string} "分页获取快递管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /express/list [get]
+func (this ExpressApi) List(c *frame.Context) {
+	query := &req.ExpressQuery{}
+	list := make([]response.ExpressResponse, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.ExpressService.List(query, &list)
+	c.Ok(list)
+}
+
+// Get 根据快递管理Id获取详细信息
+// @Summary 快递管理详情查询接口
+// @Description 快递管理详情查询接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id query   int true "id" id
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Express,msg=string} "返回快递管理详情查询"
+// @Router /express [get]
+func (this ExpressApi) Get(c *frame.Context) {
+	var req struct {
+		Id int64 `form:"id" binding:"required"  msg:"id不存在" ` //id
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	c.Ok(this.ExpressService.Get(req.Id))
+}
+
+// Add 新增快递管理
+// @Summary 新增快递管理接口
+// @Description 新增快递管理接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Express true "快递管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /express/add [post]
+func (this ExpressApi) Add(c *frame.Context) {
+	params, express := &req.ExpressAdd{}, &model.Express{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(express, params)
+	this.ExpressService.Insert(express)
+}
+
+// Edit 修改快递管理数据接口
+// @Summary 修改快递管理接口
+// @Description 新增快递管理接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Express true "快递管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /express/edit [put]
+func (this ExpressApi) Edit(c *frame.Context) {
+	params, express := &req.ExpressEdit{}, &model.Express{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(express, params)
+	this.ExpressService.Edit(express, c.Cols())
+}
+
+// Delete 删除快递管理数据
+// @Summary 删除快递管理接口
+// @Description 删除快递管理接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id path   int true "id" id
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /express [delete]
+func (a ExpressApi) Delete(c *frame.Context) {
+	var req struct {
+		Ids []int64 `form:"ids" binding:"required"  msg:"ids不存在"` //ids
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	a.ExpressService.Delete(req.Ids)
+}
+
+// Export 导出excel
+func (this ExpressApi) Export(c *frame.Context) {
+	query := &req.ExpressQuery{}
+	list := make([]model.Express, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.ExpressService.List(query, list)
+	excelList := make([]interface{}, 0)
+	for _, express := range list {
+		excelList = append(excelList, express)
+	}
+	_, files := excels.ExportExcel(excelList, "快递管理数据表")
+	file.DownloadExcel(c, files)
+}

+ 140 - 0
modules/shop/api/v1/client/banner_api.go

@@ -0,0 +1,140 @@
+package client
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+	"ulink-admin/modules/shop/models/response"
+	"ulink-admin/modules/shop/service"
+	"ulink-admin/pkg/excels"
+	"ulink-admin/pkg/file"
+	"ulink-admin/pkg/page"
+	"ulink-admin/utils"
+)
+
+type BannerApi struct {
+	BannerService *service.BannerService `inject:""`
+}
+
+// List 查询轮播管理分页数据
+// @Summary 分页查询轮播管理数据接口
+// @Description 分页查询轮播管理数据接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.BannerQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=page.Page{list=model.Banner},msg=string} "分页获取轮播管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /banner/page [get]
+func (this BannerApi) Page(c *frame.Context) {
+	query := &req.BannerQuery{}
+	c.ValidteError(c.ShouldBind(query), query)
+	list := make([]response.BannerResponse, 0)
+	i := this.BannerService.Page(query, &list)
+	c.Ok(page.Page{List: list, Total: i, Size: query.PageSize})
+}
+
+// List 查询轮播管理所有数据
+// @Summary 查询全部数据轮播管理数据接口
+// @Description 查询全部数据轮播管理数据接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.BannerQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Banner,msg=string} "分页获取轮播管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /banner/list [get]
+func (this BannerApi) List(c *frame.Context) {
+	query := &req.BannerQuery{}
+	list := make([]response.BannerResponse, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.BannerService.List(query, &list)
+	c.Ok(list)
+}
+
+// Get 根据轮播管理Id获取详细信息
+// @Summary 轮播管理详情查询接口
+// @Description 轮播管理详情查询接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id query   int true "id" id
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Banner,msg=string} "返回轮播管理详情查询"
+// @Router /banner [get]
+func (this BannerApi) Get(c *frame.Context) {
+	var req struct {
+		Id int64 `form:"id" binding:"required"  msg:"id不存在" ` //id
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	c.Ok(this.BannerService.Get(req.Id))
+}
+
+// Add 新增轮播管理
+// @Summary 新增轮播管理接口
+// @Description 新增轮播管理接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Banner true "轮播管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /banner/add [post]
+func (this BannerApi) Add(c *frame.Context) {
+	params, banner := &req.BannerAdd{}, &model.Banner{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(banner, params)
+	this.BannerService.Insert(banner)
+}
+
+// Edit 修改轮播管理数据接口
+// @Summary 修改轮播管理接口
+// @Description 新增轮播管理接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Banner true "轮播管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /banner/edit [put]
+func (this BannerApi) Edit(c *frame.Context) {
+	params, banner := &req.BannerEdit{}, &model.Banner{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(banner, params)
+	this.BannerService.Edit(banner, c.Cols())
+}
+
+// Delete 删除轮播管理数据
+// @Summary 删除轮播管理接口
+// @Description 删除轮播管理接口
+// @Tags 轮播管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id path   int true "id" id
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /banner [delete]
+func (a BannerApi) Delete(c *frame.Context) {
+	var req struct {
+		Ids []int64 `form:"ids" binding:"required"  msg:"ids不存在"` //ids
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	a.BannerService.Delete(req.Ids)
+}
+
+// Export 导出excel
+func (this BannerApi) Export(c *frame.Context) {
+	query := &req.BannerQuery{}
+	list := make([]model.Banner, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.BannerService.List(query, list)
+	excelList := make([]interface{}, 0)
+	for _, banner := range list {
+		excelList = append(excelList, banner)
+	}
+	_, files := excels.ExportExcel(excelList, "轮播管理数据表")
+	file.DownloadExcel(c, files)
+}

+ 140 - 0
modules/shop/api/v1/client/express_api.go

@@ -0,0 +1,140 @@
+package client
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+	"ulink-admin/modules/shop/models/response"
+	"ulink-admin/modules/shop/service"
+	"ulink-admin/pkg/excels"
+	"ulink-admin/pkg/file"
+	"ulink-admin/pkg/page"
+	"ulink-admin/utils"
+)
+
+type ExpressApi struct {
+	ExpressService *service.ExpressService `inject:""`
+}
+
+// List 查询快递管理分页数据
+// @Summary 分页查询快递管理数据接口
+// @Description 分页查询快递管理数据接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.ExpressQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=page.Page{list=model.Express},msg=string} "分页获取快递管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /express/page [get]
+func (this ExpressApi) Page(c *frame.Context) {
+	query := &req.ExpressQuery{}
+	c.ValidteError(c.ShouldBind(query), query)
+	list := make([]response.ExpressResponse, 0)
+	i := this.ExpressService.Page(query, &list)
+	c.Ok(page.Page{List: list, Total: i, Size: query.PageSize})
+}
+
+// List 查询快递管理所有数据
+// @Summary 查询全部数据快递管理数据接口
+// @Description 查询全部数据快递管理数据接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param object query req.ExpressQuery false "查询参数"
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Express,msg=string} "分页获取快递管理列表,返回包括列表,总数,页码,每页数量"
+// @Router /express/list [get]
+func (this ExpressApi) List(c *frame.Context) {
+	query := &req.ExpressQuery{}
+	list := make([]response.ExpressResponse, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.ExpressService.List(query, &list)
+	c.Ok(list)
+}
+
+// Get 根据快递管理Id获取详细信息
+// @Summary 快递管理详情查询接口
+// @Description 快递管理详情查询接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id query   int true "id" id
+// @Security ApiKeyAuth
+// @Success 200 {object} resp.Response{data=model.Express,msg=string} "返回快递管理详情查询"
+// @Router /express [get]
+func (this ExpressApi) Get(c *frame.Context) {
+	var req struct {
+		Id int64 `form:"id" binding:"required"  msg:"id不存在" ` //id
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	c.Ok(this.ExpressService.Get(req.Id))
+}
+
+// Add 新增快递管理
+// @Summary 新增快递管理接口
+// @Description 新增快递管理接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Express true "快递管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /express/add [post]
+func (this ExpressApi) Add(c *frame.Context) {
+	params, express := &req.ExpressAdd{}, &model.Express{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(express, params)
+	this.ExpressService.Insert(express)
+}
+
+// Edit 修改快递管理数据接口
+// @Summary 修改快递管理接口
+// @Description 新增快递管理接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param  data body model.Express true "快递管理实体对象"
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /express/edit [put]
+func (this ExpressApi) Edit(c *frame.Context) {
+	params, express := &req.ExpressEdit{}, &model.Express{}
+	c.ValidteError(c.ShouldBind(params), params)
+	utils.CopyFields(express, params)
+	this.ExpressService.Edit(express, c.Cols())
+}
+
+// Delete 删除快递管理数据
+// @Summary 删除快递管理接口
+// @Description 删除快递管理接口
+// @Tags 快递管理相关接口
+// @Accept application/json
+// @Produce application/json
+// @Param Authorization header string false "Bearer 令牌"
+// @Param id path   int true "id" id
+// @Success 200 {object} resp.Response{msg=string} "操作状态"
+// @Router /express [delete]
+func (a ExpressApi) Delete(c *frame.Context) {
+	var req struct {
+		Ids []int64 `form:"ids" binding:"required"  msg:"ids不存在"` //ids
+	}
+	c.ValidteError(c.ShouldBind(&req), &req)
+	a.ExpressService.Delete(req.Ids)
+}
+
+// Export 导出excel
+func (this ExpressApi) Export(c *frame.Context) {
+	query := &req.ExpressQuery{}
+	list := make([]model.Express, 0)
+	c.ValidteError(c.ShouldBind(query), query)
+	this.ExpressService.List(query, list)
+	excelList := make([]interface{}, 0)
+	for _, express := range list {
+		excelList = append(excelList, express)
+	}
+	_, files := excels.ExportExcel(excelList, "快递管理数据表")
+	file.DownloadExcel(c, files)
+}

+ 109 - 0
modules/shop/dao/baner_dao.go

@@ -0,0 +1,109 @@
+package dao
+
+import (
+	"github.com/druidcaesa/gotool"
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+	"ulink-admin/pkg/base"
+	"ulink-admin/pkg/page"
+)
+
+type BannerDao struct {
+	base.BaseDao
+}
+
+// Page 查询轮播管理分页数据
+func (this BannerDao) Page(query *req.BannerQuery, list interface{}) int64 {
+	session := this.GetSession().Table(model.Banner{}.TableName())
+
+	if query.Id > 0 {
+		session.And("id = ?", query.Id)
+	}
+	if query.Position > 0 {
+		session.And("position = ?", query.Position)
+	}
+	if query.State > 0 {
+		session.And("state = ?", query.State)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Image) {
+		session.And("image = ?", query.Image)
+	}
+	if query.Mode > 0 {
+		session.And("mode = ?", query.Mode)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Url) {
+		session.And("url = ?", query.Url)
+	}
+	if query.Sort > 0 {
+		session.And("sort = ?", query.Sort)
+	}
+	if !gotool.StrUtils.HasEmpty(query.CreateBy) {
+		session.And("create_by = ?", query.CreateBy)
+	}
+	if !gotool.StrUtils.HasEmpty(query.UpdateBy) {
+		session.And("update_by = ?", query.UpdateBy)
+	}
+	if query.Terminal > 0 {
+		session.And("terminal = ?", query.Terminal)
+	}
+	if !gotool.StrUtils.HasEmpty(query.BeginTime) {
+		session.And("date_format(u.create_time,'%y%m%d') >= date_format(?,'%y%m%d')", query.BeginTime)
+	}
+	if !gotool.StrUtils.HasEmpty(query.EndTime) {
+		session.And("date_format(u.create_time,'%y%m%d') <= date_format(?,'%y%m%d')", query.EndTime)
+	}
+	session.Desc("id")
+	total, err := session.Limit(query.PageSize, page.StartSize(query.PageNum, query.PageSize)).FindAndCount(list)
+	if err != nil {
+		frame.Throw(frame.SQL_CODE, "数据查询错误"+err.Error())
+	}
+	return total
+}
+
+// List 查询轮播管理分页数据
+func (this BannerDao) List(query *req.BannerQuery, list interface{}) {
+	session := this.GetSession().Table(model.Banner{}.TableName())
+
+	if query.Id > 0 {
+		session.And("id = ?", query.Id)
+	}
+	if query.Position > 0 {
+		session.And("position = ?", query.Position)
+	}
+	if query.State > 0 {
+		session.And("state = ?", query.State)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Image) {
+		session.And("image = ?", query.Image)
+	}
+	if query.Mode > 0 {
+		session.And("mode = ?", query.Mode)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Url) {
+		session.And("url = ?", query.Url)
+	}
+	if query.Sort > 0 {
+		session.And("sort = ?", query.Sort)
+	}
+	if !gotool.StrUtils.HasEmpty(query.CreateBy) {
+		session.And("create_by = ?", query.CreateBy)
+	}
+	if !gotool.StrUtils.HasEmpty(query.UpdateBy) {
+		session.And("update_by = ?", query.UpdateBy)
+	}
+	if query.Terminal > 0 {
+		session.And("terminal = ?", query.Terminal)
+	}
+	if !gotool.StrUtils.HasEmpty(query.BeginTime) {
+		session.And("date_format(u.create_time,'%y%m%d') >= date_format(?,'%y%m%d')", query.BeginTime)
+	}
+	if !gotool.StrUtils.HasEmpty(query.EndTime) {
+		session.And("date_format(u.create_time,'%y%m%d') <= date_format(?,'%y%m%d')", query.EndTime)
+	}
+	session.Desc("id")
+	err := session.Find(list)
+	if err != nil {
+		frame.Throw(frame.SQL_CODE, "数据查询错误"+err.Error())
+	}
+}

+ 85 - 0
modules/shop/dao/express_dao.go

@@ -0,0 +1,85 @@
+package dao
+
+import (
+	"github.com/druidcaesa/gotool"
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+	"ulink-admin/pkg/base"
+	"ulink-admin/pkg/page"
+)
+
+type ExpressDao struct {
+	base.BaseDao
+}
+
+// Page 查询快递管理分页数据
+func (this ExpressDao) Page(query *req.ExpressQuery, list interface{}) int64 {
+	session := this.GetSession().Table(model.Express{}.TableName())
+
+	if query.Id > 0 {
+		session.And("id = ?", query.Id)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Code) {
+		session.And("code = ?", query.Code)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Name) {
+		session.And("name = ?", query.Name)
+	}
+	if query.Sort > 0 {
+		session.And("sort = ?", query.Sort)
+	}
+	if query.IsShow > 0 {
+		session.And("is_show = ?", query.IsShow)
+	}
+	if query.IsDel > 0 {
+		session.And("is_del = ?", query.IsDel)
+	}
+	if !gotool.StrUtils.HasEmpty(query.BeginTime) {
+		session.And("date_format(u.create_time,'%y%m%d') >= date_format(?,'%y%m%d')", query.BeginTime)
+	}
+	if !gotool.StrUtils.HasEmpty(query.EndTime) {
+		session.And("date_format(u.create_time,'%y%m%d') <= date_format(?,'%y%m%d')", query.EndTime)
+	}
+	session.Desc("id")
+	total, err := session.Limit(query.PageSize, page.StartSize(query.PageNum, query.PageSize)).FindAndCount(list)
+	if err != nil {
+		frame.Throw(frame.SQL_CODE, "数据查询错误"+err.Error())
+	}
+	return total
+}
+
+// List 查询快递管理分页数据
+func (this ExpressDao) List(query *req.ExpressQuery, list interface{}) {
+	session := this.GetSession().Table(model.Express{}.TableName())
+
+	if query.Id > 0 {
+		session.And("id = ?", query.Id)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Code) {
+		session.And("code = ?", query.Code)
+	}
+	if !gotool.StrUtils.HasEmpty(query.Name) {
+		session.And("name = ?", query.Name)
+	}
+	if query.Sort > 0 {
+		session.And("sort = ?", query.Sort)
+	}
+	if query.IsShow > 0 {
+		session.And("is_show = ?", query.IsShow)
+	}
+	if query.IsDel > 0 {
+		session.And("is_del = ?", query.IsDel)
+	}
+	if !gotool.StrUtils.HasEmpty(query.BeginTime) {
+		session.And("date_format(u.create_time,'%y%m%d') >= date_format(?,'%y%m%d')", query.BeginTime)
+	}
+	if !gotool.StrUtils.HasEmpty(query.EndTime) {
+		session.And("date_format(u.create_time,'%y%m%d') <= date_format(?,'%y%m%d')", query.EndTime)
+	}
+	session.Desc("id")
+	err := session.Find(list)
+	if err != nil {
+		frame.Throw(frame.SQL_CODE, "数据查询错误"+err.Error())
+	}
+}

+ 48 - 0
modules/shop/models/model/banner.go

@@ -0,0 +1,48 @@
+package model
+
+import (
+	"time"
+	"ulink-admin/pkg/base"
+)
+
+type Banner struct {
+	Id         int64     `excel:"name=   " xorm:"pk autoincr    notnull    comment('')" json:"id"  binding:"required"`                                                                           //
+	Position   int       `excel:"name=轮播位置   ,format=1=首页,2=商品列表页,3=商品详情页" xorm:"tinyint(2)    notnull  default(1)  comment('轮播位置')" json:"position"  binding:"required,oneof=1 2 3 "`           //轮播位置(1首页 2商品列表页 3商品详情页)
+	State      int       `excel:"name=轮播状态   ,format=1=禁用,2=启用" xorm:"tinyint(2)    notnull    comment('轮播状态')" json:"state"  binding:"required,oneof=1 2 "`                                     //轮播状态
+	Image      string    `excel:"name=轮播图片地址   " xorm:"varchar(255)    notnull    comment('轮播图片地址')" json:"image"  binding:"required"`                                                           //轮播图片地址
+	Mode       int       `excel:"name=轮播类型   ,format=1=图片,2=视频,3=文字" xorm:"tinyint(2)    notnull    comment('轮播类型')" json:"mode"  binding:"required,oneof=1 2 3 "`                               //轮播类型(1图片 2视频 3文字)
+	Url        string    `excel:"name=跳转地址   " xorm:"varchar(255)      comment('跳转地址')" json:"url"  binding:"required"`                                                                          //跳转地址
+	Sort       int       `excel:"name=排序权重   " xorm:"int(11)      comment('排序权重')" json:"sort"  binding:"required"`                                                                              //排序权重
+	CreateBy   string    `excel:"name=创建人   " xorm:"varchar(255)      comment('创建人')" json:"createBy"  `                                                                                         //创建人
+	CreateTime time.Time `excel:"name=创建时间   " xorm:"datetime      comment('创建时间')" json:"createTime"  `                                                                                         //创建时间
+	UpdateBy   string    `excel:"name=更新人   " xorm:"varchar(255)      comment('更新人')" json:"updateBy"  `                                                                                         //更新人
+	UpdateTime time.Time `excel:"name=最后修改时间   " xorm:"datetime      comment('最后修改时间')" json:"updateTime"  `                                                                                     //最后修改时间
+	Terminal   int       `excel:"name=轮播终端类型   ,format=1=pc,2=2html5,3=app,4=微信小程序,5=其它" xorm:"tinyint(2)    notnull    comment('轮播终端类型')" json:"terminal"  binding:"required,oneof=1 2 3 4 5 "` //轮播终端类型(1pc 2html5 3app 4微信小程序 5其它)
+}
+
+func (this Banner) TableName() string {
+	return "shop_banner"
+}
+
+func (this *Banner) Key() int64 {
+	return this.Id
+}
+
+func (this *Banner) Model() interface{} {
+	return this
+}
+
+func (this *Banner) BeforeUpdate() {
+	user := base.GetCurUser()
+	if user != nil {
+		this.UpdateBy = user.Name
+	}
+}
+
+func (this *Banner) BeforeInsert() {
+	user := base.GetCurUser()
+	if user != nil {
+		this.CreateBy = user.Name
+		this.UpdateBy = user.Name
+	}
+}

+ 36 - 0
modules/shop/models/model/express.go

@@ -0,0 +1,36 @@
+package model
+
+import (
+	"time"
+)
+
+type Express struct {
+	Id         int64     `excel:"name=快递公司id   " xorm:"pk autoincr    notnull    comment('快递公司id')" json:"id"  binding:"required"`                             //快递公司id
+	Code       string    `excel:"name=快递公司   " xorm:"varchar(50)    notnull    comment('快递公司')" json:"code"  binding:"required"`                               //快递公司
+	Name       string    `excel:"name=快递公司全称   " xorm:"varchar(50)    notnull    comment('快递公司全称')" json:"name"  binding:"required"`                           //快递公司全称
+	Sort       int       `excel:"name=排序   " xorm:"int(11)    notnull  default(0)  comment('排序')" json:"sort"  binding:"required"`                             //排序
+	IsShow     int       `excel:"name=是否显示   ,format=1=否,2=是" xorm:"pk     notnull  default(2)  comment('是否显示')" json:"isShow"  binding:"required,oneof=1 2 "` //是否显示(1否 2是)
+	CreateTime time.Time `excel:"name=创建时间   " xorm:"datetime      comment('创建时间')" json:"createTime"  `                                                       //创建时间
+	UpdateTime time.Time `excel:"name=更新时间   " xorm:"datetime      comment('更新时间')" json:"updateTime"  `                                                       //更新时间
+	IsDel      int       `excel:"name=是否删除   ,format=1=否,2=是" xorm:"tinyint(4)    default(0)  comment('是否删除')" json:"isDel"  `                                 //是否删除(1否 2是)
+}
+
+func (this Express) TableName() string {
+	return "shop_express"
+}
+
+func (this *Express) Key() int64 {
+	return this.Id
+}
+
+func (this *Express) Model() interface{} {
+	return this
+}
+
+func (this *Express) BeforeUpdate() {
+
+}
+
+func (this *Express) BeforeInsert() {
+
+}

+ 58 - 0
modules/shop/models/req/banner_request.go

@@ -0,0 +1,58 @@
+package req
+
+import (
+	"time"
+	"ulink-admin/pkg/base"
+)
+
+type BannerAdd struct {
+	Position int    `json:"position"  binding:"required,oneof=1 2 3 "`     //轮播位置(1首页 2商品列表页 3商品详情页)
+	State    int    `json:"state"  binding:"required,oneof=1 2 "`          //轮播状态
+	Image    string `json:"image"  binding:"required"`                     //轮播图片地址
+	Mode     int    `json:"mode"  binding:"required,oneof=1 2 3 "`         //轮播类型(1图片 2视频 3文字)
+	Url      string `json:"url"  binding:"required"`                       //跳转地址
+	Sort     int    `json:"sort"  binding:"required"`                      //排序权重
+	Terminal int    `json:"terminal"  binding:"required,oneof=1 2 3 4 5 "` //轮播终端类型(1pc 2html5 3app 4微信小程序 5其它)
+}
+
+type BannerEdit struct {
+	Id       int64  `json:"id"  binding:"required"`                        //主键id
+	Position int    `json:"position"  binding:"required,oneof=1 2 3 "`     //轮播位置(1首页 2商品列表页 3商品详情页)
+	State    int    `json:"state"  binding:"required,oneof=1 2 "`          //轮播状态
+	Image    string `json:"image"  binding:"required"`                     //轮播图片地址
+	Mode     int    `json:"mode"  binding:"required,oneof=1 2 3 "`         //轮播类型(1图片 2视频 3文字)
+	Url      string `json:"url"  binding:"required"`                       //跳转地址
+	Sort     int    `json:"sort"  binding:"required"`                      //排序权重
+	Terminal int    `json:"terminal"  binding:"required,oneof=1 2 3 4 5 "` //轮播终端类型(1pc 2html5 3app 4微信小程序 5其它)
+}
+
+type BannerQuery struct {
+	base.GlobalQuery
+	Id         int64     `form:"id"`         //
+	Position   int       `form:"position"`   //轮播位置(1首页 2商品列表页 3商品详情页)
+	State      int       `form:"state"`      //轮播状态
+	Image      string    `form:"image"`      //轮播图片地址
+	Mode       int       `form:"mode"`       //轮播类型(1图片 2视频 3文字)
+	Url        string    `form:"url"`        //跳转地址
+	Sort       int       `form:"sort"`       //排序权重
+	CreateBy   string    `form:"createBy"`   //创建人
+	CreateTime time.Time `form:"createTime"` //创建时间
+	UpdateBy   string    `form:"updateBy"`   //更新人
+	UpdateTime time.Time `form:"updateTime"` //最后修改时间
+	Terminal   int       `form:"terminal"`   //轮播终端类型(1pc 2html5 3app 4微信小程序 5其它)
+}
+
+type BannerBody struct {
+	Id         int64     `json:"id" binding:"required"`       //
+	Position   int       `json:"position" binding:"required"` //轮播位置(1首页 2商品列表页 3商品详情页)
+	State      int       `json:"state" binding:"required"`    //轮播状态
+	Image      string    `json:"image" binding:"required"`    //轮播图片地址
+	Mode       int       `json:"mode" binding:"required"`     //轮播类型(1图片 2视频 3文字)
+	Url        string    `json:"url" binding:"required"`      //跳转地址
+	Sort       int       `json:"sort" binding:"required"`     //排序权重
+	CreateBy   string    `json:"createBy" `                   //创建人
+	CreateTime time.Time `json:"createTime" `                 //创建时间
+	UpdateBy   string    `json:"updateBy" `                   //更新人
+	UpdateTime time.Time `json:"updateTime" `                 //最后修改时间
+	Terminal   int       `json:"terminal" binding:"required"` //轮播终端类型(1pc 2html5 3app 4微信小程序 5其它)
+}

+ 44 - 0
modules/shop/models/req/express_request.go

@@ -0,0 +1,44 @@
+package req
+
+import (
+	"time"
+	"ulink-admin/pkg/base"
+)
+
+type ExpressAdd struct {
+	Code   string `json:"code"  binding:"required"`              //快递公司
+	Name   string `json:"name"  binding:"required"`              //快递公司全称
+	Sort   int    `json:"sort"  binding:"required"`              //排序
+	IsShow int    `json:"isShow"  binding:"required,oneof=1 2 "` //是否显示(1否 2是)
+}
+
+type ExpressEdit struct {
+	Id     int64  `json:"id"  binding:"required"`                //主键id
+	Code   string `json:"code"  binding:"required"`              //快递公司
+	Name   string `json:"name"  binding:"required"`              //快递公司全称
+	Sort   int    `json:"sort"  binding:"required"`              //排序
+	IsShow int    `json:"isShow"  binding:"required,oneof=1 2 "` //是否显示(1否 2是)
+}
+
+type ExpressQuery struct {
+	base.GlobalQuery
+	Id         int64     `form:"id"`         //快递公司id
+	Code       string    `form:"code"`       //快递公司
+	Name       string    `form:"name"`       //快递公司全称
+	Sort       int       `form:"sort"`       //排序
+	IsShow     int       `form:"isShow"`     //是否显示(1否 2是)
+	CreateTime time.Time `form:"createTime"` //创建时间
+	UpdateTime time.Time `form:"updateTime"` //更新时间
+	IsDel      int       `form:"isDel"`      //是否删除(1否 2是)
+}
+
+type ExpressBody struct {
+	Id         int64     `json:"id" binding:"required"`     //快递公司id
+	Code       string    `json:"code" binding:"required"`   //快递公司
+	Name       string    `json:"name" binding:"required"`   //快递公司全称
+	Sort       int       `json:"sort" binding:"required"`   //排序
+	IsShow     int       `json:"isShow" binding:"required"` //是否显示(1否 2是)
+	CreateTime time.Time `json:"createTime" `               //创建时间
+	UpdateTime time.Time `json:"updateTime" `               //更新时间
+	IsDel      int       `json:"isDel" `                    //是否删除(1否 2是)
+}

+ 18 - 0
modules/shop/models/response/banner_response.go

@@ -0,0 +1,18 @@
+package response
+
+import "time"
+
+type BannerResponse struct {
+	Id         int64     `excel:"name=   " xorm:"pk autoincr    notnull    comment('')" json:"id"  binding:"required"`                                                                           //
+	Position   int       `excel:"name=轮播位置   ,format=1=首页,2=商品列表页,3=商品详情页" xorm:"tinyint(2)    notnull  default(1)  comment('轮播位置')" json:"position"  binding:"required,oneof=1 2 3 "`           //轮播位置(1首页 2商品列表页 3商品详情页)
+	State      int       `excel:"name=轮播状态   ,format=1=禁用,2=启用" xorm:"tinyint(2)    notnull    comment('轮播状态')" json:"state"  binding:"required,oneof=1 2 "`                                     //轮播状态
+	Image      string    `excel:"name=轮播图片地址   " xorm:"varchar(255)    notnull    comment('轮播图片地址')" json:"image"  binding:"required"`                                                           //轮播图片地址
+	Mode       int       `excel:"name=轮播类型   ,format=1=图片,2=视频,3=文字" xorm:"tinyint(2)    notnull    comment('轮播类型')" json:"mode"  binding:"required,oneof=1 2 3 "`                               //轮播类型(1图片 2视频 3文字)
+	Url        string    `excel:"name=跳转地址   " xorm:"varchar(255)      comment('跳转地址')" json:"url"  binding:"required"`                                                                          //跳转地址
+	Sort       int       `excel:"name=排序权重   " xorm:"int(11)      comment('排序权重')" json:"sort"  binding:"required"`                                                                              //排序权重
+	CreateBy   string    `excel:"name=创建人   " xorm:"varchar(255)      comment('创建人')" json:"createBy"  `                                                                                         //创建人
+	CreateTime time.Time `excel:"name=创建时间   " xorm:"datetime      comment('创建时间')" json:"createTime"  `                                                                                         //创建时间
+	UpdateBy   string    `excel:"name=更新人   " xorm:"varchar(255)      comment('更新人')" json:"updateBy"  `                                                                                         //更新人
+	UpdateTime time.Time `excel:"name=最后修改时间   " xorm:"datetime      comment('最后修改时间')" json:"updateTime"  `                                                                                     //最后修改时间
+	Terminal   int       `excel:"name=轮播终端类型   ,format=1=pc,2=2html5,3=app,4=微信小程序,5=其它" xorm:"tinyint(2)    notnull    comment('轮播终端类型')" json:"terminal"  binding:"required,oneof=1 2 3 4 5 "` //轮播终端类型(1pc 2html5 3app 4微信小程序 5其它)
+}

+ 14 - 0
modules/shop/models/response/express_response.go

@@ -0,0 +1,14 @@
+package response
+
+import "time"
+
+type ExpressResponse struct {
+	Id         int64     `excel:"name=快递公司id   " xorm:"pk autoincr    notnull    comment('快递公司id')" json:"id"  binding:"required"`                             //快递公司id
+	Code       string    `excel:"name=快递公司   " xorm:"varchar(50)    notnull    comment('快递公司')" json:"code"  binding:"required"`                               //快递公司
+	Name       string    `excel:"name=快递公司全称   " xorm:"varchar(50)    notnull    comment('快递公司全称')" json:"name"  binding:"required"`                           //快递公司全称
+	Sort       int       `excel:"name=排序   " xorm:"int(11)    notnull  default(0)  comment('排序')" json:"sort"  binding:"required"`                             //排序
+	IsShow     int       `excel:"name=是否显示   ,format=1=否,2=是" xorm:"pk     notnull  default(2)  comment('是否显示')" json:"isShow"  binding:"required,oneof=1 2 "` //是否显示(1否 2是)
+	CreateTime time.Time `excel:"name=创建时间   " xorm:"datetime      comment('创建时间')" json:"createTime"  `                                                       //创建时间
+	UpdateTime time.Time `excel:"name=更新时间   " xorm:"datetime      comment('更新时间')" json:"updateTime"  `                                                       //更新时间
+	IsDel      int       `excel:"name=是否删除   ,format=1=否,2=是" xorm:"tinyint(4)    default(0)  comment('是否删除')" json:"isDel"  `                                 //是否删除(1否 2是)
+}

+ 29 - 0
modules/shop/router/admin/shop/banner_router.go

@@ -0,0 +1,29 @@
+package shop
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/api/v1/admin"
+)
+
+type Banner struct {
+	Api *admin.BannerApi `inject:""`
+}
+
+// 初始化路由
+func (a *Banner) InitRouter(router *frame.Group) {
+	group := router.Group("/banner").Permission(frame.MENU, "banner", "轮播管理")
+	{
+		//添加轮播管理
+		group.POST("", a.Api.Add).Permission(frame.AUTH, "banner:add", "新增轮播管理")
+		//修改轮播管理数据接口
+		group.PUT("", a.Api.Edit).Permission(frame.AUTH, "banner:edit", "更新轮播管理")
+		//删除轮播管理数据
+		group.DELETE("", a.Api.Delete).Permission(frame.AUTH, "banner:delete", "删除轮播管理")
+		//查询轮播管理数据
+		group.GET("/page", a.Api.Page).Permission(frame.AUTH, "banner:page", "分页查询轮播管理")
+		//查询轮播管理数据
+		group.GET("/list", a.Api.List).Permission(frame.AUTH, "banner:list", "查询轮播管理")
+		//查询轮播管理详情
+		group.GET("", a.Api.Get).Permission(frame.AUTH, "banner:get", "获取轮播管理详情")
+	}
+}

+ 29 - 0
modules/shop/router/admin/shop/express_router.go

@@ -0,0 +1,29 @@
+package shop
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/api/v1/admin"
+)
+
+type Express struct {
+	Api *admin.ExpressApi `inject:""`
+}
+
+//初始化路由
+func (a *Express) InitRouter(router *frame.Group) {
+	group := router.Group("/express").Permission(frame.MENU, "express", "快递管理")
+	{
+		//添加快递管理
+		group.POST("", a.Api.Add).Permission(frame.AUTH, "express:add", "新增快递管理")
+		//修改快递管理数据接口
+		group.PUT("", a.Api.Edit).Permission(frame.AUTH, "express:edit", "更新快递管理")
+		//删除快递管理数据
+		group.DELETE("", a.Api.Delete).Permission(frame.AUTH, "express:delete", "删除快递管理")
+		//查询快递管理数据
+		group.GET("/page", a.Api.Page).Permission(frame.AUTH, "express:page", "分页查询快递管理")
+		//查询快递管理数据
+		group.GET("/list", a.Api.List).Permission(frame.AUTH, "express:list", "查询快递管理")
+		//查询快递管理详情
+		group.GET("", a.Api.Get).Permission(frame.AUTH, "express:get", "获取快递管理详情")
+	}
+}

+ 4 - 0
modules/shop/router/admin/shop/shop.go

@@ -10,6 +10,8 @@ type Shop struct {
 	Product  *Product  `inject:""`
 	Cart     *Cart     `inject:""`
 	Order    *Order    `inject:""`
+	Banner   *Banner   `inject:""`
+	Express  *Express  `inject:""`
 }
 
 // 初始化系统相关路由
@@ -19,4 +21,6 @@ func (r *Shop) InitRouter(router *frame.Group) {
 	r.Product.InitRouter(group)
 	r.Cart.InitRouter(group)
 	r.Order.InitRouter(group)
+	r.Banner.InitRouter(group)
+	r.Express.InitRouter(group)
 }

+ 29 - 0
modules/shop/router/client/shop/banner_router.go

@@ -0,0 +1,29 @@
+package shop
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/api/v1/admin"
+)
+
+type Banner struct {
+	Api *admin.BannerApi `inject:""`
+}
+
+// 初始化路由
+func (a *Banner) InitRouter(router *frame.Group) {
+	group := router.Group("/banner").Permission(frame.MENU, "banner", "轮播管理")
+	{
+		//添加轮播管理
+		group.POST("", a.Api.Add).Permission(frame.AUTH, "banner:add", "新增轮播管理")
+		//修改轮播管理数据接口
+		group.PUT("", a.Api.Edit).Permission(frame.AUTH, "banner:edit", "更新轮播管理")
+		//删除轮播管理数据
+		group.DELETE("", a.Api.Delete).Permission(frame.AUTH, "banner:delete", "删除轮播管理")
+		//查询轮播管理数据
+		group.GET("/page", a.Api.Page).Permission(frame.AUTH, "banner:page", "分页查询轮播管理")
+		//查询轮播管理数据
+		group.GET("/list", a.Api.List).Permission(frame.AUTH, "banner:list", "查询轮播管理")
+		//查询轮播管理详情
+		group.GET("", a.Api.Get).Permission(frame.AUTH, "banner:get", "获取轮播管理详情")
+	}
+}

+ 29 - 0
modules/shop/router/client/shop/express_router.go

@@ -0,0 +1,29 @@
+package shop
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/api/v1/client"
+)
+
+type Express struct {
+	Api *client.ExpressApi `inject:""`
+}
+
+// 初始化路由
+func (a *Express) InitRouter(router *frame.Group) {
+	group := router.Group("/express").Permission(frame.MENU, "express", "快递管理")
+	{
+		//添加快递管理
+		group.POST("", a.Api.Add).Permission(frame.AUTH, "express:add", "新增快递管理")
+		//修改快递管理数据接口
+		group.PUT("", a.Api.Edit).Permission(frame.AUTH, "express:edit", "更新快递管理")
+		//删除快递管理数据
+		group.DELETE("", a.Api.Delete).Permission(frame.AUTH, "express:delete", "删除快递管理")
+		//查询快递管理数据
+		group.GET("/page", a.Api.Page).Permission(frame.AUTH, "express:page", "分页查询快递管理")
+		//查询快递管理数据
+		group.GET("/list", a.Api.List).Permission(frame.AUTH, "express:list", "查询快递管理")
+		//查询快递管理详情
+		group.GET("", a.Api.Get).Permission(frame.AUTH, "express:get", "获取快递管理详情")
+	}
+}

+ 4 - 0
modules/shop/router/client/shop/shop.go

@@ -12,6 +12,8 @@ type Shop struct {
 	Order    *Order    `inject:""`
 	Favorite *Favorite `inject:""`
 	Comment  *Comment  `inject:""`
+	Banner   *Banner   `inject:""`
+	Express  *Express  `inject:""`
 }
 
 // 初始化系统相关路由
@@ -23,4 +25,6 @@ func (r *Shop) InitRouter(router *frame.Group) {
 	r.Order.InitRouter(group)
 	r.Favorite.InitRouter(group)
 	r.Comment.InitRouter(group)
+	r.Banner.InitRouter(group)
+	r.Express.InitRouter(group)
 }

+ 41 - 0
modules/shop/service/banner_service.go

@@ -0,0 +1,41 @@
+package service
+
+import (
+	"ulink-admin/modules/shop/dao"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+)
+
+type BannerService struct {
+	BannerDao *dao.BannerDao `inject:""`
+}
+
+// List 查询所有轮播管理业务方法
+func (this BannerService) List(query *req.BannerQuery, list interface{}) {
+	this.BannerDao.List(query, list)
+}
+
+// Page 查询轮播管理分页列表
+func (this BannerService) Page(query *req.BannerQuery, list interface{}) int64 {
+	return this.BannerDao.Page(query, list)
+}
+
+// Insert 添加轮播管理
+func (this BannerService) Insert(banner *model.Banner) {
+	this.BannerDao.Insert(banner)
+}
+
+// Get 查询
+func (this BannerService) Get(id int64) *model.Banner {
+	return this.BannerDao.GetById(id, &model.Banner{}).(*model.Banner)
+}
+
+// Delete 批量删除
+func (this BannerService) Delete(list []int64) {
+	this.BannerDao.Delete(&model.Banner{}, list)
+}
+
+// Edit 修改
+func (this BannerService) Edit(banner *model.Banner, cols []string) {
+	this.BannerDao.Update(banner, cols...)
+}

+ 50 - 0
modules/shop/service/express_service.go

@@ -0,0 +1,50 @@
+package service
+
+import (
+	"ulink-admin/frame"
+	"ulink-admin/modules/shop/dao"
+	"ulink-admin/modules/shop/models/model"
+	"ulink-admin/modules/shop/models/req"
+)
+
+type ExpressService struct {
+	ExpressDao *dao.ExpressDao `inject:""`
+}
+
+// List 查询所有快递管理业务方法
+func (this ExpressService) List(query *req.ExpressQuery, list interface{}) {
+	this.ExpressDao.List(query, list)
+}
+
+// Page 查询快递管理分页列表
+func (this ExpressService) Page(query *req.ExpressQuery, list interface{}) int64 {
+	return this.ExpressDao.Page(query, list)
+}
+
+// Insert 添加快递管理
+func (this ExpressService) Insert(express *model.Express) {
+	//检查快递公司唯一性
+	if this.ExpressDao.Exist(express.TableName(), "code=?", express.Code) {
+		frame.Throw(frame.BUSINESS_CODE, "新增快递管理'"+express.Code+"'失败,快递公司已存在")
+	}
+	this.ExpressDao.Insert(express)
+}
+
+// Get 查询
+func (this ExpressService) Get(id int64) *model.Express {
+	return this.ExpressDao.GetById(id, &model.Express{}).(*model.Express)
+}
+
+// Delete 批量删除
+func (this ExpressService) Delete(list []int64) {
+	this.ExpressDao.Delete(&model.Express{}, list)
+}
+
+// Edit 修改
+func (this ExpressService) Edit(express *model.Express, cols []string) {
+	//检查快递公司唯一性
+	if this.ExpressDao.Exist(express.TableName(), "code=? and id!=?", express.Code, express.Id) {
+		frame.Throw(frame.BUSINESS_CODE, "新增快递管理'"+express.Code+"'失败,快递公司已存在")
+	}
+	this.ExpressDao.Update(express, cols...)
+}

+ 44 - 0
yudao-ui/src/api/shop/banner/index.ts

@@ -0,0 +1,44 @@
+import request from '@/config/axios'
+// 查询轮播管理列表
+export const getBannerPage = async (params: PageParam) => {
+  return await request.get({ url: '/shop/banner/page', params })
+}
+
+export const getBannerList = async (params: PageParam) => {
+  return await request.get({ url: '/shop/banner/list', params })
+}
+
+// 查询轮播管理详情
+export const getBanner = async (id: number) => {
+  const params={id:id}
+  return await request.get({ url: '/shop/banner',params })
+}
+
+// 新增轮播管理
+export const createBanner = async (data: any) => {
+  return await request.post({ url: '/shop/banner', data })
+}
+
+// 修改轮播管理
+export const updateBanner = async (data: any) => {
+  return await request.put({ url: '/shop/banner', data })
+}
+
+// 修改轮播管理状态
+export const updateBannerStatus = async (data: any) => {
+  return await request.put({ url: '/shop/banner/updateStatus', data })
+}
+
+// 删除轮播管理
+export const deleteBanner = async (ids: any) => {
+  const data={ids:ids}
+  return await request.delete({ url: '/shop/banner', data })
+}
+
+// 导出轮播管理
+export const exportBanner = (params) => {
+  return request.download({
+    url: '/shop/banner/excel',
+    params
+  })
+}

+ 44 - 0
yudao-ui/src/api/shop/express/index.ts

@@ -0,0 +1,44 @@
+import request from '@/config/axios'
+// 查询快递管理列表
+export const getExpressPage = async (params: PageParam) => {
+  return await request.get({ url: '/shop/express/page', params })
+}
+
+export const getExpressList = async (params: PageParam) => {
+  return await request.get({ url: '/shop/express/list', params })
+}
+
+// 查询快递管理详情
+export const getExpress = async (id: number) => {
+  const params={id:id}
+  return await request.get({ url: '/shop/express',params })
+}
+
+// 新增快递管理
+export const createExpress = async (data: any) => {
+  return await request.post({ url: '/shop/express', data })
+}
+
+// 修改快递管理
+export const updateExpress = async (data: any) => {
+  return await request.put({ url: '/shop/express', data })
+}
+
+// 修改快递管理状态
+export const updateExpressStatus = async (data: any) => {
+  return await request.put({ url: '/shop/express/updateStatus', data })
+}
+
+// 删除快递管理
+export const deleteExpress = async (ids: any) => {
+  const data={ids:ids}
+  return await request.delete({ url: '/shop/express', data })
+}
+
+// 导出快递管理
+export const exportExpress = (params) => {
+  return request.download({
+    url: '/shop/express/excel',
+    params
+  })
+}

+ 0 - 44
yudao-ui/src/api/shop/订����单管理/index.ts

@@ -1,44 +0,0 @@
-import request from '@/config/axios'
-// 查询order列表
-export const get订®¢å�•管ç�†Page = async (params: PageParam) => {
-  return await request.get({ url: '/shop/订���管�/page', params })
-}
-
-export const get订®¢å�•管ç�†List = async (params: PageParam) => {
-  return await request.get({ url: '/shop/订���管�/list', params })
-}
-
-// 查询order详情
-export const get订®¢å�•管ç�† = async (id: number) => {
-  const params={id:id}
-  return await request.get({ url: '/shop/订���管�',params })
-}
-
-// 新增order
-export const create订®¢å�•管ç�† = async (data: any) => {
-  return await request.post({ url: '/shop/订���管�', data })
-}
-
-// 修改order
-export const update订®¢å�•管ç�† = async (data: any) => {
-  return await request.put({ url: '/shop/订���管�', data })
-}
-
-// 修改order状�
-export const update订®¢å�•管ç�†Status = async (data: any) => {
-  return await request.put({ url: '/shop/订���管�/updateStatus', data })
-}
-
-// 删除order
-export const delete订®¢å�•管ç�† = async (ids: any) => {
-  const data={ids:ids}
-  return await request.delete({ url: '/shop/订���管�', data })
-}
-
-// 导出order
-export const export订®¢å�•管ç�† = (params) => {
-  return request.download({
-    url: '/shop/订���管�/excel',
-    params
-  })
-}

+ 242 - 0
yudao-ui/src/views/shop/banner/BannerForm.vue

@@ -0,0 +1,242 @@
+<template>
+
+    <el-drawer
+      :title="dialogTitle"
+      v-model="dialogVisible"
+      :close-on-click-modal="false"
+      :size="$isMobile()?'100%':'40%'"
+      direction="rtl">
+      <el-card class="box-card">
+
+    <el-form
+      ref="formRef"
+      v-loading="formLoading"
+      :model="formData"
+      :rules="formRules"
+      label-width="90px"
+    >
+ <el-row :gutter="20">
+              <el-col :span="24">
+              <el-form-item label="轮播位置" prop="position">
+                <el-select v-model="formData.position" placeholder="轮播位置">
+                  <el-option
+                      v-for="dict in positionOptions"
+
+                      :key="dict.id"
+                      :label="dict.label"
+                      :value="dict.id"
+                  />
+                </el-select>
+          </el-form-item>
+          </el-col>
+             <el-col :span="24">
+             <el-form-item label="轮播状态" prop="state">
+             <el-switch
+               v-model="formData.state"
+               :active-value="1"
+               :inactive-value="2"
+               active-text="是"
+               inactive-text="否">
+             </el-switch>
+         </el-form-item>
+         </el-col>
+          <el-col :span="24">
+          <el-form-item label="轮播图片地址" prop="image">
+            <UploadImg v-model="formData.image" />
+          </el-form-item>
+          </el-col>
+              <el-col :span="24">
+              <el-form-item label="轮播类型" prop="mode">
+                <el-select v-model="formData.mode" placeholder="轮播类型">
+                  <el-option
+                      v-for="dict in modeOptions"
+
+                      :key="dict.id"
+                      :label="dict.label"
+                      :value="dict.id"
+                  />
+                </el-select>
+          </el-form-item>
+          </el-col>
+          <el-col :span="24">
+          <el-form-item label="跳转地址" prop="url">
+            <el-input
+                v-model="formData.url"
+                placeholder="请输入跳转地址"
+            />
+          </el-form-item>
+          </el-col>
+            <el-col :span="24">
+            <el-form-item label="排序权重" prop="sort">
+               <el-input-number
+                  v-model="formData.sort"
+                  placeholder="请输入排序权重"
+              />
+            </el-form-item>
+            </el-col>
+              <el-col :span="24">
+              <el-form-item label="轮播终端类型" prop="terminal">
+                <el-select v-model="formData.terminal" placeholder="轮播终端类型">
+                  <el-option
+                      v-for="dict in terminalOptions"
+
+                      :key="dict.id"
+                      :label="dict.label"
+                      :value="dict.id"
+                  />
+                </el-select>
+          </el-form-item>
+          </el-col>
+          </el-row>
+    </el-form>
+      </el-card>
+      <div  class="dialog-footer">
+      <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="dialogVisible = false">取 消</el-button>
+      </div>
+    </el-drawer>
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { CommonStatusEnum } from '@/utils/constants'
+import * as BannerApi from '@/api/shop/banner'
+/** 定义变量*/
+const { t } = useI18n() // 国际化
+const message = useMessage() // 消息弹窗
+const dialogVisible = ref(false) // 弹窗的是否展示
+const dialogTitle = ref('') // 弹窗的标题
+const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
+const formType = ref('') // 表单的类型:create - 新增;update - 修改
+const formData = ref({
+  id: undefined,
+  position: 1,
+  //轮播状态字段
+  state: undefined,
+  //轮播图片地址字段
+  image: undefined,
+  //轮播类型字段
+  mode: undefined,
+  //跳转地址字段
+  url: undefined,
+  //排序权重字段
+  sort: undefined,
+  //轮播终端类型字段
+  terminal: undefined,
+})
+const formRules = reactive({
+  id: [{ required: true, message: "不能为空", trigger: "blur" }],
+  position: [{ required: true, message: "轮播位置不能为空", trigger: "blur" }],
+  state: [{ required: true, message: "轮播状态不能为空", trigger: "blur" }],
+  image: [{ required: true, message: "轮播图片地址不能为空", trigger: "blur" }],
+  mode: [{ required: true, message: "轮播类型不能为空", trigger: "blur" }],
+  url: [{ required: true, message: "跳转地址不能为空", trigger: "blur" }],
+  sort: [{ required: true, message: "排序权重不能为空", trigger: "blur" }],
+  terminal: [{ required: true, message: "轮播终端类型不能为空", trigger: "blur" }],
+})
+
+
+//轮播位置本地数据
+
+const positionOptions = [
+ {id:1,label:"首页",color:"#F5F5F5"},
+ {id:2,label:"商品列表页",color:"#6495ED"},
+ {id:3,label:"商品详情页",color:" #43CD80"}]
+
+//轮播状态本地数据
+
+const stateOptions = [
+ {id:1,label:"禁用",color:"#F5F5F5"},
+ {id:2,label:"启用",color:"#6495ED"}]
+
+//轮播类型本地数据
+
+const modeOptions = [
+ {id:1,label:"图片",color:"#F5F5F5"},
+ {id:2,label:"视频",color:"#6495ED"},
+ {id:3,label:"文字",color:" #43CD80"}]
+
+//轮播终端类型本地数据
+
+const terminalOptions = [
+ {id:1,label:"pc",color:"#F5F5F5"},
+ {id:2,label:"2html5",color:"#6495ED"},
+ {id:3,label:"app",color:" #43CD80"},
+ {id:4,label:"微信小程序",color:"#FF4040"},
+ {id:5,label:"其它",color:"#6495ED"}]
+
+
+/**定义窗体*/
+const formRef = ref() // 表单 Ref
+
+/**定义方法*/
+/** 打开弹窗 */
+const open = async (type: string, id?: number) => {
+  dialogVisible.value = true
+  dialogTitle.value = t('action.' + type)
+  formType.value = type
+  resetForm()
+  // 修改时,设置数据
+  if (id) {
+    formLoading.value = true
+    try {
+      formData.value = await BannerApi.getBanner(id)
+    } finally {
+      formLoading.value = false
+    }
+  }
+}
+
+
+
+/** 重置表单 */
+const resetForm = () => {
+  formData.value = {
+    id: undefined,
+    position: 1,
+    //轮播状态字段
+    state: undefined,
+    //轮播图片地址字段
+    image: undefined,
+    //轮播类型字段
+    mode: undefined,
+    //跳转地址字段
+    url: undefined,
+    //排序权重字段
+    sort: undefined,
+    //轮播终端类型字段
+    terminal: undefined,
+  }
+  formRef.value?.resetFields()
+}
+
+
+/** 提交表单 */
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+const submitForm = async () => {
+  // 校验表单
+  if (!formRef) return
+  const valid = await formRef.value.validate()
+  if (!valid) return
+  // 提交请求
+  formLoading.value = true
+  try {
+    const data = formData.value as unknown as BannerApi.BannerVO
+    if (formType.value === 'create') {
+      await BannerApi.createBanner(data)
+      message.success(t('common.createSuccess'))
+    } else {
+      await BannerApi.updateBanner(data)
+      message.success(t('common.updateSuccess'))
+    }
+    dialogVisible.value = false
+    // 发送操作成功的事件
+    emit('success')
+  } finally {
+    formLoading.value = false
+  }
+}
+
+/**define方法*/
+defineOptions({ name: 'SystemTestForm' })
+defineExpose({ open }) // 提供 open 方法,用于打开弹窗
+</script>

+ 214 - 0
yudao-ui/src/views/shop/banner/index.vue

@@ -0,0 +1,214 @@
+<template>
+  <ContentWrap>
+
+    <el-form :model="queryParams" ref="queryFormRef"  class="-mb-15px" :inline="true"  label-width="68px">
+
+      <el-form-item>
+        <el-button @click="handleQuery">
+          <Icon class="mr-5px" icon="ep:search" />
+          搜索
+        </el-button>
+        <el-button @click="resetQuery">
+          <Icon class="mr-5px" icon="ep:refresh" />
+          重置
+        </el-button>
+        <el-button
+          v-hasPermi="['shop:banner:add']"
+          plain
+          type="primary"
+          @click="openForm('create')"
+        >
+          <Icon class="mr-5px" icon="ep:plus" />
+          新增
+        </el-button>
+        <el-button
+          v-hasPermi="['shop:banner:export']"
+          :loading="exportLoading"
+          plain
+          type="success"
+          @click="handleExport"
+        >
+          <Icon class="mr-5px" icon="ep:download" />
+          导出
+        </el-button>
+      </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+
+  <ContentWrap>
+    <el-table v-loading="loading"  :data="list">
+    <el-table-column type="selection" width="55" align="center" />
+    <el-table-column label="轮播位置" align="center" prop="position" >
+      <template #default="scope">
+        {{$selectDictLabel(positionOptions,scope.row.position,"id","label")}}
+      </template>
+    </el-table-column>
+     <el-table-column label="轮播状态" align="center" prop="state" >
+       <template #default="scope">
+         <show-tag :data="stateOptions"    :value="scope.row.state" />
+       </template>
+     </el-table-column>
+    <el-table-column label="轮播图片地址" align="center" prop="image" />
+    <el-table-column label="轮播类型" align="center" prop="mode" >
+      <template #default="scope">
+        {{$selectDictLabel(modeOptions,scope.row.mode,"id","label")}}
+      </template>
+    </el-table-column>
+    <el-table-column label="跳转地址" align="center" prop="url" />
+    <el-table-column label="排序权重" align="center" prop="sort" />
+    <el-table-column label="更新人" align="center" prop="updateBy" />
+      <el-table-column label="最后修改时间" align="center" prop="updateTime" width="180">
+        <template #default="scope">
+           <span>{{ $formatTime(scope.row.updateTime,'YYYY-MM-DD  HH:mm:ss')}}</span>
+        </template>
+      </el-table-column>
+    <el-table-column label="轮播终端类型" align="center" prop="terminal" >
+      <template #default="scope">
+        {{$selectDictLabel(terminalOptions,scope.row.terminal,"id","label")}}
+      </template>
+    </el-table-column>
+    <el-table-column label="操作" fixed="right" width="150" align="center" class-name="small-padding fixed-width">
+      <template #default="scope">
+        <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="openForm('update', scope.row.id)"
+            v-hasPermi="['shop:banner:edit']"
+        >修改</el-button>
+        <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['shop:banner:remove']"
+        >删除</el-button>
+      </template>
+    </el-table-column>
+    </el-table>
+
+    <Pagination
+      v-model:limit="queryParams.pageSize"
+      v-model:page="queryParams.pageNo"
+      :total="total"
+      @pagination="getList"
+    />
+  </ContentWrap>
+
+  <BannerForm ref="formRef" @success="getList" />
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { dateFormatter } from '@/utils/formatTime'
+import download from '@/utils/download'
+import BannerForm from './BannerForm.vue'
+import * as BannerApi from '@/api/shop/banner'
+defineOptions({ name: 'Banner' })
+/**变量*/
+const message = useMessage() // 消息弹窗
+const { t } = useI18n() // 国际化
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数据
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  createTime: []
+})
+//轮播位置本地数据
+
+let positionOptions = [
+ {id:1,label:"首页",color:"#F5F5F5"},
+ {id:2,label:"商品列表页",color:"#6495ED"},
+ {id:3,label:"商品详情页",color:" #43CD80"}]
+
+//轮播状态本地数据
+
+let stateOptions = [
+ {id:1,label:"禁用",color:"#F5F5F5"},
+ {id:2,label:"启用",color:"#6495ED"}]
+
+//轮播类型本地数据
+
+let modeOptions = [
+ {id:1,label:"图片",color:"#F5F5F5"},
+ {id:2,label:"视频",color:"#6495ED"},
+ {id:3,label:"文字",color:" #43CD80"}]
+
+//轮播终端类型本地数据
+
+let terminalOptions = [
+ {id:1,label:"pc",color:"#F5F5F5"},
+ {id:2,label:"2html5",color:"#6495ED"},
+ {id:3,label:"app",color:" #43CD80"},
+ {id:4,label:"微信小程序",color:"#FF4040"},
+ {id:5,label:"其它",color:"#6495ED"}]
+
+/**窗体*/
+const queryFormRef = ref() // 搜索的表单
+/** 添加/修改操作窗体 */
+const formRef = ref()
+const exportLoading = ref(false) // 导出的加载中
+
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await BannerApi.getBannerPage(queryParams)
+    list.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.pageNo = 1
+  getList()
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+
+/** 删除按钮操作 */
+const handleDelete = async (row: number) => {
+  try {
+    // 删除的二次确认
+    await message.delConfirm()
+    // 发起删除
+    await BannerApi.deleteBanner([row.id])
+    message.success(t('common.delSuccess'))
+    // 刷新列表
+    await getList()
+  } catch {}
+}
+const openForm = (type: string, id?: number) => {
+  formRef.value.open(type, id)
+}
+/** 导出按钮操作 */
+const handleExport = async () => {
+  try {
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+    const data = await BannerApi.exportBanner(queryParams)
+    download.excel(data, '角色列表.xls')
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
+}
+
+/** 初始化 **/
+onMounted(() => {
+    getList()
+})
+</script>

+ 172 - 0
yudao-ui/src/views/shop/express/ExpressForm.vue

@@ -0,0 +1,172 @@
+<template>
+
+    <el-drawer
+      :title="dialogTitle"
+      v-model="dialogVisible"
+      :close-on-click-modal="false"
+      :size="$isMobile()?'100%':'40%'"
+      direction="rtl">
+      <el-card class="box-card">
+
+    <el-form
+      ref="formRef"
+      v-loading="formLoading"
+      :model="formData"
+      :rules="formRules"
+      label-width="90px"
+    >
+ <el-row :gutter="20">
+          <el-col :span="24">
+          <el-form-item label="快递公司" prop="code">
+            <el-input
+                v-model="formData.code"
+                placeholder="请输入快递公司"
+            />
+          </el-form-item>
+          </el-col>
+          <el-col :span="24">
+          <el-form-item label="快递公司全称" prop="name">
+            <el-input
+                v-model="formData.name"
+                placeholder="请输入快递公司全称"
+            />
+          </el-form-item>
+          </el-col>
+            <el-col :span="24">
+            <el-form-item label="排序" prop="sort">
+               <el-input-number
+                  v-model="formData.sort"
+                  placeholder="请输入排序"
+              />
+            </el-form-item>
+            </el-col>
+             <el-col :span="24">
+             <el-form-item label="是否显示" prop="isShow">
+             <el-switch
+               v-model="formData.isShow"
+               :active-value="1"
+               :inactive-value="2"
+               active-text="是"
+               inactive-text="否">
+             </el-switch>
+         </el-form-item>
+         </el-col>
+          </el-row>
+    </el-form>
+      </el-card>
+      <div  class="dialog-footer">
+      <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
+      <el-button @click="dialogVisible = false">取 消</el-button>
+      </div>
+    </el-drawer>
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { CommonStatusEnum } from '@/utils/constants'
+import * as ExpressApi from '@/api/shop/express'
+/** 定义变量*/
+const { t } = useI18n() // 国际化
+const message = useMessage() // 消息弹窗
+const dialogVisible = ref(false) // 弹窗的是否展示
+const dialogTitle = ref('') // 弹窗的标题
+const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
+const formType = ref('') // 表单的类型:create - 新增;update - 修改
+const formData = ref({
+  id: undefined,
+  //快递公司字段
+  code: undefined,
+  //快递公司全称字段
+  name: undefined,
+  sort: 0,
+  isShow: 2,
+})
+const formRules = reactive({
+  id: [{ required: true, message: "快递公司id不能为空", trigger: "blur" }],
+  code: [{ required: true, message: "快递公司不能为空", trigger: "blur" }],
+  name: [{ required: true, message: "快递公司全称不能为空", trigger: "blur" }],
+  sort: [{ required: true, message: "排序不能为空", trigger: "blur" }],
+  isShow: [{ required: true, message: "是否显示不能为空", trigger: "blur" }],
+})
+
+
+//是否显示本地数据
+
+const isShowOptions = [
+ {id:1,label:"否",color:"#F5F5F5"},
+ {id:2,label:"是",color:"#6495ED"}]
+
+//是否删除本地数据
+
+const isDelOptions = [
+ {id:1,label:"否",color:"#F5F5F5"},
+ {id:2,label:"是",color:"#6495ED"}]
+
+
+/**定义窗体*/
+const formRef = ref() // 表单 Ref
+
+/**定义方法*/
+/** 打开弹窗 */
+const open = async (type: string, id?: number) => {
+  dialogVisible.value = true
+  dialogTitle.value = t('action.' + type)
+  formType.value = type
+  resetForm()
+  // 修改时,设置数据
+  if (id) {
+    formLoading.value = true
+    try {
+      formData.value = await ExpressApi.getExpress(id)
+    } finally {
+      formLoading.value = false
+    }
+  }
+}
+
+
+
+/** 重置表单 */
+const resetForm = () => {
+  formData.value = {
+    id: undefined,
+    //快递公司字段
+    code: undefined,
+    //快递公司全称字段
+    name: undefined,
+    sort: 0,
+    isShow: 2,
+  }
+  formRef.value?.resetFields()
+}
+
+
+/** 提交表单 */
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+const submitForm = async () => {
+  // 校验表单
+  if (!formRef) return
+  const valid = await formRef.value.validate()
+  if (!valid) return
+  // 提交请求
+  formLoading.value = true
+  try {
+    const data = formData.value as unknown as ExpressApi.ExpressVO
+    if (formType.value === 'create') {
+      await ExpressApi.createExpress(data)
+      message.success(t('common.createSuccess'))
+    } else {
+      await ExpressApi.updateExpress(data)
+      message.success(t('common.updateSuccess'))
+    }
+    dialogVisible.value = false
+    // 发送操作成功的事件
+    emit('success')
+  } finally {
+    formLoading.value = false
+  }
+}
+
+/**define方法*/
+defineOptions({ name: 'SystemTestForm' })
+defineExpose({ open }) // 提供 open 方法,用于打开弹窗
+</script>

+ 193 - 0
yudao-ui/src/views/shop/express/index.vue

@@ -0,0 +1,193 @@
+<template>
+  <ContentWrap>
+
+    <el-form :model="queryParams" ref="queryFormRef"  class="-mb-15px" :inline="true"  label-width="68px">
+
+      <el-form-item label="快递公司" prop="code">
+        <el-input
+            v-model="queryParams.code"
+            placeholder="请输入快递公司"
+            clearable
+            class="!w-240px"
+            @keyup.enter="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button @click="handleQuery">
+          <Icon class="mr-5px" icon="ep:search" />
+          搜索
+        </el-button>
+        <el-button @click="resetQuery">
+          <Icon class="mr-5px" icon="ep:refresh" />
+          重置
+        </el-button>
+        <el-button
+          v-hasPermi="['shop:express:add']"
+          plain
+          type="primary"
+          @click="openForm('create')"
+        >
+          <Icon class="mr-5px" icon="ep:plus" />
+          新增
+        </el-button>
+        <el-button
+          v-hasPermi="['shop:express:export']"
+          :loading="exportLoading"
+          plain
+          type="success"
+          @click="handleExport"
+        >
+          <Icon class="mr-5px" icon="ep:download" />
+          导出
+        </el-button>
+      </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+
+  <ContentWrap>
+    <el-table v-loading="loading"  :data="list">
+    <el-table-column type="selection" width="55" align="center" />
+    <el-table-column label="快递公司" align="center" prop="code" />
+    <el-table-column label="快递公司全称" align="center" prop="name" />
+    <el-table-column label="排序" align="center" prop="sort" />
+     <el-table-column label="是否显示" align="center" prop="isShow" >
+       <template #default="scope">
+         <show-tag :data="isShowOptions"    :value="scope.row.isShow" />
+       </template>
+     </el-table-column>
+      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
+        <template #default="scope">
+           <span>{{ $formatTime(scope.row.updateTime,'YYYY-MM-DD  HH:mm:ss')}}</span>
+        </template>
+      </el-table-column>
+    <el-table-column label="操作" fixed="right" width="150" align="center" class-name="small-padding fixed-width">
+      <template #default="scope">
+        <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="openForm('update', scope.row.id)"
+            v-hasPermi="['shop:express:edit']"
+        >修改</el-button>
+        <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['shop:express:remove']"
+        >删除</el-button>
+      </template>
+    </el-table-column>
+    </el-table>
+
+    <Pagination
+      v-model:limit="queryParams.pageSize"
+      v-model:page="queryParams.pageNo"
+      :total="total"
+      @pagination="getList"
+    />
+  </ContentWrap>
+
+  <ExpressForm ref="formRef" @success="getList" />
+</template>
+<script lang="ts" setup>
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
+import { dateFormatter } from '@/utils/formatTime'
+import download from '@/utils/download'
+import ExpressForm from './ExpressForm.vue'
+import * as ExpressApi from '@/api/shop/express'
+defineOptions({ name: 'Express' })
+/**变量*/
+const message = useMessage() // 消息弹窗
+const { t } = useI18n() // 国际化
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数据
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  //快递公司查询字段
+  code: undefined,
+  createTime: []
+})
+//是否显示本地数据
+
+let isShowOptions = [
+ {id:1,label:"否",color:"#F5F5F5"},
+ {id:2,label:"是",color:"#6495ED"}]
+
+//是否删除本地数据
+
+let isDelOptions = [
+ {id:1,label:"否",color:"#F5F5F5"},
+ {id:2,label:"是",color:"#6495ED"}]
+
+/**窗体*/
+const queryFormRef = ref() // 搜索的表单
+/** 添加/修改操作窗体 */
+const formRef = ref()
+const exportLoading = ref(false) // 导出的加载中
+
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await ExpressApi.getExpressPage(queryParams)
+    list.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.pageNo = 1
+  getList()
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+
+/** 删除按钮操作 */
+const handleDelete = async (row: number) => {
+  try {
+    // 删除的二次确认
+    await message.delConfirm()
+    // 发起删除
+    await ExpressApi.deleteExpress([row.id])
+    message.success(t('common.delSuccess'))
+    // 刷新列表
+    await getList()
+  } catch {}
+}
+const openForm = (type: string, id?: number) => {
+  formRef.value.open(type, id)
+}
+/** 导出按钮操作 */
+const handleExport = async () => {
+  try {
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+    const data = await ExpressApi.exportExpress(queryParams)
+    download.excel(data, '角色列表.xls')
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
+}
+
+/** 初始化 **/
+onMounted(() => {
+    getList()
+})
+</script>