This commit is contained in:
3321822538@qq.com 2024-07-08 18:16:58 +08:00
parent 7282664846
commit 883f6e41e8
12 changed files with 476 additions and 399 deletions

View File

@ -134,7 +134,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.cont { .cont {
position: fixed; position: fixed;
left: 60rpx; left: 50%;
transform: translateX(-50%);
bottom: 78rpx; bottom: 78rpx;
width: 664rpx; width: 664rpx;
height: 122rpx; height: 122rpx;

View File

@ -17,7 +17,9 @@
<view class="tit"> <view class="tit">
{{obj.name == undefined ? '--' : obj.name}}-{{obj.sn == undefined ? '--' : obj.sn}} {{obj.name == undefined ? '--' : obj.name}}-{{obj.sn == undefined ? '--' : obj.sn}}
<view class="sets"> <view class="sets">
<image @click="btnmenu" src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ" mode=""></image> <!-- <image @click="btnmenu" src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ" mode=""></image> -->
<image @click="btnedit" src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ"
mode=""></image>
<view class="menu" v-if="menuflag"> <view class="menu" v-if="menuflag">
<view class="menu_li" @click="btnedit"> <view class="menu_li" @click="btnedit">
<image src="https://api.ccttiot.com/smartmeter/img/static/uE84FLJ6hKTfgt6gxYMw" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uE84FLJ6hKTfgt6gxYMw" mode=""></image>
@ -41,10 +43,12 @@
<view class="weather"> <view class="weather">
<view class="weather_left"> <view class="weather_left">
<view class="txt"> <view class="txt">
多云 {{daily[0].tempMin == undefined ? '--' : daily[0].tempMin}} ~ {{daily[0].tempMax == undefined ? '--' : daily[0].tempMax}} 多云 {{daily[0].tempMin == undefined ? '--' : daily[0].tempMin}} ~
{{daily[0].tempMax == undefined ? '--' : daily[0].tempMax}}
</view> </view>
<view class="txt" style="margin-left: 40rpx;"> <view class="txt" style="margin-left: 40rpx;">
{{daily[0].windDirDay == undefined ? '--' : daily[0].windDirDay }} {{daily[0].windSpeedDay == undefined ? '--' : daily[0].windSpeedDay}} {{daily[0].windDirDay == undefined ? '--' : daily[0].windDirDay }}
{{daily[0].windSpeedDay == undefined ? '--' : daily[0].windSpeedDay}}
</view> </view>
</view> </view>
<view class="weather_right" @click="btngd"> <view class="weather_right" @click="btngd">
@ -113,7 +117,7 @@
{{obj.surplusPower}}% {{obj.surplusPower}}%
</view> </view>
</view> </view>
<view class="echarts_box"> <view class="echarts_box" @click="btnec(1)">
<view class="echarts_top"> <view class="echarts_top">
<view class="top_left"> <view class="top_left">
温度 温度
@ -138,7 +142,7 @@
</uni-ec-canvas> </uni-ec-canvas>
</view> </view>
</view> </view>
<view class="echarts_box"> <view class="echarts_box" @click="btnec(2)">
<view class="echarts_top"> <view class="echarts_top">
<view class="top_left"> <view class="top_left">
湿度 湿度
@ -163,7 +167,7 @@
</uni-ec-canvas> </uni-ec-canvas>
</view> </view>
</view> </view>
<view class="echarts_box"> <view class="echarts_box" @click="btnec(3)">
<view class="echarts_top"> <view class="echarts_top">
<view class="top_left"> <view class="top_left">
重量 重量
@ -188,7 +192,7 @@
</uni-ec-canvas> </uni-ec-canvas>
</view> </view>
</view> </view>
<view class="echarts_box"> <view class="echarts_box" @click="btnec(4)">
<view class="echarts_top"> <view class="echarts_top">
<view class="top_left"> <view class="top_left">
进出量 进出量
@ -213,7 +217,7 @@
</uni-ec-canvas> </uni-ec-canvas>
</view> </view>
</view> </view>
<view class="echarts_box"> <view class="echarts_box" @click="btnec(5)">
<view class="echarts_top"> <view class="echarts_top">
<view class="top_left"> <view class="top_left">
频率 频率
@ -238,7 +242,7 @@
</uni-ec-canvas> </uni-ec-canvas>
</view> </view>
</view> </view>
<view class="echarts_box"> <view class="echarts_box" @click="btnec(6)">
<view class="echarts_top"> <view class="echarts_top">
<view class="top_left"> <view class="top_left">
二氧化碳 二氧化碳
@ -268,7 +272,8 @@
<view class="weather_info_tit"> <view class="weather_info_tit">
未来7日天气预知 未来7日天气预知
</view> </view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uQK4q99a1Qb7LFD6O3Hw" mode="" @click="showtq = false"></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uQK4q99a1Qb7LFD6O3Hw" mode=""
@click="showtq = false"></image>
</view> </view>
<view class="top" style="margin-top: 14rpx;"> <view class="top" style="margin-top: 14rpx;">
<view class="weather_add"> <view class="weather_add">
@ -295,7 +300,8 @@
</view> </view>
</view> </view>
<view class="echarts_box"> <view class="echarts_box">
<uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas7" canvas-id="uni-ec-canvas" :ec="ec"> <uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas7" canvas-id="uni-ec-canvas"
:ec="ec">
</uni-ec-canvas> </uni-ec-canvas>
</view> </view>
</view> </view>
@ -327,7 +333,7 @@
}, },
data() { data() {
return { return {
menuflag:false, menuflag: false,
ec: { ec: {
lazyLoad: true lazyLoad: true
}, },
@ -352,33 +358,33 @@
}], }],
chartday: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], chartday: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
chartData: [120, 200, 150, 80, 70, 110, 130], chartData: [120, 200, 150, 80, 70, 110, 130],
showtq:true, showtq: true,
beehiveId:'', beehiveId: '',
obj:{}, obj: {},
daily:[], daily: [],
fskx:'关', fskx: '关',
jrkg:'关', jrkg: '关',
chartData1:[], chartData1: [],
chartData2:[], chartData2: [],
chartData3:[], chartData3: [],
chartData4:[], chartData4: [],
chartData5:[], chartData5: [],
chartData6:[], chartData6: [],
chartData7:[], chartData7: [],
chartData8:[], chartData8: [],
yeartime: { yeartime: {
year: '', year: '',
month: '', month: '',
day:'' day: ''
}, },
yeartimes: { yeartimes: {
year: '', year: '',
month: '', month: '',
day:'' day: ''
}, },
daytime:'', daytime: '',
covers: [], covers: [],
dtflag:false dtflag: false
} }
}, },
onLoad(option) { onLoad(option) {
@ -414,110 +420,117 @@
this.getchartData6() this.getchartData6()
}, },
methods: { methods: {
btnvideo(){ //
btnec(num) {
uni.navigateTo({ uni.navigateTo({
url:'/page_Beehive/Beehive_log?apiaryId=' + this.obj.apiaryId + ' &name=' + this.obj.apiaryName url: '/page_Beehive/Beehive_ec?num=' + num + '&beehiveId=' + this.beehiveId
}) })
}, },
btngd(){ btnvideo() {
uni.navigateTo({
url: '/page_Beehive/Beehive_log?apiaryId=' + this.obj.apiaryId + ' &name=' + this.obj.apiaryName
})
},
btngd() {
// this.gettq()
this.showtq = true this.showtq = true
this.gettq()
}, },
btnyj(){ btnyj() {
uni.navigateTo({ uni.navigateTo({
url:'/page_Beehive/Beehive_woring?apiaryId=' + this.beehiveId + '&tit=' + '蜂箱预警记录' url: '/page_Beehive/Beehive_woring?apiaryId=' + this.beehiveId + '&tit=' + '蜂箱预警记录'
}) })
}, },
btnedit(){ btnedit() {
this.menuflag = false this.menuflag = false
uni.navigateTo({ uni.navigateTo({
url:'/page_Beehive/add_Beehive?tit=' + '修改蜂箱' + '&beehiveId=' + this.beehiveId url: '/page_Beehive/add_Beehive?tit=' + '修改蜂箱' + '&beehiveId=' + this.beehiveId
}) })
}, },
btnfx(){ btnfx() {
this.menuflag = false this.menuflag = false
uni.navigateTo({ uni.navigateTo({
url:'/page_Beehive/share_Beehive' url: '/page_Beehive/share_Beehive'
}) })
}, },
btnmenu(){ btnmenu() {
if(this.menuflag == true){ if (this.menuflag == true) {
this.menuflag = false this.menuflag = false
}else{ } else {
this.menuflag = true this.menuflag = true
} }
}, },
// //
getchartData1(){ getchartData1() {
let time = this.yeartime.year +'-' + this.yeartime.month + '-' + this.yeartime.day let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/tempN?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => { this.$u.get(`/farmer/report/tempN?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.chartData1 = res.data.map(item => item.value) this.chartData1 = res.data.map(item => item.value)
} }
}) })
}, },
// 湿 // 湿
getchartData2(){ getchartData2() {
let time = this.yeartime.year +'-' + this.yeartime.month + '-' + this.yeartime.day let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/hpN?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => { this.$u.get(`/farmer/report/hpN?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.chartData2 = res.data.map(item => item.value) this.chartData2 = res.data.map(item => item.value)
} }
}) })
}, },
// //
getchartData3(){ getchartData3() {
let time = this.yeartime.year +'-' + this.yeartime.month + '-' + this.yeartime.day let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/weightDay?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => { this.$u.get(`/farmer/report/weightDay?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(
if(res.code == 200){ res => {
if (res.code == 200) {
this.chartData3 = res.data.map(item => item.value) this.chartData3 = res.data.map(item => item.value)
} }
}) })
}, },
// //
getchartData4(){ getchartData4() {
let time = this.yeartime.year +'-' + this.yeartime.month + '-' + this.yeartime.day let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/ioCount?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => { this.$u.get(`/farmer/report/ioCount?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.chartData4 = res.data.map(item => item.value) this.chartData4 = res.data.map(item => item.value)
} }
}) })
}, },
// //
getchartData5(){ getchartData5() {
let time = this.yeartime.year +'-' + this.yeartime.month + '-' + this.yeartime.day let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/mic?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => { this.$u.get(`/farmer/report/mic?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.chartData5 = res.data.map(item => item.value) this.chartData5 = res.data.map(item => item.value)
} }
}) })
}, },
// //
getchartData6(){ getchartData6() {
let time = this.yeartime.year +'-' + this.yeartime.month + '-' + this.yeartime.day let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/co2?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => { this.$u.get(`/farmer/report/co2?dateRange=${times},${time}&beehiveId=${this.beehiveId}`).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.chartData6 = res.data.map(item => item.value) this.chartData6 = res.data.map(item => item.value)
} }
}) })
}, },
btndow(num){ btndow(num) {
if(num == 1){ if (num == 1) {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/clearWeight`).then(res => { this.$u.put(`farm/beehive/iot/${this.beehiveId}/clearWeight`).then(res => {
if(res.code == 200){ if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '去皮成功', title: '去皮成功',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -525,15 +538,15 @@
}) })
} }
}) })
}else if(num == 2){ } else if (num == 2) {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/buzzer`).then(res => { this.$u.put(`farm/beehive/iot/${this.beehiveId}/buzzer`).then(res => {
if(res.code == 200){ if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '响铃成功', title: '响铃成功',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -541,13 +554,13 @@
}) })
} }
}) })
}else if(num == 3){ } else if (num == 3) {
if(this.fskx == '关'){ if (this.fskx == '关') {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/fan?open=true`).then(res => { this.$u.put(`farm/beehive/iot/${this.beehiveId}/fan?open=true`).then(res => {
if(res.code == 200){ if (res.code == 200) {
if(this.fskx == '关'){ if (this.fskx == '关') {
this.fskx = '开' this.fskx = '开'
}else{ } else {
this.fskx = '关' this.fskx = '关'
} }
uni.showToast({ uni.showToast({
@ -555,7 +568,7 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -563,12 +576,12 @@
}) })
} }
}) })
}else{ } else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/fan?open=false`).then(res => { this.$u.put(`farm/beehive/iot/${this.beehiveId}/fan?open=false`).then(res => {
if(res.code == 200){ if (res.code == 200) {
if(this.fskx == '关'){ if (this.fskx == '关') {
this.fskx = '开' this.fskx = '开'
}else{ } else {
this.fskx = '关' this.fskx = '关'
} }
uni.showToast({ uni.showToast({
@ -576,7 +589,7 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -585,13 +598,13 @@
} }
}) })
} }
}else if(num == 4){ } else if (num == 4) {
if(this.jrkg == '关'){ if (this.jrkg == '关') {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/heat?open=true`).then(res => { this.$u.put(`farm/beehive/iot/${this.beehiveId}/heat?open=true`).then(res => {
if(res.code == 200){ if (res.code == 200) {
if(this.jrkg == '关'){ if (this.jrkg == '关') {
this.jrkg = '开' this.jrkg = '开'
}else{ } else {
this.jrkg = '关' this.jrkg = '关'
} }
uni.showToast({ uni.showToast({
@ -599,7 +612,7 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -607,12 +620,12 @@
}) })
} }
}) })
}else{ } else {
this.$u.put(`farm/beehive/iot/${this.beehiveId}/heat?open=false`).then(res => { this.$u.put(`farm/beehive/iot/${this.beehiveId}/heat?open=false`).then(res => {
if(res.code == 200){ if (res.code == 200) {
if(this.jrkg == '关'){ if (this.jrkg == '关') {
this.jrkg = '开' this.jrkg = '开'
}else{ } else {
this.jrkg = '关' this.jrkg = '关'
} }
uni.showToast({ uni.showToast({
@ -620,7 +633,7 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -631,27 +644,27 @@
} }
} }
}, },
getobj(){ getobj() {
this.$u.get(`/farm/beehive/${this.beehiveId}`).then(res => { this.$u.get(`/farm/beehive/${this.beehiveId}`).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.obj = res.data this.obj = res.data
this.latitude = res.data.lat this.latitude = res.data.lat
this.longitude = res.data.lng this.longitude = res.data.lng
if(res.data.enableFan == false){ if (res.data.enableFan == false) {
this.fskx = '关' this.fskx = '关'
}else{ } else {
this.fskx = '开' this.fskx = '开'
} }
if(res.data.enableHeat == false){ if (res.data.enableHeat == false) {
this.jrkg = '关' this.jrkg = '关'
}else{ } else {
this.jrkg = '开' this.jrkg = '开'
} }
if(res.data.lat == 0 && res.data.lng == 0){ if (res.data.lat == 0 && res.data.lng == 0) {
console.log('未找到位置信息'); console.log('未找到位置信息');
this.zoomSize = 5 this.zoomSize = 5
this.dtflag = true this.dtflag = true
}else{ } else {
this.dtflag = false this.dtflag = false
this.covers.push({ this.covers.push({
id: parseFloat(res.data.beehiveId), id: parseFloat(res.data.beehiveId),
@ -664,7 +677,7 @@
} }
this.gettq() this.gettq()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -673,9 +686,9 @@
} }
}) })
}, },
gettq(){ gettq() {
this.$u.get(`weather/7d?location=${this.longitude},${this.latitude}`).then(res => { this.$u.get(`weather/7d?location=${this.longitude},${this.latitude}`).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.daily = res.data.daily this.daily = res.data.daily
this.chartData7 = res.data.daily.map(item => item.tempMin) this.chartData7 = res.data.daily.map(item => item.tempMin)
this.chartData8 = res.data.daily.map(item => item.tempMax) this.chartData8 = res.data.daily.map(item => item.tempMax)
@ -1358,7 +1371,7 @@
left: '4%', left: '4%',
right: '4%', right: '4%',
bottom: '3%', bottom: '3%',
top:'0%', top: '0%',
containLabel: true containLabel: true
}, },
tooltip: { tooltip: {
@ -1402,8 +1415,7 @@
show: false // Y线 show: false // Y线
} }
}, },
dataZoom: [ dataZoom: [{
{
show: true, show: true,
type: 'inside', type: 'inside',
filterMode: 'none', filterMode: 'none',
@ -1471,7 +1483,8 @@
formatter: '{c}°', formatter: '{c}°',
color: '#42A5F5' color: '#42A5F5'
}, },
}] }
]
}; };
chart = echarts.init(canvas, null, { chart = echarts.init(canvas, null, {
@ -1493,7 +1506,7 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.mask{ .mask {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
position: fixed; position: fixed;
@ -1502,6 +1515,7 @@
background-color: #3D3D3D; background-color: #3D3D3D;
opacity: .6; opacity: .6;
} }
page { page {
background-color: #FAFDFD; background-color: #FAFDFD;
} }
@ -1512,6 +1526,7 @@
padding: 38rpx; padding: 38rpx;
padding-bottom: 200rpx; padding-bottom: 200rpx;
width: 750rpx; width: 750rpx;
.weather_info { .weather_info {
position: fixed; position: fixed;
padding: 30rpx 50rpx; padding: 30rpx 50rpx;
@ -1884,25 +1899,29 @@
.sets { .sets {
position: relative; position: relative;
.menu{
.menu {
padding: 20rpx; padding: 20rpx;
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
width: 218rpx; width: 218rpx;
height: 234rpx; height: 234rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.15); box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
z-index: 10; z-index: 10;
.menu_li:first-child{
.menu_li:first-child {
margin-top: 10rpx; margin-top: 10rpx;
} }
.menu_li{
image{ .menu_li {
image {
margin-right: 14rpx; margin-right: 14rpx;
width: 38rpx; width: 38rpx;
height: 38rpx; height: 38rpx;
} }
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
color: #3D3D3D; color: #3D3D3D;
@ -1912,6 +1931,7 @@
align-items: center; align-items: center;
} }
} }
image { image {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
@ -1927,7 +1947,8 @@
height: 372rpx; height: 372rpx;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
.fxmask{
.fxmask {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -1943,6 +1964,7 @@
box-sizing: border-box; box-sizing: border-box;
font-weight: 600; font-weight: 600;
} }
.num { .num {
width: 180rpx; width: 180rpx;
position: absolute; position: absolute;

View File

@ -140,7 +140,7 @@
type: 3 type: 3
}, },
{ {
title: '加', title: '加',
type: 4 type: 4
}, },
{ {
@ -391,13 +391,25 @@
width: 750rpx; width: 750rpx;
.no_cont { .no_cont {
margin: 152rpx auto 0; // margin: 152rpx auto 0;
width: 432rpx; // width: 432rpx;
padding: 16rpx;
margin-left: -10rpx;
width: 100%;
height: 82vh;
background: #fff;
padding-left: 50rpx;
padding-top: 200rpx;
// overflow: scroll;
padding-bottom: 200rpx;
box-sizing: border-box;
.img { .img {
padding-left: 50rpx;
box-sizing: border-box;
image { image {
width: 432rpx; width: 350rpx;
height: 432rpx; height: 350rpx;
} }
} }

View File

@ -20,8 +20,7 @@
<view class="left_cont" :class="[ <view class="left_cont" :class="[
index=== currentIndex? 'act1' : '', index=== currentIndex? 'act1' : '',
index + 1 === currentIndex? 'act2' : '', index + 1 === currentIndex? 'act2' : '',
index- 1 === currentIndex? 'act3' : '' index- 1 === currentIndex? 'act3' : '']">
]">
{{item.title}} {{item.title}}
</view> </view>
</view> </view>
@ -177,7 +176,7 @@
this.pageNum = 1 this.pageNum = 1
this.rzlist = [] this.rzlist = []
if (this.title == '蜂箱预警记录') { if (this.title == '蜂箱预警记录') {
this.yjtxt = '该蜂场其他蜂箱' this.yjtxt = '其他蜂箱'
this.getfx() this.getfx()
this.getyuj() this.getyuj()
} else { } else {
@ -401,13 +400,23 @@
width: 750rpx; width: 750rpx;
.no_cont { .no_cont {
margin: 152rpx auto 0; padding: 16rpx;
width: 432rpx; margin-left: -10rpx;
width: 100%;
height: 82vh;
background: #fff;
padding-left: 50rpx;
padding-top: 200rpx;
// overflow: scroll;
padding-bottom: 200rpx;
box-sizing: border-box;
.img { .img {
padding-left: 50rpx;
box-sizing: border-box;
image { image {
width: 432rpx; width: 350rpx;
height: 432rpx; height: 350rpx;
} }
} }

View File

@ -30,6 +30,7 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
// //
{ {
"path": "pages/Apiary", "path": "pages/Apiary",
@ -202,6 +203,14 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, {
"path" : "Beehive_ec",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, },
{ {
"path" : "share_Beehive", "path" : "share_Beehive",

View File

@ -27,7 +27,7 @@
<view class="Apiary_card" v-for="(item,index) in list" :key="index" @click="btnapiaryxq(item.apiaryId)"> <view class="Apiary_card" v-for="(item,index) in list" :key="index" @click="btnapiaryxq(item.apiaryId)">
<image :src="item.picture" mode=""></image> <image :src="item.picture" mode=""></image>
<view class="weather"> <view class="weather">
<image src="https://api.ccttiot.com/smartmeter/img/static/u6wWpgZOuId6JSX8LGmz" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/u6wWpgZOuId6JSX8LGmz" mode="scaleToFill"></image>
<view class="txt1"> <view class="txt1">
多云 多云
</view> </view>
@ -66,7 +66,7 @@
total: '', total: '',
pagesize: 10, pagesize: 10,
logoflag: false, logoflag: false,
code: '' code: '',
} }
}, },
onLoad() { onLoad() {
@ -170,7 +170,7 @@
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15); box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx; border-radius: 20rpx 20rpx 20rpx 20rpx;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
image { image {
width: 674rpx; width: 674rpx;
height: 360rpx; height: 360rpx;
@ -221,7 +221,6 @@
width: 674rpx; width: 674rpx;
height: 70rpx; height: 70rpx;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
image { image {
width: 44rpx; width: 44rpx;
@ -250,7 +249,7 @@
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
width: 664rpx; width: 664rpx;
align-items: center;
.search { .search {
display: flex; display: flex;

View File

@ -43,7 +43,7 @@
<view class=""> <view class="">
</view> </view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uLpiGDDDvBwk7hOhOtVp" mode="" v-if=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uLpiGDDDvBwk7hOhOtVp" mode="scaleToFill" v-if=""></image>
</view> </view>
<view class="imgbox" v-else> <view class="imgbox" v-else>

View File

@ -302,7 +302,7 @@
}, },
btnpage() { btnpage() {
uni.switchTab({ uni.switchTab({
url: '/pages/Beehive' url: '/pages/Beehive?apiaryId=' + this.apiaryId
}) })
}, },
gettq() { gettq() {

View File

@ -88,7 +88,7 @@
type: 3 type: 3
}, },
{ {
title: '加', title: '加',
type: 4 type: 4
}, },
{ {
@ -118,7 +118,7 @@
token: '', token: '',
checked: false, checked: false,
id: '', id: '',
arrimg:[] arrimg: []
} }
}, },
onLoad(option) { onLoad(option) {
@ -131,7 +131,7 @@
this.getfc() this.getfc()
}, },
onShow() { onShow() {
this.imglist = []
}, },
methods: { methods: {
// //
@ -144,32 +144,32 @@
this.apiaryName = res.data.beehiveName this.apiaryName = res.data.beehiveName
this.textValue = res.data.content this.textValue = res.data.content
this.checked = res.data.apiaryLog this.checked = res.data.apiaryLog
if(res.data.picture.length > 0){ if (res.data.picture.length > 0) {
this.imglist = res.data.picture.split(',') this.imglist = res.data.picture.split(',')
}else{ } else {
this.imglist = [] this.imglist = []
} }
} }
}) })
}, },
imgdel(indexToRemove){ imgdel(indexToRemove) {
this.imglist = this.imglist.filter((item, index) => index !== indexToRemove) this.imglist = this.imglist.filter((item, index) => index !== indexToRemove)
}, },
btnedit(){ btnedit() {
if (this.imglist) { if (this.imglist) {
let validUrls = this.imglist.filter(item => typeof item === 'string') let validUrls = this.imglist.filter(item => typeof item === 'string')
this.arrimg = validUrls.join(',') this.arrimg = validUrls.join(',')
} }
let data = { let data = {
id:this.id, id: this.id,
beehiveId: this.apiaryId, beehiveId: this.apiaryId,
type: this.type, type: this.type,
content: this.textValue, content: this.textValue,
picture: this.arrimg, picture: this.arrimg,
apiaryLog: this.checked apiaryLog: this.checked
} }
this.$u.put(`/farm/beehive/log`,data).then(res => { this.$u.put(`/farm/beehive/log`, data).then(res => {
if(res.code == 200){ if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '编辑成功', title: '编辑成功',
icon: 'success', icon: 'success',
@ -178,7 +178,7 @@
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 1500) }, 1500)
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
@ -194,9 +194,19 @@
this.checked = e this.checked = e
}, },
btnadd() { btnadd() {
if (this.imglist) { if (this.apiaryId == '') {
let validUrls = this.imglist.filter(item => typeof item === 'string') uni.showToast({
title: '请选择蜂箱',
icon: 'none',
duration: 1000
})
} else {
if (this.imglist.length > 80) {
let validUrls = this.imglist.filter(item => typeof item == 'string')
this.imglist = validUrls.join(',') this.imglist = validUrls.join(',')
console.log(this.imglist.length);
}else{
this.imglist = this.imglist[0]
} }
let data = { let data = {
beehiveId: this.apiaryId, beehiveId: this.apiaryId,
@ -223,6 +233,7 @@
}) })
} }
}) })
}
}, },
confirmmy(e) { confirmmy(e) {
@ -464,7 +475,8 @@
padding-right: 10rpx; padding-right: 10rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
.xx{
.xx {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
border-radius: 50%; border-radius: 50%;
@ -477,6 +489,7 @@
top: -8rpx; top: -8rpx;
right: 0; right: 0;
} }
image { image {
height: 212rpx; height: 212rpx;
border-radius: 20rpx; border-radius: 20rpx;

View File

@ -17,8 +17,9 @@
</view> </view>
</view> </view>
<view class="tabbar"> <view class="tabbar">
<view class="cont" :id="indextab == index ? 'active' : ''" v-for="(item,index) in miyuancolumns" :key="index" @click="btntab(index,item)"> <view class="cont" v-for="(item,index) in miyuancolumns" :key="index" @click="btntab(index,item)">
{{item.label}} {{item.label}} <text v-if="item.count != '-1'">({{item.count}})</text>
<view class="gl" :id="indextab == index ? 'active' : ''"></view>
</view> </view>
</view> </view>
</view> </view>
@ -191,7 +192,7 @@
code: '', code: '',
swiperHeight:554, swiperHeight:554,
curtitidx:0, curtitidx:0,
miyuancolumns: [{label:'全部'}], miyuancolumns: [{label:'全部',count:'a'}],
pagesum: 1, pagesum: 1,
pagesize: 99, pagesize: 99,
pagesizes: 5, pagesizes: 5,
@ -203,9 +204,10 @@
} }
}, },
onLoad() { onLoad() {
// this.apiaryId = this.miyuancolumns[0].value
}, },
onShow() { onShow() {
this.indextab = 0
this.pagesum = 1 this.pagesum = 1
// this.fxlist = [] // this.fxlist = []
this.getmiyuancolumns() this.getmiyuancolumns()
@ -251,23 +253,21 @@
this.logoflag = true this.logoflag = true
}else{ }else{
this.logoflag = false this.logoflag = false
// let uniqueIds = new Set(this.fxlist.map(item => item.sn))
// let uniqueRows = res.rows.filter(row => !uniqueIds.has(row.sn))
// uniqueRows.forEach(row => uniqueIds.add(row.sn))
// this.fxlist = this.fxlist.concat(uniqueRows)
let oldSnSet = new Set(this.fxlist.map(item => item.sn)); let oldSnSet = new Set(this.fxlist.map(item => item.sn));
let result = []; let result = [];
res.rows.forEach(row => { res.rows.forEach(row => {
if (oldSnSet.has(row.sn)) { if (oldSnSet.has(row.sn)) {
result.push(row) result.push(row)
oldSnSet.delete(row.sn); oldSnSet.delete(row.sn)
} else { } else {
result.push(row); result.push(row)
} }
}) });
this.fxlist = this.fxlist.filter(item => oldSnSet.has(item.sn)); result.sort((a, b) => b.onlineStatus - a.onlineStatus) // 1 0
this.fxlist = result.filter(row => oldSnSet.has(row.sn))
this.fxlist = result; this.fxlist = result;
this.pagesum++ this.pagesum++;
} }
}else{ }else{
// uni.showToast({ // uni.showToast({
@ -298,9 +298,10 @@
if (res.code === 200) { if (res.code === 200) {
this.miyuancolumns = res.rows.map(item => ({ this.miyuancolumns = res.rows.map(item => ({
value: item.apiaryId, value: item.apiaryId,
label: item.name label: item.name,
count:item.beehiveCount
})) }))
this.miyuancolumns.unshift({ label: '全部',value:''}) this.miyuancolumns.unshift({ label: '全部',value:'',count:'-1'})
this.apiaryId = this.miyuancolumns[0].value this.apiaryId = this.miyuancolumns[0].value
this.logoflag = false this.logoflag = false
this.getlist() this.getlist()
@ -334,6 +335,7 @@
border-bottom: 3px solid #FFC107; border-bottom: 3px solid #FFC107;
font-weight: 600; font-weight: 600;
font-size: 40rpx; font-size: 40rpx;
display: block !important;
} }
#status{ #status{
background-color: #808080; background-color: #808080;
@ -477,6 +479,18 @@
font-weight: 400; font-weight: 400;
font-size: 36rpx; font-size: 36rpx;
color: #3D3D3D; color: #3D3D3D;
position: relative;
.gl{
width: 46rpx;
height: 46rpx;
background: #FFC107;
border-radius: 50%;
position: absolute;
top: 2rpx;
right: -10rpx;
opacity: .7;
display: none;
}
} }
} }
@ -487,7 +501,7 @@
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
width: 664rpx; width: 664rpx;
align-items: center;
.search { .search {
display: flex; display: flex;

View File

@ -52,7 +52,7 @@
</view> </view>
<view class="txt"> <view class="txt">
<view class="iconfont icon-xiangyou1"></view> <!-- <view class="iconfont icon-xiangyou1"></view> -->
</view> </view>
</view> </view>
@ -89,7 +89,7 @@
</view> </view>
<view class="txt"> <view class="txt">
<view class="iconfont icon-xiangyou1"></view> <!-- <view class="iconfont icon-xiangyou1"></view> -->
</view> </view>
</view> </view>

View File

@ -25,7 +25,7 @@
<view class="fclt"> <view class="fclt">
<image src="https://api.ccttiot.com/smartmeter/img/static/ukbyhyrDcp3VzgyeJo2G" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/ukbyhyrDcp3VzgyeJo2G" mode=""></image>
<view class="fctit">{{fxobj.name == undefined ? '--' : fxobj.name}}</view> <view class="fctit">{{fxobj.name == undefined ? '--' : fxobj.name}}</view>
<view class="fcry">已认养</view> <!-- <view class="fcry">已认养</view> -->
</view> </view>
<view class="fcrt" @click="fxslag = false"> <view class="fcrt" @click="fxslag = false">
x x
@ -80,7 +80,7 @@
<view class="fclt"> <view class="fclt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uB2k1NNeN2QUuSZIAf5r" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uB2k1NNeN2QUuSZIAf5r" mode=""></image>
<view class="fctit">{{fcobj.name == undefined ? '--' : fcobj.name}}</view> <view class="fctit">{{fcobj.name == undefined ? '--' : fcobj.name}}</view>
<view class="fcry">已认养</view> <!-- <view class="fcry">已认养</view> -->
</view> </view>
<view class="fcrt" @click="fcflag = false"> <view class="fcrt" @click="fcflag = false">
x x
@ -112,7 +112,7 @@
<view class="">当前湿度{{nowtqobj.humidity == undefined ? '--' : nowtqobj.humidity}}%</view> <view class="">当前湿度{{nowtqobj.humidity == undefined ? '--' : nowtqobj.humidity}}%</view>
</view> </view>
<view class="fcli"> <view class="fcli">
<view class="">在线{{fcobj.beehiveCount == undefined ? '--' : fcobj.beehiveCount}}</view> <view class="">总蜂箱{{fcobj.beehiveCount == undefined ? '--' : fcobj.beehiveCount}}</view>
</view> </view>
</view> </view>
<view class="btncha" @click="btnpage(2)"> <view class="btncha" @click="btnpage(2)">
@ -163,8 +163,6 @@
onShow() { onShow() {
this.getMyLocation() this.getMyLocation()
this.getMyLocations() this.getMyLocations()
}, },
onReady() { onReady() {
this.mapContext = uni.createMapContext('map', this) this.mapContext = uni.createMapContext('map', this)