mirror of
https://shylinux.com/x/enterprise
synced 2025-04-25 09:08:06 +08:00
add some
This commit is contained in:
parent
f00bc26d93
commit
4eb76ca3c7
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
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.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.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
|
||||
] })
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
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.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, "元"]},
|
||||
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)]},
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
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.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.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
|
||||
] })
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
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.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.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
|
||||
] })
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
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.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.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
|
||||
] })
|
||||
|
@ -47,10 +47,10 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
func (s Table) SelectJoinCompany(m *ice.Message) *ice.Message {
|
||||
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))
|
||||
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 }
|
||||
|
@ -10,7 +10,7 @@ type company struct{ Table }
|
||||
|
||||
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 {
|
||||
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()
|
||||
} else {
|
||||
arg[2], arg[3] = model.COMPANY_UID, msg.Append(model.UID)
|
||||
|
@ -10,6 +10,7 @@ const (
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_ROLE = "user_role"
|
||||
USER_GROUP_ROLE = "user_group_role"
|
||||
GROUP_UID = "group_uid"
|
||||
GROUP_NAME = "group_name"
|
||||
|
@ -4,13 +4,11 @@ import "shylinux.com/x/ice"
|
||||
|
||||
type target struct {
|
||||
Table
|
||||
fields string `data:"title,content"`
|
||||
fields string `data:"title,content,user_uid"`
|
||||
create string `name:"create title* content*" 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 init() { ice.TeamCtxCmd(target{}) }
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{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]},
|
||||
] })
|
||||
},
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{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]},
|
||||
] })
|
||||
},
|
||||
|
@ -2,9 +2,13 @@ package {{.Option "zone"}}
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type {{.Option "name"}} struct{ Tables }
|
||||
|
||||
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) {
|
||||
type {{.Option "name"}} struct {
|
||||
Table
|
||||
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"}}{}) }
|
||||
|
@ -1,10 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_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.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [{text: value.title}]},
|
||||
{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: [{text: value.content}]},
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title||value.name||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||value.info]},
|
||||
] })
|
||||
},
|
||||
})
|
||||
|
@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{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]},
|
||||
] })
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user