45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
App({
|
|
onLaunch() {
|
|
this.initPpScale();
|
|
},
|
|
|
|
globalData: {
|
|
// wx.request 请求的服务地址
|
|
// wxRequestUrl: "https://device.shuziweidao.com/gateway/",
|
|
wxRequestUrl: "http://192.168.10.173:8889/",
|
|
|
|
// 秤的所有信息
|
|
ppScale: {
|
|
plugin: null,
|
|
activeProtocol: null,
|
|
// domain: "https://device.shuziweidao.com/gateway",
|
|
domain: "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);
|
|
|
|
wx.hideLoading();
|
|
});
|
|
},
|
|
}) |