mirror of
https://shylinux.com/x/community
synced 2025-04-29 02:59:22 +08:00
90 lines
4.8 KiB
JavaScript
90 lines
4.8 KiB
JavaScript
Volcanos(chat.ONIMPORT, {
|
|
_init: function(can, msg) {
|
|
msg.Option("_share_title", msg.Append(mdb.NAME)), msg.Option("_share_content", msg.Append(mdb.INFO)), msg.Option("_share_icons", msg.Append(aaa.AVATAR))
|
|
// if (!can.base.isIn(msg.Option(USER_ROLE), "1", "2", "3")) { delete(can.onaction.updateAvatar), delete(can.onaction.updateBackground) }
|
|
can.ui = can.page.Appends(can, can._output, [html.HEAD, html.LIST, "from"])
|
|
msg.Table(function(value) {
|
|
can.page.Append(can, can.ui.head, [{img: can.misc.Resource(can, value.background||html.BACKGROUND_JPG), onclick: function(event) {
|
|
can.onaction.updateBackground && can.onaction.updateBackground(event, can)
|
|
}}])
|
|
can.page.Append(can, can.ui.head, [can.onimport.itemcard(can, value, [
|
|
{view: html.TITLE, list: [value.name, can.onimport.authView(can, value), can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, msg)]},
|
|
{view: html.STATUS, list: [value.city_name, value.street_name, value.service_name]},
|
|
{view: html.STATUS, list: [value.info]},
|
|
], function() {})])
|
|
})
|
|
switch (msg.Append(AUTH_TYPE)) {
|
|
case "root": can.onimport.myTitle(can, "My City", "城市列表", can.ui.list); break
|
|
case "city": can.onimport.myTitle(can, "My Company", "组织列表", can.ui.list); break
|
|
case "service": can.onimport.myTitle(can, "My Member", "成员列表", can.ui.list); break
|
|
default: can.onimport.myTitle(can, "My Auth", "服务列表", can.ui.list)
|
|
} can.onimport.myTitle(can, "My From", "认证机构", can.ui.from)
|
|
msg.Append(AUTH_TYPE) == "personal"? can.onimport.serviceList(can, msg): msg.Append(AUTH_TYPE) == "service"? can.onimport.memberList(can, msg): can.onimport.authList(can, msg)
|
|
can.onimport.fromList(can, msg, can.ui.from), can.onappend.board(can, msg)
|
|
},
|
|
myTitle: function(can, name, help, target) {
|
|
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, name, help)}]}])
|
|
},
|
|
authList: function(can, msg) {
|
|
can.runAction(can.request({}, {auth_uid: msg.Append(UID)}), "authList", [], function(msg) {
|
|
can.onimport.myView(can, msg, function(value) {
|
|
return [
|
|
{view: html.TITLE, list: [value.name, can.onimport.authView(can, value), can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, value)]},
|
|
{view: html.STATUS, list: [value.info, value.service_name]},
|
|
]
|
|
}, function(event, value) {
|
|
can.Option(AUTH_UID, value.uid), can.Update(event)
|
|
}, can.ui.list)
|
|
})
|
|
},
|
|
memberList: function(can, msg) {
|
|
can.runAction(can.request({}, {auth_uid: msg.Append(UID)}), "memberList", [], function(msg) {
|
|
can.onimport.myView(can, msg, function(value) { value.icons = value.auth_avatar||value.user_avatar||html.AVATAR_JPG
|
|
return [
|
|
{view: html.TITLE, list: [value.auth_name||value.user_name, can.onimport.authView(can, value), can.onimport.textView(can, value, AUTH_TYPE),
|
|
can.onimport.titleAction(can, value),
|
|
]},
|
|
{view: html.STATUS, list: [value.auth_info||value.user_info]},
|
|
]
|
|
}, function(event, value) {
|
|
if (value.auth_uid) {
|
|
can.Option(AUTH_UID, value.auth_uid), can.Update(event)
|
|
} else {
|
|
can.onimport.myStory(can, {index: "web.team.gonganxitong.user", args: [value.user_uid]})
|
|
}
|
|
}, can.ui.list)
|
|
})
|
|
},
|
|
serviceList: function(can, msg) {
|
|
can.runAction(can.request({}, {}), "serviceList", [msg.Append(USER_UID)||msg.Option(USER_UID)], function(msg) {
|
|
can.onimport.myView(can, msg, function(value) { value.icons = value.avatar||value.service_icon||html.AVATAR_JPG
|
|
return [
|
|
{view: html.TITLE, list: [value.name, can.onimport.authView(can, value), can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, value)]},
|
|
{view: html.STATUS, list: [value.info, value.service_name]},
|
|
]
|
|
}, function(event, value) {
|
|
can.Option(AUTH_UID, value.uid), can.Update(event)
|
|
}, can.ui.list)
|
|
})
|
|
},
|
|
fromList: function(can, msg, target) {
|
|
can.runAction(can.request({}, {}), "fromList", [msg.Append("from_uid")], function(msg) {
|
|
if (msg.Length() == 0) { return can.onmotion.hidden(can, target) }
|
|
can.onimport.myView(can, msg, function(value) {
|
|
return [
|
|
{view: html.TITLE, list: [value.name, can.onimport.authView(can, value), can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, value)]},
|
|
{view: html.STATUS, list: [value.info, value.service_name]},
|
|
]
|
|
}, function(event, value) {
|
|
can.Option(AUTH_UID, value.uid), can.Update(event)
|
|
}, target)
|
|
})
|
|
},
|
|
})
|
|
Volcanos(chat.ONACTION, {
|
|
enter: function(event, can) { var msg = can.request(event)
|
|
can.onimport.myPlugin(can, {space: msg.Option("nodename"), index: msg.Option("index"), args: [msg.Option("place_uid")]})
|
|
},
|
|
updateBackground: function(event, can) { can.user.upload(can.request(event, {field: aaa.BACKGROUND}), can) },
|
|
updateAvatar: function(event, can) { can.user.upload(can.request(event, {field: aaa.AVATAR}), can) },
|
|
}) |