Bläddra i källkod

1.ipad端调整

master
huangjiajun 7 månader sedan
förälder
incheckning
82fee5973e
5 ändrade filer med 24 tillägg och 5 borttagningar
  1. +4
    -1
      app/db/db_order_list.go
  2. +0
    -1
      app/ipad/hdl/hdl_order.go
  3. +15
    -1
      app/ipad/hdl/hdl_order_goods.go
  4. +4
    -1
      app/ipad/svc/svc_order.go
  5. +1
    -1
      app/router/ipad_router.go

+ 4
- 1
app/db/db_order_list.go Visa fil

@@ -160,9 +160,12 @@ func GetOrderListByIpad(eg *xorm.Engine, param map[string]string) (*[]model.Orde
}
sess.And("enterprise_id in (?) or oid like ?", php2go.Implode(",", ids), "%"+param["keyword"]+"%")
}
if param["state"] != "" {
if param["state"] != "" && param["state"] != "1" {
sess.And("state =?", param["state"])
}
if param["state"] == "1" {
sess.In("state", []string{"1", "2"})
}
size := utils.StrToInt(param["limit"])
start := (utils.StrToInt(param["page"]) - 1) * size
count, err := sess.Limit(size, start).OrderBy("id asc").FindAndCount(&order)


+ 0
- 1
app/ipad/hdl/hdl_order.go Visa fil

@@ -11,7 +11,6 @@ func OrderCate(c *gin.Context) {
{"name": "全部", "id": ""},
{"name": "待制作", "id": "0"},
{"name": "制作中", "id": "1"},
{"name": "待烘焙", "id": "2"},
{"name": "待分拣", "id": "3"},
{"name": "已完成", "id": "4"},
}


+ 15
- 1
app/ipad/hdl/hdl_order_goods.go Visa fil

@@ -10,6 +10,17 @@ import (
"github.com/gin-gonic/gin"
)

func OrderGoodsCate(c *gin.Context) {
var res = []map[string]string{
{"name": "全部", "id": ""},
{"name": "待制作", "id": "0"},
{"name": "制作中", "id": "1"},
{"name": "待烘焙", "id": "2"},
{"name": "已完成", "id": "3"},
}
e.OutSuc(c, res, nil)
return
}
func OrderGoods(c *gin.Context) {
var args map[string]string
if err := c.ShouldBindJSON(&args); err != nil {
@@ -28,7 +39,7 @@ func OrderGoods(c *gin.Context) {
scheme, host, subDomain, moreSubDomain := svc.ImageBucketNew(c)
var tmpMap interface{}
stateArr := []string{"待制作", "制作中", "烘焙中", "分拣中", "已完成", "已取消"}
btnArr := []string{"开始制作", "制作中", "制作完成", "烘焙完成", "分拣完成", "已取消"}
btnArr := []string{"开始制作", "制作完成", "烘焙完成", "已完成", "已完成", "已取消"}
for _, v := range *data {
var tmp = map[string]string{
"oid": utils.Int64ToStr(v.Oid),
@@ -40,6 +51,9 @@ func OrderGoods(c *gin.Context) {
"goods_img": "",
"state": utils.IntToStr(v.State),
}
if v.State == 4 {
tmp["state"] = "3"
}
// 商品主图
if goodsMap[v.GoodsId].ImageList != "" {
utils.Unserialize([]byte(goodsMap[v.GoodsId].ImageList), &tmpMap)


+ 4
- 1
app/ipad/svc/svc_order.go Visa fil

@@ -23,7 +23,7 @@ func Order(c *gin.Context) {
}
enterpriseMap := db.GetEnterpriseMore(eg, enterpriseIds)
stateArr := []string{"待制作", "制作中", "烘焙中", "分拣中", "已完成", "已取消"}
btnArr := []string{"进入制作", "进入制作", "进入制作", "开始分拣", "分拣完成", "已取消"}
btnArr := []string{"进入制作", "进入制作", "进入制作", "分拣完成", "查看详情", "已取消"}
for _, v := range *data {
enterpriseName := ""
_, ok := enterpriseMap[v.EnterpriseId]
@@ -38,6 +38,9 @@ func Order(c *gin.Context) {
"state": utils.IntToStr(v.State),
"enterprise_name": enterpriseName,
}
if v.State == 2 {
tmp["state"] = "1"
}
list = append(list, tmp)
}
}


+ 1
- 1
app/router/ipad_router.go Visa fil

@@ -11,7 +11,7 @@ func IpadInit(r *gin.RouterGroup) {
r.Use(mw.Auth) //检测登录状态
r.GET("order/cate", hdl.OrderCate) //订单类目
r.POST("order/list", hdl.Order) //订单
r.GET("order/goods/cate", hdl.OrderCate) //订单商品类目
r.GET("order/goods/cate", hdl.OrderGoodsCate) //订单商品类目
r.POST("order/goods/list", hdl.OrderGoods) //订单商品
r.GET("responsible", hdl.Responsible) //负责人
r.POST("order/make/begin", hdl.OrderMakeBegin) //订单开始制作


Laddar…
Avbryt
Spara