This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-09-15 20:00:14 +08:00
parent f00bc26d93
commit 4eb76ca3c7
14 changed files with 25 additions and 23 deletions

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "express_status", mdb.STATUS)]}, {view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "express_status", mdb.STATUS)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at)]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
{view: html.STATUS, list: [value.company_name+":", value.open_id]}, {view: html.STATUS, list: [value.company_name+":", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]}, {view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] }) ] })

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name||value.user_name||"待确认", can.onimport.textView(can, value, "order_type", mdb.TYPE)]}, {view: html.TITLE, list: [value.name||value.user_name||"待确认", can.onimport.textView(can, value, "order_type", mdb.TYPE)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), can.onimport.textView(can, value, "order_status", mdb.STATUS)]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value, "order_status", mdb.STATUS)]},
{view: html.STATUS, list: ["数量:", value.total, "件", "总额:", value.amount, "元"]}, {view: html.STATUS, list: ["数量:", value.total, "件", "总额:", value.amount, "元"]},
value.payment_success_time && {view: html.STATUS, list: ["收款时间:", can.base.TimeTrim(value.payment_success_time)]}, value.payment_success_time && {view: html.STATUS, list: ["收款时间:", can.base.TimeTrim(value.payment_success_time)]},
value.express_recv_time && {view: html.STATUS, list: ["收货时间:", can.base.TimeTrim(value.express_recv_time)]}, value.express_recv_time && {view: html.STATUS, list: ["收货时间:", can.base.TimeTrim(value.express_recv_time)]},

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "payment_status", mdb.STATUS)]}, {view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "payment_status", mdb.STATUS)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at)]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
{view: html.STATUS, list: [value.company_name, ": ", value.open_id]}, {view: html.STATUS, list: [value.company_name, ": ", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]}, {view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] }) ] })

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "refund_status", mdb.STATUS)]}, {view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "refund_status", mdb.STATUS)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at)]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
{view: html.STATUS, list: [value.company_name, ": ", value.open_id]}, {view: html.STATUS, list: [value.company_name, ": ", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]}, {view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] }) ] })

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "return_status", mdb.STATUS)]}, {view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, "return_status", mdb.STATUS)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at)]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
{view: html.STATUS, list: [value.company_name+":", value.open_id]}, {view: html.STATUS, list: [value.company_name+":", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]}, {view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] }) ] })

View File

@ -47,10 +47,10 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
func (s Table) SelectJoinCompany(m *ice.Message) *ice.Message { func (s Table) SelectJoinCompany(m *ice.Message) *ice.Message {
return s.SelectJoin(m, company{}, model.NAME, model.CITY_UID) return s.SelectJoin(m, company{}, model.NAME, model.CITY_UID)
} }
func (s Table) CheckRole(m *ice.Message, arg ...string) *ice.Message { func (s Table) CheckRole(m *ice.Message, arg ...string) {
role := UserGroupRole(s.UserPlaceRole(m)) role := UserGroupRole(s.UserPlaceRole(m))
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserGroupCreator.String())...), role.String()) m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserGroupCreator.String())...), role.String())
return m m.Option(model.USER_ROLE, kit.Format(role))
} }
type Tables struct{ Table } type Tables struct{ Table }

View File

@ -10,7 +10,7 @@ type company struct{ Table }
func (s company) FindOrCreateByName(m *ice.Message, arg ...string) { func (s company) FindOrCreateByName(m *ice.Message, arg ...string) {
if msg := m.Cmd(s, s.Select, model.NAME, arg[3], arg[0], arg[1]); msg.Length() == 0 { if msg := m.Cmd(s, s.Select, model.NAME, arg[3], arg[0], arg[1]); msg.Length() == 0 {
msg := m.Cmd(s, s.Create, model.NAME, arg[3], arg[0], arg[1]) msg := m.Cmd(s, s.Insert, model.NAME, arg[3], arg[0], arg[1])
arg[2], arg[3] = model.COMPANY_UID, msg.Result() arg[2], arg[3] = model.COMPANY_UID, msg.Result()
} else { } else {
arg[2], arg[3] = model.COMPANY_UID, msg.Append(model.UID) arg[2], arg[3] = model.COMPANY_UID, msg.Append(model.UID)

View File

@ -10,6 +10,7 @@ const (
TITLE = "title" TITLE = "title"
CONTENT = "content" CONTENT = "content"
USER_UID = "user_uid" USER_UID = "user_uid"
USER_ROLE = "user_role"
USER_GROUP_ROLE = "user_group_role" USER_GROUP_ROLE = "user_group_role"
GROUP_UID = "group_uid" GROUP_UID = "group_uid"
GROUP_NAME = "group_name" GROUP_NAME = "group_name"

View File

@ -4,13 +4,11 @@ import "shylinux.com/x/ice"
type target struct { type target struct {
Table Table
fields string `data:"title,content"` fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"` create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"` remove string `name:"remove" role:"leader"`
} }
func (s target) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
func (s target) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
func (s target) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") } func (s target) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(target{}) } func init() { ice.TeamCtxCmd(target{}) }

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title]}, {view: html.TITLE, list: [value.title]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
{view: html.OUTPUT, list: [value.content]}, {view: html.OUTPUT, list: [value.content]},
] }) ] })
}, },

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title]}, {view: html.TITLE, list: [value.title]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
{view: html.OUTPUT, list: [value.content]}, {view: html.OUTPUT, list: [value.content]},
] }) ] })
}, },

View File

@ -2,9 +2,13 @@ package {{.Option "zone"}}
import "shylinux.com/x/ice" import "shylinux.com/x/ice"
type {{.Option "name"}} struct{ Tables } type {{.Option "name"}} struct {
Table
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
} }
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd({{.Option "name"}}{}) } func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }

View File

@ -1,10 +1,9 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
if (msg.IsDetail()) { var value = msg.TableDetail(); msg.Option("_share_title", value.title), msg.Option("_share_content", value.content) } can.onimport.myView(can, msg, function(value) { return [
can.onimport.itemcards(can, msg, function(value) { return [ {view: html.TITLE, list: [value.title||value.name||value.user_name]},
{view: html.TITLE, list: [{text: value.title}]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)}, {text: value.user_name}]}, {view: html.OUTPUT, list: [value.content||value.info]},
{view: html.OUTPUT, list: [{text: value.content}]},
] }) ] })
}, },
}) })

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title]}, {view: html.TITLE, list: [value.title]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
{view: html.OUTPUT, list: [value.content]}, {view: html.OUTPUT, list: [value.content]},
] }) ] })
}, },