From ade0ef80343bcce323d4466431f7bbf6b6b43df0 Mon Sep 17 00:00:00 2001 From: 17792275749 <812100002@qq.com> Date: Wed, 7 May 2025 09:27:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9636=20=E5=92=8C=20568?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF=E3=80=81=E9=85=8D?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=BD=93=E9=87=8D=E7=A7=A4?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 +-- .../devices/{CF568_G.png => YX-B4-568-BW.png} | Bin .../devices/{CF636_G.png => YX-B8-636-BW.png} | Bin pages/setNetwork/setNetwork.js | 24 +++++++++++++----- pages/userInfo/userInfo.js | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) rename images/devices/{CF568_G.png => YX-B4-568-BW.png} (100%) rename images/devices/{CF636_G.png => YX-B8-636-BW.png} (100%) diff --git a/app.js b/app.js index ea52ae5..b1db9b1 100644 --- a/app.js +++ b/app.js @@ -31,7 +31,7 @@ App({ "deviceCalcuteType": 3, "deviceConnectType": 2, "deviceFuncType": 223, - "deviceName": "CF568_G", + "deviceName": "YX-B4-568-BW", "devicePowerType": 3, "deviceProtocolType": 3, "deviceType": 1, @@ -52,7 +52,7 @@ App({ "deviceCalcuteType": 4, "deviceConnectType": 2, "deviceFuncType": 65759, - "deviceName": "CF636_G", + "deviceName": "YX-B8-636-BW", "devicePowerType": 3, "deviceProtocolType": 3, "deviceType": 1, diff --git a/images/devices/CF568_G.png b/images/devices/YX-B4-568-BW.png similarity index 100% rename from images/devices/CF568_G.png rename to images/devices/YX-B4-568-BW.png diff --git a/images/devices/CF636_G.png b/images/devices/YX-B8-636-BW.png similarity index 100% rename from images/devices/CF636_G.png rename to images/devices/YX-B8-636-BW.png diff --git a/pages/setNetwork/setNetwork.js b/pages/setNetwork/setNetwork.js index 0e9e394..d1c071d 100644 --- a/pages/setNetwork/setNetwork.js +++ b/pages/setNetwork/setNetwork.js @@ -26,13 +26,25 @@ Page({ deviceId: deviceId }; $.ajax("weighingScale/binding/device", params, "POST").then(res => { - app.globalData.ppScale.activeProtocol.codeSetBindingState((res) => { - console.log("setNetwork.js codeSetBindingState", res); - - wx.navigateTo({ - url: "/pages/setNetworkSuccessful/setNetworkSuccessful" + if (res.success) { + app.globalData.ppScale.activeProtocol.codeSetBindingState((res) => { + console.log("setNetwork.js codeSetBindingState", res); + + wx.navigateTo({ + url: "/pages/setNetworkSuccessful/setNetworkSuccessful" + }) }) - }) + } else { + wx.showToast({ + icon: "none", + title: res.message + }) + setTimeout(() => { + wx.switchTab({ + url: "/pages/home/home" + }) + }, 1500) + } }).catch(err => { wx.showToast({ icon: "none", diff --git a/pages/userInfo/userInfo.js b/pages/userInfo/userInfo.js index e2aba56..d752193 100644 --- a/pages/userInfo/userInfo.js +++ b/pages/userInfo/userInfo.js @@ -195,7 +195,7 @@ Page({ }) let seviceList = []; app.globalData.ppScale.device.setting.map(item => { - if(this.data.deviceInfo.type === item.deviceName) { + if(this.data.deviceInfo && this.data.deviceInfo.type === item.deviceName) { seviceList.push(item); } })