mirror of
https://shylinux.com/x/community
synced 2025-07-01 21:21:19 +08:00
add some
This commit is contained in:
parent
1a99c2c96e
commit
6e37730daa
@ -289,8 +289,12 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
value = AllowStatus(kit.Int(value)).String()
|
||||
case model.MESSAGE_STATUS:
|
||||
value = MessageStatus(kit.Int(value)).String()
|
||||
case model.SERVICE_STATUS:
|
||||
value = ServiceStatus(kit.Int(value)).String()
|
||||
case model.PAYMENTLIST_STATUS:
|
||||
value = PaymentStatus(kit.Int(value)).String()
|
||||
case model.PRICE, model.AMOUNT:
|
||||
value = kit.Format("%.2f", kit.Float(value)/100)
|
||||
}
|
||||
return value
|
||||
})
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"shylinux.com/x/icebergs/base/web/html"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
@ -19,6 +20,8 @@ type member struct {
|
||||
promote string `name:"promote" role:"void"`
|
||||
demote string `name:"demote" role:"void"`
|
||||
setCookie string `name:"setCookie" help:"切换"`
|
||||
main string `name:"main" help:"主页" role:"void"`
|
||||
auth string `name:"auth" help:"认证" role:"void"`
|
||||
}
|
||||
|
||||
func (s member) Remove(m *ice.Message, arg ...string) {
|
||||
@ -55,6 +58,13 @@ func (s member) SetCookie(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.UserPlace, s.Select, model.UID, m.Option(model.UID))
|
||||
m.ProcessCookie(model.USER_UID, m.Append(model.USER_UID))
|
||||
}
|
||||
func (s member) Main(m *ice.Message, arg ...string) {
|
||||
m.ProcessField(api.RENZHENGSHOUQUAN_PORTAL, []string{m.Option(model.AUTH_UID)})
|
||||
}
|
||||
func (s member) Auth(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(city{}, s.Select, model.NAME, m.Option(model.CITY_NAME))
|
||||
m.Cmdy(user{}, s.AuthCreate, kit.Dict(msg.AppendSimple(model.AUTH_UID)))
|
||||
}
|
||||
func (s member) List(m *ice.Message, arg ...string) {
|
||||
USER_PLACE_ROLE := s.Keys(s.UserPlace, model.ROLE)
|
||||
user_uid, isLeader, isCreator := m.Option(model.USER_UID), s.IsLeader(m), s.IsCreator(m)
|
||||
@ -68,6 +78,8 @@ func (s member) List(m *ice.Message, arg ...string) {
|
||||
return
|
||||
}
|
||||
defer m.Sort(kit.Fields(model.MEMBER_STATUS, USER_PLACE_ROLE, "auth_status", model.CREATED_AT))
|
||||
s.SelectJoinUser(m, model.NAME, model.INFO, model.AVATAR, model.AUTH_UID)
|
||||
s.SelectJoinAuth(m)
|
||||
m.Table(func(value ice.Maps) {
|
||||
if !m.FieldsIsDetail() {
|
||||
if user_uid == value[model.USER_UID] {
|
||||
@ -78,6 +90,13 @@ func (s member) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
button := []ice.Any{}
|
||||
kit.If(m.IsTech() && value[model.USER_UID] != user_uid, func() { button = append(button, s.SetCookie) })
|
||||
if value[model.AUTH_UID] == "" {
|
||||
kit.If(value[model.USER_UID] == user_uid, func() {
|
||||
button = append(button, s.Auth)
|
||||
})
|
||||
} else {
|
||||
button = append(button, s.Main)
|
||||
}
|
||||
if MemberStatus(kit.Int(value[model.MEMBER_STATUS])) == MemberNormal {
|
||||
if isCreator {
|
||||
switch kit.Int(value[USER_PLACE_ROLE]) {
|
||||
@ -105,8 +124,6 @@ func (s member) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
m.PushButton(button...)
|
||||
})
|
||||
s.SelectJoinUser(m, model.NAME, model.INFO, model.AVATAR, model.AUTH_UID)
|
||||
s.SelectJoinAuth(m)
|
||||
s.DisplayBase(m, "").DisplayCSS("")
|
||||
m.Echo("count: %d", m.Length())
|
||||
}
|
||||
|
@ -336,6 +336,7 @@ type Service struct {
|
||||
Nodename string `gorm:"type:varchar(32)"`
|
||||
Pathname string `gorm:"type:varchar(255)"`
|
||||
Hostname string `gorm:"type:varchar(32)"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Support struct {
|
||||
db.ModelContent
|
||||
|
@ -1,8 +1,5 @@
|
||||
$body:not(.mobile) { background-color:var(--notice-bg-color); }
|
||||
$body.dark { --plugin-bg-color:#0d1117; --output-bg-color:#171a22; }
|
||||
$body.width1.light { --plugin-bg-color:#f4f5f9; --output-bg-color:#fefefd; }
|
||||
$body.width1.light { --plugin-bg-color:#f4f5f9; --output-bg-color:white; }
|
||||
$body.width1.light { --plugin-bg-color:#f3f3f4; --output-bg-color:white; --notice-bg-color:#006fff; }
|
||||
$body.dark { background-color:var(--notice-bg-color); --plugin-bg-color:#0d1117; --output-bg-color:#171a22; }
|
||||
$body.light { background-color:#dbe7fe; --plugin-bg-color:#f3f3f4; --output-bg-color:white; --notice-bg-color:#006fff; }
|
||||
$body.width1 fieldset.Action div.input.float { position:static; }
|
||||
$body.width1 fieldset.Action div.input.float table { width:100%; }
|
||||
$body.width1 div.upload.float div.action { display:flex; }
|
||||
@ -84,6 +81,7 @@ $output div.item.card div.title { width:100%; display:flex; position:relative; }
|
||||
$output div.item.card div.title span.type { line-height:22px; }
|
||||
$output div.item.card div.title span.status { line-height:22px; }
|
||||
$output div.item.card div.title span.price { color:var(--danger-bg-color); }
|
||||
$output div.item.card div.title span.score { background-color:var(--hover-bg-color); color:var(--danger-bg-color); padding:0 5px; }
|
||||
body.width1 $output div.item.card div.title span.price { margin-left:auto; }
|
||||
$output div.item.card div.title span.auth { font-size:14px; padding:3px; }
|
||||
$output div.item.card div.title span.time { position:absolute; right:0; font-size:12px; color:gray; }
|
||||
@ -133,7 +131,7 @@ $output table.content.detail tr.uid { display:none; }
|
||||
$output table.content.detail input { border:none; }
|
||||
|
||||
$output fieldset.story.otherList>div.output { max-height:unset !important; }
|
||||
$output fieldset.story>div.output>div.tabs { background-color:var(--plugin-bg-color); display:flex; overflow:auto; position:sticky; top:0; z-index:1; }
|
||||
$output fieldset.story>div.output>div.tabs { background-color:var(--plugin-bg-color); display:flex; overflow:auto; position:sticky; top:0; z-index:2; }
|
||||
$output fieldset.story>div.output>div.tabs>div.item { white-space:pre; line-height:22px; padding:5px; }
|
||||
$output fieldset.story>div.output>div.tabs>div.item.select { border-top:var(--box-notice); background-color:var(--output-bg-color); }
|
||||
$output fieldset.story>div.output>div.tabs>div.item.danger.select { border-top:var(--box-danger); background-color:var(--output-bg-color); }
|
||||
|
@ -101,11 +101,9 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
|
||||
role = action.Role
|
||||
} else {
|
||||
m.Option(s.Keys(s.Place, model.UID), arg[1])
|
||||
defer s.SelectJoinUser(m)
|
||||
}
|
||||
} else {
|
||||
defer s.SelectJoinUser(m)
|
||||
}
|
||||
defer s.SelectJoinUser(m)
|
||||
if action, ok := cmd.Actions["beforeAction"]; ok {
|
||||
action.Hand(m.Message, arg[1:]...)
|
||||
}
|
||||
|
@ -5,9 +5,10 @@ Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg)
|
||||
},
|
||||
otherList: function(can, msg, action) { if (!msg.IsDetail()) { return } typeof action == "string" && (action = [action])
|
||||
otherList: function(can, msg, action) {
|
||||
if (!msg.IsDetail()) { return } typeof action == "string" && (action = [action])
|
||||
can.core.Next(action, function(action, next) {
|
||||
can.run(can.request({}, {uid: msg.Append(UID)}), action, function(msg) { if (msg.Length() == 0) { return next() }
|
||||
can.run(can.request({}, {uid: msg.Append(UID)}, msg.TableDetail()), action, function(msg) { if (msg.Length() == 0) { return next() }
|
||||
can.page.Append(can, can._output, [{view: [[html.ITEM, html.TITLE, action], "", can.user.trans(can, action)]}])
|
||||
can.onappend.plugin(can, {index: can.ConfIndex()}, function(sub) { can.onimport.myField(can, sub)
|
||||
can.onappend.style(sub, "otherList")
|
||||
@ -187,7 +188,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
},
|
||||
myIndex: function(can, msg, target) { can.onimport.myTitle(can, "My Index", "我的应用", target)
|
||||
var list = ["visitor", "creator", "landlord", "teacher", "leader", "boss", "tenant", "student", "worker", "custom", "admin", "parent", "server"]
|
||||
var _list = can.Conf("_trans.value."+can.Conf("_user_place_role"))
|
||||
var _list = can.Conf("_trans.value."+can.Conf("_user_place_role"))||{}
|
||||
can.core.Item(_list, function(key) { list.indexOf(key) == -1 && list.push(key) })
|
||||
var role = can.page.Append(can, target, [{view: aaa.ROLE, list: can.core.List(list, function(key) {
|
||||
var value = _list[key]; if (!value) { return } if (can.base.isIn(key, ctx.STYLE, mdb.ICONS)) { return }
|
||||
|
@ -27,6 +27,8 @@ type service struct {
|
||||
oauth string `name:"oauth" icon:"bi bi-shield-fill-check"`
|
||||
open string `name:"open" role:"void"`
|
||||
conf string `name:"conf" role:"void"`
|
||||
online string `name:"online" help:"上架" style:"notice" role:"tech"`
|
||||
offline string `name:"offline" help:"下架" style:"danger" role:"tech"`
|
||||
}
|
||||
|
||||
func ServiceUID(m *ice.Message) string {
|
||||
@ -97,15 +99,26 @@ func (s service) Compile(m *ice.Message, arg ...string) {
|
||||
}
|
||||
func (s service) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) < 2 {
|
||||
s.Orders(m, s.Desc(model.UPDATED_AT)).Select(m)
|
||||
s.Orders(m, s.Desc(model.STATUS), s.Desc(model.UPDATED_AT)).Select(m)
|
||||
} else {
|
||||
s.SelectDetail(m, model.UID, arg[1])
|
||||
}
|
||||
if m.IsTech() {
|
||||
m.PushAction(s.Open, s.Conf, s.Code, s.Data).Action(s.Oauth, s.Autogen)
|
||||
} else {
|
||||
m.PushAction(s.Open).Action()
|
||||
}
|
||||
m.Table(func(value ice.Maps) {
|
||||
button := []ice.Any{s.Open}
|
||||
defer func() { m.PushButton(button...) }()
|
||||
if m.IsTech() {
|
||||
button = append(button, s.Conf, s.Code, s.Data)
|
||||
switch ServiceStatus(kit.Int(value[model.STATUS])) {
|
||||
case ServiceOffline:
|
||||
button = append(button, s.Online)
|
||||
case ServiceOnline:
|
||||
button = append(button, s.Offline)
|
||||
}
|
||||
m.Action(s.Oauth, s.Autogen)
|
||||
} else {
|
||||
m.Action()
|
||||
}
|
||||
})
|
||||
m.RenameAppend(model.NODENAME, model.SPACE, model.NODETYPE, model.SERVICE_TYPE, mdb.STATUS, model.SERVICE_STATUS)
|
||||
s.DisplayBase(m, "")
|
||||
}
|
||||
@ -121,6 +134,12 @@ func (s service) Code(m *ice.Message, arg ...string) {
|
||||
func (s service) Data(m *ice.Message, arg ...string) {
|
||||
s.spaceOpen(m, web.CODE_MYSQL_QUERY, aaa.SESS, "mysql", mdb.DATABASE, s.name(m))
|
||||
}
|
||||
func (s service) Online(m *ice.Message, arg ...string) {
|
||||
s.Table.Update(m, kit.Simple(model.STATUS, ServiceOnline), m.OptionSimple(model.UID)...)
|
||||
}
|
||||
func (s service) Offline(m *ice.Message, arg ...string) {
|
||||
s.Table.Update(m, kit.Simple(model.STATUS, ServiceOffline), m.OptionSimple(model.UID)...)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(service{}) }
|
||||
|
||||
@ -130,3 +149,17 @@ func (s service) name(m *ice.Message) string {
|
||||
func (s service) spaceOpen(m *ice.Message, index string, arg ...ice.Any) {
|
||||
m.ProcessOpen(kit.MergeURL(web.S(m.Option(web.SPACE))+web.C(index), arg...))
|
||||
}
|
||||
|
||||
type ServiceStatus int
|
||||
|
||||
const (
|
||||
ServiceOffline ServiceStatus = iota
|
||||
ServiceOnline
|
||||
)
|
||||
|
||||
var ServiceStatusList = map[ServiceStatus]string{
|
||||
ServiceOffline: "offline",
|
||||
ServiceOnline: "online",
|
||||
}
|
||||
|
||||
func (s ServiceStatus) String() string { return ServiceStatusList[s] }
|
||||
|
@ -1,7 +1,11 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) {
|
||||
value._style = value.service_status
|
||||
value.icons = can.misc.Resource(can, value.icon.split("?")[0], value.space)
|
||||
if (value.service_status == "offline" && !msg.IsTech()) {
|
||||
return
|
||||
}
|
||||
return [
|
||||
{view: html.TITLE, list: [value.name]},
|
||||
{view: html.STATUS, list: [value.index]},
|
||||
|
@ -18,6 +18,7 @@ type user struct {
|
||||
Table
|
||||
setting setting
|
||||
template string `data:"4b-Z_r8dZmm1pHdd2h4A10VVYX4OIHvemlLjsHKBj2s"`
|
||||
fields string `data:"name,info,avatar,background,auth_uid"`
|
||||
create string `name:"create open_id* avatar usernick"`
|
||||
modify string `name:"modify info" role:"void"`
|
||||
list string `name:"list uid auto" role:"void"`
|
||||
|
68
src/renzhengshouquan/account.go
Normal file
68
src/renzhengshouquan/account.go
Normal file
@ -0,0 +1,68 @@
|
||||
package renzhengshouquan
|
||||
|
||||
import (
|
||||
"shylinux.com/x/community/src/renzhengshouquan/model"
|
||||
"shylinux.com/x/ice"
|
||||
)
|
||||
|
||||
type account struct {
|
||||
Table
|
||||
order string `data:"4"`
|
||||
fields string `data:"type,status,amount"`
|
||||
create string `name:"create account_type*" role:"leader"`
|
||||
createDefault string `name:"createDefault" role:"leader" help:"开通默认账户"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
recharge string `name:"recharge amount*" role:"leader" help:"充值"`
|
||||
transfer string `name:"transfer amount* to_account_uid*:select" role:"leader" help:"转账"`
|
||||
withdraw string `name:"withdraw amount*" role:"leader" help:"提现"`
|
||||
}
|
||||
|
||||
func (s account) CreateDefault(m *ice.Message, arg ...string) {
|
||||
s.ValueCreate(m, arg...)
|
||||
}
|
||||
func (s account) List(m *ice.Message, arg ...string) {
|
||||
s.ValueList(m, arg).Display("")
|
||||
if m.Length() == 0 {
|
||||
m.SetResult().EchoInfoButton("请开通默认账户", s.CreateDefault)
|
||||
} else {
|
||||
m.PushAction(s.Recharge, s.Transfer, s.Withdraw)
|
||||
}
|
||||
}
|
||||
func (s account) Recharge(m *ice.Message, arg ...string) {
|
||||
s.TransPrice(m, arg)
|
||||
s.Transaction(m, func() {
|
||||
s.AddCount(m, model.AMOUNT, arg[1], m.Option(model.UID))
|
||||
m.Cmdy(transition{}, s.Create, model.TRANSITION_TYPE, TransitionRecharge, model.AMOUNT, m.Option(model.AMOUNT), model.TO_ACCOUNT_UID, m.Option(model.UID))
|
||||
})
|
||||
}
|
||||
func (s account) Transfer(m *ice.Message, arg ...string) {
|
||||
s.TransPrice(m, arg)
|
||||
s.Transaction(m, func() {
|
||||
s.AddCount(m, model.AMOUNT, "-"+arg[1], m.Option(model.UID))
|
||||
s.AddCount(m, model.AMOUNT, arg[1], m.Option(model.TO_ACCOUNT_UID))
|
||||
m.Cmdy(transition{}, s.Create, model.TRANSITION_TYPE, TransitionTransfer, model.AMOUNT, m.Option(model.AMOUNT), model.FROM_ACCOUNT_UID, m.Option(model.UID), m.OptionSimple(model.TO_ACCOUNT_UID))
|
||||
})
|
||||
}
|
||||
func (s account) Withdraw(m *ice.Message, arg ...string) {
|
||||
s.TransPrice(m, arg)
|
||||
s.Transaction(m, func() {
|
||||
s.AddCount(m, model.AMOUNT, "-"+arg[1], m.Option(model.UID))
|
||||
m.Cmd(transition{}, s.Create, model.TRANSITION_TYPE, TransitionWithdraw, model.AMOUNT, m.Option(model.AMOUNT), model.FROM_ACCOUNT_UID, m.Option(model.UID))
|
||||
})
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(account{}) }
|
||||
|
||||
type AccountType int
|
||||
|
||||
const (
|
||||
AccountDefault AccountType = iota
|
||||
AccountBank
|
||||
)
|
||||
|
||||
var AccountTypeList = map[AccountType]string{
|
||||
AccountDefault: "默认账户",
|
||||
AccountBank: "银行账户",
|
||||
}
|
||||
|
||||
func (s AccountType) String() string { return AccountTypeList[s] }
|
9
src/renzhengshouquan/account.js
Normal file
9
src/renzhengshouquan/account.js
Normal 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.name||"默认账户", can.onimport.unitView(can, value, "amount", "元"), 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||value.info]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -25,6 +25,8 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
s.InputsListSkip(m, AuthTypeList, kit.Select("0", "-1", m.IsTech()), arg...)
|
||||
case model.AUTH_STATUS:
|
||||
s.InputsList(m, AuthStatusList, arg...)
|
||||
case model.ACCOUNT_TYPE:
|
||||
s.InputsList(m, AccountTypeList, arg...)
|
||||
case model.FROM_UID:
|
||||
if AuthType(kit.Int(m.Option(model.AUTH_TYPE))) == AuthRoot {
|
||||
m.Push(arg[0], aaa.ROOT)
|
||||
@ -63,6 +65,8 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
value = AuthStatus(kit.Int(value)).String()
|
||||
case model.CERT_STATUS:
|
||||
value = CertStatus(kit.Int(value)).String()
|
||||
case model.TRANSITION_TYPE:
|
||||
value = TransitionType(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
||||
|
@ -3,51 +3,56 @@ package model
|
||||
import "shylinux.com/x/mysql-story/src/db"
|
||||
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
STATUS = "status"
|
||||
SCORE = "score"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
AVATAR = "avatar"
|
||||
BACKGROUND = "background"
|
||||
USER_UID = "user_uid"
|
||||
USER_AUTH_ROLE = "user_auth_role"
|
||||
AUTH_UID = "auth_uid"
|
||||
AUTH_NAME = "auth_name"
|
||||
AUTH_INFO = "auth_info"
|
||||
AUTH_TYPE = "auth_type"
|
||||
AUTH_STATUS = "auth_status"
|
||||
AUTH_AVATAR = "auth_avatar"
|
||||
CERT_UID = "cert_uid"
|
||||
CERT_STATUS = "cert_status"
|
||||
PLACE_NAME = "place_name"
|
||||
STREET_NAME = "street_name"
|
||||
COMPANY_UID = "company_uid"
|
||||
COMPANY_NAME = "company_name"
|
||||
CITY_UID = "city_uid"
|
||||
CITY_NAME = "city_name"
|
||||
FROM_UID = "from_uid"
|
||||
SERVICE_UID = "service_uid"
|
||||
PLACE_UID = "place_uid"
|
||||
STORAGE_UID = "storage_uid"
|
||||
DASHBOARD_UID = "dashboard_uid"
|
||||
SPACE = "space"
|
||||
INDEX = "index"
|
||||
VALUE = "value"
|
||||
PATH = "path"
|
||||
NUMBER = "number"
|
||||
BIRTH = "birth"
|
||||
PERIOD = "period"
|
||||
PERSON = "person"
|
||||
AUTHOR = "author"
|
||||
ADDRESS = "address"
|
||||
MOBILE = "mobile"
|
||||
VERIFY = "verify"
|
||||
VENDOR = "vendor"
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
STATUS = "status"
|
||||
AMOUNT = "amount"
|
||||
SCORE = "score"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
AVATAR = "avatar"
|
||||
BACKGROUND = "background"
|
||||
USER_UID = "user_uid"
|
||||
USER_AUTH_ROLE = "user_auth_role"
|
||||
AUTH_UID = "auth_uid"
|
||||
AUTH_NAME = "auth_name"
|
||||
AUTH_INFO = "auth_info"
|
||||
AUTH_TYPE = "auth_type"
|
||||
AUTH_STATUS = "auth_status"
|
||||
AUTH_AVATAR = "auth_avatar"
|
||||
CERT_UID = "cert_uid"
|
||||
CERT_STATUS = "cert_status"
|
||||
ACCOUNT_TYPE = "account_type"
|
||||
FROM_ACCOUNT_UID = "from_account_uid"
|
||||
TO_ACCOUNT_UID = "to_account_uid"
|
||||
TRANSITION_TYPE = "transition_type"
|
||||
PLACE_NAME = "place_name"
|
||||
STREET_NAME = "street_name"
|
||||
COMPANY_UID = "company_uid"
|
||||
COMPANY_NAME = "company_name"
|
||||
CITY_UID = "city_uid"
|
||||
CITY_NAME = "city_name"
|
||||
FROM_UID = "from_uid"
|
||||
SERVICE_UID = "service_uid"
|
||||
PLACE_UID = "place_uid"
|
||||
STORAGE_UID = "storage_uid"
|
||||
DASHBOARD_UID = "dashboard_uid"
|
||||
SPACE = "space"
|
||||
INDEX = "index"
|
||||
VALUE = "value"
|
||||
PATH = "path"
|
||||
NUMBER = "number"
|
||||
BIRTH = "birth"
|
||||
PERIOD = "period"
|
||||
PERSON = "person"
|
||||
AUTHOR = "author"
|
||||
ADDRESS = "address"
|
||||
MOBILE = "mobile"
|
||||
VERIFY = "verify"
|
||||
VENDOR = "vendor"
|
||||
)
|
||||
|
||||
type UserAuth struct {
|
||||
@ -83,5 +88,23 @@ type Cert struct {
|
||||
Mobile string `gorm:"type:varchar(16)"`
|
||||
Verify string `gorm:"type:varchar(16)"`
|
||||
}
|
||||
type Account struct {
|
||||
db.ModelWithUID
|
||||
AuthUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
Amount int `gorm:"default:0"`
|
||||
}
|
||||
type Transition struct {
|
||||
db.ModelWithUID
|
||||
AuthUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
Amount int `gorm:"default:0"`
|
||||
FromAccountUID string `gorm:"type:char(32);index"`
|
||||
ToAccountUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
func init() { db.CmdModels("", &UserAuth{}, &Auth{}, &Cert{}) }
|
||||
func init() { db.CmdModels("", &UserAuth{}, &Auth{}, &Cert{}, &Account{}, &Transition{}) }
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong"
|
||||
"shylinux.com/x/community/src/renzhengshouquan/model"
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
@ -31,7 +32,8 @@ func (s Portal) PlaceCreate(m *ice.Message, arg ...string) {
|
||||
case AuthCity:
|
||||
arg = append(arg, model.FROM_UID, s.findAuthFrom(m, AuthRoot))
|
||||
case AuthPersonal:
|
||||
arg = append(arg, model.USER_UID, m.Option(model.USER_UID))
|
||||
msg := m.Cmd(api.GONGANXITONG_USER, s.Table.Select, model.UID, m.Option(model.USER_UID))
|
||||
arg = append(arg, model.USER_UID, m.Option(model.USER_UID), model.AVATAR, msg.Append(model.AVATAR))
|
||||
}
|
||||
arg = kit.TransArgKeys(arg, model.AUTH_NAME, model.NAME, model.AUTH_INFO, model.INFO, model.AUTH_TYPE, model.TYPE)
|
||||
if m.Options(arg).Cmdy(s.Place, s.Insert, arg).IsErr() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"portal": "认证授权",
|
||||
"cert": "上传证件", "auth": "认证授权", "admin": "管理后台", "profile": "用户名片",
|
||||
"account": "账户", "transition": "账单",
|
||||
"certList": "证件", "memberList": "成员",
|
||||
"issue": "认证", "revoke": "吊销", "enter": "进入",
|
||||
"verify": "验证",
|
||||
@ -13,6 +14,8 @@
|
||||
"icons": {
|
||||
"cert": "https://img.icons8.com/officel/80/identification-documents--v2.png",
|
||||
"auth": "https://img.icons8.com/officel/80/id-verified.png",
|
||||
"account": "https://img.icons8.com/officel/80/id-verified.png",
|
||||
"transition": "https://img.icons8.com/officel/80/id-verified.png",
|
||||
"admin": "https://img.icons8.com/officel/80/structured-document-data.png",
|
||||
"profile": "https://img.icons8.com/officel/80/passport.png"
|
||||
},
|
||||
|
@ -36,13 +36,13 @@ func (s profile) List(m *ice.Message, arg ...string) {
|
||||
s.Select(m, model.UID, arg[0]).Action()
|
||||
name := m.Append(model.NAME)
|
||||
button := []ice.Any{}
|
||||
button = append(button, s.Enter)
|
||||
kit.If(s.IsWorker(m), func() { button = append(button, s.Modify) })
|
||||
switch AuthType(kit.Int(m.Append(model.AUTH_TYPE))) {
|
||||
case AuthService:
|
||||
s.SelectJoinRecent(m, "")
|
||||
s.SelectJoinService(m)
|
||||
name = kit.JoinWord(m.Append(model.CITY_NAME), m.Append(model.STREET_NAME), m.Append(model.PLACE_NAME))
|
||||
kit.If(s.IsWorker(m), func() { button = append(button, s.Enter) })
|
||||
case AuthCompany:
|
||||
// kit.If(s.IsWorker(m), func() { m.PushAction(s.Modify, s.Enter) }, func() { m.PushAction() })
|
||||
case AuthPersonal:
|
||||
@ -78,9 +78,10 @@ func (s profile) MemberList(m *ice.Message, arg ...string) {
|
||||
s.SelectJoinAuth(m)
|
||||
m.Table(func(value ice.Maps) {
|
||||
if value[model.AUTH_STATUS] == "" && value[model.USER_UID] == user_uid {
|
||||
// m.PushButton(s.AuthPersonal, s.Enter)
|
||||
m.PushButton(s.AuthPersonal)
|
||||
} else {
|
||||
m.PushButton()
|
||||
// m.PushButton(s.Enter)
|
||||
}
|
||||
})
|
||||
s.authSort(m)
|
||||
@ -110,6 +111,7 @@ func (s profile) FromList(m *ice.Message, arg ...string) {
|
||||
break
|
||||
}
|
||||
}
|
||||
// m.PushAction(s.Enter)
|
||||
}
|
||||
func (s profile) AuthPersonal(m *ice.Message, arg ...string) {
|
||||
s.CreditCmdy(m, m.ActionKey(), arg)
|
||||
|
@ -60,10 +60,13 @@ Volcanos(chat.ONIMPORT, {
|
||||
Volcanos(chat.ONACTION, {
|
||||
enter: function(event, can) { var msg = can.request(event)
|
||||
if (msg.Option("auth_type") == "company") {
|
||||
can.user.open(can.misc.MergePodCmd(can, {pod: "20240724-community", cmd: "web.team.renzhengshouquan.admin", auth_uid: msg.Option("auth_uid"), view: "admin"}))
|
||||
} else {
|
||||
can.onimport.myStory(can, {index: "web.team.renzhengshouquan.portal", args: [msg.Option(UID)]})
|
||||
// can.user.open(can.misc.MergePodCmd(can, {pod: "20240724-community", cmd: "web.team.renzhengshouquan.admin", auth_uid: msg.Option("auth_uid"), view: "admin"}))
|
||||
} else if (msg.Option("auth_type") == "service") {
|
||||
can.onimport.myStory(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]})
|
||||
// can.onimport.myPlugin(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]})
|
||||
} else {
|
||||
can.onimport.myStory(can, {index: "web.team.renzhengshouquan.portal", args: [msg.Option(UID)||msg.Option(AUTH_UID)]})
|
||||
}
|
||||
can.page.ClassList.del(can, can._fields, "_process")
|
||||
},
|
||||
|
33
src/renzhengshouquan/transition.go
Normal file
33
src/renzhengshouquan/transition.go
Normal file
@ -0,0 +1,33 @@
|
||||
package renzhengshouquan
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type transition struct {
|
||||
Table
|
||||
order string `data:"5"`
|
||||
fields string `data:"transition_type,status,amount,from_account_uid,to_account_uid"`
|
||||
create string `name:"create transition_type* amount* from_account_uid to_account_uid" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s transition) List(m *ice.Message, arg ...string) {
|
||||
s.ValueList(m, arg).Display("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(transition{}) }
|
||||
|
||||
type TransitionType int
|
||||
|
||||
const (
|
||||
TransitionRecharge TransitionType = iota
|
||||
TransitionTransfer
|
||||
TransitionWithdraw
|
||||
)
|
||||
|
||||
var TransitionTypeList = map[TransitionType]string{
|
||||
TransitionRecharge: "充值",
|
||||
TransitionTransfer: "转账",
|
||||
TransitionWithdraw: "提现",
|
||||
}
|
||||
|
||||
func (s TransitionType) String() string { return TransitionTypeList[s] }
|
9
src/renzhengshouquan/transition.js
Normal file
9
src/renzhengshouquan/transition.js
Normal 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.name||value.user_name, value.transition_type, value.amount, 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||value.info]},
|
||||
] })
|
||||
},
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user