This commit is contained in:
3321822538@qq.com 2025-02-19 15:25:49 +08:00
parent 58ed1420fc
commit 07957bf4e8
3 changed files with 438 additions and 213 deletions

View File

@ -24,11 +24,14 @@
<!-- <image @click="btnmenu" src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ" mode=""></image> -->
<!-- 正在连接 -->
<image v-if="zcljflag" style="width: 180rpx;height: 40rpx;margin-right:20rpx" src="https://api.ccttiot.com/smartmeter/img/static/uYUoki4Tc56rzINzY2Ba" mode=""></image>
<image v-if="zcljflag" style="width: 180rpx;height: 40rpx;margin-right:20rpx"
src="https://api.ccttiot.com/smartmeter/img/static/uYUoki4Tc56rzINzY2Ba" mode=""></image>
<!-- 连接成功 -->
<image v-if="ljcgflag" style="width: 40rpx;height: 40rpx;margin-right:20rpx" src="https://api.ccttiot.com/smartmeter/img/static/uhSqWj4f07z8oDMh0i8f" mode=""></image>
<image v-if="ljcgflag" style="width: 40rpx;height: 40rpx;margin-right:20rpx"
src="https://api.ccttiot.com/smartmeter/img/static/uhSqWj4f07z8oDMh0i8f" mode=""></image>
<!-- 未连接 -->
<image v-if="wljflag" style="width: 40rpx;height: 40rpx;margin-right:20rpx" src="https://api.ccttiot.com/smartmeter/img/static/uBp1lbXlGEMD4s5P8LGu" mode=""></image>
<image v-if="wljflag" style="width: 40rpx;height: 40rpx;margin-right:20rpx"
src="https://api.ccttiot.com/smartmeter/img/static/uBp1lbXlGEMD4s5P8LGu" mode=""></image>
<image @click="btnedit" src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ"
mode=""></image>
@ -137,15 +140,15 @@
{{obj.surplusPowerPoint == undefined ? '--' : obj.surplusPowerPoint}}%
</view>
<view class="ele" v-else>
<image style="height: 25rpx;" v-if="ver_data.bat <= 100 && ver_data.bat >= 80"
<image style="height: 25rpx;" v-if="point <= 100 && point >= 80"
src="https://api.ccttiot.com/smartmeter/img/static/uWbKPMvIuFZjzviEJjmP" mode=""></image>
<image style="height: 25rpx;" v-if="ver_data.bat < 80 && ver_data.bat >= 50"
<image style="height: 25rpx;" v-if="point < 80 && point >= 50"
src="https://api.ccttiot.com/smartmeter/img/static/u0mCXpSrvcROLCMsahNh" mode=""></image>
<image style="height: 25rpx;" v-if="ver_data.bat < 50 && ver_data.bat >= 20"
<image style="height: 25rpx;" v-if="point < 50 && point >= 20"
src="https://api.ccttiot.com/smartmeter/img/static/uGGgEPbe8ryHspQPL2o8" mode=""></image>
<image style="height: 25rpx;" v-if="ver_data.bat < 20"
<image style="height: 25rpx;" v-if="point < 20"
src="https://api.ccttiot.com/smartmeter/img/static/uIRhPmP5WUJaIg0nft9E" mode=""></image>
{{this.point == undefined ? '--' : this.point}}%
{{point == undefined ? '--' : point}}%
</view>
</view>
<view class="echarts_box" v-if="xnwd" @click="btnec(1)">
@ -275,7 +278,8 @@
当前 {{obj.volume / 1000 == 0 ? obj.volume : (obj.volume / 1000).toFixed(1)}}khz
</view>
<view class="top_cont" v-else>
当前 {{(ver_data.MIC !== undefined && !isNaN(ver_data.MIC) && ver_data.MIC / 1000 === 0) ? ver_data.MIC : ((ver_data.MIC !== undefined && !isNaN(ver_data.MIC)) ? (ver_data.MIC / 1000).toFixed(1) : '--')}}khz
当前
{{(ver_data.MIC !== undefined && !isNaN(ver_data.MIC) && ver_data.MIC / 1000 === 0) ? ver_data.MIC : ((ver_data.MIC !== undefined && !isNaN(ver_data.MIC)) ? (ver_data.MIC / 1000).toFixed(1) : '--')}}khz
</view>
<view class="top_right">
<view style="width: 1rpx;">
@ -332,7 +336,8 @@
</view>
<view class="top" style="margin-top: 14rpx;">
<view class="weather_add">
蜂场位置<span style="color: #42A5F5;">{{obj.apiaryCounty == undefined ? '--' : obj.apiaryCounty}}</span>
蜂场位置<span
style="color: #42A5F5;">{{obj.apiaryCounty == undefined ? '--' : obj.apiaryCounty}}</span>
</view>
<view class="up_time">
{{daytime}}更新
@ -518,9 +523,29 @@
},
//
btntbsz() {
// xBlufi.notifySendCustomData({
//       customData: ""
// })
console.log("11bat_stop" + this.shezhiobj.minPower + '@' + "temp_start" + this.shezhiobj.minHeat + '@' + "temp_stop" + this.shezhiobj.maxHeat + '@' + "fan_start" + this.shezhiobj.maxFan + '@' + "fan_stop" + this.shezhiobj.minFan + '@' + "co2_start" + this.shezhiobj.maxCo2 + '@' + "co2_stop" + this.shezhiobj.minCo2 + '@');
if(this.ljcgflag == true){
xBlufi.notifySendCustomData({
customData: "11bat_stop" + this.shezhiobj.minPower + '@' + "temp_start" + this.shezhiobj.minHeat + '@' + "temp_stop" + this.shezhiobj.maxHeat + '@' + "fan_start" + this.shezhiobj.maxFan + '@' + "fan_stop" + this.shezhiobj.minFan + '@' + "co2_start" + this.shezhiobj.maxCo2 + '@' + "co2_stop" + this.shezhiobj.minCo2 + '@'
})
uni.showToast({
title: '同步成功',
icon: 'success',
duration: 2000
})
}else{
let that = this
uni.showModal({
title: "提示",
content: '设备暂未连接,是否连接?',
success: function(res) {
if (res.confirm) {
that.Binddevice()
}
}
})
}
},
// id
getobj() {
@ -742,7 +767,8 @@
})
this.ver_data = obj
if (this.ver_data.bat != '' || this.ver_data.bat != undefined) { //
this.point = (1 - (this.obj.modelMaxV - this.ver_data.bat) / (this.obj.modelMaxV -this.obj.modelMinV)) * 100
let dian = (1 - (this.obj.modelMaxV - this.ver_data.bat) / (this.obj.modelMaxV - this.obj.modelMinV)) * 100
this.point = dian.toFixed(1)
if (this.scdeviceflag == true) { //
let data = {
beehiveId: this.beehiveId,
@ -785,6 +811,12 @@
break
case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED: {
console.log('蓝牙异常断开', options.result)
if(options.result == false){
this.zcljflag = false
this.wljflag = false
this.ljcgflag = false
this.tbszflag = false
}
}
break;
}
@ -861,14 +893,16 @@
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url:'/page_Beehive/add_Beehive?tit=' + '修改蜂箱' + '&beehiveId=' + that.beehiveId
url: '/page_Beehive/add_Beehive?tit=' + '修改蜂箱' +
'&beehiveId=' + that.beehiveId
})
}
}
})
} else {
uni.navigateTo({
url: '/page_Beehive/Beehive_log?apiaryId=' + this.obj.apiaryId + ' &name=' + this.obj.apiaryName
url: '/page_Beehive/Beehive_log?apiaryId=' + this.obj.apiaryId + ' &name=' + this.obj
.apiaryName
})
}
} else {
@ -998,14 +1032,27 @@
if (this.obj.userId == user.userId) {
if (num == 1) {
if (this.obj.onlineStatus == 0) {
if(this.ljcgflag == true){
xBlufi.notifySendCustomData({
      customData: "11clear_weight@"
 })
customData: "11clear_weight@"
})
uni.showToast({
title: '去皮成功',
icon: 'success',
duration: 2000
})
}else{
let that = this
uni.showModal({
title: "提示",
content: '设备暂未连接,是否连接?',
success: function(res) {
if (res.confirm) {
that.Binddevice()
}
}
})
}
} else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/clearWeight`).then(res => {
if (res.code == 200) {
@ -1025,14 +1072,27 @@
}
} else if (num == 2) {
if (this.obj.onlineStatus == 0) {
if(this.ljcgflag == true){
xBlufi.notifySendCustomData({
      customData: "11beep11@" + 10
 })
customData: "11beep11@" + 10
})
uni.showToast({
title: '响铃成功',
icon: 'success',
duration: 2000
})
}else{
let that = this
uni.showModal({
title: "提示",
content: '设备暂未连接,是否连接?',
success: function(res) {
if (res.confirm) {
that.Binddevice()
}
}
})
}
} else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/buzzer`).then(res => {
if (res.code == 200) {
@ -1053,8 +1113,9 @@
} else if (num == 3) {
if (this.fskx == '关') {
if (this.obj.onlineStatus == 0) {
if(this.ljcgflag == true){
xBlufi.notifySendCustomData({
    customData: '11fan100@'
customData: '11fan100@'
})
this.fskx = '开'
uni.showToast({
@ -1062,6 +1123,18 @@
icon: 'success',
duration: 2000
})
}else{
let that = this
uni.showModal({
title: "提示",
content: '设备暂未连接,是否连接?',
success: function(res) {
if (res.confirm) {
that.Binddevice()
}
}
})
}
} else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/fan?open=true`).then(res => {
if (res.code == 200) {
@ -1086,8 +1159,9 @@
}
} else {
if (this.obj.onlineStatus == 0) {
if(this.ljcgflag == true){
xBlufi.notifySendCustomData({
    customData: "11fan0@"
customData: "11fan0@"
})
this.fskx = '关'
uni.showToast({
@ -1095,6 +1169,18 @@
icon: 'success',
duration: 2000
})
}else{
let that = this
uni.showModal({
title: "提示",
content: '设备暂未连接,是否连接?',
success: function(res) {
if (res.confirm) {
that.Binddevice()
}
}
})
}
} else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/fan?open=false`).then(res => {
if (res.code == 200) {
@ -1121,8 +1207,9 @@
} else if (num == 4) {
if (this.jrkg == '关') {
if (this.obj.onlineStatus == 0) {
if(this.ljcgflag == true){
xBlufi.notifySendCustomData({
    customData: "11hot100@"
customData: "11hot100@"
})
this.jrkg = '开'
uni.showToast({
@ -1130,6 +1217,18 @@
icon: 'success',
duration: 2000
})
}else{
let that = this
uni.showModal({
title: "提示",
content: '设备暂未连接,是否连接?',
success: function(res) {
if (res.confirm) {
that.Binddevice()
}
}
})
}
} else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/heat?open=true`).then(res => {
if (res.code == 200) {
@ -1154,8 +1253,9 @@
}
} else {
if (this.obj.onlineStatus == 0) {
if(this.ljcgflag == true){
xBlufi.notifySendCustomData({
    customData: "11hot0@"
customData: "11hot0@"
})
this.jrkg = '关'
uni.showToast({
@ -1163,6 +1263,18 @@
icon: 'success',
duration: 2000
})
}else{
let that = this
uni.showModal({
title: "提示",
content: '设备暂未连接,是否连接?',
success: function(res) {
if (res.confirm) {
that.Binddevice()
}
}
})
}
} else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/heat?open=false`).then(res => {
if (res.code == 200) {
@ -2003,6 +2115,7 @@
#active {
color: red !important;
}
.mask {
width: 100%;
height: 100vh;
@ -2012,13 +2125,16 @@
background-color: #3D3D3D;
opacity: .6;
}
page {
background-color: #FAFDFD;
}
.page {
padding: 38rpx;
padding-bottom: 200rpx;
width: 750rpx;
.weather_info {
position: fixed;
padding: 30rpx 50rpx;
@ -2029,11 +2145,13 @@
background: #FFFFFF;
z-index: 999 !important;
border-radius: 20rpx 20rpx 0rpx 0rpx;
.echarts_box {
margin-top: 24rpx;
width: 646rpx;
height: 344rpx;
}
.weather_cont {
margin-top: 42rpx;
width: 100%;
@ -2041,6 +2159,7 @@
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
.weather_li {
.data {
text-align: center;
@ -2049,6 +2168,7 @@
font-size: 24rpx;
color: #50565A;
}
.week {
margin-top: 4rpx;
text-align: center;
@ -2057,6 +2177,7 @@
font-size: 24rpx;
color: #50565A;
}
.week_weather {
margin-top: 14rpx;
text-align: center;
@ -2065,12 +2186,14 @@
font-size: 28rpx;
color: #50565A;
}
.week_weather_img {
margin-top: 4rpx;
display: flex;
align-items: center;
justify-content: center;
width: 72rpx;
image {
width: 48rpx;
height: 48rpx;
@ -2078,25 +2201,30 @@
}
}
}
.top {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.weather_info_tit {
font-weight: 600;
font-size: 36rpx;
color: #3D3D3D;
}
image {
width: 42rpx;
height: 42rpx;
}
.weather_add {
font-weight: 600;
font-size: 32rpx;
color: #50565A;
}
.up_time {
font-weight: 400;
font-size: 32rpx;
@ -2104,6 +2232,7 @@
}
}
}
.echarts_box {
margin-top: 26rpx;
padding: 18rpx 24rpx;
@ -2111,14 +2240,17 @@
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 28rpx 28rpx 28rpx 28rpx;
.echarts {
margin-top: 24rpx;
width: 100%;
height: 330rpx;
}
.echarts_top {
display: flex;
align-items: center;
.top_left {
width: 33.33%;
display: flex;
@ -2126,12 +2258,14 @@
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
image {
margin-left: 10rpx;
width: 25.03rpx;
height: 34rpx;
}
}
.top_cont {
width: 33.33%;
text-align: center;
@ -2139,10 +2273,12 @@
font-size: 36rpx;
color: #3D3D3D;
}
.top_right {
width: 33.33%;
display: flex;
align-items: center;
.txt {
display: flex;
align-items: center;
@ -2151,6 +2287,7 @@
font-weight: 400;
font-size: 32rpx;
color: #4D4D4D;
.icon-xiangyou1 {
margin-top: 4rpx;
margin-left: 8rpx;
@ -2159,6 +2296,7 @@
}
}
}
.bottom_box {
padding: 38rpx 20rpx;
position: fixed;
@ -2172,6 +2310,7 @@
border-radius: 0rpx 0rpx 0rpx 0rpx;
bottom: 0;
left: 0;
.type_li {
padding: 12rpx 26rpx;
background: #FFF5D6;
@ -2181,6 +2320,7 @@
font-size: 32rpx;
color: #3D3D3D;
}
.act1 {
background: #FFC107;
border-radius: 12rpx 12rpx 12rpx 12rpx;
@ -2188,22 +2328,26 @@
color: #FFFFFF;
}
}
.card_top {
margin-top: 28rpx;
display: flex;
flex-wrap: nowrap;
align-items: center;
.name {
font-weight: 600;
font-size: 36rpx;
color: #3D3D3D;
}
.time {
margin-left: 18rpx;
font-weight: 400;
font-size: 28rpx;
color: #808080;
}
.ele {
margin-left: auto;
display: flex;
@ -2212,6 +2356,7 @@
font-weight: 400;
font-size: 28rpx;
color: #808080;
image {
margin-right: 12rpx;
width: 46rpx;
@ -2219,6 +2364,7 @@
}
}
}
.setbox {
margin: 0 auto;
margin-top: 34rpx;
@ -2226,6 +2372,7 @@
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
.setcard {
position: relative;
padding: 14rpx 22rpx;
@ -2234,33 +2381,39 @@
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx;
.top {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
.left {
font-weight: 600;
font-size: 28rpx;
color: #3D3D3D;
}
.right {
font-size: 24rpx;
color: #808080;
}
}
.bot {
margin-top: 14rpx;
font-weight: 400;
font-size: 24rpx;
color: #808080;
}
.img {
position: absolute;
right: 24rpx;
bottom: 24rpx;
width: 82rpx;
height: 82rpx;
image {
width: 82rpx;
height: 82rpx;
@ -2268,30 +2421,36 @@
}
}
}
.weather {
margin-top: 12rpx;
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
.weather_left {
display: flex;
flex-wrap: nowrap;
align-items: center;
.txt {
display: flex;
flex-wrap: nowrap;
align-items: center;
image {
width: 38rpx;
height: 38rpx;
margin-right: 8rpx;
}
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
}
}
.weather_right {
display: flex;
flex-wrap: nowrap;
@ -2299,22 +2458,27 @@
font-weight: 400;
font-size: 28rpx;
color: #42A5F5;
.icon-xiangyou1 {}
}
}
.address {
display: flex;
align-items: center;
margin-top: 8rpx;
image {
margin-right: 8rpx;
width: 20rpx;
height: 24rpx;
}
font-weight: 400;
font-size: 28rpx;
color: #808080;
}
.tit {
display: flex;
flex-wrap: nowrap;
@ -2324,10 +2488,12 @@
font-weight: 600;
font-size: 32rpx;
color: #3D3D3D;
.sets {
position: relative;
display: flex;
align-items: center;
.tongbu {
width: 130rpx;
height: 40rpx;
@ -2339,6 +2505,7 @@
background-color: #FFC107;
margin-right: 20rpx;
}
.menu {
padding: 20rpx;
position: absolute;
@ -2349,15 +2516,18 @@
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx;
z-index: 10;
.menu_li:first-child {
margin-top: 10rpx;
}
.menu_li {
image {
margin-right: 14rpx;
width: 38rpx;
height: 38rpx;
}
font-weight: 400;
font-size: 32rpx;
color: #3D3D3D;
@ -2367,12 +2537,14 @@
align-items: center;
}
}
image {
width: 36rpx;
height: 36rpx;
}
}
}
.mapbox {
position: relative;
margin: 0 auto;
@ -2381,6 +2553,7 @@
height: 372rpx;
border-radius: 20rpx;
overflow: hidden;
.fxmask {
position: absolute;
top: 0;
@ -2397,11 +2570,13 @@
box-sizing: border-box;
font-weight: 600;
}
.num {
width: 180rpx;
position: absolute;
top: 24rpx;
left: 30rpx;
.txt {
width: 180rpx;
font-weight: 600;
@ -2409,15 +2584,18 @@
color: #FFC107;
}
}
.btn {
position: absolute;
right: 0rpx;
bottom: 0rpx;
image {
width: 90rpx;
height: 90rpx;
}
}
.map {
width: 672rpx;
height: 372rpx;

View File

@ -21,18 +21,18 @@
<view class="machao">
总重量{{(obj.totalWeight == undefined ? '--' : (Number(obj.totalWeight / 1000)).toFixed(2)) + 'kg'}}
</view>
<view class="machao">
箱内温度{{obj.innerTemperature == undefined ? '--' : obj.innerTemperature + '°C'}} <input type="text" v-model="wdxsn" /> <view class="" @click="btnone">校准</view>
</view>
<view class="machao">
箱内湿度{{obj.innerHumidity == undefined ? '--' : obj.innerHumidity + '%'}}
</view>
<view class="machao">
箱外温度{{obj.outerTemperature == undefined ? '--' : obj.outerTemperature + '°C'}} <input type="text" v-model="wdxsw" /> <view class="" @click="btntwo">校准</view>
</view>
<view class="machao">
箱外湿度{{obj.outerHumidity == undefined ? '--' : obj.outerHumidity + '%'}}
</view>
<view class="machao">
箱内温度{{obj.innerTemperature == undefined ? '--' : obj.innerTemperature + '°C'}}
</view>
<view class="machao">
箱外温度{{obj.outerTemperature == undefined ? '--' : obj.outerTemperature + '°C'}}
</view>
<view class="machao">
剩余电量{{obj.surplusPowerPoint == undefined ? '--' : obj.surplusPowerPoint + '%'}}
</view>
@ -90,6 +90,8 @@
powerStatus: '--',
message: '定时器未启动',
intervalId: null, // ID
wdxsn:'',
wdxsw:''
}
},
onLoad(options) {
@ -127,6 +129,34 @@
this.clearInterval();
},
methods: {
//
btnone(){
this.$u.put(`/app/beehive/admin/wdxsn?sn=${this.storeId}&wdxsn=${this.wdxsn}`).then(res=>{
if(res.code == 200){
this.obj.innerTemperature = Number(this.obj.innerTemperature) + Number(this.wdxsn)
}else{
uni.showToast({
title:res.msg,
icon: 'none',
duration:2000
})
}
})
},
//
btntwo(){
this.$u.put(`/app/beehive/admin/wdxsw?sn=${this.storeId}&wdxsw=${this.wdxsw}`).then(res=>{
if(res.code == 200){
this.obj.outerTemperature = Number(this.obj.outerTemperature) + Number(this.wdxsw)
}else{
uni.showToast({
title:res.msg,
icon: 'none',
duration:2000
})
}
})
},
btnshang(){
uni.reLaunch({
url:'/page_user/luru'
@ -360,6 +390,23 @@
margin-top: 20rpx;
text-align: left;
font-size: 32rpx;
display: flex;
align-items: center;
input{
width: 100rpx;
height: 40rpx;
border: 1px solid #ce9e10;
margin-left: 50rpx;
text-align: center;
}
view{
margin-left: 20rpx;
padding: 10rpx 20rpx;
box-sizing: border-box;
background-color: #ce9e10;
color: #fff;
border-radius: 10rpx;
}
}
.title {

View File

@ -34,9 +34,9 @@
<button class="button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" >
授权登录
</button>
<view class="button" style="text-align: center;background-color: transparent;border: 1px solid #FFF5D6;margin-top: 80rpx;color: #FFF5D6;" @click="btnname">
<!-- <view class="button" style="text-align: center;background-color: transparent;border: 1px solid #FFF5D6;margin-top: 80rpx;color: #FFF5D6;" @click="btnname">
手机号登录
</view>
</view> -->
<!-- <view class="yinsi">
<u-checkbox-group>
<u-checkbox v-model="checked" shape="circle" size="28"></u-checkbox>