This commit is contained in:
3321822538@qq.com 2024-07-12 18:14:24 +08:00
parent 3bb308e2b1
commit 03540b0720
11 changed files with 688 additions and 211 deletions

View File

@ -1,6 +1,6 @@
const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({
baseUrl: 'http://124.221.246.124:2291',
baseUrl: 'http://192.168.2.143:3202',
// baseUrl: 'https://fen.ccttiot.com/prod-api',
loadingText: '努力加载中~',
loadingTime: 800,

View File

@ -53,7 +53,10 @@
"libVersion" : "latest",
"appid" : "wxe092159cf34ef21a",
"setting" : {
"urlCheck" : false
"urlCheck" : false,
"minified" : true,
"postcss" : true,
"es6" : true
},
"usingComponents" : true,
"optimization" : {
@ -78,5 +81,6 @@
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
"vueVersion" : "2",
"fallbackLocale" : "zh-Hans"
}

View File

@ -113,9 +113,14 @@
{{obj.lastOnlineTime == undefined ? '--' : obj.lastOnlineTime}}
</view>
<view class="ele">
<image style="height: 25rpx;" v-if="obj.surplusPowerPoint <= 100 && obj.surplusPowerPoint > 90" src="https://api.ccttiot.com/smartmeter/img/static/uUDtZqG4vEMDSyFglw2O" mode=""></image>
<image style="height: 25rpx;" v-if="obj.surplusPowerPoint < 91 && obj.surplusPowerPoint > 20" src="https://api.ccttiot.com/smartmeter/img/static/uvCuPhgajbgui2Ankzwv" mode=""></image>
<image style="height: 25rpx;" v-if="obj.surplusPowerPoint < 21 || obj.surplusPowerPoint == 0" src="https://api.ccttiot.com/smartmeter/img/static/uVgUKpW05NMPRbdIRL8b" mode=""></image>
<image style="height: 25rpx;" v-if="obj.surplusPowerPoint <= 100 && obj.surplusPowerPoint >= 80"
src="https://api.ccttiot.com/smartmeter/img/static/uWbKPMvIuFZjzviEJjmP" mode=""></image>
<image style="height: 25rpx;" v-if="obj.surplusPowerPoint < 80 && obj.surplusPowerPoint >= 50"
src="https://api.ccttiot.com/smartmeter/img/static/u0mCXpSrvcROLCMsahNh" mode=""></image>
<image style="height: 25rpx;" v-if="obj.surplusPowerPoint < 50 && obj.surplusPowerPoint >= 20"
src="https://api.ccttiot.com/smartmeter/img/static/uGGgEPbe8ryHspQPL2o8" mode=""></image>
<image style="height: 25rpx;" v-if="obj.surplusPowerPoint < 20"
src="https://api.ccttiot.com/smartmeter/img/static/uIRhPmP5WUJaIg0nft9E" mode=""></image>
{{obj.surplusPowerPoint == undefined ? '--' : obj.surplusPowerPoint}}%
</view>
</view>
@ -123,7 +128,8 @@
<view class="echarts_top">
<view class="top_left">
温度
<image style="width: 36rpx;height: 34rpx;" src="https://api.ccttiot.com/smartmeter/img/static/utoKXhZBoejfRZwNUMP9" mode=""></image>
<image style="width: 36rpx;height: 34rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/utoKXhZBoejfRZwNUMP9" mode=""></image>
</view>
<view class="top_cont">
当前 {{obj.innerTemperature == undefined ? '--' : obj.innerTemperature}}
@ -148,7 +154,8 @@
<view class="echarts_top">
<view class="top_left">
湿度
<image style="width: 30rpx;height: 32rpx;" src="https://api.ccttiot.com/smartmeter/img/static/una6Kbd2gdBZ9gG6lg44" mode=""></image>
<image style="width: 30rpx;height: 32rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/una6Kbd2gdBZ9gG6lg44" mode=""></image>
</view>
<view class="top_cont">
当前 {{obj.innerHumidity}}%
@ -173,7 +180,8 @@
<view class="echarts_top">
<view class="top_left">
重量
<image style="width: 28rpx;height: 33rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uk7CvwzeU0ukxvS9cBtD" mode=""></image>
<image style="width: 28rpx;height: 33rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uk7CvwzeU0ukxvS9cBtD" mode=""></image>
</view>
<view class="top_cont">
当前 {{obj.totalWeight == 999999 ? '--' : (obj.totalWeight / 1000).toFixed(1)}}kg
@ -198,7 +206,8 @@
<view class="echarts_top">
<view class="top_left">
进出量
<image style="width: 33rpx;height: 33rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uhsU6Y1K35jxA4aRauzy" mode=""></image>
<image style="width: 33rpx;height: 33rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uhsU6Y1K35jxA4aRauzy" mode=""></image>
</view>
<view class="top_cont">
当前 {{obj.ioCountDay}}
@ -223,7 +232,8 @@
<view class="echarts_top">
<view class="top_left">
频率
<image style="width: 38rpx;height: 32rpx;" src="https://api.ccttiot.com/smartmeter/img/static/up9IaGzSg1RKhIZz3V7a" mode=""></image>
<image style="width: 38rpx;height: 32rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/up9IaGzSg1RKhIZz3V7a" mode=""></image>
</view>
<view class="top_cont">
当前 {{obj.volume / 1000 == 0 ? obj.volume : (obj.volume / 1000).toFixed(1)}}khz
@ -248,7 +258,8 @@
<view class="echarts_top">
<view class="top_left">
二氧化碳
<image style="width: 36rpx;height: 38rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uAw3ZCXnMbekNML7CTSu" mode=""></image>
<image style="width: 36rpx;height: 38rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uAw3ZCXnMbekNML7CTSu" mode=""></image>
</view>
<view class="top_cont">
当前 {{obj.innerCo2}}ppm
@ -293,14 +304,17 @@
<view class="week">
{{item.textDay}}
</view>
<view class="week_weather">
<view class="week_weather" >
{{item.windDirDay}}
</view>
<view class="week_weather_img">
<!-- <view class="week_weather_img">
<image src="https://api.ccttiot.com/smartmeter/img/static/u6wWpgZOuId6JSX8LGmz" mode=""></image>
</view>
</view> -->
</view>
</view>
<!-- <view class="xqtq" style="color: #42A5F5;" @click="btntqxq">
天气详情
</view> -->
<view class="echarts_box">
<uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas7" canvas-id="uni-ec-canvas"
:ec="ec">
@ -387,15 +401,17 @@
daytime: '',
covers: [],
dtflag: false,
modelTags:[],
height:false,
io:false,
xnwd:false,
xnsd:false,
sypl:false,
eyht:false,
beep:false
modelTags: [],
height: false,
io: false,
xnwd: false,
xnsd: false,
sypl: false,
eyht: false,
beep: false,
timer: null,
}
},
onLoad(option) {
@ -429,12 +445,65 @@
this.getchartData4()
this.getchartData5()
this.getchartData6()
//
this.startTimer()
},
onUnload() {
//
this.clearTimer()
},
methods: {
//
btntqxq(){
},
// 30
startTimer() {
if (this.timer) {
clearInterval(this.timer); //
}
this.timer = setInterval(() => {
//
this.$u.put(`/app/beehive/iot/${this.beehiveId}/upload`).then(res => {
if (res.code == 200) {
setTimeout(() => {
this.$refs.canvas1.init(this.initChart)
this.$refs.canvas2.init(this.initChart2)
this.$refs.canvas3.init(this.initChart3)
this.$refs.canvas4.init(this.initChart4)
this.$refs.canvas5.init(this.initChart5)
this.$refs.canvas6.init(this.initChart6)
this.$refs.canvas7.init(this.initChart7)
}, 1000)
this.getobj()
let now = new Date();
let previousDay = new Date(now)
this.yeartime.year = now.getFullYear()
this.yeartime.month = String(previousDay.getMonth() + 1).padStart(2, '0')
this.yeartime.day = String(now.getDate()).padStart(2, '0')
previousDay.setDate(now.getDate() - 7)
this.yeartimes.year = previousDay.getFullYear()
this.yeartimes.month = String(previousDay.getMonth() + 1).padStart(2, '0')
this.yeartimes.day = String(previousDay.getDate()).padStart(2, '0')
this.getchartData1()
this.getchartData2()
this.getchartData3()
this.getchartData4()
this.getchartData5()
this.getchartData6()
}
})
}, 30000); // 30
},
clearTimer() {
//
if (this.timer) {
clearInterval(this.timer);
this.timer = null; //
}
},
//
btnec(num) {
uni.navigateTo({
@ -443,7 +512,8 @@
},
btnvideo() {
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
})
},
btngd() {
@ -502,11 +572,11 @@
let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.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 => {
if (res.code == 200) {
this.chartData3 = res.data.map(item => item.value)
}
})
res => {
if (res.code == 200) {
this.chartData3 = res.data.map(item => item.value)
}
})
},
//
getchartData4() {
@ -670,18 +740,18 @@
this.longitude = res.data.lng
this.modelTags = res.data.modelTags
this.modelTags.forEach(item => {
if(item == 1){
if (item == 1) {
this.height = true
}else if(item == 2){
} else if (item == 2) {
this.io = true
}else if(item == 3){
} else if (item == 3) {
this.xnwd = true
this.xnsd = true
}else if(item == 10){
} else if (item == 10) {
this.sypl = true
}else if(item == 9){
} else if (item == 9) {
this.eyht = true
}else if(item == 13){
} else if (item == 13) {
this.beep = true
}
})
@ -696,8 +766,9 @@
this.jrkg = '开'
}
if (res.data.lat == 0 && res.data.lng == 0) {
console.log('未找到位置信息');
this.zoomSize = 5
this.latitude = 39.56
this.longitude = 116.20
this.zoomSize = 1
this.dtflag = true
} else {
this.dtflag = false
@ -1557,7 +1628,7 @@
.page {
// position: relative;
padding: 38rpx;
padding-bottom: 200rpx;
width: 750rpx;
@ -1605,7 +1676,7 @@
text-align: center;
width: 72rpx;
font-weight: 600;
font-size: 36rpx;
font-size: 24rpx;
color: #50565A;
}
@ -1993,7 +2064,8 @@
opacity: .5;
z-index: 99;
color: #fff;
text-align: center;
// text-align: center;
padding-left: 10rpx;
font-size: 36rpx;
padding-top: 288rpx;
box-sizing: border-box;

View File

@ -10,7 +10,7 @@
<view v-if="title == '添加蜂箱'" class="qrcode" @click="btnqrcode">
<image src="https://api.ccttiot.com/smartmeter/img/static/uy7BNwAMIKwvstqFnRhs" mode=""></image>
</view>
<view v-else class="qrcode">
<view v-else class="qrcode" @click="btnqrcode">
<image src="https://api.ccttiot.com/smartmeter/img/static/uy7BNwAMIKwvstqFnRhs" mode=""></image>
</view>
<input v-if="title == '添加蜂箱'" type="text" class="ips" v-model="sn" placeholder="请扫描蜂箱上的二维码" style="margin-left: 32rpx;"
@ -181,10 +181,15 @@
onlyFromCamera: true,
scanType: ['qrCode'],
success: res => {
this.sn = res.result
let url = res.result
let sIndex = url.indexOf('s=')
if (sIndex !== -1) {
this.sn = url.substring(sIndex + 2);
} else {
this.sn = res.result
}
},
fail: err => {
console.error('扫描失败:', err)
uni.showToast({
title: '扫描失败',
icon: 'none'

View File

@ -8,19 +8,21 @@
除螨设置
</view>
<view class="tit1">
<image src="https://api.ccttiot.com/smartmeter/img/static/utZh1saVjZgOBz3orDkL" mode=""></image>
<image style="width: 42rpx;height: 42rpx;" src="https://api.ccttiot.com/smartmeter/img/static/utZh1saVjZgOBz3orDkL" mode=""></image>
间隔时长
</view>
<view class="set_li">
每隔<view class="ipt_box"><input type="text" class="ips" v-model="miteInterval" placeholder=" "
placeholder-class="my-placeholder" /> </view>/ &nbsp;&nbsp; 除螨工作
placeholder-class="my-placeholder" /> </view>/ &nbsp;&nbsp; 除螨工作
</view>
<view class="tit" style="margin-top: 58rpx;">
<image style="width: 52rpx;height: 52rpx;" src="https://api.ccttiot.com/smartmeter/img/static/ulPpf3J16ARy14XH4R7r" mode=""></image>
<image style="width: 52rpx;height: 52rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/ulPpf3J16ARy14XH4R7r" mode=""></image>
保护设置
</view>
<view class="tit1">
<image style="width: 40rpx;height: 41rpx;" src="https://api.ccttiot.com/smartmeter/img/static/ul8NIQoFMG44Nj0W1geF" mode=""></image>
<image style="width: 40rpx;height: 41rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/ul8NIQoFMG44Nj0W1geF" mode=""></image>
电量保护%
</view>
<view class="set_li">
@ -164,25 +166,32 @@
},
methods: {
btncz(){
this.miteInterval = 15
this.minPower = 20
this.minHeat = 0
this.maxHeat = 5
this.maxFan = 35
this.minFan = 20
this.minCo2 = 400
this.maxCo2 = 440
this.list.forEach(item => {
if (item.checked) {
item.checked = false;
}
})
this.lists.forEach(item => {
if (item.checked) {
item.checked = false;
}
btncz() {
this.$u.get(`/farm/userSetting/default`).then(res => {
if (res.code == 200) {
this.miteInterval = res.data.miteInterval
this.minPower = res.data.minPower
this.minHeat = res.data.minHeat
this.maxHeat = res.data.maxHeat
this.maxFan = res.data.maxFan
this.minFan = res.data.minFan
this.minCo2 = res.data.minCo2
this.maxCo2 = res.data.maxCo2
this.value = []
this.values = []
this.list.forEach(item => {
if (item.checked) {
item.checked = false;
}
})
this.lists.forEach(item => {
if (item.checked) {
item.checked = false;
}
})
}
})
},
checkboxChange(e) {
let index = this.value.indexOf(e)
@ -235,7 +244,7 @@
minHeat: this.minHeat,
maxHeat: this.maxHeat,
maxFan: this.maxFan,
minFan:this.minFan,
minFan: this.minFan,
minCo2: this.minCo2,
maxCo2: this.maxCo2,
singleNotice: this.value,
@ -248,9 +257,9 @@
icon: 'success',
duration: 1000
})
}else if(res.code == 401){
} else if (res.code == 401) {
uni.navigateTo({
url:'/pages/login/login'
url: '/pages/login/login'
})
} else {
uni.showToast({
@ -267,9 +276,10 @@
</script>
<style lang="scss">
/deep/ .u-checkbox{
/deep/ .u-checkbox {
margin-right: 80rpx;
}
page {
background-color: #F4FAF8;
}
@ -335,6 +345,7 @@
.tit1 {
margin-top: 30rpx;
margin-left: 6rpx;
display: flex;
flex-wrap: nowrap;
align-items: center;
@ -360,7 +371,7 @@
font-weight: 400;
font-size: 32rpx;
color: #808080;
.ipt_box {
display: flex;
align-items: center;

View File

@ -165,6 +165,15 @@
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path" : "fengchangxq",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
// userpages ...
]

View File

@ -26,15 +26,16 @@
<scroll-view v-else class="Apiary_box" scroll-y="true" @scrolltolower="loadMore">
<view class="Apiary_card" v-for="(item,index) in list" :key="index" @click="btnapiaryxq(item.apiaryId)">
<image :src="item.picture" mode=""></image>
<view class="weather">
<image src="https://api.ccttiot.com/smartmeter/img/static/u6wWpgZOuId6JSX8LGmz" mode="scaleToFill"></image>
<!-- <view class="weather">
<image src="https://api.ccttiot.com/smartmeter/img/static/u6wWpgZOuId6JSX8LGmz" mode="scaleToFill">
</image>
<view class="txt1">
多云
</view>
<view class="txt2">
温度舒适湿润光照强空气优
</view>
</view>
</view> -->
<view class="info">
<view class="left">
{{item.name}}
@ -50,6 +51,7 @@
</scroll-view>
<tab-bar :indexs='1' style=""></tab-bar>
<u-toast ref="uToast" />
</view>
</template>
@ -70,7 +72,7 @@
}
},
onLoad() {
},
onShow() {
this.pagesum = 1
@ -103,11 +105,16 @@
if (this.list.length < this.total) {
this.ishave();
} else {
uni.showToast({
title: '没有更多蜂场了',
icon: 'none',
duration: 1000
});
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 1000
// });
this.$refs.uToast.show({
title: '没有更多蜂场了',
type: 'default',
position:'bottom'
})
}
},
addApiary() {
@ -126,9 +133,9 @@
if (this.total < 1) {
this.logoflag = true;
} else {
if(this.pagesum > 1){
if (this.pagesum > 1) {
this.list = this.list.concat(res.rows)
}else{
} else {
this.list = res.rows
}
this.pagesum++;
@ -170,7 +177,8 @@
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 20rpx 20rpx 20rpx 20rpx;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
image {
width: 674rpx;
height: 360rpx;
@ -221,7 +229,7 @@
top: 0;
width: 674rpx;
height: 70rpx;
background-color: rgba(255, 255, 255, 0.5);
background-color: rgba(255, 255, 255, 0.5);
image {
width: 44rpx;
@ -250,7 +258,8 @@
display: flex;
flex-wrap: nowrap;
width: 664rpx;
align-items: center;
align-items: center;
.search {
display: flex;

View File

@ -28,7 +28,7 @@
{{daily[0].humidity == undefined ? '--' : daily[0].humidity}} %
</view>
</view>
<image @click="btnedfc" style="width: 44rpx;height: 44rpx;position: absolute;top: 228rpx;right:36rpx ;"
<image @click="btnedfc" style="width: 44rpx;height: 44rpx;position: absolute;top: 224rpx;right:36rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ" mode=""></image>
</view>
<view class="info_box">
@ -68,7 +68,7 @@
</view>
</view>
<view class="tit">
具体位
</view>
<view class="setbox">
<view class="setcard" @click="btnship">
@ -104,45 +104,65 @@
</view>
</view>
</view>
<view class="tit">
蜂场变化
</view>
<view class="swiper-item" @click="btntu">
<view class="card_box">
<view class="card">
<view class="card_top">
<view class="top_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/uk7CvwzeU0ukxvS9cBtD"
mode=""></image>
近7天蜂箱总重量变化
</view>
<view class="top_right">
<view style="width: 1rpx;">
</view>
<view class="txt">
<view class="iconfont icon-xiangyou1"></view>
</view>
</view>
</view>
<view class="echarts">
<uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas3" canvas-id="uni-ec-canvas"
:ec="ec">
</uni-ec-canvas>
</view>
</view>
</view>
</view>
<view class="swiper-item" @click="btntu">
<view class="card_box">
<view class="card">
<view class="card_top">
<view class="top_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/uhsU6Y1K35jxA4aRauzy" mode=""></image>
近7天蜜蜂总出勤变化
</view>
<view class="top_right">
<view style="width: 1rpx;">
</view>
<view class="txt">
<view class="iconfont icon-xiangyou1"></view>
</view>
</view>
</view>
<view class="echarts">
<uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas4" canvas-id="uni-ec-canvas" :ec="ec">
</uni-ec-canvas>
</view>
</view>
</view>
</view>
<u-mask :show="showtq" @click="showtq = false" :z-index='100' duration='0' />
<!-- <view class="weather_info" v-show="showtq">
<view class="top">
<view class="weather_info_tit">
未来7日天气预知
</view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uQK4q99a1Qb7LFD6O3Hw" mode=""
@click="showtq = false"></image>
</view>
<view class="top" style="margin-top: 14rpx;">
<view class="weather_add">
蜂场位置<span style="color: #42A5F5;">{{apiaryobj.apiaryCounty}}</span>
</view>
<view class="up_time">
{{daytime}}更新
</view>
</view>
<view class="weather_cont">
<view class="weather_li" v-for="(item,index) in daily" :key="index">
<view class="data">
{{item.fxDate.slice(5)}}
</view>
<view class="week">
{{item.textDay}}
</view>
<view class="week_weather">
{{item.windDirDay}}
</view>
<view class="week_weather_img">
<image src="https://api.ccttiot.com/smartmeter/img/static/u6wWpgZOuId6JSX8LGmz" mode=""></image>
</view>
</view>
</view>
<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>
</view>
</view> -->
<view class="weather_info" v-show="showtq">
<view class="top">
<view class="weather_info_tit">
@ -153,7 +173,7 @@
</view>
<view class="top" style="margin-top: 14rpx;">
<view class="weather_add">
蜂场位置<span style="color: #42A5F5;">{{obj.apiaryCounty}}</span>
蜂场位置<span style="color: #42A5F5;">{{apiaryobj.county}}</span>
</view>
<view class="up_time">
{{daytime}}更新
@ -167,12 +187,9 @@
<view class="week">
{{item.textDay}}
</view>
<view class="week_weather">
<view class="week_weather" >
{{item.windDirDay}}
</view>
<view class="week_weather_img">
<image src="https://api.ccttiot.com/smartmeter/img/static/u6wWpgZOuId6JSX8LGmz" mode=""></image>
</view>
</view>
</view>
<view class="echarts_box">
@ -240,22 +257,74 @@
strokeColor: "#78addd",
strokeWidth: 1,
zIndex: 1,
}]
}],
yeartime: {
year: '',
month: '',
day: ''
},
yeartimes: {
year: '',
month: '',
day: ''
},
chartData3: [],
chartData4: [],
}
},
onLoad(option) {
setTimeout(() => {
this.$refs.canvas7.init(this.initChart7)
this.$refs.canvas3.init(this.initChart3)
this.$refs.canvas4.init(this.initChart4)
}, 1000)
this.apiaryId = option.id
this.getfcxq()
this.getMyLocation()
},
onShow() {
const now = new Date();
const previousDay = new Date(now)
this.yeartime.year = now.getFullYear()
this.yeartime.month = String(previousDay.getMonth() + 1).padStart(2, '0')
this.yeartime.day = String(now.getDate()).padStart(2, '0')
previousDay.setDate(now.getDate() - 7)
this.yeartimes.year = previousDay.getFullYear()
this.yeartimes.month = String(previousDay.getMonth() + 1).padStart(2, '0')
this.yeartimes.day = String(previousDay.getDate()).padStart(2, '0')
this.getchartData3()
this.getchartData4()
},
methods: {
btntu(){
uni.navigateTo({
url:'/page_user/fengchangxq?beehiveId=' + this.apiaryId
})
},
//
getchartData3() {
let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/weightDay?dateRange=${times},${time}&apiaryId=${this.apiaryId}`).then(res => {
if (res.code == 200) {
this.chartData3 = res.data.map(item => item.value)
this.$refs.canvas3.init(this.initChart3)
}
})
},
//
getchartData4() {
let time = this.yeartime.year + '-' + this.yeartime.month + '-' + this.yeartime.day
let times = this.yeartimes.year + '-' + this.yeartimes.month + '-' + this.yeartimes.day
this.$u.get(`/farmer/report/ioCount?dateRange=${times},${time}&apiaryId=${this.apiaryId}`).then(res => {
if (res.code == 200) {
this.chartData4 = res.data.map(item => item.value)
this.$refs.canvas4.init(this.initChart4)
}
})
},
//
btnpageyj(){
uni.navigateTo({
@ -588,6 +657,222 @@
chart.setOption(option)
return chart
},
//
initChart4(canvas, width, height, canvasDpr) {
let that = this
const option = {
grid: {
left: '4%',
right: '4%',
bottom: '3%',
top: '4%',
containLabel: true
},
xAxis: {
show: true,
type: 'category',
boundaryGap: false,
axisLine: {
show: false // X线
},
axisTick: {
show: false // X
},
axisLabel: {
show: false // X
},
axisLabel: {
show: true,
color: '#ccc',
fontSize: 11,
rotate: 0,
},
splitLine: {
show: false,
},
// data: that.chartday,
},
yAxis: {
show: true,
axisLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
show: true,
color: '#ccc',
fontSize: 11,
formatter: function(value) {
// 00
return Math.ceil(value) + '只'
},
},
splitLine: {
show: true, // X线
lineStyle: {
type: 'dashed', // 线线
color: '#ccc', // 线
width: 1 // 线
}
}
},
visualMap: {
type: 'piecewise',
show: false,
dimension: 0,
seriesIndex: 0,
pieces: [{
gt: 1,
lt: 3,
color: 'RGBA(255, 241, 201, 1)',
},
{
gt: 5,
lt: 7,
color: 'RGBA(255, 241, 201, 1)',
},
],
},
series: [{
type: 'line',
smooth: 0.6,
symbol: 'none',
lineStyle: {
color: '#FFE28C',
width: 4,
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#FFF1C9'
}, ]),
},
},
data: that.chartData4,
}],
};
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: canvasDpr
})
option.series[0].data = that.chartData4
canvas.setChart(chart)
chart.setOption(option)
return chart
},
//
initChart3(canvas, width, height, canvasDpr) {
let that = this
const option = {
grid: {
left: '4%',
right: '4%',
bottom: '3%',
top: '4%',
containLabel: true
},
xAxis: {
show: true,
type: 'category',
boundaryGap: false,
axisLine: {
show: false // X线
},
axisTick: {
show: false // X
},
axisLabel: {
show: false // X
},
axisLabel: {
show: true,
color: '#ccc',
fontSize: 11,
rotate: 0,
},
splitLine: {
show: false,
},
// data: that.chartday,
},
yAxis: {
show: true,
axisLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
show: true,
color: '#ccc',
fontSize: 11,
formatter: function(value) {
// 00
return (value / 1000).toFixed(1) + 'Kg'
},
},
splitLine: {
show: true, // X线
lineStyle: {
type: 'dashed', // 线线
color: '#ccc', // 线
width: 1 // 线
}
}
},
visualMap: {
type: 'piecewise',
show: false,
dimension: 0,
seriesIndex: 0,
pieces: [{
gt: 1,
lt: 3,
color: 'RGBA(255, 241, 201, 1)',
},
{
gt: 5,
lt: 7,
color: 'RGBA(255, 241, 201, 1)',
},
],
},
series: [{
type: 'line',
smooth: 0.6,
symbol: 'none',
lineStyle: {
color: '#FFE28C',
width: 4,
},
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#FFF1C9'
}, ]),
},
},
data: that.chartData3,
}],
};
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: canvasDpr
})
option.series[0].data = that.chartData3
canvas.setChart(chart)
chart.setOption(option)
return chart
},
}
}
@ -607,7 +892,93 @@
.page {
position: relative;
width: 750rpx;
.swiper-item {
display: flex;
justify-content: center;
transition: height 0.3s ease-in-out;
margin-top: 34rpx;
&.active {
height: 500rpx; //
}
&:not(.active) {
height: 426rpx; //
}
.card_box {
display: flex;
flex-wrap: wrap;
.card {
padding: 18rpx;
width: 638rpx;
height: 426rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
border-radius: 28rpx 28rpx 28rpx 28rpx;
.card_top {
display: flex;
align-items: center;
.top_left {
display: flex;
align-items: center;
font-weight: 400;
font-size: 36rpx;
color: #3D3D3D;
image {
margin-right: 24rpx;
margin-left: 28rpx;
width: 40rpx;
height: 45rpx;
}
}
.top_cont {
width: 33.33%;
text-align: center;
font-weight: 600;
font-size: 36rpx;
color: #3D3D3D;
}
.top_right {
margin-left: auto;
display: flex;
align-items: center;
.txt {
display: flex;
align-items: center;
flex-wrap: nowrap;
margin-left: auto;
font-weight: 400;
font-size: 32rpx;
color: #4D4D4D;
.icon-xiangyou1 {
margin-top: 4rpx;
margin-left: 8rpx;
}
}
}
}
.echarts {
margin-top: 24rpx;
width: 100%;
// height: 80%;
height: 344rpx;
}
}
}
}
.pops {
position: fixed;
left: 98rpx;
@ -693,8 +1064,7 @@
width: 750rpx;
height: 820rpx;
background: #FFFFFF;
z-index: 200;
z-index: 999 !important;
border-radius: 20rpx 20rpx 0rpx 0rpx;
.echarts_box {
@ -728,7 +1098,7 @@
text-align: center;
width: 72rpx;
font-weight: 600;
font-size: 36rpx;
font-size: 24rpx;
color: #50565A;
}

View File

@ -51,10 +51,10 @@
已认养
</view> -->
<view class="ele">
<image style="height: 25rpx;" v-if="item.surplusPowerPoint <= 100 && item.surplusPowerPoint > 90" src="https://api.ccttiot.com/smartmeter/img/static/uUDtZqG4vEMDSyFglw2O" mode=""></image>
<!-- <image v-if="item.surplusPowerPoint < 90 && item.surplusPowerPoint > 50" src="https://api.ccttiot.com/smartmeter/img/static/uWDVO6wzl5tRe8X3rmhT" mode=""></image> -->
<image style="height: 25rpx;" v-if="item.surplusPowerPoint < 91 && item.surplusPowerPoint > 20" src="https://api.ccttiot.com/smartmeter/img/static/uvCuPhgajbgui2Ankzwv" mode=""></image>
<image style="height: 25rpx;" v-if="item.surplusPowerPoint < 21 || item.surplusPowerPoint == 0" src="https://api.ccttiot.com/smartmeter/img/static/uVgUKpW05NMPRbdIRL8b" mode=""></image>
<image style="height: 25rpx;" v-if="item.surplusPowerPoint <= 100 && item.surplusPowerPoint >= 80" src="https://api.ccttiot.com/smartmeter/img/static/uWbKPMvIuFZjzviEJjmP" mode=""></image>
<image style="height: 25rpx;" v-if="item.surplusPowerPoint < 80 && item.surplusPowerPoint >= 50" src="https://api.ccttiot.com/smartmeter/img/static/u0mCXpSrvcROLCMsahNh" mode=""></image>
<image style="height: 25rpx;" v-if="item.surplusPowerPoint < 50 && item.surplusPowerPoint >= 20" src="https://api.ccttiot.com/smartmeter/img/static/uGGgEPbe8ryHspQPL2o8" mode=""></image>
<image style="height: 25rpx;" v-if="item.surplusPowerPoint < 20" src="https://api.ccttiot.com/smartmeter/img/static/uIRhPmP5WUJaIg0nft9E" mode=""></image>
{{item.surplusPowerPoint}}%
</view>
</view>
@ -84,30 +84,6 @@
重量
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 2">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uhsU6Y1K35jxA4aRauzy" mode=""></image>
<view class="li_txt">
{{item.ioCount}}
<span></span>
</view>
</view>
<view class="li_bot">
进出量
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 9">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/um4lfl5q2O7FNM1EQc2L" mode=""></image>
<view class="li_txt">
{{item.innerCo2 == 0 ? '--' : item.innerCo2}}
<span>ppm</span>
</view>
</view>
<view class="li_bot">
二氧化碳
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 3">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/una6Kbd2gdBZ9gG6lg44 " mode=""></image>
@ -120,6 +96,31 @@
箱内湿度
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 3">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uWjV9HEHrP5g0B5AHD1j" mode=""></image>
<view class="li_txt">
{{item.innerTemperature < -40 || item.innerTemperature > 100 || item.innerHumidity < -40 || item.innerHumidity > 100 ? '--' : item.innerTemperature}}
<span></span>
</view>
</view>
<view class="li_bot">
箱内温度
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 2">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uhsU6Y1K35jxA4aRauzy" mode=""></image>
<view class="li_txt">
{{item.ioCount}}
<span></span>
</view>
</view>
<view class="li_bot">
进出量
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 4">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/una6Kbd2gdBZ9gG6lg44" mode=""></image>
@ -133,30 +134,6 @@
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 10">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/up9IaGzSg1RKhIZz3V7a" mode=""></image>
<view class="li_txt">
{{item.volume / 1000 == 0 ? '--' : (item.volume / 1000).toFixed(1)}}
<span>khz</span>
</view>
</view>
<view class="li_bot">
频率
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 3">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uWjV9HEHrP5g0B5AHD1j" mode=""></image>
<view class="li_txt">
{{item.innerTemperature < -40 || item.innerTemperature > 100 || item.innerHumidity < -40 || item.innerHumidity > 100 ? '--' : item.innerTemperature}}
<span></span>
</view>
</view>
<view class="li_bot">
箱内温度
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 4">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uWjV9HEHrP5g0B5AHD1j" mode=""></image>
@ -169,6 +146,32 @@
箱外温度
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 9">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/um4lfl5q2O7FNM1EQc2L" mode=""></image>
<view class="li_txt">
{{item.innerCo2 == 0 ? '--' : item.innerCo2}}
<span>ppm</span>
</view>
</view>
<view class="li_bot">
二氧化碳
</view>
</view>
<view class="info_li" v-for="(val,index) in item.modelTags" :key="index" v-if="val == 10">
<view class="li_top">
<image src="https://api.ccttiot.com/smartmeter/img/static/up9IaGzSg1RKhIZz3V7a" mode=""></image>
<view class="li_txt">
{{item.volume / 1000 == 0 ? '--' : (item.volume / 1000).toFixed(1)}}
<span>khz</span>
</view>
</view>
<view class="li_bot">
频率
</view>
</view>
</view>
</view>
@ -181,7 +184,7 @@
<tab-bar :indexs='2' style=""></tab-bar>
<u-toast ref="uToast" />
</view>
</template>
@ -293,11 +296,16 @@
if (this.fxlist.length < this.total) {
this.getlist()
} else {
uni.showToast({
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 1000
// });
this.$refs.uToast.show({
title: '没有更多蜂箱了',
icon: 'none',
duration: 1000
});
type: 'default',
position:'bottom'
})
}
},
getmiyuancolumns() {

View File

@ -72,26 +72,20 @@
</swiper-item>
<swiper-item>
<view class="swiper-item">
<view class="card_box">
<view class="card">
<view class="card_top">
<view class="top_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/uk7CvwzeU0ukxvS9cBtD"
mode=""></image>
近7天蜂箱总重量变化
</view>
<view class="top_right">
<view style="width: 1rpx;">
</view>
<view class="txt">
<!-- <view class="iconfont icon-xiangyou1"></view> -->
</view>
</view>
</view>
<view class="echarts">
@ -100,7 +94,6 @@
</uni-ec-canvas>
</view>
</view>
</view>
</view>
</swiper-item>
@ -601,7 +594,7 @@
fontSize: 11,
formatter: function(value) {
// 00
return value + 'Kg'
return value / 1000 + 'Kg'
},
},
splitLine: {

View File

@ -305,9 +305,7 @@
this.latitude = Number(res.latitude.toFixed(5)) - 0.004
this.longitude = Number(res.longitude.toFixed(5)) + 0.004
this.setMapScale()
this.$u.get("/farm/beehive/listNearBy?center=" + this.jinweidu + '&radius=' + 1000)
.then(
res => {
this.$u.get('/farm/beehive/listAll').then(res => {
if (res.code == 200) {
//
this.listmaps = res.data
@ -348,9 +346,7 @@
this.jinweidu = res.longitude + ',' + res.latitude
this.latitude = Number(res.latitude.toFixed(5)) - 0.004
this.longitude = Number(res.longitude.toFixed(5)) + 0.004
this.$u.get("/farm/apiary/listNearBy?center=" + this.jinweidu + '&radius=' + 1000)
.then(
res => {
this.$u.get('/farm/apiary/listAll').then(res => {
if (res.code == 200) {
//
this.listmap = res.data