2025年4月2日17:58:50

This commit is contained in:
17792275749
2025-04-02 17:58:52 +08:00
parent a706b0ecbb
commit cb50138e38
5 changed files with 32 additions and 16 deletions
+4 -2
View File
@@ -5,13 +5,15 @@ App({
globalData: {
// wx.request 请求的服务地址
wxRequestUrl: "https://device.shuziweidao.com/gateway/",
// wxRequestUrl: "https://device.shuziweidao.com/gateway/",
wxRequestUrl: "http://192.168.10.173:8889/",
// 秤的所有信息
ppScale: {
plugin: null,
activeProtocol: null,
domain: "https://device.shuziweidao.com/gateway", // http://192.168.10.173:8889
// domain: "https://device.shuziweidao.com/gateway",
domain: "http://192.168.10.173:8889",
wifi: {
ssid: "",
password: ""
+10 -8
View File
@@ -8,13 +8,6 @@ Page({
},
onLoad(options) {
let name = app.globalData.ppScale.device.name;
let deviceSelect = app.globalData.ppScale.device.connection;
this.setData({
name: name ? name : deviceSelect.name,
deviceSelect: deviceSelect
})
app.globalData.ppScale.plugin.bus.subscribe("deviceConnect", (res) => {
console.log('connectedDevice ===》deviceConnect', res);
@@ -65,7 +58,7 @@ Page({
})
} else {
app.globalData.ppScale.device.name = this.data.name;
wx.navigateTo({
wx.redirectTo({
url: "/pages/connectionSuccessful/connectionSuccessful"
})
}
@@ -74,6 +67,14 @@ Page({
});
},
onShow() {
let deviceSelect = app.globalData.ppScale.device.connection;
this.setData({
name: deviceSelect.name,
deviceSelect: deviceSelect
})
},
nameInput(e) {
this.setData({
name: e.detail.value
@@ -90,6 +91,7 @@ Page({
title: "蓝牙配对中...",
mask: true
});
app.globalData.ppScale.device.name = name;
app.globalData.ppScale.plugin.Blue.createBLEConnection(deviceSelect);
} else {
wx.showToast({
@@ -3,7 +3,7 @@ const app = getApp();
Page({
// 获取wifi列表
openGetWifiList() {
wx.navigateTo({
wx.redirectTo({
url: "/pages/getWifiList/getWifiList"
})
}
+2 -2
View File
@@ -120,13 +120,13 @@ Page({
"deviceAccuracyType": 2,
"deviceCalcuteType": 3,
"deviceConnectType": 2,
"deviceFuncType": 32991,
"deviceFuncType": 223,
"deviceName": "CF568_G",
"devicePowerType": 3,
"deviceProtocolType": 3,
"deviceType": 1,
"deviceUnitType": "0,1,11",
"id": 7,
"id": 65,
"imgUrl": null,
"macAddressStart": 6,
"remark": null,
@@ -42,8 +42,9 @@ Page({
title: "正在同步用户信息,请稍等...",
mask: true
});
setSubUser();
this.setSubUser();
} else {
this.resetDevice();
app.globalData.ppScale.plugin.Blue.stop();
wx.switchTab({
url: "/pages/home/home"
@@ -75,8 +76,9 @@ Page({
this.setData({
['subUser.i']: i + 1
})
setSubUser();
this.setSubUser();
} else {
this.resetDevice();
app.globalData.ppScale.plugin.Blue.stop();
wx.hideLoading();
wx.switchTab({
@@ -86,6 +88,16 @@ Page({
})
},
resetDevice() {
app.globalData.ppScale.device = {
setting: [],
list: [],
mac: null,
name: "",
connection: null
}
},
// 获取家庭成员列表
getSubUser() {
let params = {};