mirror of
https://shylinux.com/x/community
synced 2025-05-06 22:16:54 +08:00
49 lines
2.8 KiB
JavaScript
49 lines
2.8 KiB
JavaScript
Volcanos(chat.ONIMPORT, {
|
|
_init: function(can, msg) { can.ui = can.page.Append(can, can._output, [html.TABS, html.LIST])
|
|
can.runAction({}, ctx.RUN, ["web.team.gonganxitong.domain"], function(msg) { var domain_uid = can.misc.Cookie(can, "domain_uid")
|
|
can.page.Append(can, can.ui.tabs, [{view: [[html.ITEM, domain_uid? "": html.SELECT], "", "全部"], onclick: function(event) { can.misc.Cookie(can, "domain_uid", "")
|
|
can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) })
|
|
}}])
|
|
can.page.Append(can, can.ui.tabs, msg.Table(function(value) {
|
|
return {view: [[html.ITEM, value.uid == domain_uid? html.SELECT: ""], "", value.name], onclick: function(event) { can.misc.Cookie(can, "domain_uid", value.uid)
|
|
can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) })
|
|
}}
|
|
}))
|
|
}), can.onimport._data(can, msg)
|
|
},
|
|
_data: function(can, msg) { can.onmotion.clear(can, can.ui.list)
|
|
can.onimport.itemcards(can, msg, function(value) { return [
|
|
{view: html.STATUS, list: [
|
|
{text: [value.user_name, "", aaa.USERNAME]}, can.onimport.authView(can, value), can.onimport.timeView(can, value),
|
|
]},
|
|
{view: html.STATUS, list: [
|
|
// {text: [value.city_name, "", "city"]},
|
|
{text: [value.street_name, "", "street"]},
|
|
{text: [value.place_name, "", "place"]},
|
|
{text: [value.command_name, "", "command"]},
|
|
// {text: [value.service_name.split(" ")[0], "", "service"]},
|
|
]},
|
|
{view: html.OUTPUT, list: [value.title]},
|
|
{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) {
|
|
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) {
|
|
can.onimport.thumbs(event, can, value, "commentCreate")
|
|
}},
|
|
{view: html.ITEM, list: [{icon: "bi bi-star"}, {text: value.favor_count||"收藏"}], onclick: function(event) {
|
|
can.onimport.thumbs(event, can, value, "favorToggle")
|
|
}, className: value.favor_status%2==1? "done": ""},
|
|
{view: html.ITEM, list: [{icon: "bi bi-box-arrow-up"}, {text: value.share_count||"分享"}], onclick: function(event) {
|
|
can.onimport.thumbs(event, can, value, "shareCreate")
|
|
}},
|
|
]},
|
|
] })
|
|
},
|
|
thumbs: function(event, can, value, button) { can.onkeymap.prevent(event)
|
|
var target = can.page.SelectOne(can, event.currentTarget, html.SPAN)
|
|
can.runAction(can.request(event, value), button, [], function(msg) { target.innerHTML = msg.Result() })
|
|
},
|
|
})
|