diff --git a/frame.js b/frame.js index fcf887e0..ca6171dc 100644 --- a/frame.js +++ b/frame.js @@ -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") diff --git a/lib/user.js b/lib/user.js index 2d584099..db9fe79b 100644 --- a/lib/user.js +++ b/lib/user.js @@ -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"))