From 30348175f48691ee383f47adbd3e4fc979e2aa75 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Tue, 18 Oct 2022 12:23:52 +0800 Subject: [PATCH] opt some --- core/mall/goods.go | 16 ++++++++-------- render.go | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/mall/goods.go b/core/mall/goods.go index 57dde2a0..96048af9 100644 --- a/core/mall/goods.go +++ b/core/mall/goods.go @@ -7,27 +7,27 @@ import ( "shylinux.com/x/icebergs/base/web" ) +const ( + PRICE = "price" +) const GOODS = "goods" func init() { Index.MergeCommands(ice.Commands{ GOODS: {Name: "goods hash auto", Help: "商品", Actions: ice.MergeActions(ice.Actions{ - mdb.CREATE: {Name: "modify zone type name text price count image"}, mdb.MODIFY: {Name: "modify zone type name text price count image"}, + web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) { web.Upload(m) }}, "copy": {Hand: func(m *ice.Message, arg ...string) { m.Cmd("", mdb.CREATE, m.OptionSimple("zone,type,name,text,price,count,image")) }}, - web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) { web.Upload(m) }}, }, mdb.HashAction(mdb.FIELD, "time,hash,zone,type,name,text,price,count,image")), Hand: func(m *ice.Message, arg ...string) { if mdb.HashSelect(m, arg...); len(arg) == 0 || arg[0] == "" { - if !m.IsMobile() { - m.Action(mdb.CREATE, mdb.EXPORT, mdb.IMPORT) - } + m.Action(mdb.CREATE, mdb.EXPORT, mdb.IMPORT) ctx.DisplayLocal(m, "") } else { - m.EchoImages(web.MergeURL2(m, "/share/cache/"+m.Append("image"))) + m.EchoImages(web.MergeURL2(m, web.SHARE_CACHE+m.Append("image"))) } m.PushAction("copy", mdb.MODIFY, mdb.REMOVE) }}, - }) -} \ No newline at end of file + }) +} diff --git a/render.go b/render.go index 7dea81ed..3641a19a 100644 --- a/render.go +++ b/render.go @@ -26,7 +26,7 @@ func Render(m *Message, cmd string, args ...Any) string { list = append(list, kit.Format(``, k, kit.Select(k, kit.Value(m._cmd.Meta, kit.Keys("_trans", k)), m.Option(MSG_LANGUAGE) != "en"))) } - return kit.Join(list, SP) + return strings.Join(list, "") case RENDER_IMAGES: // src [height] m.Debug("what %v", m.Option(MSG_USERUA))