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); } })