mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt mp
This commit is contained in:
parent
041f4ac34c
commit
3257626d81
2
frame.js
2
frame.js
@ -761,7 +761,7 @@ Volcanos("onmotion", {help: "动态交互", list: [], _init: function(can, targe
|
|||||||
can.page.Modify(can, target||can._output, "")
|
can.page.Modify(can, target||can._output, "")
|
||||||
},
|
},
|
||||||
hidden: function(can, target) {
|
hidden: function(can, target) {
|
||||||
can.page.Modify(can, target, {style: {display: "none"}})
|
can.page.Modify(can, target||can._target, {style: {display: "none"}})
|
||||||
},
|
},
|
||||||
toggle: function(can, target) {
|
toggle: function(can, target) {
|
||||||
can.page.Toggle(can, target)
|
can.page.Toggle(can, target)
|
||||||
|
@ -18,6 +18,14 @@ App({
|
|||||||
}; return max
|
}; return max
|
||||||
},
|
},
|
||||||
Table: function(cb) { var res = []
|
Table: function(cb) { var res = []
|
||||||
|
if (msg.append && msg.append[0] == "key" && msg.append[1] == "value") {
|
||||||
|
var line = {}; kit.List(msg.key, function(key, index) {
|
||||||
|
line[key] = msg.value[index]
|
||||||
|
})
|
||||||
|
typeof cb == "function" && cb(line, 0, 1)
|
||||||
|
return res.push(line), res
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < msg.Length(); i++) { var line = {}
|
for (var i = 0; i < msg.Length(); i++) { var line = {}
|
||||||
for (var k in msg.append) { line[msg.append[k]] = msg[msg.append[k]][i] }
|
for (var k in msg.append) { line[msg.append[k]] = msg[msg.append[k]][i] }
|
||||||
typeof cb == "function" && cb(line, i, msg.Length())
|
typeof cb == "function" && cb(line, i, msg.Length())
|
||||||
@ -107,9 +115,9 @@ App({
|
|||||||
}}) },
|
}}) },
|
||||||
location: function(cb) { wx.chooseLocation({success: function(res) {
|
location: function(cb) { wx.chooseLocation({success: function(res) {
|
||||||
typeof cb == "function" && cb({
|
typeof cb == "function" && cb({
|
||||||
name: res.name, text: res.address,
|
type: "gcj02", name: res.name, text: res.address,
|
||||||
latitude: parseInt(res.latitude * 100000),
|
|
||||||
longitude: parseInt(res.longitude * 100000),
|
longitude: parseInt(res.longitude * 100000),
|
||||||
|
latitude: parseInt(res.latitude * 100000),
|
||||||
})
|
})
|
||||||
}}) },
|
}}) },
|
||||||
|
|
||||||
|
@ -148,13 +148,48 @@ Page({
|
|||||||
app.toast("添加成功"), page.run(event, order)
|
app.toast("添加成功"), page.run(event, order)
|
||||||
})
|
})
|
||||||
}) },
|
}) },
|
||||||
upload: function() {
|
startLocalServiceDiscovery: function(event, page, order, cmd) {
|
||||||
|
wx.onLocalServiceFound(function(res) {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
|
||||||
|
wx.showLoading()
|
||||||
|
wx.startLocalServiceDiscovery({
|
||||||
|
serviceType: '_http._tcp.',
|
||||||
|
success: function(res) {
|
||||||
|
wx.hideLoading()
|
||||||
|
console.log(res)
|
||||||
},
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
getLocation: function(event, page, order, cmd) { app.location(function(res) {
|
getLocation: function(event, page, order, cmd) { app.location(function(res) {
|
||||||
page.run(event, order, kit.Simple("action", cmd, res), function() {
|
page.run(event, order, kit.Simple("action", cmd, res), function() {
|
||||||
app.toast("添加成功"), page.run(event, order)
|
app.toast("添加成功"), page.run(event, order)
|
||||||
})
|
})
|
||||||
}) },
|
}) },
|
||||||
|
chooseLocation: function(event, page, order, cmd) {
|
||||||
|
wx.chooseLocation({success: function(res) { res.text = res.address, delete(res.address)
|
||||||
|
page.run(event, order, kit.Simple("action", cmd, res), function() {
|
||||||
|
app.toast("添加成功"), page.run(event, order)
|
||||||
|
})
|
||||||
|
}})
|
||||||
|
},
|
||||||
|
|
||||||
|
getWifiList: function(event, page, order, cmd) {
|
||||||
|
wx.onGetWifiList(function(res) {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
|
||||||
|
wx.getWifiList(function(res) {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
openLocation: function(event, page, order, cmd) {
|
||||||
|
var list = page.data.list[order].msg.Table()
|
||||||
|
var data = list[event.currentTarget.dataset.index]||list[0]
|
||||||
|
wx.openLocation({name: data.name, address: data.text, latitude: parseInt(data.latitude)/100000.0, longitude: parseInt(data.longitude)/100000.0})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
onReady: function () {},
|
onReady: function () {},
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"minifyWXSS": true
|
"minifyWXSS": true
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.0.4",
|
"libVersion": "2.15.0",
|
||||||
"appid": "wxf4e5104d83476ed6",
|
"appid": "wxf4e5104d83476ed6",
|
||||||
"projectname": "%E7%BB%88%E7%AB%AF%E5%B7%A5%E5%85%B7%E9%93%BE",
|
"projectname": "%E7%BB%88%E7%AB%AF%E5%B7%A5%E5%85%B7%E9%93%BE",
|
||||||
"debugOptions": {
|
"debugOptions": {
|
||||||
@ -68,10 +68,10 @@
|
|||||||
"miniprogram": {
|
"miniprogram": {
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
"id": -1,
|
"id": 0,
|
||||||
"name": "pages/action/action",
|
"name": "pages/action/action",
|
||||||
"pathName": "pages/action/action",
|
"pathName": "pages/action/action",
|
||||||
"query": "river=2d506d&storm=8271a3&title=hi.scan",
|
"query": "river= e0a1eb&storm=c23ae3&title=hi.scan",
|
||||||
"scene": 1001
|
"scene": 1001
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user