1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
shylinux 2021-07-23 02:53:32 +08:00
parent bb93cd6d61
commit 70d6093210
2 changed files with 6 additions and 2 deletions

View File

@ -215,7 +215,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
})
if (msg.Option("_handle") != "true" && cmds && cmds[0] == "action" && can.onaction[cmds[1]]) {
return msg.Option("_handle", "true"), can.core.CallFunc(can.onaction[cmds[1]], {event: event, can: can, msg: msg})
return msg.Option("_handle", "true"), can.core.CallFunc(can.onaction[cmds[1]], {event: event, can: can, msg: msg, cmd: cmds[1]})
}
var feature = can.Conf("feature")

View File

@ -5,7 +5,11 @@ Volcanos("user", {help: "用户操作", agent: {
})
},
getLocation: function(cb) {
typeof cb == "function" && cb({name: "some"})
navigator.geolocation.getCurrentPosition(function(res) {
cb({latitude: parseInt(res.coords.latitude*100000), longitude: parseInt(res.coords.longitude*100000)})
}, function(some) {
typeof cb == "function" && cb({name: "some"})
} );
},
openLocation: function(msg) {
window.open("https://map.baidu.com/search/"+encodeURIComponent(msg.Option("text"))