1
0
forked from x/volcanos
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-06-06 00:03:58 +08:00
parent 8fcb2dfdfa
commit 68eedc76f1
3 changed files with 11 additions and 5 deletions

View File

@ -372,4 +372,4 @@ Volcanos("misc", {
},
_signal: function(args) { this._list.push(args) }, _list: [], _skip: navigator && navigator.userAgent.indexOf("Chrome") > -1? 3: 3,
})

View File

@ -23,6 +23,10 @@ Volcanos(chat.ONACTION, {
}), can.page.setData(can), can.user.toast(can, "加载成功")
},
refresh: function(event, can) { can.onaction._apis = "", can.onaction._cmds = []
if (can.db.index == "web.chat.grant") {
wx.redirectTo({url: can.base.MergeURL("grant", {serve: can.db.serve, space: can.db.space})})
return
}
if (can.db.share) { can.onaction._apis = "/share/"+can.db.share
can.run(event, [ctx.ACTION, ctx.COMMAND], function(msg) {
can.onaction._cmds = [ctx.ACTION, ctx.RUN], can.onaction._reload(can, msg)
@ -59,8 +63,8 @@ Volcanos(chat.ONACTION, {
} field._history = field._history||[]
switch (name) {
case ice.BACK: field._history.pop(); var ls = field._history.pop()||[], i = 0
can.core.List(field.inputs, function(input) { if (input.type != html.BUTTON) { input.value = ls[i++]||"" } })
can.onaction._refresh(event, can, order); break
can.core.List(field.inputs, function(input) { if (input.type != html.BUTTON) { input.value = ls[i++]||"" } })
can.onaction._refresh(event, can, order); break
case ctx.RUN: break
case ice.LIST:
case web.REFRESH: msg._method = http.GET; break
@ -95,7 +99,7 @@ Volcanos(chat.ONACTION, {
can.run(event, [field.id||field.index, ctx.ACTION, input.name], function(msg) {
switch (msg.Option(ice.MSG_PROCESS)) {
case "_location":
can.user.parse(can, msg.Option("_arg"))
can.user.parse(can, msg.Option("_arg"))
}
can.onaction._refresh(event, can, order)
})

View File

@ -15,6 +15,7 @@ function Volcanos(name, list) { if (Volcanos._page) { Volcanos._page[name] = lis
Volcanos._init = function() { var page = Volcanos._page; page.__proto__ = getApp(), delete(Volcanos._page)
var can = {__proto__: page,
Option: function() { return {} },
request: function(event) { event = event||{}, event = event._event||event
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
function set(key, value) { if (key == "_method") { return msg._method = value }
@ -28,7 +29,8 @@ Volcanos._init = function() { var page = Volcanos._page; page.__proto__ = getApp
},
run: function(event, cmds, cb) { wx.showLoading(); const info = wx.getSystemInfoSync()
can.misc.POST(can, can.request(event, {share: can.db.share}), can.base.MergeURL(can.onaction._apis||nfs.CHAT_ACTION, kit.Dict(
ice.POD, can.db.pod||can.db.space, ice.MSG_THEME, info.theme, ice.MSG_DEBUG, can.db.debug,
// ice.POD, can.db.pod||can.db.space, ice.MSG_THEME, info.theme, ice.MSG_DEBUG, can.db.debug,
ice.POD, can.db.pod, ice.MSG_THEME, info.theme, ice.MSG_DEBUG, can.db.debug,
)), {cmds: (can.onaction._cmds||[]).concat(cmds)}, function(msg) { wx.hideLoading()
msg.Dump = function() { can.ui.setData({list: msg.Table()}) }, cb(msg)
})