1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shaoying 2021-02-09 10:50:19 +08:00
parent 041f4ac34c
commit 3257626d81
4 changed files with 125 additions and 82 deletions

View File

@ -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)

View File

@ -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),
}) })
}}) }, }}) },

View File

@ -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 () {},

View File

@ -1,80 +1,80 @@
{ {
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": { "packOptions": {
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": true, "minified": true,
"newFeature": true, "newFeature": true,
"coverView": true, "coverView": true,
"nodeModules": false, "nodeModules": false,
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false, "uglifyFileName": false,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"useMultiFrameRuntime": false, "useMultiFrameRuntime": false,
"useApiHook": true, "useApiHook": true,
"babelSetting": { "babelSetting": {
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}, },
"enableEngineNative": false, "enableEngineNative": false,
"bundle": false, "bundle": false,
"useIsolateContext": true, "useIsolateContext": true,
"useCompilerModule": true, "useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false, "userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"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": {
"hidedInDevtools": [] "hidedInDevtools": []
}, },
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {
"search": { "search": {
"list": [] "list": []
}, },
"conversation": { "conversation": {
"list": [] "list": []
}, },
"plugin": { "plugin": {
"list": [] "list": []
}, },
"game": { "game": {
"currentL": -1, "currentL": -1,
"list": [] "list": []
}, },
"gamePlugin": { "gamePlugin": {
"list": [] "list": []
}, },
"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
} }
] ]
} }
} }
} }