2024-12-09 12:24:45 +08:00

69 lines
2.6 KiB
Go

package gonganxitong
import (
"shylinux.com/x/ice"
"shylinux.com/x/community/src/gonganxitong/model"
)
type meeting struct {
Table
order string `data:"93"`
auth string `data:"issued"`
role string `data:"leader,worker"`
fields string `data:"user_id,vendor"`
config string `name:"config place_uid* user_uid* user_id* vendor*"`
create string `name:"create subject* start_time*:select@date end_time*:select@date" role:"worker"`
modify string `name:"modify subject* start_time*:select@date end_time*:select@date" role:"worker"`
cancel string `name:"cancel" role:"worker"`
enter string `name:"enter" help:"入会" style:"notice" role:"worker"`
}
func (s meeting) Config(m *ice.Message, arg ...string) {
s.InsertOrUpdate(m, arg, m.OptionSimple(model.PLACE_UID)...)
}
func (s meeting) Create(m *ice.Message, arg ...string) { s.cmdy(m, s.MeetingPost, arg...) }
func (s meeting) Modify(m *ice.Message, arg ...string) { s.cmdy(m, s.MeetingPut, arg...) }
func (s meeting) Cancel(m *ice.Message, arg ...string) { s.cmdy(m, s.MeetingCancel, arg...) }
func (s meeting) Enter(m *ice.Message, arg ...string) { m.ProcessOpen(m.Option(model.LINK)) }
func (s meeting) List(m *ice.Message, arg ...string) {
if s.cmdy(m, s.MeetingList, arg[1:]...); m.Length() > 0 {
if len(arg) == 1 {
m.PushAction(s.Enter, s.Modify, s.Cancel).Action(s.Create).Display("")
s.SpendlistCheck(m, 0)
} else if m.IsMobileUA() {
m.EchoQRCode(m.Append(model.LINK)).Display("").DisplayCSS("")
} else {
m.EchoQRCode(m.Append(model.LINK)).Display("").DisplayCSS("")
// m.EchoIFrame(m.Append(model.LINK)).SetAppend()
}
}
}
func (s meeting) MeetingList(m *ice.Message, arg ...string) {}
func (s meeting) MeetingPost(m *ice.Message, arg ...string) {}
func (s meeting) MeetingPut(m *ice.Message, arg ...string) {}
func (s meeting) MeetingCancel(m *ice.Message, arg ...string) {}
func init() { ice.TeamCtxCmd(meeting{Table: newTable()}) }
var MeetingVendor interface {
UserList(m *ice.Message, arg ...string) *ice.Message
MeetingList(m *ice.Message, arg ...string) *ice.Message
MeetingPost(m *ice.Message, arg ...string) *ice.Message
MeetingPut(m *ice.Message, arg ...string) *ice.Message
MeetingCancel(m *ice.Message, arg ...string) *ice.Message
}
func (s meeting) cmdy(m *ice.Message, action ice.Any, arg ...string) {
if m.Option(model.AUTH_UID, s.StreetAuthUID(m, m.Option(model.PLACE_UID))) == "" {
return
}
msg := s.Select(m.Spawn(), m.OptionSimple(model.PLACE_UID)...)
if msg.Append(model.VENDOR) == "" {
m.Echo("本服务暂未配置,请联系公司管理员配置")
return
} else {
m.Cmdy(msg.Append(model.VENDOR), action, arg)
}
}