forked from x/volcanos
opt some
This commit is contained in:
parent
8fcb2dfdfa
commit
68eedc76f1
@ -23,6 +23,10 @@ Volcanos(chat.ONACTION, {
|
|||||||
}), can.page.setData(can), can.user.toast(can, "加载成功")
|
}), can.page.setData(can), can.user.toast(can, "加载成功")
|
||||||
},
|
},
|
||||||
refresh: function(event, can) { can.onaction._apis = "", can.onaction._cmds = []
|
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
|
if (can.db.share) { can.onaction._apis = "/share/"+can.db.share
|
||||||
can.run(event, [ctx.ACTION, ctx.COMMAND], function(msg) {
|
can.run(event, [ctx.ACTION, ctx.COMMAND], function(msg) {
|
||||||
can.onaction._cmds = [ctx.ACTION, ctx.RUN], can.onaction._reload(can, msg)
|
can.onaction._cmds = [ctx.ACTION, ctx.RUN], can.onaction._reload(can, msg)
|
||||||
@ -59,8 +63,8 @@ Volcanos(chat.ONACTION, {
|
|||||||
} field._history = field._history||[]
|
} field._history = field._history||[]
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case ice.BACK: field._history.pop(); var ls = field._history.pop()||[], i = 0
|
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.core.List(field.inputs, function(input) { if (input.type != html.BUTTON) { input.value = ls[i++]||"" } })
|
||||||
can.onaction._refresh(event, can, order); break
|
can.onaction._refresh(event, can, order); break
|
||||||
case ctx.RUN: break
|
case ctx.RUN: break
|
||||||
case ice.LIST:
|
case ice.LIST:
|
||||||
case web.REFRESH: msg._method = http.GET; break
|
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) {
|
can.run(event, [field.id||field.index, ctx.ACTION, input.name], function(msg) {
|
||||||
switch (msg.Option(ice.MSG_PROCESS)) {
|
switch (msg.Option(ice.MSG_PROCESS)) {
|
||||||
case "_location":
|
case "_location":
|
||||||
can.user.parse(can, msg.Option("_arg"))
|
can.user.parse(can, msg.Option("_arg"))
|
||||||
}
|
}
|
||||||
can.onaction._refresh(event, can, order)
|
can.onaction._refresh(event, can, order)
|
||||||
})
|
})
|
||||||
|
@ -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)
|
Volcanos._init = function() { var page = Volcanos._page; page.__proto__ = getApp(), delete(Volcanos._page)
|
||||||
var can = {__proto__: page,
|
var can = {__proto__: page,
|
||||||
|
Option: function() { return {} },
|
||||||
request: function(event) { event = event||{}, event = event._event||event
|
request: function(event) { event = event||{}, event = event._event||event
|
||||||
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
|
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
|
||||||
function set(key, value) { if (key == "_method") { return msg._method = value }
|
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()
|
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(
|
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()
|
)), {cmds: (can.onaction._cmds||[]).concat(cmds)}, function(msg) { wx.hideLoading()
|
||||||
msg.Dump = function() { can.ui.setData({list: msg.Table()}) }, cb(msg)
|
msg.Dump = function() { can.ui.setData({list: msg.Table()}) }, cb(msg)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user