This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-12-05 09:47:38 +08:00
parent 2b6779c889
commit f0c3ed433a
7 changed files with 61 additions and 7 deletions

View File

@ -563,6 +563,8 @@ func PortalCmd(portal ice.Any) {
}
cmd("portal", portal)
cmd("goodslist", goodslist{Table: table})
cmd("quotalist", goodslist{Table: table})
cmd("spendlist", goodslist{Table: table})
cmd("paymentlist", paymentlist{Table: table})
cmd("meeting", meeting{Table: table})
cmd("document", document{Table: table})

View File

@ -1,16 +1,55 @@
package gonganxitong
import "shylinux.com/x/ice"
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/community/src/api"
"shylinux.com/x/community/src/gonganxitong/model"
)
type goodslist struct {
Table
order string `data:"91"`
fields string `data:"name,title,content,user_uid"`
fields string `data:"name,price,title,content,user_uid"`
create string `name:"create name* title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
payfor string `name:"payfor" help:"购买" style:"notice" role:"worker"`
}
func (s goodslist) AfterMigrate(m *ice.Message, arg ...string) {
s.Table.AfterMigrate(m, arg...)
s.insert(m, "service", "2-1", "1000", "初级版")
s.insert(m, "service", "2-2", "3000", "高级版")
s.insert(m, "service", "2-3", "5000", "旗舰版")
s.insert(m, "company", "5-1", "10000", "企业初级版")
s.insert(m, "company", "5-2", "30000", "企业高级版")
s.insert(m, "company", "5-3", "50000", "企业旗舰版")
}
func (s goodslist) List(m *ice.Message, arg ...string) {
if s.PrefixPortal(m) == api.RENZHENGSHOUQUAN_PORTAL {
msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.UID, arg[0])
switch kit.Int(msg.Append(model.AUTH_TYPE)) {
case 3:
s.Select(m, model.PLACE_UID, "service")
case 4:
s.Select(m, model.PLACE_UID, "company")
}
m.PushAction(s.Payfor).Action()
} else {
s.Select(m, model.PLACE_UID, "service")
m.PushAction(s.Payfor).Action()
if s.IsLeader(m) {
m.Action(s.Create)
}
}
m.Display("")
}
func (s goodslist) Payfor(m *ice.Message, arg ...string) {
}
func init() { ice.TeamCtxCmd(goodslist{Table: newTable()}) }
func (s goodslist) insert(m *ice.Message, auth, level, price string, arg ...string) {
s.Insert(m, model.UID, kit.Hashs(auth, level), model.PLACE_UID, auth, model.NAME, level, model.PRICE, price, model.TITLE, kit.Select("", arg, 0), model.CONTENT, kit.Select("", arg, 1))
}

View File

@ -0,0 +1,9 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title, "¥ "+value.price/100+" / 月", can.onimport.titleAction(can, value)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
{view: html.OUTPUT, list: [value.content]},
] })
},
})

View File

@ -111,6 +111,7 @@ const (
AMOUNT = "amount"
ACCESS_TOKEN = "access_token"
EXPIRE_TIME = "expire_time"
PRICE = "price"
)
type Sess struct {
@ -150,6 +151,7 @@ type Goodslist struct {
Name string `gorm:"type:varchar(32)"`
Title string `gorm:"type:varchar(64)"`
Content string `gorm:"type:varchar(128)"`
Price int
}
type Quotalist struct {
db.ModelWithUID

View File

@ -52,7 +52,9 @@ func (s paymentlist) List(m *ice.Message, arg ...string) {
func (s paymentlist) Payfor(m *ice.Message, arg ...string) {
s.cmdy(m, s.Request, arg...)
}
func (s paymentlist) Request(m *ice.Message, arg ...string) {}
func (s paymentlist) Request(m *ice.Message, arg ...string) {
}
func (s paymentlist) Response(m *ice.Message, arg ...string) {
if len(arg) > 1 {
s.Update(m, kit.Dict(model.STATUS, PaymentSuccess), s.PLACE_UID, arg[0], model.UID, arg[1])

View File

@ -3,7 +3,7 @@ package gonganxitong
import "shylinux.com/x/ice"
type quotalist struct {
Tables
Table
fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
@ -12,4 +12,4 @@ type quotalist struct {
func (s quotalist) List(m *ice.Message, arg ...string) {
}
func init() { ice.TeamCtxCmd(quotalist{}) }
func init() { ice.TeamCtxCmd(quotalist{Table: newTable()}) }

View File

@ -3,7 +3,7 @@ package gonganxitong
import "shylinux.com/x/ice"
type spendlist struct {
Tables
Table
fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
@ -12,4 +12,4 @@ type spendlist struct {
func (s spendlist) List(m *ice.Message, arg ...string) {
}
func init() { ice.TeamCtxCmd(spendlist{}) }
func init() { ice.TeamCtxCmd(spendlist{Table: newTable()}) }