mirror of
https://shylinux.com/x/icebergs
synced 2025-04-28 18:22:02 +08:00
add some
This commit is contained in:
parent
db53a31bcf
commit
409dd40848
@ -2,7 +2,6 @@ package chat
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ func init() {
|
|||||||
CMD: {Help: "命令", Actions: web.ApiWhiteAction(), Hand: func(m *ice.Message, arg ...string) {
|
CMD: {Help: "命令", Actions: web.ApiWhiteAction(), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg[0]) == 0 || arg[0] == "" {
|
if len(arg[0]) == 0 || arg[0] == "" {
|
||||||
web.RenderMain(m)
|
web.RenderMain(m)
|
||||||
} else if aaa.Right(m, arg) {
|
} else {
|
||||||
if m.IsCliUA() {
|
if m.IsCliUA() {
|
||||||
m.Cmdy(arg, m.Optionv(ice.ARG)).RenderResult()
|
m.Cmdy(arg, m.Optionv(ice.ARG)).RenderResult()
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,6 +17,9 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
var weather = new AMap.Weather(); weather.getLive(can.Status("city"), function(err, data) { can.Status(data) })
|
var weather = new AMap.Weather(); weather.getLive(can.Status("city"), function(err, data) { can.Status(data) })
|
||||||
}, 500)
|
}, 500)
|
||||||
}), can.onmotion.delay(can, function() { can.onaction.current({}, can) })
|
}), can.onmotion.delay(can, function() { can.onaction.current({}, can) })
|
||||||
|
AMap.event.addListener(can.ui.geolocation, 'error', function(res) {
|
||||||
|
can.user.toastFailure(can, res.message)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
map.add(can.ui.favor = new AMap.OverlayGroup())
|
map.add(can.ui.favor = new AMap.OverlayGroup())
|
||||||
map.add(can.ui.marker = new AMap.Marker({position: [116.39, 39.9]}))
|
map.add(can.ui.marker = new AMap.Marker({position: [116.39, 39.9]}))
|
||||||
@ -40,6 +43,7 @@ Volcanos(chat.ONACTION, {
|
|||||||
current: "定位", favor: "收藏",
|
current: "定位", favor: "收藏",
|
||||||
input: {
|
input: {
|
||||||
zoom: "缩放", pitch: "倾斜", rotation: "旋转",
|
zoom: "缩放", pitch: "倾斜", rotation: "旋转",
|
||||||
|
weather: "天气", temperature: "温度", humidity: "湿度", windPower: "风速",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
current: function(event, can) {
|
current: function(event, can) {
|
||||||
@ -55,6 +59,9 @@ Volcanos(chat.ONACTION, {
|
|||||||
center: function(can, item) { can.ui.marker.setTitle(item.name)
|
center: function(can, item) { can.ui.marker.setTitle(item.name)
|
||||||
can.ui.map.setCenter(new AMap.LngLat(parseFloat(item.longitude), parseFloat(item.latitude)))
|
can.ui.map.setCenter(new AMap.LngLat(parseFloat(item.longitude), parseFloat(item.latitude)))
|
||||||
can.onmotion.delay(can, function() { can.onexport.status(can) }, 500)
|
can.onmotion.delay(can, function() { can.onexport.status(can) }, 500)
|
||||||
|
},
|
||||||
|
direction: function(event, can, button, item) {
|
||||||
|
can.user.isMobile && window.open(`https://uri.amap.com/marker?position=${item.longitude},${item.latitude}&name=${item.name||item.text}&callnative=1`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {
|
Volcanos(chat.ONEXPORT, {
|
||||||
|
@ -3,7 +3,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) {},
|
|||||||
can.db.list = {}, can.ui = can.onappend.layout(can), can.onimport._project(can)
|
can.db.list = {}, can.ui = can.onappend.layout(can), can.onimport._project(can)
|
||||||
// can.core.Item(can.ui.zone, function(key, item) { key == "favor" || item._legend.click() })
|
// can.core.Item(can.ui.zone, function(key, item) { key == "favor" || item._legend.click() })
|
||||||
if (can.user.isMobile) {
|
if (can.user.isMobile) {
|
||||||
can.page.style(can, can.ui.project, "z-index", 10, "position", "absolute")
|
can.page.style(can, can.ui.project, "z-index", 10, "position", "absolute", html.MAX_HEIGHT, can.ConfHeight()-120)
|
||||||
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
|
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth())
|
||||||
can.onmotion.hidden(can, can._action), can.onmotion.hidden(can, can._status)
|
can.onmotion.hidden(can, can._action), can.onmotion.hidden(can, can._status)
|
||||||
} else {
|
} else {
|
||||||
@ -11,7 +11,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) {},
|
|||||||
}
|
}
|
||||||
msg.Option(ice.MSG_ACTION, ""), cb && cb(msg)
|
msg.Option(ice.MSG_ACTION, ""), cb && cb(msg)
|
||||||
if (msg.IsDetail()) { can.onaction.center(can, can.onimport._item(can, msg.TableDetail())) } else {
|
if (msg.IsDetail()) { can.onaction.center(can, can.onimport._item(can, msg.TableDetail())) } else {
|
||||||
msg.Table(function(item) { can.onimport._item(can, item) }), can.ui.zone.favor._total(msg.Length())
|
msg.Table(function(item) { can.onimport._item(can, item) }), can.ui.zone.favor._total(msg.Length()), can.ui.zone.favor.toggle(true)
|
||||||
var item = can.db.list[can.db.hash[0]]; item && item.click()
|
var item = can.db.list[can.db.hash[0]]; item && item.click()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -33,7 +33,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) {},
|
|||||||
}, 500)
|
}, 500)
|
||||||
}, function(event) {
|
}, function(event) {
|
||||||
can.onaction.center(can, item), can.user.carteRight(event, can, {
|
can.onaction.center(can, item), can.user.carteRight(event, can, {
|
||||||
direction: function(event, button) { can.onaction[button](event, can, button) },
|
direction: function(event, button) { can.onaction[button](event, can, button, item) },
|
||||||
favor: function(event, button) { can.onaction.create(can.request(event, item), can, button) },
|
favor: function(event, button) { can.onaction.create(can.request(event, item), can, button) },
|
||||||
plugin: function(event, button) { can.user.input(can.request(event, item), can, [ctx.INDEX, ctx.ARGS], function(data) {
|
plugin: function(event, button) { can.user.input(can.request(event, item), can, [ctx.INDEX, ctx.ARGS], function(data) {
|
||||||
item.extra = can.base.Copy(item.extra||{}, data), can.onimport.plugin(can, item)
|
item.extra = can.base.Copy(item.extra||{}, data), can.onimport.plugin(can, item)
|
||||||
@ -49,8 +49,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) {},
|
|||||||
if (can.onmotion.cache(can, function() { return item.hash }, can.ui.profile)) { return true }
|
if (can.onmotion.cache(can, function() { return item.hash }, can.ui.profile)) { return true }
|
||||||
can.onappend.plugin(can, {space: item.space, index: extra.index, args: extra.args}, function(sub) { item._plugin = sub
|
can.onappend.plugin(can, {space: item.space, index: extra.index, args: extra.args}, function(sub) { item._plugin = sub
|
||||||
sub.onaction._close = function() { can.onmotion.hidden(can, can.ui.profile) }
|
sub.onaction._close = function() { can.onmotion.hidden(can, can.ui.profile) }
|
||||||
sub.onexport.output = function() { sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true)
|
sub.onexport.output = function() {
|
||||||
can.page.style(can, can.ui.profile, html.HEIGHT, can.ConfHeight()/2, html.WIDTH, can.ConfWidth()/2)
|
var width = (can.user.isMobile? can.ConfWidth()-120: can.ConfWidth()/2)
|
||||||
|
sub.onimport.size(sub, can.ConfHeight()/2, width, true)
|
||||||
|
can.page.style(can, can.ui.profile, html.HEIGHT, can.ConfHeight()/2, html.WIDTH, width)
|
||||||
}
|
}
|
||||||
}, can.ui.profile)
|
}, can.ui.profile)
|
||||||
return true
|
return true
|
||||||
|
@ -73,7 +73,6 @@ Volcanos(chat.ONACTION, {
|
|||||||
current: "定位", favor: "收藏",
|
current: "定位", favor: "收藏",
|
||||||
input: {
|
input: {
|
||||||
zoom: "缩放", pitch: "倾斜", rotation: "旋转",
|
zoom: "缩放", pitch: "倾斜", rotation: "旋转",
|
||||||
weather: "天气", temperature: "温度", humidity: "湿度", windPower: "风速",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
_point: function(event, can, item) { var rect = can.ui.content.getBoundingClientRect()
|
_point: function(event, can, item) { var rect = can.ui.content.getBoundingClientRect()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user