本文整理汇总了Golang中go2o/src/cache.GetDropOptionsOfCategory函数的典型用法代码示例。如果您正苦于以下问题:Golang GetDropOptionsOfCategory函数的具体用法?Golang GetDropOptionsOfCategory怎么用?Golang GetDropOptionsOfCategory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetDropOptionsOfCategory函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Goods_select
//商品选择
func (this *goodsC) Goods_select(ctx *web.Context) {
r, w := ctx.Request, ctx.Response
r.ParseForm()
cateOpts := cache.GetDropOptionsOfCategory(this.GetPartnerId(ctx))
ctx.App.Template().Execute(w, gof.TemplateDataMap{
"cate_opts": template.HTML(cateOpts),
"no_pic_url": format.GetGoodsImageUrl(""),
}, "views/partner/goods/goods_select.html")
}
示例2: Create
func (this *goodsC) Create(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
shopChks := cache.GetShopCheckboxs(partnerId, "")
cateOpts := cache.GetDropOptionsOfCategory(partnerId)
ctx.App.Template().Execute(ctx.ResponseWriter, gof.TemplateDataMap{
"shop_chk": template.HTML(shopChks),
"cate_opts": template.HTML(cateOpts),
},
"views/partner/goods/create_goods.html")
}
示例3: Create
func (this *goodsC) Create(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
shopChks := cache.GetShopCheckboxs(partnerId, "")
cateOpts := cache.GetDropOptionsOfCategory(partnerId)
e := &sale.ValueItem{
Image: ctx.App.Config().GetString(variable.NoPicPath),
}
js, _ := json.Marshal(e)
ctx.App.Template().Execute(ctx.Response, gof.TemplateDataMap{
"entity": template.JS(js),
"shop_chk": template.HTML(shopChks),
"cate_opts": template.HTML(cateOpts),
},
"views/partner/goods/create_goods.html")
}
示例4: EditCategory
func (this *categoryC) EditCategory(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r, w := ctx.Request, ctx.Response
r.ParseForm()
id, _ := strconv.Atoi(r.Form.Get("id"))
var category *sale.ValueCategory = dps.SaleService.GetCategory(partnerId, id)
json, _ := json.Marshal(category)
re := regexp.MustCompile(fmt.Sprintf("<option class=\"opt\\d+\" value=\"%d\">[^>]+>", id))
originOpts := cache.GetDropOptionsOfCategory(partnerId)
cateOpts := re.ReplaceAll(originOpts, nil)
ctx.App.Template().Execute(w,
gof.TemplateDataMap{
"entity": template.JS(json),
"cate_opts": template.HTML(cateOpts),
},
"views/partner/category/category_edit.html")
}
示例5: Edit
func (this *goodsC) Edit(ctx *web.Context) {
partnerId := this.GetPartnerId(ctx)
r, w := ctx.Request, ctx.Response
var e *sale.ValueItem
id, _ := strconv.Atoi(r.URL.Query().Get("item_id"))
e = dps.SaleService.GetValueItem(partnerId, id)
if e == nil {
w.Write([]byte("商品不存在"))
return
}
js, _ := json.Marshal(e)
shopChks := cache.GetShopCheckboxs(partnerId, e.ApplySubs)
cateOpts := cache.GetDropOptionsOfCategory(partnerId)
ctx.App.Template().Execute(w,
gof.TemplateDataMap{
"entity": template.JS(js),
"shop_chk": template.HTML(shopChks),
"cate_opts": template.HTML(cateOpts),
},
"views/partner/goods/update_goods.html")
}