forked from x/icebergs
add some
This commit is contained in:
parent
9ba006a1da
commit
daa740ffbe
@ -61,6 +61,8 @@ const (
|
|||||||
IMAGE = "image"
|
IMAGE = "image"
|
||||||
SUBMIT = "submit"
|
SUBMIT = "submit"
|
||||||
CHROME = "chrome"
|
CHROME = "chrome"
|
||||||
|
NEED = "need"
|
||||||
|
MUST = "must"
|
||||||
|
|
||||||
STYLE = "style"
|
STYLE = "style"
|
||||||
FLOAT = "float"
|
FLOAT = "float"
|
||||||
|
@ -217,6 +217,9 @@ const (
|
|||||||
WIKI_WORD = "web.wiki.word"
|
WIKI_WORD = "web.wiki.word"
|
||||||
WIKI_PORTAL = "web.wiki.portal"
|
WIKI_PORTAL = "web.wiki.portal"
|
||||||
CHAT_OAUTH_CLIENT = "web.chat.oauth.client"
|
CHAT_OAUTH_CLIENT = "web.chat.oauth.client"
|
||||||
|
CHAT_WX_ACCESS = "web.chat.wx.access"
|
||||||
|
CHAT_WX_TEMPLATE = "web.chat.wx.template"
|
||||||
|
CHAT_WX_OCR = "web.chat.wx.ocr"
|
||||||
CHAT_MESSAGE = "web.chat.message"
|
CHAT_MESSAGE = "web.chat.message"
|
||||||
CHAT_HEADER = "web.chat.header"
|
CHAT_HEADER = "web.chat.header"
|
||||||
CHAT_IFRAME = "web.chat.iframe"
|
CHAT_IFRAME = "web.chat.iframe"
|
||||||
|
1
conf.go
1
conf.go
@ -256,6 +256,7 @@ const ( // MSG
|
|||||||
LOG_TRACEID = "log.id"
|
LOG_TRACEID = "log.id"
|
||||||
|
|
||||||
MSG_NODETYPE = "node.type"
|
MSG_NODETYPE = "node.type"
|
||||||
|
MSG_NODENAME = "node.name"
|
||||||
MSG_FILES = "file.system"
|
MSG_FILES = "file.system"
|
||||||
FROM_SPACE = "from.space"
|
FROM_SPACE = "from.space"
|
||||||
FROM_DAEMON = "from.daemon"
|
FROM_DAEMON = "from.daemon"
|
||||||
|
@ -143,13 +143,15 @@ func init() {
|
|||||||
if ice.Info.NodeType == web.WORKER {
|
if ice.Info.NodeType == web.WORKER {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Option(ice.MSG_NODETYPE, ice.Info.NodeType)
|
|
||||||
kit.If(m.Option(ice.MSG_USERPOD), func(p string) {
|
kit.If(m.Option(ice.MSG_USERPOD), func(p string) {
|
||||||
m.Option(ice.MSG_NODETYPE, m.Cmdx(web.SPACE, p, cli.RUNTIME, ice.MSG_NODETYPE))
|
m.Option(ice.MSG_NODETYPE, m.Cmdx(web.SPACE, p, cli.RUNTIME, ice.MSG_NODETYPE))
|
||||||
|
m.Option(ice.MSG_NODENAME, m.Cmdx(web.SPACE, p, cli.RUNTIME, ice.MSG_NODENAME))
|
||||||
m.Option("favicon", m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), web.SPACE, ice.INFO).Append(mdb.ICONS))
|
m.Option("favicon", m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), web.SPACE, ice.INFO).Append(mdb.ICONS))
|
||||||
}, func() {
|
}, func() {
|
||||||
// m.Option("titles", ice.Info.Title())
|
m.Option(ice.MSG_NODETYPE, ice.Info.NodeType)
|
||||||
|
m.Option(ice.MSG_NODENAME, ice.Info.NodeName)
|
||||||
m.Option("favicon", ice.Info.NodeIcon)
|
m.Option("favicon", ice.Info.NodeIcon)
|
||||||
|
m.Option("titles", ice.Info.Titles)
|
||||||
})
|
})
|
||||||
m.Option(aaa.LANGUAGE, strings.ReplaceAll(strings.ToLower(kit.Select("", kit.Split(kit.GetValid(
|
m.Option(aaa.LANGUAGE, strings.ReplaceAll(strings.ToLower(kit.Select("", kit.Split(kit.GetValid(
|
||||||
func() string { return kit.Select("", "zh-cn", strings.Contains(m.Option(ice.MSG_USERUA), "zh_CN")) },
|
func() string { return kit.Select("", "zh-cn", strings.Contains(m.Option(ice.MSG_USERUA), "zh_CN")) },
|
||||||
|
6
meta.go
6
meta.go
@ -94,9 +94,9 @@ func (m *Message) Push(key string, value Any, arg ...Any) *Message {
|
|||||||
if v = kit.Value(value, k); v != nil {
|
if v = kit.Value(value, k); v != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if v = kit.Value(value, kit.Keys(EXTRA, k)); v != nil {
|
// if v = kit.Value(value, kit.Keys(EXTRA, k)); v != nil {
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
if v = val[k]; v != nil {
|
if v = val[k]; v != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,8 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
}
|
}
|
||||||
msg.Option(ice.MSG_ACTION, ""), can.require([msg.Option(nfs.SCRIPT)], function(can) {
|
msg.Option(ice.MSG_ACTION, ""), can.require([msg.Option(nfs.SCRIPT)], function(can) {
|
||||||
var debug = msg.isDebug() && can.user.info.userrole == aaa.TECH; debug && can.onmotion.toggle(can, can._fields, true)
|
var debug = msg.isDebug() && can.user.info.userrole == aaa.TECH; debug && can.onmotion.toggle(can, can._fields, true)
|
||||||
// debug = false
|
debug = false, can.onmotion.hidden(can, can._fields)
|
||||||
can.onmotion.hidden(can, can._fields)
|
|
||||||
wx.config({debug: debug, signature: msg.Option("signature"), timestamp: msg.Option("timestamp"), nonceStr: msg.Option("noncestr"), appId: msg.Option("appid"),
|
wx.config({debug: debug, signature: msg.Option("signature"), timestamp: msg.Option("timestamp"), nonceStr: msg.Option("noncestr"), appId: msg.Option("appid"),
|
||||||
openTagList: ["wx-open-subscribe"],
|
|
||||||
jsApiList: can.core.Item({
|
jsApiList: can.core.Item({
|
||||||
getLocation: function(can, cb) { wx.getLocation({type: "gcj02", success: function (res) {
|
getLocation: function(can, cb) { wx.getLocation({type: "gcj02", success: function (res) {
|
||||||
can.base.isFunc(cb) && cb({type: "gcj02", name: "当前位置", text: "当前位置", latitude: parseInt(res.latitude*100000), longitude: parseInt(res.longitude*100000) })
|
can.base.isFunc(cb) && cb({type: "gcj02", name: "当前位置", text: "当前位置", latitude: parseInt(res.latitude*100000), longitude: parseInt(res.longitude*100000) })
|
||||||
@ -17,23 +15,33 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
name: msg.Option(mdb.NAME), address: msg.Option(mdb.TEXT), infoUrl: msg.Option(web.LINK),
|
name: msg.Option(mdb.NAME), address: msg.Option(mdb.TEXT), infoUrl: msg.Option(web.LINK),
|
||||||
longitude: parseFloat(msg.Option(aaa.LONGITUDE)), latitude: parseFloat(msg.Option(aaa.LATITUDE)), scale: msg.Option("scale")||14,
|
longitude: parseFloat(msg.Option(aaa.LONGITUDE)), latitude: parseFloat(msg.Option(aaa.LATITUDE)), scale: msg.Option("scale")||14,
|
||||||
}) },
|
}) },
|
||||||
scanQRCode: function(can, cb) { wx.scanQRCode({needResult: cb? 1: 0, scanType: ["qrCode", "barCode"], success: function (res) {
|
|
||||||
can.base.isFunc(cb) && cb(can.base.ParseJSON(res.resultStr))
|
|
||||||
} }) },
|
|
||||||
chooseImage: function(can, cb, count) { wx.chooseImage({count: count||9, sourceType: ["camera", "album"], sizeType: ["original", "compressed"], success: function (res) {
|
chooseImage: function(can, cb, count) { wx.chooseImage({count: count||9, sourceType: ["camera", "album"], sizeType: ["original", "compressed"], success: function (res) {
|
||||||
can.base.isFunc(cb) && cb(res.localIds)
|
can.base.isFunc(cb) && cb(res.localIds)
|
||||||
} }) },
|
} }) },
|
||||||
uploadImage: function(can, id, cb) { wx.uploadImage({ localId: id, isShowProgressTips: 1, success: function (res) {
|
uploadImage: function(can, id, cb) { wx.uploadImage({ localId: id, isShowProgressTips: 1, success: function (res) {
|
||||||
can.base.isFunc(cb) && cb(res.serverId)
|
can.base.isFunc(cb) && cb(res.serverId)
|
||||||
} }) },
|
} }) },
|
||||||
|
previewImage: function(can, url, list) {
|
||||||
|
wx.previewImage({current: url, urls: list||[url]})
|
||||||
|
},
|
||||||
|
scanQRCode: function(can, cb) { wx.scanQRCode({needResult: cb? 1: 0, scanType: ["qrCode", "barCode"], success: function (res) {
|
||||||
|
can.base.isFunc(cb) && cb(can.base.ParseJSON(res.resultStr))
|
||||||
|
} }) },
|
||||||
}, function(key, value) { return can.user.agent[key] = value, key }).concat([
|
}, function(key, value) { return can.user.agent[key] = value, key }).concat([
|
||||||
"updateAppMessageShareData", "updateTimelineShareData",
|
"updateAppMessageShareData", "updateTimelineShareData",
|
||||||
]),
|
]), openTagList: ["wx-open-subscribe"],
|
||||||
})
|
})
|
||||||
wx.ready(function () {
|
wx.ready(function () {
|
||||||
|
function share(title, icons) {
|
||||||
|
wx.updateAppMessageShareData({title: title, desc: can.user.info.titles, link: location.href, imgUrl: icons})
|
||||||
|
wx.updateTimelineShareData({title: title, link: location.href, imgUrl: icons})
|
||||||
|
}
|
||||||
var p = can.misc.Resource(can, can.user.info.favicon); can.base.beginWith(p, "/") && (p = location.origin + p)
|
var p = can.misc.Resource(can, can.user.info.favicon); can.base.beginWith(p, "/") && (p = location.origin + p)
|
||||||
wx.updateAppMessageShareData({title: can.user.info.titles, desc: "车管所业务代办", link: location.href, imgUrl: p})
|
share(document.title, p)
|
||||||
wx.updateTimelineShareData({title: can.user.info.titles, link: location.href, imgUrl: p})
|
can.user.agent.init = function(can) { if (!can) { return }
|
||||||
|
p = can.misc.Resource(can, can.Conf(mdb.ICONS))||p; can.base.beginWith(p, "/") && (p = location.origin + p)
|
||||||
|
share(document.title, p)
|
||||||
|
}, can.user.agent.init(can.user.agent.cmd)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -42,8 +50,6 @@ Volcanos(chat.ONACTION, {
|
|||||||
list: [
|
list: [
|
||||||
"getLocation", "openLocation", "openAddress",
|
"getLocation", "openLocation", "openAddress",
|
||||||
"scanQRCode", "scanQRCode1",
|
"scanQRCode", "scanQRCode1",
|
||||||
"chooseImage", "uploadImage", "previewImage",
|
|
||||||
"updateAppMessageShareData", "updateTimelineShareData",
|
|
||||||
],
|
],
|
||||||
getLocation: function(event, can, button) {
|
getLocation: function(event, can, button) {
|
||||||
wx.getLocation({type: "gcj02", success: function (res) {
|
wx.getLocation({type: "gcj02", success: function (res) {
|
||||||
@ -76,39 +82,4 @@ Volcanos(chat.ONACTION, {
|
|||||||
can._output.innerHTML = res.resultStr
|
can._output.innerHTML = res.resultStr
|
||||||
} })
|
} })
|
||||||
},
|
},
|
||||||
uploadImage: function(event, can, button) {
|
|
||||||
wx.chooseImage({success: function (res) { can.core.List(res.localIds, function(item) {
|
|
||||||
wx.uploadImage({localId: item, isShowProgressTips: 1, success: function (res) {
|
|
||||||
var serverId = res.serverId;
|
|
||||||
can._output.innerHTML = serverId
|
|
||||||
} })
|
|
||||||
}) }})
|
|
||||||
},
|
|
||||||
chooseImage: function(event, can, button) {
|
|
||||||
wx.chooseImage({count: 9, sourceType: ["camera", "album"], sizeType: ["original", "compressed"], success: function (res) {
|
|
||||||
can.page.Append(can, can._output, can.core.List(res.localIds, function(item) {
|
|
||||||
return {img: item, style: {"max-width": can.ConfWidth()}}
|
|
||||||
}))
|
|
||||||
} })
|
|
||||||
},
|
|
||||||
previewImage: function(event, can, button) {
|
|
||||||
wx.previewImage({urls: [
|
|
||||||
"https://2021.shylinux.com/share/local/usr/icons/timg.png",
|
|
||||||
"https://2021.shylinux.com/share/local/usr/icons/mall.png",
|
|
||||||
]})
|
|
||||||
},
|
|
||||||
updateAppMessageShareData: function(event, can, button) {
|
|
||||||
wx.updateAppMessageShareData({
|
|
||||||
title: document.title, desc: "工具系统", link: location.href,
|
|
||||||
imgUrl: "https://2021.shylinux.com/share/local/usr/icons/timg.png",
|
|
||||||
success: function (res) { can._output.innerHTML = JSON.stringify(res) },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
updateTimelineShareData: function(event, can, button) {
|
|
||||||
wx.updateTimelineShareData({
|
|
||||||
title: document.title, desc: "工具系统", link: location.href,
|
|
||||||
imgUrl: "https://2021.shylinux.com/share/local/usr/icons/timg.png",
|
|
||||||
success: function (res) { can._output.innerHTML = JSON.stringify(res) },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user