diff --git a/src/api/common.go b/src/api/common.go index 9647886..c8fdb9e 100644 --- a/src/api/common.go +++ b/src/api/common.go @@ -5,6 +5,17 @@ const GONGANXITONG_CITY = "web.team.gonganxitong.city" const GONGANXITONG_STREET = "web.team.gonganxitong.street" const GUANLIXITONG_COMPANY = "web.team.guanlixitong.company" +const ( + ROOT = "root" + TECH = "tech" + VOID = "void" + VISITOR = "visitor" + CREATOR = "creator" + LEADER = "leader" + WORKER = "worker" + SERVER = "server" +) + type AuthStatus int const ( diff --git a/src/gonganxitong/city.go b/src/gonganxitong/city.go index 1af028b..8727bf3 100644 --- a/src/gonganxitong/city.go +++ b/src/gonganxitong/city.go @@ -20,9 +20,11 @@ func (s user) Init(m *ice.Message, arg ...string) { } func (s street) Init(m *ice.Message, arg ...string) { cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL + cmdSpace[m.PrefixKey()] = "20240724-community" } func (s city) Init(m *ice.Message, arg ...string) { cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL + cmdSpace[m.PrefixKey()] = "20240724-community" } func (s city) FindOrCreateByName(m *ice.Message, arg ...string) { if msg := m.Cmd(s, s.Select, model.NAME, arg[1]); msg.Length() == 0 { diff --git a/src/gonganxitong/common.go b/src/gonganxitong/common.go index c935777..3fcd340 100644 --- a/src/gonganxitong/common.go +++ b/src/gonganxitong/common.go @@ -251,7 +251,7 @@ func (s Table) SelectJoinCity(m *ice.Message, arg ...string) *ice.Message { } func (s Table) SelectJoinUser(m *ice.Message, arg ...string) *ice.Message { kit.If(len(arg) == 0, func() { arg = append(arg, model.NAME, model.AVATAR) }) - if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.USER_UID) == -1 { + if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.USER_UID) == -1 && kit.IndexOf(m.Appendv(ice.KEY), model.USER_UID) == -1 { return m } return s.SelectJoin(m, user{}, arg...) diff --git a/src/gonganxitong/market.js b/src/gonganxitong/market.js index d1ae8f2..b20ea92 100644 --- a/src/gonganxitong/market.js +++ b/src/gonganxitong/market.js @@ -18,10 +18,10 @@ Volcanos(chat.ONIMPORT, { {view: html.TITLE, list: [value.command_name, value.title, value.price > 0 && can.onimport.moneyView(can, value)]}, {view: html.OUTPUT, list: [value.content]}, {view: html.ACTION, list: [ - {view: html.ITEM, list: [{icon: "bi bi-hand-thumbs-up"}, {text: value.thumb_count||"点赞"}], onclick: function(event) { + {view: html.ITEM, list: [{icon: "bi bi-heart"}, {text: value.thumb_count||"点赞"}], onclick: function(event) { can.onimport.thumbs(event, can, value, "thumbToggle") }, className: value.thumb_status%2==1? "done": ""}, - {view: html.ITEM, list: [{icon: "bi bi-chat-left-text"}, {text: value.comment_count||"评论"}], onclick: function(event) { + {view: html.ITEM, list: [{icon: "bi bi-chat-square"}, {text: value.comment_count||"评论"}], onclick: function(event) { can.onimport.thumbs(event, can, value, "commentCreate") }}, {view: html.ITEM, list: [{icon: "bi bi-star"}, {text: value.favor_count||"收藏"}], onclick: function(event) { diff --git a/src/gonganxitong/member.go b/src/gonganxitong/member.go index 3f88ad7..9f5c21e 100644 --- a/src/gonganxitong/member.go +++ b/src/gonganxitong/member.go @@ -15,9 +15,9 @@ type member struct { order string `data:"102"` role string `data:"leader,worker,server"` remove string `name:"remove" role:"leader"` - disable string `name:"disable" role:"leader"` - demote string `name:"demote" role:"creator"` - promote string `name:"promote" role:"creator"` + disable string `name:"disable" style:"danger" role:"leader"` + demote string `name:"demote" help:"降级" style:"danger" role:"creator"` + promote string `name:"promote" help:"升级" role:"creator"` enable string `name:"enable" role:"leader"` auth string `name:"auth" help:"认证" role:"void"` main string `name:"main" help:"主页" role:"void"` @@ -47,47 +47,6 @@ func (s member) Enable(m *ice.Message, arg ...string) { m.Cmdy(s.UserPlace, s.UpdateField, model.STATUS, MemberNormal, s.option(m, model.ROLE, kit.Format(UserPlaceTenant))) s.recordEvent(m, "✅", m.Trans("enable member", "启用成员"), html.NOTICE) } - -func (s member) Auth(m *ice.Message, arg ...string) { - msg := m.Cmd(city{}, s.Select, model.NAME, m.Option(model.CITY_NAME)) - if m.WarnNotValid(msg.Append(model.AUTH_UID) == "") { - return - } - m.Cmdy(user{}, s.AuthCreate, kit.Dict(msg.AppendSimple(model.AUTH_UID))) -} -func (s member) Main(m *ice.Message, arg ...string) { - m.ProcessField(api.RENZHENGSHOUQUAN_PORTAL, []string{m.Option(model.AUTH_UID)}) -} -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) SetInfo(m *ice.Message, arg ...string) { - m.Cmdy(s.UserPlace, s.Modify, arg) -} -func (s member) UserInfo(m *ice.Message, arg ...string) { - if msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.USER_UID, m.Option(model.UID)); msg.Append(model.UID) == "" { - m.ProcessHold() - } else { - m.ProcessField(api.RENZHENGSHOUQUAN_PORTAL, []string{msg.Append(model.UID)}, arg...) - } -} -func (s Portal) UserInfo(m *ice.Message, arg ...string) { - msg := m.Cmd(s.UserPlace, s.Table.Select, s.Keys(s.Place, model.UID), m.Option(model.PLACE_UID), model.USER_UID, m.Option(model.UID)) - m.ProcessField(s.PrefixMember(m), []string{m.Option(model.PLACE_UID), msg.Append(model.UID)}, arg...) -} -func (s Table) UserInfo(m *ice.Message, arg ...string) { - m.Cmdy(s.PrefixPortal(m), s.UserInfo, arg) -} -func (s member) SetLanguage(m *ice.Message, arg ...string) { - msg := m.Cmd(s.UserPlace, s.Select, s.Keys(s.Place, model.UID), m.Option(model.PLACE_UID), s.Key(s.UserPlace, model.UID), m.Option(model.UID)) - m.Cmdy(user{}, s.UpdateField, arg, model.UID, msg.Append(model.USER_UID)) -} -func (s member) SessList(m *ice.Message, arg ...string) { - msg := m.Cmd(s.UserPlace, s.Select, s.Keys(s.Place, model.UID), m.Option(model.PLACE_UID), s.Key(s.UserPlace, model.UID), m.Option(model.UID)) - s.OtherList(m, sess{}, msg.AppendSimple(model.USER_UID)...) - m.Display("sess.js") -} 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) @@ -123,15 +82,15 @@ func (s member) List(m *ice.Message, arg ...string) { } else { button = append(button, s.Main) } - if value[model.USER_UID] != user_uid && m.IsTech() { - button = append(button, s.SetCookie) - } if value[model.USER_UID] == user_uid || isLeader { button = append(button, s.SetInfo) } if value[model.USER_UID] == user_uid { button = append(button, s.SetLanguage) } + if value[model.USER_UID] != user_uid && m.IsTech() { + button = append(button, s.SetCookie) + } if MemberStatus(kit.Int(value[model.MEMBER_STATUS])) == MemberNormal { if isCreator { switch kit.Int(value[USER_PLACE_ROLE]) { @@ -161,6 +120,46 @@ func (s member) List(m *ice.Message, arg ...string) { }) s.DisplayBase(m, "").DisplayCSS("") } +func (s member) SessList(m *ice.Message, arg ...string) { + msg := m.Cmd(s.UserPlace, s.Select, s.Keys(s.Place, model.UID), m.Option(model.PLACE_UID), s.Key(s.UserPlace, model.UID), m.Option(model.UID)) + s.OtherList(m, sess{}, msg.AppendSimple(model.USER_UID)...) + m.Display("sess.js") +} +func (s member) Auth(m *ice.Message, arg ...string) { + msg := m.Cmd(city{}, s.Select, model.NAME, m.Option(model.CITY_NAME)) + if m.WarnNotValid(msg.Append(model.AUTH_UID) == "") { + return + } + m.Cmdy(user{}, s.AuthCreate, kit.Dict(msg.AppendSimple(model.AUTH_UID))) +} +func (s member) Main(m *ice.Message, arg ...string) { + m.ProcessField(api.RENZHENGSHOUQUAN_PORTAL, []string{m.Option(model.AUTH_UID)}) +} +func (s member) SetInfo(m *ice.Message, arg ...string) { + m.Cmdy(s.UserPlace, s.Modify, arg) +} +func (s member) UserInfo(m *ice.Message, arg ...string) { + if msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.USER_UID, m.Option(model.UID)); msg.Append(model.UID) == "" { + m.ProcessHold() + } else { + m.ProcessField(api.RENZHENGSHOUQUAN_PORTAL, []string{msg.Append(model.UID)}, arg...) + } +} +func (s Portal) UserInfo(m *ice.Message, arg ...string) { + msg := m.Cmd(s.UserPlace, s.Table.Select, s.Keys(s.Place, model.UID), m.Option(model.PLACE_UID), model.USER_UID, m.Option(model.UID)) + m.ProcessField(s.PrefixMember(m), []string{m.Option(model.PLACE_UID), msg.Append(model.UID)}, arg...) +} +func (s Table) UserInfo(m *ice.Message, arg ...string) { + m.Cmdy(s.PrefixPortal(m), s.UserInfo, arg) +} +func (s member) SetLanguage(m *ice.Message, arg ...string) { + msg := m.Cmd(s.UserPlace, s.Select, s.Keys(s.Place, model.UID), m.Option(model.PLACE_UID), s.Key(s.UserPlace, model.UID), m.Option(model.UID)) + m.Cmdy(user{}, s.UpdateField, arg, model.UID, msg.Append(model.USER_UID)) +} +func (s member) SetCookie(m *ice.Message, arg ...string) { + m.Cmdy(s.UserPlace, s.Select, model.UID, m.Option(model.UID)) + m.ProcessCookie(ice.MSG_USERUID, m.Append(model.USER_UID)) +} func init() { ice.TeamCtxCmd(member{Tables: newTables()}) } diff --git a/src/gonganxitong/portal.css b/src/gonganxitong/portal.css index 66c7cf5..7dd7828 100644 --- a/src/gonganxitong/portal.css +++ b/src/gonganxitong/portal.css @@ -60,7 +60,8 @@ $output>div>div.list.mynotice>span:last-child { color:gray; } $output>div>div.list.mylist>fieldset>div.output { max-height:none !important; } $output>div>div.list.myallow>div.title { border-left:var(--box-danger3); padding-left:10px; } $output>div>div.list.myorder>div.title { border-left:var(--box-danger3); padding-left:10px; display:none; } -body.width1 $output>div>div.list.myorder { border-radius:0; padding:0 20px 20px; margin:0; } +body.width1 $output>div>div.list.myorder { padding:0 10px 20px; } +$output>div.action { background-color:var(--output-bg-color); } $output div.item.card:not(:last-child) { margin-bottom:2px; } $output div.item.card.sticky { position:sticky; top:0; z-index:2; } $output div.item.card.loaded { position:sticky; top:0; z-index:2; } @@ -193,11 +194,11 @@ body.width1 $action div.item.text.filter { flex-grow:1; } body.width1 $output div.item.card div.container>div.title>span.price { margin-left:auto; } body.width1 $output div.item.card div.container>div.title>span.status { margin-left:auto; } body.width1 $output fieldset.story>div.output>div.place_info { min-height:68px; } -body.width1 $output fieldset.story>div.output>div.place_info>div.item>div.output { background-color:var(--plugin-bg-color); } -body.width1 $output fieldset.story>div.output>table.detail tr.created_at { display:none; } -body.width1 $output fieldset.story>div.output>table.detail tr.updated_at { display:none; } -body.width1 $output fieldset.story>div.output>table.detail tr.user_name { display:none; } -body.width1 $output fieldset.story>div.output>table.detail tr.user_avatar { display:none; } +$output fieldset.story>div.output>div.place_info>div.item>div.output { background-color:var(--plugin-bg-color); } +$output fieldset.story>div.output>table.detail tr.created_at { display:none; } +$output fieldset.story>div.output>table.detail tr.updated_at { display:none; } +$output fieldset.story>div.output>table.detail tr.user_name { display:none; } +$output fieldset.story>div.output>table.detail tr.user_avatar { display:none; } body:not(.mobile) $action div.item.button input:hover { background-color:var(--hover-bg-color); } body:not(.mobile) $action div.item.notice input[type=button]:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } body:not(.mobile) $output input.notice[type=button]:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } diff --git a/src/gonganxitong/portal.go b/src/gonganxitong/portal.go index 7fbbf0e..ab451c0 100644 --- a/src/gonganxitong/portal.go +++ b/src/gonganxitong/portal.go @@ -367,7 +367,7 @@ func (s Portal) ValueRemove(m *ice.Message, arg ...string) { s.Table.Delete(m, m.OptionSimple(s.Keys(s.Place, model.UID), model.UID)...) } func (s Portal) ValueModify(m *ice.Message, arg ...string) { - s.Table.Update(m, kit.Dict(arg), m.OptionSimple(s.Keys(s.Place, model.UID), model.UID)...) + s.Table.Update(m, kit.Dict(arg), m.OptionSimple(model.UID, s.Keys(s.Place, model.UID))...) } func (s Portal) ValueList(m *ice.Message, arg ...string) { PLACE_UID := s.Keys(s.Place, model.UID) diff --git a/src/gonganxitong/portal.js b/src/gonganxitong/portal.js index 265da04..484997c 100644 --- a/src/gonganxitong/portal.js +++ b/src/gonganxitong/portal.js @@ -28,8 +28,8 @@ Volcanos(chat.ONIMPORT, { can.page.Appends(can, target||can.ui.list, [{view: html.TITLE, list: [{text: can.user.trans(can, name, help)}]}]) }, myPortal: function(can, msg) { can.sup.current = {} - can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true) - can.onmotion.delay(can, function() { can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true) }, 300) + // can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true) + // can.onmotion.delay(can, function() { can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true) }, 300) can.core.List(["_place_uid", "_place_name", "_place_type", "_user_place_role", "_street_name"], function(key) { can.Conf(key, msg.Option(key)) }) var PLACE_UID = can.Conf("_place_uid"), PLACE_NAME = can.Conf("_place_name"), PLACE_TYPE = can.Conf("_place_type") var USER_PLACE_ROLE = can.Conf("_user_place_role"), STREET_NAME = can.Conf("_street_name") diff --git a/src/gonganxitong/portal.json b/src/gonganxitong/portal.json index 9a7a403..d1c3b86 100644 --- a/src/gonganxitong/portal.json +++ b/src/gonganxitong/portal.json @@ -8,14 +8,10 @@ "read": "已读", "done": "完成", "sticky": "置顶", "unSticky": "取消置顶", "cancel": "取消", "submit": "提交", "finish": "完成", "reject": "驳回", "approve": "通过", "process": "开始", "pushPublic": "推广", "marketInsert": "推广", - "marketPlaceEnter": "进入系统", - "messagePlaceEnter": "进入系统", + "marketPlaceEnter": "进入系统", "messagePlaceEnter": "进入系统", "applyCreate": "申请权限", "commentCreate": "评论", "applyQRCode": "邀请码", "config": "配置", "code": "编程", "data": "数据", "cache": "缓存", - "promote": "升级", "demote": "降级", "clean": "数据清理", "domain": "领域分类", - "city": "城市", - "user": "城市", "icons": { "qrcode": "bi bi-qr-code", "apply": "bi bi-pencil-square", diff --git a/src/gonganxitong/setting.go b/src/gonganxitong/setting.go index 8b62ab8..c831f4d 100644 --- a/src/gonganxitong/setting.go +++ b/src/gonganxitong/setting.go @@ -2,7 +2,6 @@ package gonganxitong import ( "shylinux.com/x/ice" - "shylinux.com/x/icebergs/base/aaa" kit "shylinux.com/x/toolkits" "shylinux.com/x/community/src/api" @@ -34,19 +33,19 @@ func (s setting) Update(m *ice.Message, arg ...string) { msg := s.Hash.Select(m.Spawn(), m.Option(model.NAME)) args := m.OptionSimple(model.PLACE_UID, model.USER_UID, model.NAME) switch msg.Append(model.ROLE) { - case aaa.TECH: + case api.TECH: if m.IsTech() { args = m.OptionSimple(model.PLACE_UID, model.NAME) } else { return } - case "creator": + case api.CREATOR: if s.IsCreator(m) { args = m.OptionSimple(model.PLACE_UID, model.NAME) } else { return } - case "leader": + case api.LEADER: if s.IsLeader(m) { args = m.OptionSimple(model.PLACE_UID, model.NAME) } else { @@ -69,11 +68,11 @@ func (s setting) List(m *ice.Message, arg ...string) { msg := s.Select(m.Spawn(), args...) msg.Table(func(value ice.Maps) { data[value[model.NAME]] = value[model.VALUE] }) s.Hash.List(m.Spawn()).Table(func(value ice.Maps) { - if value[model.ROLE] == aaa.TECH && !m.IsTech() { + if value[model.ROLE] == api.TECH && !m.IsTech() { - } else if value[model.ROLE] == "creator" && !s.IsCreator(m) { + } else if value[model.ROLE] == api.CREATOR && !s.IsCreator(m) { - } else if value[model.ROLE] == "leader" && !s.IsLeader(m) { + } else if value[model.ROLE] == api.LEADER && !s.IsLeader(m) { } else { m.Push(model.NAME, value[model.NAME]) @@ -122,6 +121,12 @@ func (s Table) SettingSelect(m *ice.Message, arg ...string) { m.Option(value[model.NAME], value[model.VALUE]) }) } +func (s Table) SettingIsOn(m *ice.Message, key string) bool { + if m.Option(key) == "on" { + return true + } + return false +} const ( SETTING_PROFILE = "profile" diff --git a/src/renzhengshouquan/account.go b/src/renzhengshouquan/account.go index bf171ce..73145ab 100644 --- a/src/renzhengshouquan/account.go +++ b/src/renzhengshouquan/account.go @@ -8,6 +8,8 @@ import ( type account struct { Table order string `data:"4"` + auth string `data:"issued"` + role string `data:"leader,worker"` fields string `data:"type,status,amount"` create string `name:"create account_type*" role:"leader"` createDefault string `name:"createDefault" role:"leader" help:"开通默认账户"` diff --git a/src/renzhengshouquan/cert.go b/src/renzhengshouquan/cert.go index cbaf01d..b8239c9 100644 --- a/src/renzhengshouquan/cert.go +++ b/src/renzhengshouquan/cert.go @@ -13,6 +13,7 @@ import ( type cert struct { Table order string `data:"1"` + role string `data:"leader,worker"` fields string `data:"cert_status,path,number,name,type,person,address,mobile,verify,user_uid"` upload string `name:"upload" role:"leader"` remove string `name:"remove" role:"leader"` diff --git a/src/renzhengshouquan/portal.json b/src/renzhengshouquan/portal.json index a72a021..e2c21e4 100644 --- a/src/renzhengshouquan/portal.json +++ b/src/renzhengshouquan/portal.json @@ -17,7 +17,7 @@ "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" + "profile": "profile.png" }, "input": { "My Auth": "我的认证", diff --git a/src/renzhengshouquan/profile.png b/src/renzhengshouquan/profile.png new file mode 100644 index 0000000..8f8a172 Binary files /dev/null and b/src/renzhengshouquan/profile.png differ diff --git a/src/renzhengshouquan/transition.go b/src/renzhengshouquan/transition.go index f33afc9..0f02913 100644 --- a/src/renzhengshouquan/transition.go +++ b/src/renzhengshouquan/transition.go @@ -9,6 +9,8 @@ import ( type transition struct { Table order string `data:"5"` + auth string `data:"issued"` + role string `data:"leader,worker"` 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"`