添加了更换wifi名称的接口
This commit is contained in:
@@ -41,78 +41,19 @@ Component({
|
|||||||
if(res === 23) {
|
if(res === 23) {
|
||||||
app.globalData.ppScale.wifi.ssid = ssid;
|
app.globalData.ppScale.wifi.ssid = ssid;
|
||||||
app.globalData.ppScale.wifi.password = password;
|
app.globalData.ppScale.wifi.password = password;
|
||||||
|
|
||||||
this.triggerEvent('wifiEvent', {
|
|
||||||
status: true
|
|
||||||
});
|
|
||||||
|
|
||||||
// let mac = app.globalData.ppScale.device.mac;
|
let scaleDeviceId = app.globalData.ppScale.device.mac.replace(/:/g, '');
|
||||||
// let deviceId = app.globalData.ppScale.device.connection.deviceId;
|
if(scaleDeviceId) {
|
||||||
// if(mac && deviceId) {
|
let params = {
|
||||||
// let scaleDeviceId = mac.replace(/:/g, '');
|
equipmentCode: scaleDeviceId,
|
||||||
// let params = {
|
wifiName: ssid
|
||||||
// equipmentName: app.globalData.ppScale.device.name,
|
};
|
||||||
// scaleDeviceId: scaleDeviceId,
|
$.ajax("weighingScale/edit/device", params, "POST").then((res) => {
|
||||||
// deviceId: deviceId
|
this.triggerEvent('wifiEvent', {
|
||||||
// };
|
status: true
|
||||||
// $.ajax("weighingScale/binding/device", params, "POST").then(res => {
|
});
|
||||||
// if (res.success) {
|
})
|
||||||
// app.globalData.ppScale.activeProtocol.codeSetBindingState((res) => {
|
}
|
||||||
// console.log("setNetwork.js codeSetBindingState", res);
|
|
||||||
|
|
||||||
// if(res == 0) {
|
|
||||||
// this.triggerEvent('deviceEvent', {
|
|
||||||
// status: true
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// app.globalData.ppScale.plugin.Blue.disconnect();
|
|
||||||
// wx.showToast({
|
|
||||||
// title: "绑定失败,请重试。",
|
|
||||||
// icon: "none"
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// wx.navigateBack({
|
|
||||||
// delta: 2
|
|
||||||
// })
|
|
||||||
// }, 1500)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// app.globalData.ppScale.plugin.Blue.disconnect();
|
|
||||||
// wx.showToast({
|
|
||||||
// icon: "none",
|
|
||||||
// title: res.message
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// wx.navigateBack({
|
|
||||||
// delta: 2
|
|
||||||
// })
|
|
||||||
// }, 1500)
|
|
||||||
// }
|
|
||||||
// }).catch(err => {
|
|
||||||
// app.globalData.ppScale.plugin.Blue.disconnect();
|
|
||||||
// wx.showToast({
|
|
||||||
// icon: "none",
|
|
||||||
// title: err.message
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// wx.navigateBack({
|
|
||||||
// delta: 2
|
|
||||||
// })
|
|
||||||
// }, 1500)
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// app.globalData.ppScale.plugin.Blue.disconnect();
|
|
||||||
// wx.showToast({
|
|
||||||
// icon: "none",
|
|
||||||
// title: "Mac 地址与 deviceId 获取失败,请重新绑定"
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// wx.navigateBack({
|
|
||||||
// delta: 2
|
|
||||||
// })
|
|
||||||
// }, 1500)
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
app.globalData.ppScale.plugin.Blue.disconnect();
|
app.globalData.ppScale.plugin.Blue.disconnect();
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
|||||||
Reference in New Issue
Block a user