mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
mix github
This commit is contained in:
commit
bac4fa029e
@ -1,8 +1,8 @@
|
||||
const kit = require("utils/kit.js")
|
||||
|
||||
App({
|
||||
// data: {}, conf: {serve: "https://shylinux.com/chat", space: "mac"},
|
||||
data: {}, conf: {serve: "https://shylinux.com/chat", space: ""},
|
||||
data: {}, conf: {serve: "https://shylinux.com/chat", space: "mac"},
|
||||
// data: {}, conf: {serve: "https://shylinux.com/chat", space: ""},
|
||||
request: function(cmd, data, cb) { var app = this; data.sessid = app.conf.sessid, data.pod = app.conf.space
|
||||
wx.request({method: "POST", url: app.conf.serve+"/"+cmd, data: data, success: function(res) { var msg = res.data
|
||||
if (res.statusCode == 401) { return app.usercode(function() {app.request(cmd, data, cb)}) }
|
||||
|
@ -38,12 +38,21 @@ view.option view.select picker view {
|
||||
view.output {
|
||||
clear:both;
|
||||
}
|
||||
view.output>view.item {
|
||||
view.output view.item {
|
||||
text-align:center;
|
||||
font-size:18px;
|
||||
padding:10px;
|
||||
border:solid 1px green;
|
||||
}
|
||||
view.output view.list view.item {
|
||||
background-color:darkgray;
|
||||
margin-left:20px;
|
||||
}
|
||||
view.output view.code {
|
||||
margin-left:10px;
|
||||
padding:10px;
|
||||
border-left:solid 2px cyan;
|
||||
}
|
||||
|
||||
view.title {
|
||||
margin-top:20px;
|
||||
|
@ -4,8 +4,8 @@ const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
action: ["扫码", "清屏", "刷新", "串行", "并行", "共享"],
|
||||
river: "", storm: "", title: "",
|
||||
res: [], his: {}, inputs: {},
|
||||
river: "", storm: "",
|
||||
},
|
||||
action: {
|
||||
"扫码": function(event, page, data, name) {
|
||||
@ -19,7 +19,9 @@ Page({
|
||||
},
|
||||
"刷新": function(event, page, data, name) {
|
||||
var list = []; app.data[page.data.river+page.data.storm] = page.data.res = list
|
||||
wx.showLoading()
|
||||
app.request("action", {cmds: [page.data.river, page.data.storm]}, function(msg) {
|
||||
wx.hideLoading()
|
||||
msg.Table(function(line, index) {
|
||||
page.data.his[index] = []
|
||||
line.inputs = JSON.parse(line.inputs)
|
||||
@ -204,7 +206,9 @@ Page({
|
||||
if (cmds[i] === "") {cmds.pop()} else {break}
|
||||
}
|
||||
|
||||
wx.showLoading()
|
||||
app.request("action", {cmds: cmds}, function(msg) {
|
||||
wx.hideLoading()
|
||||
page.data.res[order].msg = msg
|
||||
page.setData({res: page.data.res})
|
||||
typeof cb == "function" && cb(msg)
|
||||
@ -276,8 +280,9 @@ Page({
|
||||
app.conf.sessid = options.sessid || app.conf.sessid
|
||||
this.data.river = options.river
|
||||
this.data.storm = options.storm
|
||||
|
||||
this.data.title = options.title
|
||||
app.title(options.title)
|
||||
|
||||
var data = app.data[options.river+options.storm]
|
||||
if (data) {return this.setData({res: this.data.res = data})}
|
||||
this.onaction({}, {}, "刷新")
|
||||
@ -293,11 +298,9 @@ Page({
|
||||
onShareAppMessage: function (res) {
|
||||
console.log(res)
|
||||
return {
|
||||
title: "some",
|
||||
path: "pages/action/action?river="+this.data.river+"&storm="+this.data.storm,
|
||||
success: function(res) {
|
||||
console.log(res)
|
||||
},
|
||||
title: this.data.title,
|
||||
path: "pages/action/action?river="+this.data.river+"&storm="+this.data.storm+"&title="+this.data.title,
|
||||
success: function(res) { console.log(res) },
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
<!-- 文本 -->
|
||||
<view class="output" wx:if="{{field.msg.result && field.feature && field.feature.display == 'inner'}}"><rich-text wx:for="{{field.msg.result}}" wx:key="name" nodes="{{item}}"></rich-text></view>
|
||||
<view class="output" wx:elif="{{field.msg.result}}"><text wx:for="{{field.msg.result}}" wx:key="name">{{item}}</text></view>
|
||||
<view class="code" wx:elif="{{field.msg.result}}"><text wx:for="{{field.msg.result}}" wx:key="name">{{item}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -4,7 +4,7 @@ const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
action: ["扫码", "刷新", "登录", "授权"],
|
||||
msg: {append: ["key", "name"]},
|
||||
river: {},
|
||||
},
|
||||
action: {
|
||||
"扫码": function(event, page, data, name) {
|
||||
@ -13,8 +13,13 @@ Page({
|
||||
})
|
||||
},
|
||||
"刷新": function(event, page, data, name) {
|
||||
wx.showLoading()
|
||||
app.request("river", {}, function(msg) {
|
||||
page.setData({msg: msg}), msg.nRow() == 1 && page.ondetail(event, data, 0)
|
||||
wx.hideLoading()
|
||||
var river = {}; msg.Table(function(value) {
|
||||
river[value.key] = value
|
||||
})
|
||||
page.setData({river: river})
|
||||
})
|
||||
},
|
||||
"登录": function(event, page, data, name) {
|
||||
@ -33,10 +38,30 @@ Page({
|
||||
console.log("action", "river", name)
|
||||
this.action[name](event, this, data)
|
||||
},
|
||||
ondetail: function(event, data, index) {
|
||||
data = data || event.target.dataset, index = index||data.index||0
|
||||
console.log("detail", "river", index)
|
||||
app.jumps("storm/storm", {river: this.data.msg.key[index], title: this.data.msg.name[index]})
|
||||
ondetail: function(event, data) { var page = this
|
||||
data = data || event.target.dataset.item
|
||||
|
||||
console.log("detail", "river", data)
|
||||
var river = page.data.river[data.key]
|
||||
if (river.tool) {
|
||||
river.hidetool = !river.hidetool
|
||||
page.setData({river: page.data.river})
|
||||
return
|
||||
}
|
||||
|
||||
wx.showLoading()
|
||||
app.request("storm", {cmds: [data.key]}, function(msg) {
|
||||
wx.hideLoading()
|
||||
river.tool = {}; msg.Table(function(value) {
|
||||
river.tool[value.key] = value
|
||||
value.river = data
|
||||
})
|
||||
page.setData({river: page.data.river})
|
||||
})
|
||||
},
|
||||
onchange: function(event, data) { var page = this
|
||||
data = data || event.target.dataset.item
|
||||
app.jumps("action/action", {river: data.river.key, storm: data.key, title: data.river.name+"."+data.name})
|
||||
},
|
||||
|
||||
onLoad: function (options) {
|
||||
|
@ -1,4 +1,12 @@
|
||||
<import src="../../app.wxml"/>
|
||||
|
||||
<template is="action" data="{{action}}"></template>
|
||||
<template is="list-name" data="{{msg}}"></template>
|
||||
|
||||
<view class="output">
|
||||
<view class="item" wx:for="{{river}}" wx:key="name">
|
||||
<view class="item" bindtap="ondetail" data-item="{{item}}">{{item.name}}</view>
|
||||
<view class="list" wx:if="{{!item.hidetool}}">
|
||||
<view class="item" bindtap="onchange" wx:for="{{item.tool}}" wx:key="name" data-item="{{item}}">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
4
client/mp/plugin/story/paste.js
Normal file
4
client/mp/plugin/story/paste.js
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
module.exports = {
|
||||
onimport: function() {},
|
||||
}
|
1
client/mp/plugin/story/paste.wxml
Normal file
1
client/mp/plugin/story/paste.wxml
Normal file
@ -0,0 +1 @@
|
||||
hello wrold
|
@ -77,10 +77,10 @@
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"id": 4,
|
||||
"name": "pages/action/action",
|
||||
"pathName": "pages/action/action",
|
||||
"query": "river=d82c1d&storm=f7a8c9&title=mac.hi",
|
||||
"query": "river=d82c1d&storm=12d1d7&title=mac.paste",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
|
24
plugin/story/paste.js
Normal file
24
plugin/story/paste.js
Normal file
@ -0,0 +1,24 @@
|
||||
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, list, cb, target) { can._output.innerHTML = "";
|
||||
can.ui = can.page.Append(can, can._target, [
|
||||
{view: ["content", "div"]}, {view: ["display", "pre"]},
|
||||
])
|
||||
can.onappend.table(can, can.ui.content, "table", msg)
|
||||
can.onappend.board(can, can.ui.display, "board", msg)
|
||||
return typeof cb == "function" && cb(msg)
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "控件交互", list: [],
|
||||
onclick: function(event, can) {
|
||||
can.run(event, [], function() {})
|
||||
},
|
||||
})
|
||||
Volcanos("ondetail", {help: "控件交互", list: ["编辑", "删除"],
|
||||
"编辑": function(event, can, key) {
|
||||
console.log(key)
|
||||
},
|
||||
"删除": function(event, can, key) {
|
||||
console.log(key)
|
||||
},
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user