1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00

opt input

This commit is contained in:
harveyshao 2022-10-28 22:42:54 +08:00
parent 816ea9f3b4
commit c4108d5875

View File

@ -15,16 +15,21 @@ const GOODS = "goods"
func init() {
Index.MergeCommands(ice.Commands{
GOODS: {Name: "goods hash auto", Help: "商品", Actions: ice.MergeActions(ice.Actions{
mdb.MODIFY: {Name: "modify zone type name text price count image"},
GOODS: {Name: "goods hash@keyboard place@province date@date name@key auto", Help: "商品", Actions: ice.MergeActions(ice.Actions{
mdb.MODIFY: {Name: "modify zone type name text price count image=4@img"},
mdb.CREATE: {Name: "modify zone type name text price count image=4@img"},
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")) }},
"copy": {Hand: func(m *ice.Message, arg ...string) {
m.Cmd("", mdb.CREATE, m.OptionSimple("zone,type,name,text,price,count,image"))
}},
}, 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] == "" {
m.Action(mdb.CREATE, mdb.EXPORT, mdb.IMPORT)
ctx.DisplayLocal(m, "")
} else {
m.EchoImages(web.MergeURL2(m, web.SHARE_CACHE+kit.Split(m.Append("image"))[0]))
for _, p := range kit.Split(m.Append("image")) {
m.EchoImages(web.MergeURL2(m, web.SHARE_CACHE+p))
}
}
m.PushAction("copy", mdb.MODIFY, mdb.REMOVE)
}},