45 lines
954 B
JavaScript
45 lines
954 B
JavaScript
const app = getApp();
|
|
import $ from "../../utils/request";
|
|
|
|
Page({
|
|
data: {
|
|
deviceInfo: null,
|
|
},
|
|
|
|
onShow() {
|
|
this.getDevice();
|
|
},
|
|
|
|
// 获取已经绑定的设备列表
|
|
getDevice() {
|
|
let params = {};
|
|
$.ajax("weighingScale/list/device", params, "GET", false).then((res) => {
|
|
this.setData({
|
|
deviceInfo: res.result[0]
|
|
})
|
|
})
|
|
},
|
|
|
|
openReplaceNetwork() {
|
|
wx.navigateTo({
|
|
url: "/pages/replaceNetwork/replaceNetwork"
|
|
})
|
|
},
|
|
|
|
delDevice() {
|
|
let params = {
|
|
equipmentCode: this.data.deviceInfo.equipmentCode,
|
|
};
|
|
$.ajax("weighingScale/del/device", params, "POST", true, "正在解绑设备...").then(res_ => {
|
|
wx.showToast({
|
|
icon: "none",
|
|
title: res_.message,
|
|
})
|
|
setTimeout(() => {
|
|
wx.navigateBack({
|
|
delta: 1
|
|
})
|
|
}, 1500);
|
|
});
|
|
}
|
|
}) |