Compare commits

..

2 Commits

Author SHA1 Message Date
liubaixun 3224184649 fix(merge): merge
merge

Signed-off-by: liubaixun <liubaixun@yinxiang.com>
2023-10-12 14:27:47 +08:00
pangdundun c36307ecd8 新增5s刷新和取消无用模块 2023-10-09 18:07:25 +08:00
45 changed files with 381 additions and 186 deletions

View File

@ -28,7 +28,8 @@
"path": "pages/preciseWaterAndFertilizer/preciseWaterAndFertilizer",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}, {

View File

@ -224,7 +224,7 @@
indexs: 1,
inputData1: [],
// timer: null
timer: null
};
},
watch: {
@ -234,13 +234,13 @@
this.deviceId = option.id
this.dataInit()
let that = this
// this.timer = setInterval(function() {
// that.dataInit();
// that.getReg();
// }, 3000);
this.timer = setInterval(function() {
that.dataInit();
}, 5000);
},
onUnload() {
// clearTimeout(this.timer)
let that = this
clearTimeout(that.timer)
},
onPullDownRefresh() {
// uni.showLoading({

View File

@ -1,14 +1,15 @@
<template>
<view class="preciseWaterAndFertilizer">
<u-navbar :background="background" :is-back='true' back-icon-color='#FFFFFF' :border-bottom="false"
title="精准水肥" title-color='#FFFFFF' :title-bold='true' title-size='32'></u-navbar>
<u-navbar :background="background" :is-back='true' back-icon-color='#FFFFFF' :border-bottom="false" title="精准水肥"
title-color='#FFFFFF' :title-bold='true' title-size='32'></u-navbar>
<view class="content">
<view class="item" v-for="item,index in deviceList" :key="index">
<image src="../../static/icon_precise.png" mode=""></image>
<view class="center">
<text>{{item.deviceTypeName}}</text>
<text>在线</text>
<text
:class="item.deviceState == 1 ? 'state' : 'state_act'">{{ item.deviceState == 1 ? "在线" : "离线"}}</text>
</view>
<view class="right" @click="toFertilizer(item)">
<text>状态</text>
@ -31,7 +32,9 @@
};
},
onLoad() {
const that= this
uni.showLoading({
title: '加载中...'
})
uni.getStorage({
key: 'token',
success: function(res) {
@ -43,6 +46,31 @@
})
}
})
const that = this
setInterval(function() {
uni.getStorage({
key: 'token',
success: function(res) {
uni.showLoading({
title: '加载中...'
})
that.getEquipmentInfo(uni.getStorageSync('userid'))
}
})
}, 120000);
},
onPullDownRefresh() {
uni.showLoading({
title: '加载中...'
})
const that = this
uni.getStorage({
key: 'token',
success: function(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'))
}
})
},
methods: {
// 线线
@ -59,9 +87,16 @@
url: this.api.sel_eqbyid + userid,
method: 'GET'
}).then(res => {
console.log(res, '根据用户id查询对应的设备数据');
// console.log(res, 'id');
if (res.code == 200) {
uni.hideLoading()
uni.stopPullDownRefresh();
this.deviceList = res.data
}else {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
})
}
})
},
@ -91,6 +126,7 @@
box-sizing: border-box;
padding: 0 20rpx 0 26rpx;
margin-bottom: 10rpx;
>image {
width: 60rpx;
height: 56rpx;
@ -109,7 +145,8 @@
color: #333333;
margin-right: 11rpx;
}
>text:nth-child(2){
>.state {
width: 66rpx;
height: 34rpx;
background: #EFFCF7;
@ -123,6 +160,21 @@
justify-content: center;
align-items: center;
}
>.state_act {
width: 66rpx;
height: 34rpx;
background: #F5F6FA;
border: 2px solid #E1E2E6;
border-radius: 17rpx;
font-size: 20rpx;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: #999999;
display: flex;
justify-content: center;
align-items: center;
}
}
.right {

View File

@ -40,7 +40,7 @@
</view>
</view>
<view class="testBase" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1">
<!-- <view class="testBase" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1">
<view class="nav">
<image src="../../static/base.png" mode=""></image>
<text>{{ item1.deviceTypeName }}</text>
@ -54,9 +54,9 @@
</view>
</view>
</view>
</view>
</view> -->
<view class="testBase1" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1">
<!-- <view class="testBase1" v-for="(item1,index1) in waterAndFertilizerParamsList" :key="index1">
<view class="nav">
<image src="../../static/testBase1.png" mode=""></image>
<text>{{ item1.deviceTypeName }}</text>
@ -67,7 +67,7 @@
<text>{{ getStatus(item2.equipmentNumber,item2.targetValue) + item2.environmentDataId }}</text>
<text>{{ item2.environmentData + getTypeList(item2.formula) }}</text>
</view>
</view>
</view> -->
</view>
</view>
</template>

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

@ -21388,7 +21388,8 @@ var _default = {
"path": "pages/preciseWaterAndFertilizer/preciseWaterAndFertilizer",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
}, {
"path": "pages/userCenter/userCenter",

View File

@ -412,24 +412,22 @@ var _default = {
left1Act: -1,
topActive: 0,
indexs: 1,
inputData1: []
// timer: null
inputData1: [],
timer: null
};
},
watch: {},
onLoad: function onLoad(option) {
this.deviceId = option.id;
this.dataInit();
var that = this;
// this.timer = setInterval(function() {
// that.dataInit();
// that.getReg();
// }, 3000);
this.timer = setInterval(function () {
that.dataInit();
}, 5000);
},
onUnload: function onUnload() {
// clearTimeout(this.timer)
var that = this;
clearTimeout(that.timer);
},
onPullDownRefresh: function onPullDownRefresh() {
// uni.showLoading({

View File

@ -185,6 +185,7 @@ exports.default = void 0;
//
//
//
//
var _default = {
data: function data() {
return {
@ -196,7 +197,9 @@ var _default = {
};
},
onLoad: function onLoad() {
var that = this;
uni.showLoading({
title: '加载中...'
});
uni.getStorage({
key: 'token',
success: function success(res) {
@ -208,6 +211,30 @@ var _default = {
});
}
});
var that = this;
setInterval(function () {
uni.getStorage({
key: 'token',
success: function success(res) {
uni.showLoading({
title: '加载中...'
});
that.getEquipmentInfo(uni.getStorageSync('userid'));
}
});
}, 120000);
},
onPullDownRefresh: function onPullDownRefresh() {
uni.showLoading({
title: '加载中...'
});
var that = this;
uni.getStorage({
key: 'token',
success: function success(res) {
that.getEquipmentInfo(uni.getStorageSync('userid'));
}
});
},
methods: {
// 离线或者在线
@ -224,9 +251,16 @@ var _default = {
url: this.api.sel_eqbyid + userid,
method: 'GET'
}).then(function (res) {
console.log(res, '根据用户id查询对应的设备数据');
// console.log(res, '根据用户id查询对应的设备数据');
if (res.code == 200) {
uni.hideLoading();
uni.stopPullDownRefresh();
_this.deviceList = res.data;
} else {
_this.$refs.uToast.show({
title: res.msg,
type: 'error'
});
}
});
}

View File

@ -1,6 +1,7 @@
{
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": true,
"usingComponents": {
"u-navbar": "/node-modules/uview-ui/components/u-navbar/u-navbar"
}

View File

@ -1 +1 @@
<view class="preciseWaterAndFertilizer"><u-navbar vue-id="cdd718f8-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="精准水肥" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" bind:__l="__l"></u-navbar><view class="content"><block wx:for="{{deviceList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item"><image src="../../static/icon_precise.png" mode></image><view class="center"><text>{{item.deviceTypeName}}</text><text>在线</text></view><view data-event-opts="{{[['tap',[['toFertilizer',['$0'],[[['deviceList','',index]]]]]]]}}" class="right" bindtap="__e"><text>状态</text><image src="../../static/right-arrow.png" mode></image></view></view></block></view></view>
<view class="preciseWaterAndFertilizer"><u-navbar vue-id="cdd718f8-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="精准水肥" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" bind:__l="__l"></u-navbar><view class="content"><block wx:for="{{deviceList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="item"><image src="../../static/icon_precise.png" mode></image><view class="center"><text>{{item.deviceTypeName}}</text><text class="{{[item.deviceState==1?'state':'state_act']}}">{{item.deviceState==1?"在线":"离线"}}</text></view><view data-event-opts="{{[['tap',[['toFertilizer',['$0'],[[['deviceList','',index]]]]]]]}}" class="right" bindtap="__e"><text>状态</text><image src="../../static/right-arrow.png" mode></image></view></view></block></view></view>

View File

@ -63,7 +63,7 @@
color: #333333;
margin-right: 11rpx;
}
.preciseWaterAndFertilizer .content .item .center > text:nth-child(2) {
.preciseWaterAndFertilizer .content .item .center > .state {
width: 66rpx;
height: 34rpx;
background: #EFFCF7;
@ -77,6 +77,20 @@
justify-content: center;
align-items: center;
}
.preciseWaterAndFertilizer .content .item .center > .state_act {
width: 66rpx;
height: 34rpx;
background: #F5F6FA;
border: 2px solid #E1E2E6;
border-radius: 17rpx;
font-size: 20rpx;
font-family: PingFang-SC-Bold;
font-weight: bold;
color: #999999;
display: flex;
justify-content: center;
align-items: center;
}
.preciseWaterAndFertilizer .content .item .right {
width: 120rpx;
height: 54rpx;

View File

@ -145,53 +145,11 @@ var render = function () {
}
}
)
var l3 = _vm.__map(
_vm.waterAndFertilizerParamsList,
function (item1, index1) {
var $orig = _vm.__get_orig(item1)
var l2 = _vm.__map(item1.childList, function (item2, index2) {
var $orig = _vm.__get_orig(item2)
var m2 = _vm.getStatus(item2.equipmentNumber, item2.targetValue)
var m3 = _vm.getTypeList(item2.formula)
return {
$orig: $orig,
m2: m2,
m3: m3,
}
})
return {
$orig: $orig,
l2: l2,
}
}
)
var l5 = _vm.__map(
_vm.waterAndFertilizerParamsList,
function (item1, index1) {
var $orig = _vm.__get_orig(item1)
var l4 = _vm.__map(item1.childList, function (item2, index2) {
var $orig = _vm.__get_orig(item2)
var m4 = _vm.getStatus(item2.equipmentNumber, item2.targetValue)
var m5 = _vm.getTypeList(item2.formula)
return {
$orig: $orig,
m4: m4,
m5: m5,
}
})
return {
$orig: $orig,
l4: l4,
}
}
)
_vm.$mp.data = Object.assign(
{},
{
$root: {
l1: l1,
l3: l3,
l5: l5,
},
}
)

View File

@ -1 +1,5 @@
<<<<<<< HEAD
<view class="timeEnvironment data-v-34c343d8"><u-navbar vue-id="63a4351c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时环境" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-34c343d8" bind:__l="__l"></u-navbar><view class="navbar data-v-34c343d8"><image src="https://cdn.lihe-control.com/static/timeEnvironment_bg.png" mode class="data-v-34c343d8"></image></view><view class="content data-v-34c343d8"><view class="title data-v-34c343d8"><image src="../../static/logo_1.png" mode class="data-v-34c343d8"></image><view class="right data-v-34c343d8"><view class="data-v-34c343d8">温室智慧云</view><view class="data-v-34c343d8">Greenhouse wisdom Cloud</view></view></view><view class="subtitle data-v-34c343d8">欢迎使用温室智慧云数据统计</view><block wx:for="{{$root.l1}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="waterAndFertilizerParams data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/PH.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text></view><view class="detail data-v-34c343d8"><block wx:for="{{item1.l0}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/icon'+(index2+1<9?index2+1:1)+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m0+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m1}}</view></view></view></block></view></view></block><block wx:for="{{$root.l3}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="testBase data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/base.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text></view><view class="detail data-v-34c343d8"><block wx:for="{{item1.l2}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/icon@'+(item2.$orig.formula?item2.$orig.formula:1)+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m2+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m3}}</view></view></view></block></view></view></block><block wx:for="{{$root.l5}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="testBase1 data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/testBase1.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text><text class="data-v-34c343d8">温室#1</text></view><block wx:for="{{item1.l4}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/'+(index2+1<5?index2+1:1)+'.png'}}" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item2.m4+item2.$orig.environmentDataId}}</text><text class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m5}}</text></view></block></view></block></view></view>
=======
<view class="timeEnvironment data-v-34c343d8"><u-navbar vue-id="63a4351c-1" background="{{background}}" is-back="{{true}}" back-icon-color="#FFFFFF" border-bottom="{{false}}" title="实时环境" title-color="#FFFFFF" title-bold="{{true}}" title-size="32" class="data-v-34c343d8" bind:__l="__l"></u-navbar><view class="navbar data-v-34c343d8"><image src="../../static/timeEnvironment_bg.png" mode class="data-v-34c343d8"></image></view><view class="content data-v-34c343d8"><view class="title data-v-34c343d8"><image src="../../static/logo_1.png" mode class="data-v-34c343d8"></image><view class="right data-v-34c343d8"><view class="data-v-34c343d8">温室智慧云</view><view class="data-v-34c343d8">Greenhouse wisdom Cloud</view></view></view><view class="subtitle data-v-34c343d8">欢迎使用温室智慧云数据统计</view><block wx:for="{{$root.l1}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="waterAndFertilizerParams data-v-34c343d8"><view class="nav data-v-34c343d8"><image src="../../static/PH.png" mode class="data-v-34c343d8"></image><text class="data-v-34c343d8">{{item1.$orig.deviceTypeName}}</text></view><view class="detail data-v-34c343d8"><block wx:for="{{item1.l0}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view data-event-opts="{{[['tap',[['toTarget_water_fertilizer_PH',['$0','$1'],[[['waterAndFertilizerParamsList','',index1],['childList','',index2,'equipmentId']],[['waterAndFertilizerParamsList','',index1],['childList','',index2,'environmentData']]]]]]]}}" class="item data-v-34c343d8" bindtap="__e"><image src="{{'../../static/icon/icon'+(index2+1<9?index2+1:1)+'.png'}}" mode class="data-v-34c343d8"></image><view class="info data-v-34c343d8"><view class="data-v-34c343d8">{{item2.m0+item2.$orig.environmentDataId}}</view><view class="data-v-34c343d8">{{item2.$orig.environmentData+item2.m1}}</view></view></view></block></view></view></block></view></view>
>>>>>>> wx-program