state接口

pull/9/head
pangdundun 2023-10-08 17:12:17 +08:00
parent 4d0b9210e8
commit ffeb1a50d6
38 changed files with 74 additions and 63 deletions

View File

@ -201,8 +201,8 @@
signalCurrent: 0, signalCurrent: 0,
show: false, show: false,
rightList2: ['外控信号2#', rightList2: ['外控信号1#',
'外控信号1#', '外控信号2#',
'外控信号3#', '外控信号3#',
'外控信号4#', '外控信号4#',
'高液位信号', '高液位信号',
@ -243,11 +243,10 @@
// clearTimeout(this.timer) // clearTimeout(this.timer)
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.showLoading({ // uni.showLoading({
title: '加载中...' // title: '...'
}) // })
this.dataInit(); this.dataInit();
this.getReg();
}, },
methods: { methods: {
toWebView(id) { toWebView(id) {
@ -264,9 +263,9 @@
} }
}, },
dataInit() { dataInit() {
// uni.showLoading({ uni.showLoading({
// title: '...' title: '加载中...'
// }) })
const that = this const that = this
var deviceId = this.deviceId var deviceId = this.deviceId
var data = { var data = {
@ -297,9 +296,9 @@
}, },
getReg() { getReg() {
// uni.showLoading({ uni.showLoading({
// title: '...' title: '加载中...'
// }) })
const that = this const that = this
var data = { var data = {
equipmentId: this.deviceId, equipmentId: this.deviceId,
@ -314,7 +313,7 @@
// console.log(res, 11); // console.log(res, 11);
if (res.code == 200) { if (res.code == 200) {
uni.hideLoading() uni.hideLoading()
uni.stopPullDownRefresh(); // uni.stopPullDownRefresh();
this.inputData1 = res.data; this.inputData1 = res.data;
this.getType00(); this.getType00();
this.inputData1[10 + (this.indexs - 1) + '01'] = this.countData10(this.inputData1[10 + ( this.inputData1[10 + (this.indexs - 1) + '01'] = this.countData10(this.inputData1[10 + (
@ -397,7 +396,13 @@
var statusIndex = 8 var statusIndex = 8
for (var j = 0; j < statusIndex; j++) { for (var j = 0; j < statusIndex; j++) {
if (Number(number[number.length - 1 - j])) { if (Number(number[number.length - 1 - j])) {
this.right2Index.push(j) if (j = 0) {
this.right2Index.push(1)
} else if (j = 1) {
this.right2Index.push(0)
} else {
this.right2Index.push(j)
}
} }
} }
}, },

View File

@ -176,7 +176,7 @@
userId: res.data userId: res.data
} }
}).then(res => { }).then(res => {
// console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
that.userName = res.data.username; that.userName = res.data.username;
that.admin = that.user_level(res.data.userType); that.admin = that.user_level(res.data.userType);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -400,7 +400,7 @@ var _default = {
}], }],
signalCurrent: 0, signalCurrent: 0,
show: false, show: false,
rightList2: ['外控信号2#', '外控信号1#', '外控信号3#', '外控信号4#', '高液位信号', '中液位信号', '低液位信号', '电机信号'], rightList2: ['外控信号1#', '外控信号2#', '外控信号3#', '外控信号4#', '高液位信号', '中液位信号', '低液位信号', '电机信号'],
irrigate_value1: 0, irrigate_value1: 0,
irrigate_value2: 0, irrigate_value2: 0,
irrigate_value3: 0, irrigate_value3: 0,
@ -432,11 +432,10 @@ var _default = {
// clearTimeout(this.timer) // clearTimeout(this.timer)
}, },
onPullDownRefresh: function onPullDownRefresh() { onPullDownRefresh: function onPullDownRefresh() {
uni.showLoading({ // uni.showLoading({
title: '加载中...' // title: '加载中...'
}); // })
this.dataInit(); this.dataInit();
this.getReg();
}, },
methods: (_methods = { methods: (_methods = {
toWebView: function toWebView(id) { toWebView: function toWebView(id) {
@ -454,9 +453,9 @@ var _default = {
}, },
dataInit: function dataInit() { dataInit: function dataInit() {
var _this = this; var _this = this;
// uni.showLoading({ uni.showLoading({
// title: '加载中...' title: '加载中...'
// }) });
var that = this; var that = this;
var deviceId = this.deviceId; var deviceId = this.deviceId;
var data = { var data = {
@ -487,9 +486,9 @@ var _default = {
}, },
getReg: function getReg() { getReg: function getReg() {
var _this2 = this; var _this2 = this;
// uni.showLoading({ uni.showLoading({
// title: '加载中...' title: '加载中...'
// }) });
var that = this; var that = this;
var data = { var data = {
equipmentId: this.deviceId, equipmentId: this.deviceId,
@ -504,7 +503,7 @@ var _default = {
// console.log(res, 11); // console.log(res, 11);
if (res.code == 200) { if (res.code == 200) {
uni.hideLoading(); uni.hideLoading();
uni.stopPullDownRefresh(); // uni.stopPullDownRefresh();
_this2.inputData1 = res.data; _this2.inputData1 = res.data;
_this2.getType00(); _this2.getType00();
_this2.inputData1[10 + (_this2.indexs - 1) + '01'] = _this2.countData10(_this2.inputData1[10 + (_this2.indexs - 1) + '01']); _this2.inputData1[10 + (_this2.indexs - 1) + '01'] = _this2.countData10(_this2.inputData1[10 + (_this2.indexs - 1) + '01']);
@ -586,7 +585,13 @@ var _default = {
var statusIndex = 8; var statusIndex = 8;
for (var j = 0; j < statusIndex; j++) { for (var j = 0; j < statusIndex; j++) {
if (Number(number[number.length - 1 - j])) { if (Number(number[number.length - 1 - j])) {
this.right2Index.push(j); if (j = 0) {
this.right2Index.push(1);
} else if (j = 1) {
this.right2Index.push(0);
} else {
this.right2Index.push(j);
}
} }
} }
}, },

View File

@ -201,7 +201,7 @@ var _default = {
userId: res.data userId: res.data
} }
}).then(function (res) { }).then(function (res) {
// console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
that.userName = res.data.username; that.userName = res.data.username;
that.admin = that.user_level(res.data.userType); that.admin = that.user_level(res.data.userType);

View File

@ -2,6 +2,7 @@
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "wszhyWx", "projectname": "wszhyWx",
"setting": { "setting": {
"compileHotReLoad": true "compileHotReLoad": true,
"urlCheck": false
} }
} }