2025年4月2日19:51:49
This commit is contained in:
@@ -13,30 +13,43 @@ Page({
|
||||
app.globalData.ppScale.wifi.ssid = ssid;
|
||||
app.globalData.ppScale.wifi.password = password;
|
||||
|
||||
let scaleDeviceId = app.globalData.ppScale.device.mac.replace(/:/g, '');
|
||||
let params = {
|
||||
equipmentName: app.globalData.ppScale.device.name,
|
||||
scaleDeviceId: scaleDeviceId,
|
||||
};
|
||||
$.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"
|
||||
let mac = app.globalData.ppScale.device.mac;
|
||||
if(mac) {
|
||||
let scaleDeviceId = mac.replace(/:/g, '');
|
||||
let params = {
|
||||
equipmentName: app.globalData.ppScale.device.name,
|
||||
scaleDeviceId: scaleDeviceId,
|
||||
};
|
||||
$.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"
|
||||
})
|
||||
})
|
||||
}).catch(err => {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
title: err.message
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.switchTab({
|
||||
url: "/pages/home/home"
|
||||
})
|
||||
}, 1500)
|
||||
})
|
||||
}).catch(err => {
|
||||
} else {
|
||||
wx.showToast({
|
||||
icon: "none",
|
||||
title: err.message
|
||||
title: "Mac 地址获取失败,请重新绑定"
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.switchTab({
|
||||
url: "/pages/home/home"
|
||||
})
|
||||
}, 1500)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user