第一版
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
App({
|
||||
onLaunch() {
|
||||
this.initPpScale();
|
||||
},
|
||||
|
||||
globalData: {
|
||||
// wx.request 请求的服务地址
|
||||
wxRequestUrl: "http://device.shuziweidao.com:8889/",
|
||||
|
||||
// 秤的所有信息
|
||||
ppScale: {
|
||||
plugin: null,
|
||||
activeProtocol: null,
|
||||
domain: "http://device.shuziweidao.com:8889", // http://192.168.10.173:8889
|
||||
wifi: {
|
||||
ssid: "",
|
||||
password: ""
|
||||
},
|
||||
options: {
|
||||
key: "lefudc91611833e18d94",
|
||||
secret: "eQ50JYimMp0X7uhNLj6D3lTEk4TUUvEG7dvaqKM9t1U="
|
||||
},
|
||||
device: {
|
||||
setting: [], // 即将要搜索周边秤的配置
|
||||
list: [], // 根据配置搜索到秤的列表
|
||||
mac: null, // 选中的设备mac地址/SN码
|
||||
name: "", // 设备名称
|
||||
connection: null, // 默认选中连接的设备
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
initPpScale() {
|
||||
this.globalData.ppScale.plugin = requirePlugin('ppScale-plugin');
|
||||
const plugin = this.globalData.ppScale.plugin;
|
||||
|
||||
plugin.bus.subscribe("connectState", (res) => {
|
||||
console.log("app.js ===> connectState", res);
|
||||
});
|
||||
|
||||
plugin.bus.subscribe("devicesModel", (res) => {
|
||||
console.log('app.js devicesModel', res);
|
||||
this.globalData.ppScale.device.mac = res.deviceMac;
|
||||
});
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user