wx-program
pangdundun 2024-01-22 09:42:36 +08:00
parent 857f77487e
commit b3f3feceba
42 changed files with 70 additions and 71 deletions

View File

@ -49,7 +49,8 @@
clearInterval(this.timer)&&this.timer
},
onShow() {
const that = this
// console.log('greenhouseDevice');
const that = this
this.timer=setInterval(function() {
uni.getStorage({
key: 'token',
@ -57,7 +58,7 @@
that.getEquipmentInfo(uni.getStorageSync('userid'))
}
})
}, 120000);
}, 60000);
},
onPullDownRefresh() {
uni.showLoading({

View File

@ -28,7 +28,8 @@
background: {
backgroundColor: '#24B383',
},
deviceList: []
deviceList: [],
timer:null
};
},
onLoad() {
@ -42,18 +43,23 @@
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
})
setInterval(function() {
},
onHide() {
clearInterval(this.timer)&&this.timer
},
onShow() {
// console.log('preciseWaterAndFertilizer');
const that = this
this.timer=setInterval(function() {
uni.getStorage({
key: 'token',
success: function(res) {
// uni.showLoading({
// title: '...'
// })
that.getEquipmentInfo(uni.getStorageSync('userid'))
}
})
}, 120000);
}, 60000);
},
onPullDownRefresh() {
uni.showLoading({

View File

@ -216,7 +216,7 @@
<span>*更新数据时间&nbsp;: &nbsp;{{ (updateTime.filter(el=> el.equipmentId == item1.deviceId)).length > 0 ? (updateTime.filter(el=> el.equipmentId == item1.deviceId))[0].updateTime : '暂无'}}</span>
</view>
</view>
</view>
</view>
</template>
@ -356,16 +356,9 @@
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
})
this.timer = setInterval(function() {
uni.getStorage({
key: 'token',
success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'))
},
})
}, 60000);
},
onShow() {
// console.log('timeEnvironment');
let that = this
clearInterval(that.timer) && that.timer
this.timer = setInterval(function() {
@ -491,7 +484,7 @@
} else {
this.updateTime.push('暂无')
}
console.log(this.updateTime,'this.updateTime');
// console.log(this.updateTime,'this.updateTime');
}).catch(err => {
console.log('接口失败');
})

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -213,6 +213,7 @@ var _default = {
clearInterval(this.timer) && this.timer;
},
onShow: function onShow() {
// console.log('greenhouseDevice');
var that = this;
this.timer = setInterval(function () {
uni.getStorage({
@ -221,7 +222,7 @@ var _default = {
that.getEquipmentInfo(uni.getStorageSync('userid'));
}
});
}, 120000);
}, 60000);
},
onPullDownRefresh: function onPullDownRefresh() {
uni.showLoading({

View File

@ -193,7 +193,8 @@ var _default = {
background: {
backgroundColor: '#24B383'
},
deviceList: []
deviceList: [],
timer: null
};
},
onLoad: function onLoad() {
@ -207,17 +208,21 @@ var _default = {
that.getEquipmentInfo(uni.getStorageSync('userid'));
}
});
setInterval(function () {
},
onHide: function onHide() {
clearInterval(this.timer) && this.timer;
},
onShow: function onShow() {
// console.log('preciseWaterAndFertilizer');
var that = this;
this.timer = setInterval(function () {
uni.getStorage({
key: 'token',
success: function success(res) {
// uni.showLoading({
// title: '加载中...'
// })
that.getEquipmentInfo(uni.getStorageSync('userid'));
}
});
}, 120000);
}, 60000);
},
onPullDownRefresh: function onPullDownRefresh() {
uni.showLoading({

View File

@ -783,16 +783,9 @@ var _default = {
that.getEquipmentInfo(uni.getStorageSync('userid'));
}
});
this.timer = setInterval(function () {
uni.getStorage({
key: 'token',
success: function success(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'));
}
});
}, 60000);
},
onShow: function onShow() {
// console.log('timeEnvironment');
var that = this;
clearInterval(that.timer) && that.timer;
this.timer = setInterval(function () {
@ -963,7 +956,7 @@ var _default = {
} else {
_this.updateTime.push('暂无');
}
console.log(_this.updateTime, 'this.updateTime');
// console.log(this.updateTime,'this.updateTime');
}).catch(function (err) {
console.log('接口失败');
});