1
This commit is contained in:
parent
c0309dafef
commit
86e4aae012
@ -16,7 +16,8 @@ const variable = {
|
||||
name: "", //应用名字
|
||||
whatType: type, //判断当前是哪端
|
||||
// baseUrl: "http://jiaxingtest.a1.luyouxia.net:19159", //本地测试接口的基础路径
|
||||
baseUrl: "https://api.lihe-control.com", //线上接口的基础路径
|
||||
// baseUrl: "https://api.lihe-control.com", //线上接口的基础路径
|
||||
baseUrl: "http://jiaxingtest.f1.luyouxia.net:13996", //线上接口的基础路径
|
||||
|
||||
|
||||
mapKey: "", //jsapi
|
||||
|
@ -6,8 +6,8 @@
|
||||
<view class="content">
|
||||
<view class="output_valve">
|
||||
<view class="title">
|
||||
<image src="../../static/output_valve.png" mode=""></image>
|
||||
<text>输出电磁阀</text>
|
||||
<text> <image src="../../static/output_valve.png" mode=""></image>
|
||||
<text>输出电磁阀</text></text>
|
||||
</view>
|
||||
<view class="detail">
|
||||
<template v-for="(item,index) in 64">
|
||||
@ -81,7 +81,30 @@
|
||||
<view :class="right2Index.indexOf(index + 4) != -1?'item_act':'item'" v-for="(item,index) in rightList2.slice(4, 8)" :key="index">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="output_valve stir-value" v-if="fertilizerType==1">
|
||||
<view class="title">
|
||||
<text>搅拌配置</text>
|
||||
<template>
|
||||
<view class="u-flex">
|
||||
<text>启动方式:{{openTypeStir}}</text>
|
||||
<view class="right" @click="showStir()">
|
||||
<text class="set-text">设置</text>
|
||||
<image src="../../static/downArrow.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
<view class="detail">
|
||||
<template v-for="(item,index) in stirListShow">
|
||||
<view class="item" :class="stirList[index]==1?'active':''" :key="index">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="set">
|
||||
<view class="item" v-for="(item,index) in readFs_byid_name_list" :key="index" @click="showPop(index+1)">
|
||||
<view class="left">
|
||||
@ -105,6 +128,7 @@
|
||||
<view class="control_model">
|
||||
<view class="control">
|
||||
控制模式:
|
||||
|
||||
</view>
|
||||
<view class="model">
|
||||
<text @click="change00(1)" :class="topActive==1?'stop_act':'stop'"
|
||||
@ -205,7 +229,7 @@
|
||||
</view>
|
||||
|
||||
<view class="line_pop"></view>
|
||||
<view class="changeMoreBtn" @click="toWebView(indexs)">
|
||||
<view class="changeMoreBtn" @click="toWebView(indexs,'irrigateSet')">
|
||||
<image src="../../static/changeMore.png" mode=""></image>
|
||||
<text>修改更多参数</text>
|
||||
</view>
|
||||
@ -214,6 +238,65 @@
|
||||
<image src="../../static/closed.png" mode="" @click="closePop"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 搅拌程序弹窗 -->
|
||||
<u-popup v-model="stirshow" mode="center" :mask-close-able='false' width="640rpx"
|
||||
:closeable='false'>
|
||||
<view class="contentPop">
|
||||
<view class="contentPop_box">
|
||||
<view class="title">
|
||||
搅拌配置
|
||||
</view>
|
||||
<view class="control_model">
|
||||
<view class="control">
|
||||
控制模式: <view class="model">
|
||||
<text @click="changeOpen(0)" :class="inputData2['600'] == 0?'stop':'stop_act'"
|
||||
class="stop">{{inputData2['600'] == 0?'无效':'有效'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="model">
|
||||
<text @click="change600(2)" :class="topActive2[2] == 1?'stop_act':'stop'"
|
||||
class="stop">停止</text>
|
||||
<text @click="change600(1)" :class="topActive2[1] == 1?'hand_act':'hand'" class="hand"
|
||||
style="width: 140rpx;">手动启动</text>
|
||||
<text @click="change600(0)" :class="topActive2[0] == 1?'auto_act':'auto'">自动</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line_pop"></view>
|
||||
<view class="irrigate_time1">
|
||||
手动启动时间
|
||||
<view class="irrigate_input">
|
||||
<input v-model="inputData2['601']"
|
||||
@blur="changeData10('601', $event)" type="digit" placeholder="0"
|
||||
step="0.1" />
|
||||
<!-- <u-input v-model="inputData[10 + (indexs - 1) + '01']" type="text" :border="false" input-align='center'
|
||||
height='66' :clearable='false' /> -->
|
||||
</view>
|
||||
分钟
|
||||
</view>
|
||||
|
||||
<view class="line_pop"></view>
|
||||
<view class="output_valve stir-value-popup">
|
||||
|
||||
<view class="title">手自动启动搅拌电机选择:</view>
|
||||
<view class="detail">
|
||||
<template v-for="(item,index) in stirListShow">
|
||||
<view @click="changeIndexOpen1(index)" class="item" :class="stirpopupList[index]==1?'active':''" :key="index">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line_pop"></view>
|
||||
<view class="changeMoreBtn" @click="toWebView(0,'stir')">
|
||||
<image src="../../static/changeMore.png" mode=""></image>
|
||||
<text>修改更多参数</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<image src="../../static/closed.png" mode="" @click="closeStirPop"></image>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
@ -310,7 +393,37 @@
|
||||
'solenoidSixteen'
|
||||
],
|
||||
readFs_byid_name:'',
|
||||
actList1:["0","0","0","0"]
|
||||
actList1:["0","0","0","0"],
|
||||
|
||||
// 搅拌程序
|
||||
openTypeStir:'',
|
||||
stirListShow:[ {
|
||||
name: 'A肥',
|
||||
}, {
|
||||
name: 'B肥',
|
||||
}, {
|
||||
name: 'C肥',
|
||||
}, {
|
||||
name: 'D肥',
|
||||
}, {
|
||||
name: 'E肥',
|
||||
}, {
|
||||
name: 'F肥',
|
||||
}, {
|
||||
name: 'G肥',
|
||||
}, {
|
||||
name: 'H肥',
|
||||
}, {
|
||||
name: '酸',
|
||||
},],
|
||||
stirList:[],
|
||||
stirshow:false,
|
||||
// 搅拌程序弹窗
|
||||
inputData2:[],
|
||||
inputData2New:[],
|
||||
stirpopupList:[],
|
||||
topActive2: [],
|
||||
fertilizerType:0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -318,6 +431,7 @@
|
||||
},
|
||||
onLoad(option) {
|
||||
this.deviceId = option.id
|
||||
this.fertilizerType=option.fertilizerType?option.fertilizerType:0
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
@ -342,12 +456,13 @@
|
||||
},
|
||||
methods: {
|
||||
|
||||
toWebView(id) {
|
||||
toWebView(id,url) {
|
||||
// console.log(id);
|
||||
uni.navigateTo({
|
||||
url: '/pages/web_view/web_view?id=' + id + '&deviceId=' + this.deviceId
|
||||
url: '/pages/web_view/web_view?id=' + id + '&deviceId=' + this.deviceId+ '&url=' + url
|
||||
})
|
||||
},
|
||||
|
||||
countData10(data) {
|
||||
if (data) {
|
||||
return data / 10
|
||||
@ -376,8 +491,12 @@
|
||||
this.inputData = res.data;
|
||||
this.getData30() //数据30/进水出水泵
|
||||
this.getData29() //数据29 启动方式/信号
|
||||
|
||||
this.getDataInfo2()
|
||||
this.getcenterBottom() //获取电磁阀
|
||||
// 获取搅拌程序
|
||||
this.getStirList()
|
||||
this.getData81()
|
||||
} else {
|
||||
that.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
@ -388,7 +507,24 @@
|
||||
|
||||
|
||||
},
|
||||
|
||||
//什么方式启动的搅拌
|
||||
getData81() {
|
||||
var number = this.padString(this.inputData['81'].toString(2), 4)
|
||||
|
||||
var openListNew = []
|
||||
openListNew = number.split("")
|
||||
var stirList = openListNew.reverse();
|
||||
this.openTypeStir = this.getType81(stirList)
|
||||
},
|
||||
getStirList() {
|
||||
// var num = this.inputData['82']
|
||||
var num = this.inputData['82']
|
||||
|
||||
var num1 = this.padString(num.toString(2), 8)
|
||||
var openListNew = []
|
||||
openListNew = num1.split("")
|
||||
this.stirList = openListNew.reverse();
|
||||
},
|
||||
// 查看用户施肥机名称信息
|
||||
getReadFs_byid(){
|
||||
let deviceId = this.deviceId;
|
||||
@ -489,6 +625,7 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
padString(str, length) {
|
||||
return str.padStart(length, '0');
|
||||
},
|
||||
@ -713,6 +850,21 @@
|
||||
return '无'
|
||||
}
|
||||
},
|
||||
|
||||
getType81(list) {
|
||||
if(list[0]==1){
|
||||
return '定时启动'
|
||||
}else if(list[1]==1){
|
||||
return '间隔启动'
|
||||
}else if(list[2]==1){
|
||||
return '联动启动'
|
||||
}else if(list[3]==1){
|
||||
return '手动启动'
|
||||
}else{
|
||||
return '无'
|
||||
}
|
||||
},
|
||||
|
||||
//countType计算类型
|
||||
//0是原数据
|
||||
//1是原数据-400
|
||||
@ -754,7 +906,97 @@
|
||||
signalHandler(index) {
|
||||
this.signalCurrent = index
|
||||
},
|
||||
|
||||
showStir(){
|
||||
this.stirshow=true
|
||||
var data = {
|
||||
equipmentId: this.deviceId,
|
||||
pattern: 600, //需要根据文档填写 //6目标ph-数值
|
||||
regNum: 36,
|
||||
};
|
||||
this.$http({
|
||||
url: this.api.readFs_reg,
|
||||
data: data
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.inputData2 = res.data;
|
||||
this.inputData2New = JSON.parse(JSON.stringify(res.data));
|
||||
|
||||
this.getType600();
|
||||
|
||||
this.getActive1();
|
||||
|
||||
// this.inputData2New[603] = this.getData1(this.inputData2[603]);
|
||||
|
||||
this.inputData2[601] = this.countData10(this.inputData2[601]);
|
||||
// this.inputData2[604] = this.countData10(this.inputData2[604]);
|
||||
// this.inputData2[615] = this.countData10(this.inputData2[615]);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 工作方式选择
|
||||
changeOpen(index) {
|
||||
this.inputData2['600'] = index;
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: index,
|
||||
},
|
||||
};
|
||||
|
||||
this.getType600();
|
||||
this.changeBtn('600', dataNum);
|
||||
},
|
||||
change600(index) {
|
||||
var list = ["0", "0", "0"];
|
||||
list[index] = "1";
|
||||
this.topActive2 = list;
|
||||
this.$forceUpdate();
|
||||
var revList = list.slice().reverse();
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.inputData2['600']=parseInt(num, 2)
|
||||
this.changeBtn("600", dataNum);
|
||||
},
|
||||
getType600() {
|
||||
var number = this.padString(this.inputData2["600"].toString(2), 3);
|
||||
var openListNew = [];
|
||||
openListNew = number.split("");
|
||||
this.topActive2 = openListNew.reverse();
|
||||
|
||||
},
|
||||
changeIndexOpen1(active) {
|
||||
if (this.stirpopupList[active] == "1") {
|
||||
this.stirpopupList[active] = "0";
|
||||
} else {
|
||||
this.stirpopupList[active] = "1";
|
||||
}
|
||||
this.$forceUpdate();
|
||||
var revList = this.stirpopupList.slice().reverse();
|
||||
var num = revList.join("");
|
||||
var dataNum = {
|
||||
target: {
|
||||
value: parseInt(num, 2),
|
||||
},
|
||||
};
|
||||
this.changeBtn(602, dataNum);
|
||||
},
|
||||
getActive1() {
|
||||
this.stirpopupList = [];
|
||||
var num = this.inputData2["602"];
|
||||
|
||||
var num1 = this.padString(num.toString(2), 8);
|
||||
var openListNew = [];
|
||||
openListNew = num1.split("");
|
||||
this.stirpopupList = openListNew.reverse();
|
||||
},
|
||||
closeStirPop() {
|
||||
// this.dataInit();
|
||||
// this.getReg();
|
||||
this.stirshow = false
|
||||
},
|
||||
showPop(index) {
|
||||
this.show = true
|
||||
this.indexs = index
|
||||
@ -848,25 +1090,60 @@
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx;
|
||||
|
||||
margin-top: 10rpx;
|
||||
&.stir-value-popup{
|
||||
width: 100%;
|
||||
.title{
|
||||
border-bottom: unset!important;
|
||||
}
|
||||
.detail{
|
||||
width: 100%;
|
||||
.item{
|
||||
width: 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
>image {
|
||||
justify-content: space-between;
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
>text {
|
||||
text {
|
||||
font-size: 30rpx;
|
||||
font-family: PingFang-SC-Bold;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.set-text {
|
||||
font-size: 30rpx;
|
||||
font-family: PingFang-SC-Bold;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
margin-right: 20rpx;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
>image {
|
||||
width: 16rpx;
|
||||
height: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.stir-value{
|
||||
.detail .item{
|
||||
|
||||
width: 115rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detail {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
@ -888,6 +1165,10 @@
|
||||
align-items: center;
|
||||
margin: 5rpx 8rpx;
|
||||
flex-shrink: 0;
|
||||
&.active{
|
||||
background: #24B383;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1249,7 +1530,7 @@
|
||||
}
|
||||
|
||||
.control_model {
|
||||
height: 172rpx;
|
||||
// height: 172rpx;
|
||||
// border-bottom: 1rpx solid #DDDDDD;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx;
|
||||
@ -1259,6 +1540,11 @@
|
||||
font-family: PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.model{
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.model {
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
<view class="content">
|
||||
<template v-for="item,index in deviceList">
|
||||
<view class="item" :key="index" v-if="item.equipmentName==1||item.equipmentName==20">
|
||||
<view class="item" :key="index" v-if="item.deviceName==1||item.deviceName==20">
|
||||
<image src="../../static/icon_precise.png" mode=""></image>
|
||||
<view class="center">
|
||||
<text>{{item.deviceTypeName}}</text>
|
||||
@ -86,7 +86,7 @@
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pages/fertilizer_machine/fertilizer_machine?id=' + item.deviceId
|
||||
url: '/pages/fertilizer_machine/fertilizer_machine?id=' + item.deviceId+'&fertilizerType='+item.fertilizerType
|
||||
})
|
||||
}
|
||||
|
||||
@ -96,15 +96,16 @@
|
||||
getEquipmentInfo(userid) {
|
||||
let that = this
|
||||
this.$http({
|
||||
url: this.api.sel_eqbyid + userid,
|
||||
url: this.api.sel_userbyid + userid,
|
||||
method: 'GET'
|
||||
}).then(res => {
|
||||
// console.log(res, '根据用户id查询对应的设备数据');
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
this.deviceList = res.data;
|
||||
this.deviceList = this.deviceList.filter(e=>e.equipmentName == 1||e.equipmentName == 20).sort((a,b)=>a.equipmentStatu - b.equipmentStatu)
|
||||
this.deviceList = res.data.devices;
|
||||
this.deviceList = this.deviceList.filter(e=>e.deviceName == 1||e.deviceName == 20).sort((a,b)=>a.equipmentStatu - b.equipmentStatu)
|
||||
|
||||
}else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
|
@ -10,14 +10,16 @@
|
||||
id:'',
|
||||
src:'',
|
||||
userid:'',
|
||||
deviceId:''
|
||||
deviceId:'',
|
||||
url:''
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// console.log('options',options);
|
||||
if(options){
|
||||
this.id = options.id;
|
||||
this.deviceId = options.deviceId
|
||||
this.deviceId = options.deviceId;
|
||||
this.url=options.url
|
||||
}
|
||||
let that = this
|
||||
uni.getStorage({
|
||||
@ -29,7 +31,7 @@
|
||||
key:'userid',
|
||||
success:function(res){
|
||||
that.userid = res.data
|
||||
that.src = `https://portal.lihe-control.com/#/irrigateSet?id=${that.id}&token=${that.token}&userid=${that.userid}&deviceId=${that.deviceId}`
|
||||
that.src = `https://portal.lihe-control.com/#/${options.url}?id=${that.id}&token=${that.token}&userid=${that.userid}&deviceId=${that.deviceId}`
|
||||
// console.log(that.src);
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user