aaa
This commit is contained in:
parent
e40f4ad0f4
commit
f09348e8b9
|
@ -21,10 +21,10 @@
|
|||
</view>
|
||||
<view class="tit">
|
||||
{{obj.name}}-{{obj.sn}}
|
||||
<view class="sets" v-if="false">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ" mode=""></image>
|
||||
<view class="menu">
|
||||
<view class="menu_li">
|
||||
<view class="sets">
|
||||
<image @click="btnmenu" src="https://api.ccttiot.com/smartmeter/img/static/ulHBKvkXDfe9OIveIJKZ" mode=""></image>
|
||||
<view class="menu" v-if="menuflag">
|
||||
<view class="menu_li" @click="btnedit">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uE84FLJ6hKTfgt6gxYMw" mode=""></image>
|
||||
编辑信息
|
||||
</view>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/uBfAFsDIhqFTFKxL0PVP" mode=""></image>
|
||||
投放认养
|
||||
</view>
|
||||
<view class="menu_li">
|
||||
<view class="menu_li" @click="btnfx">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uwkwkl1CDZfUhQyZdNFY" mode=""></image>
|
||||
分享认养
|
||||
</view>
|
||||
|
@ -52,7 +52,7 @@
|
|||
{{daily[0].windDirDay}} {{daily[0].windSpeedDay}}级
|
||||
</view>
|
||||
</view>
|
||||
<view class="weather_right">
|
||||
<view class="weather_right" @click="showtq = true">
|
||||
更多天气 <view class="iconfont icon-xiangyou1"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -60,11 +60,11 @@
|
|||
<view class="weather_left">
|
||||
<view class="txt">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uZqKuAjf2idHAtkknKEU" mode=""></image>
|
||||
{{obj.outerHumidity}}%
|
||||
{{obj.outerHumidity < -40 || obj.outerHumidity > 100? '--' : obj.outerHumidity}}%
|
||||
</view>
|
||||
<view class="txt" style="margin-left: 26rpx;">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uJmWnkVE9UeIhNYdPexV" mode=""></image>
|
||||
{{obj.outerTemperature}}℃
|
||||
{{obj.outerTemperature < -40 || obj.outerTemperature > 100? '--' : obj.outerTemperature}}℃
|
||||
</view>
|
||||
</view>
|
||||
<view class="weather_right" style="font-weight: 400;font-size: 24rpx;color: #808080;">
|
||||
|
@ -280,7 +280,7 @@
|
|||
蜂场位置:<span style="color: #42A5F5;">{{obj.apiaryCounty}}</span>
|
||||
</view>
|
||||
<view class="up_time">
|
||||
1小时前更新
|
||||
{{daytime}}更新
|
||||
</view>
|
||||
</view>
|
||||
<view class="weather_cont">
|
||||
|
@ -331,6 +331,7 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
menuflag:false,
|
||||
ec: {
|
||||
lazyLoad: true
|
||||
},
|
||||
|
@ -367,6 +368,8 @@
|
|||
chartData4:[],
|
||||
chartData5:[],
|
||||
chartData6:[],
|
||||
chartData7:[],
|
||||
chartData8:[],
|
||||
yeartime: {
|
||||
year: '',
|
||||
month: '',
|
||||
|
@ -377,11 +380,11 @@
|
|||
month: '',
|
||||
day:''
|
||||
},
|
||||
daytime:''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.beehiveId = option.beehiveId
|
||||
this.getobj()
|
||||
},
|
||||
onShow() {
|
||||
setTimeout(() => {
|
||||
|
@ -393,15 +396,14 @@
|
|||
this.$refs.canvas6.init(this.initChart6)
|
||||
this.$refs.canvas7.init(this.initChart7)
|
||||
}, 1000)
|
||||
|
||||
this.getobj()
|
||||
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')
|
||||
|
||||
// const now = new Date();
|
||||
// 创建一个新的Date对象,表示前一天
|
||||
|
||||
previousDay.setDate(now.getDate() - 7)
|
||||
this.yeartimes.year = previousDay.getFullYear()
|
||||
this.yeartimes.month = String(previousDay.getMonth() + 1).padStart(2, '0')
|
||||
|
@ -414,6 +416,25 @@
|
|||
this.getchartData6()
|
||||
},
|
||||
methods: {
|
||||
btnedit(){
|
||||
this.menuflag = false
|
||||
uni.navigateTo({
|
||||
url:'/page_Beehive/add_Beehive?tit=' + '修改蜂箱' + '&beehiveId=' + this.beehiveId
|
||||
})
|
||||
},
|
||||
btnfx(){
|
||||
this.menuflag = false
|
||||
uni.navigateTo({
|
||||
url:'/page_Beehive/share_Beehive'
|
||||
})
|
||||
},
|
||||
btnmenu(){
|
||||
if(this.menuflag == true){
|
||||
this.menuflag = false
|
||||
}else{
|
||||
this.menuflag = true
|
||||
}
|
||||
},
|
||||
// 温度图表
|
||||
getchartData1(){
|
||||
let time = this.yeartime.year +'-' + this.yeartime.month + '-' + this.yeartime.day
|
||||
|
@ -633,10 +654,24 @@
|
|||
this.$u.get(`weather/7d?location=${this.longitude},${this.latitude}`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.daily = res.data.daily
|
||||
this.chartData7 = res.data.daily.map(item => item.tempMin)
|
||||
this.chartData8 = res.data.daily.map(item => item.tempMax)
|
||||
this.daytime = res.data.updateTime
|
||||
let date = new Date(this.daytime);
|
||||
let formattedDate = this.formatDate(date)
|
||||
this.daytime = formattedDate
|
||||
console.log(this.daytime);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
formatDate(date) {
|
||||
let year = date.getFullYear()
|
||||
let month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
let day = String(date.getDate()).padStart(2, '0')
|
||||
let hours = String(date.getHours()).padStart(2, '0')
|
||||
let minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
@ -1366,7 +1401,7 @@
|
|||
series: [{
|
||||
name: '最高温度',
|
||||
type: 'line',
|
||||
data: [25, 29, 29, 29, 27, 24, 26],
|
||||
data: this.chartData8,
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
|
@ -1398,7 +1433,7 @@
|
|||
{
|
||||
name: '最低温蒂',
|
||||
type: 'line',
|
||||
data: [15, 18, 19, 19, 21, 20, 20],
|
||||
data: this.chartData7,
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
|
@ -1423,7 +1458,7 @@
|
|||
devicePixelRatio: canvasDpr
|
||||
})
|
||||
|
||||
|
||||
// option.series[0].data = that.chartData7
|
||||
canvas.setChart(chart)
|
||||
chart.setOption(option)
|
||||
return chart
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
</u-navbar>
|
||||
<view class="top">
|
||||
<view class="top_left">
|
||||
福鼎蜂场
|
||||
{{apiaryName}}
|
||||
</view>
|
||||
<view class="top_right">
|
||||
<view class="top_right" @click="showmiyuan = true">
|
||||
其他蜂场 <view class="iconfont icon-xiangyou1" style="font-size: 40rpx;">
|
||||
|
||||
</view>
|
||||
|
@ -62,44 +62,61 @@
|
|||
</view>
|
||||
<view class="cont_box" v-if="true">
|
||||
<view class="left">
|
||||
<view class="left_cont_box" v-for="(item, index) in tabs" :key="index" @click="changeTag(index)"
|
||||
<view class="left_cont_box" v-for="(item, index) in tabs" :key="index" @click="changeTag(item.beehiveId,index)"
|
||||
:class="currentIndex === index ? 'act4' : ''">
|
||||
<view class="left_cont" :class="[
|
||||
index=== currentIndex? 'act1' : '',
|
||||
index + 1 === currentIndex? 'act2' : '',
|
||||
index- 1 === currentIndex? 'act3' : ''
|
||||
]">
|
||||
{{item.title}}
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="right_cont">
|
||||
<view class="right_cont" v-for="(item,index) in rzlist" :key="index">
|
||||
<view class="right_cont_top">
|
||||
<view class="cont_left">
|
||||
|
||||
2024-05-21 09:52:01
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
<view class="cont_right">
|
||||
<view class="cont_right" v-if="item.type == 1">
|
||||
换脾
|
||||
</view>
|
||||
<view class="cont_right" v-if="item.type == 2">
|
||||
饲喂
|
||||
</view>
|
||||
<view class="cont_right" v-if="item.type == 3">
|
||||
取蜜
|
||||
</view>
|
||||
<view class="cont_right" v-if="item.type == 4">
|
||||
加脾
|
||||
</view>
|
||||
<view class="cont_right" v-if="item.type == 5">
|
||||
除螨
|
||||
</view>
|
||||
<view class="cont_right" v-if="item.type == 6">
|
||||
换王
|
||||
</view>
|
||||
<view class="cont_right" v-if="item.type == 7">
|
||||
换位置
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="cont">
|
||||
分享车胎愚人节一年电影截图宽银 幕国会女63去爱为用户如上图还有 途客与他
|
||||
{{item.content}}
|
||||
</view>
|
||||
|
||||
<view class="imgcont">
|
||||
<view class="img_box" v-for="item in 8" :key="item">
|
||||
<image src="" mode=""></image>
|
||||
<view class="img_box" v-for="(val,index) in item.picture" :key="index">
|
||||
<image :src="val" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="log_info">
|
||||
<view class="txt">
|
||||
福鼎蜂场-001
|
||||
{{item.apiaryName}}
|
||||
</view>
|
||||
<view class="txt">
|
||||
21111154689
|
||||
{{item.beehiveSn}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="log_work">
|
||||
|
@ -120,8 +137,12 @@
|
|||
|
||||
</view>
|
||||
</view>
|
||||
<view class="addtj">
|
||||
添加日志
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-select v-model="showmiyuan" :list="fclist" title='选择蜂场' @confirm="confirmmy"></u-select>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -132,6 +153,7 @@
|
|||
bgc: {
|
||||
backgroundColor: " #F4FAF8",
|
||||
},
|
||||
showmiyuan: false,
|
||||
title: "操作日志",
|
||||
currentIndex: 0,
|
||||
tabs: [{
|
||||
|
@ -165,16 +187,69 @@
|
|||
],
|
||||
textValue: '',
|
||||
currentCount: 0,
|
||||
showxy:false
|
||||
showxy:false,
|
||||
apiaryId:'',
|
||||
beehiveId:'',
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
rzlist:[],
|
||||
fclist:[],
|
||||
apiaryName:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
onLoad(option) {
|
||||
this.apiaryId = option.apiaryId
|
||||
this.getfxlb()
|
||||
this.getfc()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
confirmmy(e){
|
||||
this.rzlist = []
|
||||
this.apiaryId = e[0].value
|
||||
this.apiaryName = e[0].label
|
||||
this.getfxlb()
|
||||
},
|
||||
// 查询指定蜂箱列表
|
||||
getfxlb(){
|
||||
this.$u.get(`farm/beehive/listByApiary/${this.apiaryId}`).then(res => {
|
||||
if(res.code == 200){
|
||||
if(res.data){
|
||||
this.tabs = res.data
|
||||
this.apiaryName = this.tabs[0].apiaryName
|
||||
this.beehiveId = res.data[0].beehiveId
|
||||
this.getfxrz()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询蜂箱日志
|
||||
getfxrz(){
|
||||
this.$u.get(`/farm/beehive/log/list?pageNum=${this.pageNum}&pageSize=${this.pageSize}&withApiary=false&beehiveId=${this.beehiveId}`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.rzlist = res.rows.map(row => {
|
||||
return {
|
||||
...row,
|
||||
picture: row.picture.split(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 请求蜂场
|
||||
getfc(){
|
||||
this.$u.get(`farm/apiary/listAll`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.fclist = res.data.map(item => ({
|
||||
value: item.apiaryId,
|
||||
label: item.name
|
||||
}))
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
hidePlaceholder() {
|
||||
this.placeholderVisible = false;
|
||||
},
|
||||
|
@ -229,8 +304,10 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
changeTag(idx) {
|
||||
changeTag(beehiveId,idx) {
|
||||
this.beehiveId = beehiveId
|
||||
this.currentIndex = idx
|
||||
this.getfxrz()
|
||||
},
|
||||
ClickImage(PhotoAddress) {
|
||||
uni.previewImage({
|
||||
|
@ -251,6 +328,19 @@
|
|||
page {
|
||||
background-color: #F4FAF8;
|
||||
}
|
||||
.addtj{
|
||||
width: 300rpx;
|
||||
height: 90rpx;
|
||||
background-color: #FFCC25;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
bottom: 300rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.page {
|
||||
// position: relative;
|
||||
|
@ -482,12 +572,11 @@
|
|||
width: 100%;
|
||||
height: 100vn;
|
||||
background: #fff;
|
||||
|
||||
.right_cont {
|
||||
padding: 20rpx 26rpx;
|
||||
border: 2rpx solid #D8D8D8;
|
||||
border-radius: 20rpx;
|
||||
|
||||
margin-top: 20rpx;
|
||||
.log_work {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
|
|
|
@ -7,10 +7,15 @@
|
|||
扫描二维码
|
||||
</view>
|
||||
<view class="iptbox">
|
||||
<view class="qrcode" @click="btnqrcode">
|
||||
<view v-if="title == '添加蜂箱'" class="qrcode" @click="btnqrcode">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uy7BNwAMIKwvstqFnRhs" mode=""></image>
|
||||
</view>
|
||||
<input type="text" class="ips" v-model="sn" placeholder="请扫描蜂箱上的二维码" style="margin-left: 32rpx;"
|
||||
<view v-else class="qrcode">
|
||||
<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;"
|
||||
placeholder-class="my-placeholder" />
|
||||
<input v-else type="text" class="ips" v-model="sn" disabled="true" placeholder="请扫描蜂箱上的二维码" style="margin-left: 32rpx;"
|
||||
placeholder-class="my-placeholder" />
|
||||
|
||||
</view>
|
||||
|
@ -34,13 +39,16 @@
|
|||
设备ID或视频流地址
|
||||
</view>
|
||||
<view class="iptbox">
|
||||
<input type="text" class="ips" v-model="code" placeholder="请输入设备ID或视频流地址"
|
||||
<input type="text" class="ips" v-model="videoStream" placeholder="请输入设备ID或视频流地址"
|
||||
placeholder-class="my-placeholder"/>
|
||||
|
||||
</view>
|
||||
<view class="btn" @click="btnadd">
|
||||
<view class="btn" @click="btnadd" v-if="title == '添加蜂箱'">
|
||||
确认添加
|
||||
</view>
|
||||
<view class="btn" @click="btnedit" v-else>
|
||||
确认修改
|
||||
</view>
|
||||
<!-- 选择蜂场 -->
|
||||
<u-select v-model="showmiyuan" :list="miyuancolumns" title='选择蜂场' @confirm="confirmmy"></u-select>
|
||||
</view>
|
||||
|
@ -62,16 +70,69 @@
|
|||
showmiyuan: false,
|
||||
miyuancolumns: [],
|
||||
pagesum: 1,
|
||||
pagesize: 99
|
||||
pagesize: 99,
|
||||
beehiveId:'',
|
||||
code:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(option) {
|
||||
if(option.tit){
|
||||
this.title = option.tit
|
||||
this.beehiveId = option.beehiveId
|
||||
this.geteditxq()
|
||||
}else{
|
||||
this.title = '添加蜂箱'
|
||||
}
|
||||
this.getmiyuancolumns()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 修改部分
|
||||
geteditxq(){
|
||||
this.$u.get(`/farm/beehive/${this.beehiveId}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.sn = res.data.sn
|
||||
this.name = res.data.name
|
||||
this.fc = res.data.apiaryName
|
||||
this.videoStream = res.data.videoStream
|
||||
this.fcid = res.data.apiaryId
|
||||
}
|
||||
})
|
||||
},
|
||||
btnedit(){
|
||||
let data = {
|
||||
beehiveId:this.beehiveId,
|
||||
apiaryId:this.fcid,
|
||||
name:this.name,
|
||||
videoStream:this.videoStream
|
||||
}
|
||||
this.$u.put(`/farm/beehive`,data).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'success',
|
||||
duration:1000
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1500)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 修改结束// 修改结束// 修改结束// 修改结束// 修改结束
|
||||
btnqrcode(){
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
|
@ -123,7 +184,7 @@
|
|||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
setTimeout(()=>{
|
||||
|
|
|
@ -78,7 +78,9 @@
|
|||
methods: {
|
||||
// 跳转蜂场详情
|
||||
btnapiaryxq(id){
|
||||
|
||||
uni.navigateTo({
|
||||
url:'/pages/Apiary/Apiary_detail?id=' + id
|
||||
})
|
||||
},
|
||||
loadMore() {
|
||||
if (this.list.length < this.total) {
|
||||
|
|
|
@ -7,25 +7,25 @@
|
|||
<view class="tip_cont">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uwO70CUV98b3maj6bfCF" mode=""></image>
|
||||
<view class="txt">
|
||||
中华蜂
|
||||
{{listfz}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip_cont" style="margin-top: 28rpx;">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uQQym033Pvs3rirm9kP5" mode=""></image>
|
||||
<view class="txt">
|
||||
枣花蜜
|
||||
{{listmy}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip_cont" style="margin-top: 28rpx;">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/u9wAWh1AIzSDGgKDKsKY" mode=""></image>
|
||||
<view class="txt">
|
||||
22.0 ℃
|
||||
{{daily[0].tempMax}} ℃
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip_cont" style="margin-top: 28rpx;">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uBIctX6qJ9yMtAZYuY0R" mode=""></image>
|
||||
<view class="txt">
|
||||
60.0 %
|
||||
{{daily[0].humidity}} %
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/uuDdvHXyO9xuWd3DqCLU" mode=""></image>
|
||||
|
||||
</view>
|
||||
<view class="cont_img" style="margin-top: 15rpx;">
|
||||
<view class="cont_img" style="margin-top: 15rpx;" @click="btnpage">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/urhdebIu3K8vqRb8leoH" mode=""></image>
|
||||
</view>
|
||||
<view class="cont_img" style="margin-top: 15rpx;">
|
||||
|
@ -43,7 +43,7 @@
|
|||
1
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont_img" style="margin-top: 25rpx;">
|
||||
<view class="cont_img" style="margin-top: 25rpx;" @click="btncaozuo">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uZVc2GgYQoUmn6aJwVeR" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -55,10 +55,10 @@
|
|||
:show-location='true'> </map>
|
||||
<view class="num">
|
||||
<view class="txt">
|
||||
在线:1001
|
||||
在线:{{apiaryobj.onlineBeehiveCount}}
|
||||
</view>
|
||||
<view class="txt" style="color:#FF473E ;margin-top: 10rpx;">
|
||||
在线:100
|
||||
离线:{{apiaryobj.offlineBeehiveCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn" @click="showwl = true">
|
||||
|
@ -108,26 +108,27 @@
|
|||
<view class="weather_info_tit">
|
||||
未来7日天气预知
|
||||
</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 class="top" style="margin-top: 14rpx;">
|
||||
<view class="weather_add">
|
||||
蜂场位置:<span style="color: #42A5F5;">福鼎市</span>
|
||||
蜂场位置:<span style="color: #42A5F5;">{{apiaryobj.county}}</span>
|
||||
</view>
|
||||
<view class="up_time">
|
||||
1小时前更新
|
||||
{{daytime}}更新
|
||||
</view>
|
||||
</view>
|
||||
<view class="weather_cont">
|
||||
<view class="weather_li" v-for="imte in 7 " :key="item">
|
||||
<view class="weather_li" v-for="(item,index) in daily" :key="index">
|
||||
<view class="data">
|
||||
5/16
|
||||
{{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>
|
||||
|
@ -135,19 +136,20 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="echarts_box">
|
||||
<uni-ec-canvas class="uni-ec-canvas" id="uni-ec-canvas" ref="canvas" canvas-id="uni-ec-canvas" :ec="ec">
|
||||
</uni-ec-canvas>
|
||||
<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>
|
||||
<u-mask :show="showwl" @click="showwl = false" :z-index='100' duration='0' />
|
||||
<view class="pops" v-if='showwl'>
|
||||
<image class="bgimg" src="https://api.ccttiot.com/smartmeter/img/static/uImWgTlNYBAv4SO02gSL" mode=""></image>
|
||||
<image class="bgimg" src="https://api.ccttiot.com/smartmeter/img/static/uImWgTlNYBAv4SO02gSL" mode="">
|
||||
</image>
|
||||
<view class="tit">
|
||||
电子围栏(Km)
|
||||
</view>
|
||||
<view class="cont">
|
||||
最大距离 <view class="ipt"><input type="text" class="ips" v-model="code" placeholder=" "
|
||||
placeholder-class="my-placeholder" /></view>
|
||||
placeholder-class="my-placeholder" /></view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
确定
|
||||
|
@ -173,8 +175,8 @@
|
|||
backgroundColor: " #F4FAF8",
|
||||
},
|
||||
title: "福鼎蜂场",
|
||||
latitude: '39.916527',
|
||||
longitude: ' 116.397128',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
isMap: false,
|
||||
zoomSize: 15,
|
||||
markers: [{
|
||||
|
@ -189,25 +191,110 @@
|
|||
title: 'Marker2'
|
||||
}],
|
||||
showtq: false,
|
||||
showwl:false
|
||||
|
||||
showwl: false,
|
||||
apiaryId: '',
|
||||
apiaryobj: {},
|
||||
listmy: '',
|
||||
listfz:'',
|
||||
daily:[],
|
||||
chartData7:[],
|
||||
chartData8:[],
|
||||
daytime:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
onLoad(option) {
|
||||
setTimeout(() => {
|
||||
this.$refs.canvas7.init(this.initChart7)
|
||||
}, 1000)
|
||||
this.apiaryId = option.id
|
||||
this.getfcxq()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
showtqs(){
|
||||
setTimeout(() => {
|
||||
|
||||
this.$refs.canvas.init(this.initChart)
|
||||
}, 200);
|
||||
this.showtq=true
|
||||
btncaozuo(){
|
||||
uni.navigateTo({
|
||||
url:'/page_Beehive/Beehive_log?apiaryId=' + this.apiaryId
|
||||
})
|
||||
},
|
||||
initChart(canvas, width, height, canvasDpr) {
|
||||
btnpage(){
|
||||
uni.switchTab({
|
||||
url:'/pages/Beehive'
|
||||
})
|
||||
},
|
||||
gettq(){
|
||||
console.log(this.latitude,this.longitude);
|
||||
this.$u.get(`weather/7d?location=${this.longitude},${this.latitude}`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.daily = res.data.daily
|
||||
this.chartData7 = res.data.daily.map(item => item.tempMin)
|
||||
this.chartData8 = res.data.daily.map(item => item.tempMax)
|
||||
this.daytime = res.data.updateTime
|
||||
let date = new Date(this.daytime);
|
||||
let formattedDate = this.formatDate(date)
|
||||
this.daytime = formattedDate
|
||||
}
|
||||
})
|
||||
},
|
||||
formatDate(date) {
|
||||
let year = date.getFullYear()
|
||||
let month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
let day = String(date.getDate()).padStart(2, '0')
|
||||
let hours = String(date.getHours()).padStart(2, '0')
|
||||
let minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`
|
||||
},
|
||||
getfcxq() {
|
||||
this.$u.get(`/farm/apiary/${this.apiaryId}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.apiaryobj = res.data
|
||||
this.latitude = res.data.lat
|
||||
this.longitude = res.data.lng
|
||||
this.gettq()
|
||||
this.getmy()
|
||||
this.getfz()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getmy() {
|
||||
this.$u.get(`/common/getDictByType?dictType=apiary_honey_type`).then(res => {
|
||||
if (res.code == 200) {
|
||||
for(let i = 0; i < res.data.length;i++){
|
||||
if(res.data[i].dictValue == this.apiaryobj.honeyType){
|
||||
this.listmy = res.data[i].dictLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getfz() {
|
||||
this.$u.get(`/common/getDictByType?dictType=apiary_bee_type`).then(res => {
|
||||
if (res.code == 200) {
|
||||
for(let i = 0; i < res.data.length;i++){
|
||||
if(res.data[i].dictValue == this.apiaryobj.beeType){
|
||||
this.listfz = res.data[i].dictLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
showtqs() {
|
||||
setTimeout(() => {
|
||||
|
||||
this.$refs.canvas7.init(this.initChart7)
|
||||
}, 200);
|
||||
this.showtq = true
|
||||
},
|
||||
initChart7(canvas, width, height, canvasDpr) {
|
||||
let that = this
|
||||
|
||||
const option = {
|
||||
|
@ -215,7 +302,7 @@
|
|||
left: '4%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
top:'0%',
|
||||
top: '0%',
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {
|
||||
|
@ -234,18 +321,18 @@
|
|||
axisLabel: {
|
||||
show: false // 隐藏X轴标签
|
||||
},
|
||||
splitLine: {
|
||||
show: true, // 显示X轴网格线
|
||||
lineStyle: {
|
||||
type: 'dashed', // 设置网格线为虚线
|
||||
color: '#ccc', // 可以设置虚线的颜色
|
||||
width: 1 // 可以设置虚线的宽度
|
||||
}
|
||||
}
|
||||
splitLine: {
|
||||
show: true, // 显示X轴网格线
|
||||
lineStyle: {
|
||||
type: 'dashed', // 设置网格线为虚线
|
||||
color: '#ccc', // 可以设置虚线的颜色
|
||||
width: 1 // 可以设置虚线的宽度
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
max: 40, // 设置Y轴的最大值为40
|
||||
max: 40, // 设置Y轴的最大值为40
|
||||
axisLabel: {
|
||||
show: false // 隐藏Y轴标签
|
||||
},
|
||||
|
@ -259,76 +346,76 @@
|
|||
show: false // 隐藏Y轴背景网格线
|
||||
}
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
show: true,
|
||||
type: 'inside',
|
||||
filterMode: 'none',
|
||||
xAxisIndex: [0],
|
||||
startValue: -20,
|
||||
endValue: 20
|
||||
},
|
||||
{
|
||||
show: true,
|
||||
type: 'inside',
|
||||
filterMode: 'none',
|
||||
yAxisIndex: [0],
|
||||
startValue: -20,
|
||||
endValue: 20
|
||||
}
|
||||
],
|
||||
dataZoom: [{
|
||||
show: true,
|
||||
type: 'inside',
|
||||
filterMode: 'none',
|
||||
xAxisIndex: [0],
|
||||
startValue: -20,
|
||||
endValue: 20
|
||||
},
|
||||
{
|
||||
show: true,
|
||||
type: 'inside',
|
||||
filterMode: 'none',
|
||||
yAxisIndex: [0],
|
||||
startValue: -20,
|
||||
endValue: 20
|
||||
}
|
||||
],
|
||||
series: [{
|
||||
name: '最高温度',
|
||||
type: 'line',
|
||||
data: [25, 29, 29, 29, 27, 24, 26],
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
lineStyle: {
|
||||
width: 3
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#42A5F5'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
formatter: '{c}°',
|
||||
color: '#42A5F5'
|
||||
},
|
||||
markLine: {
|
||||
silent: true, // 不响应鼠标事件
|
||||
symbol: ['none', 'none'], // 不显示标记
|
||||
lineStyle: {
|
||||
color: 'red', // 使虚线更明显
|
||||
type: 'dashed'
|
||||
},
|
||||
// data: [
|
||||
// { yAxis: 'min' },
|
||||
// { yAxis: 'max' }
|
||||
// ]
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '最低温蒂',
|
||||
type: 'line',
|
||||
data: [15, 18, 19, 19, 21, 20, 20],
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
lineStyle: {
|
||||
width: 3
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#42A5F5'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'bottom',
|
||||
formatter: '{c}°',
|
||||
color: '#42A5F5'
|
||||
},
|
||||
}]
|
||||
name: '最高温度',
|
||||
type: 'line',
|
||||
data: this.chartData8,
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
lineStyle: {
|
||||
width: 3
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#42A5F5'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
formatter: '{c}°',
|
||||
color: '#42A5F5'
|
||||
},
|
||||
markLine: {
|
||||
silent: true, // 不响应鼠标事件
|
||||
symbol: ['none', 'none'], // 不显示标记
|
||||
lineStyle: {
|
||||
color: 'red', // 使虚线更明显
|
||||
type: 'dashed'
|
||||
},
|
||||
// data: [
|
||||
// { yAxis: 'min' },
|
||||
// { yAxis: 'max' }
|
||||
// ]
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '最低温蒂',
|
||||
type: 'line',
|
||||
data: this.chartData7,
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
lineStyle: {
|
||||
width: 3
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#42A5F5'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'bottom',
|
||||
formatter: '{c}°',
|
||||
color: '#42A5F5'
|
||||
},
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
chart = echarts.init(canvas, null, {
|
||||
|
@ -361,7 +448,8 @@
|
|||
.page {
|
||||
// position: relative;
|
||||
width: 750rpx;
|
||||
.pops{
|
||||
|
||||
.pops {
|
||||
position: fixed;
|
||||
left: 98rpx;
|
||||
top: 400rpx;
|
||||
|
@ -370,7 +458,8 @@
|
|||
height: 420rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||
.bgimg{
|
||||
|
||||
.bgimg {
|
||||
z-index: -1;
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
|
@ -378,7 +467,8 @@
|
|||
width: 210rpx;
|
||||
height: 172rpx;
|
||||
}
|
||||
.tit{
|
||||
|
||||
.tit {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin: 40rpx auto 0;
|
||||
|
@ -386,35 +476,40 @@
|
|||
font-size: 36rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
.cont{
|
||||
|
||||
.cont {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
margin-top: 42rpx;
|
||||
width: 100%;
|
||||
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #3D3D3D;
|
||||
.ipt{
|
||||
|
||||
.ipt {
|
||||
margin-left: 18rpx;
|
||||
width: 178rpx;
|
||||
height: 76rpx;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #808080;
|
||||
.ips{
|
||||
|
||||
.ips {
|
||||
padding: 14rpx;
|
||||
}
|
||||
|
||||
.my-placeholder {
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
.btn{
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
@ -424,12 +519,13 @@
|
|||
height: 90rpx;
|
||||
background: #FFC107;
|
||||
border-radius: 54rpx 54rpx 54rpx 54rpx;
|
||||
|
||||
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.weather_info {
|
||||
position: fixed;
|
||||
padding: 30rpx 50rpx;
|
||||
|
@ -480,7 +576,7 @@
|
|||
.week_weather {
|
||||
margin-top: 14rpx;
|
||||
text-align: center;
|
||||
width: 72rpx;
|
||||
width: 82rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #50565A;
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<view class="li_top">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uk7CvwzeU0ukxvS9cBtD" mode=""></image>
|
||||
<view class="li_txt">
|
||||
{{item.totalWeight}}
|
||||
{{item.totalWeight == 999999 ? '--' : item.totalWeight}}
|
||||
<span>kg</span>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -87,7 +87,7 @@
|
|||
<view class="li_top">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/una6Kbd2gdBZ9gG6lg44" mode=""></image>
|
||||
<view class="li_txt">
|
||||
{{item.innerHumidity}}
|
||||
{{item.innerHumidity < -40 || item.innerHumidity > 100? '--' : item.innerHumidity}}
|
||||
<span>%</span>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -99,7 +99,7 @@
|
|||
<view class="li_top">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/utoKXhZBoejfRZwNUMP9" mode=""></image>
|
||||
<view class="li_txt">
|
||||
{{item.outerHumidity}}
|
||||
{{ item.outerHumidity < -40 || item.outerHumidity > 100? '--' : item.outerHumidity}}
|
||||
<span>℃</span>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/up9IaGzSg1RKhIZz3V7a" mode=""></image>
|
||||
<view class="li_txt">
|
||||
{{item.volume}}
|
||||
<span>Hz</span>
|
||||
<!-- <span>Hz</span> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="li_bot">
|
||||
|
@ -147,7 +147,7 @@
|
|||
<view class="li_top">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uWjV9HEHrP5g0B5AHD1j" mode=""></image>
|
||||
<view class="li_txt">
|
||||
{{item.outerHumidity}}
|
||||
{{item.outerHumidity < -40 || item.outerHumidity > 100? '--' : item.outerHumidity}}
|
||||
<span>℃</span>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -342,7 +342,7 @@
|
|||
display: flex;
|
||||
align-items: flex-start;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
span{
|
||||
font-size: 20rpx;
|
||||
|
|
|
@ -7,19 +7,19 @@
|
|||
<view class="tip_cont">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uKW514Tl8TVUiaJW2ygl" mode=""></image>
|
||||
<view class="txt">
|
||||
蜂箱数量:10
|
||||
蜂箱数量:{{tjobj.beehiveCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip_cont" style="margin-top: 48rpx;">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uBEd8suIZ2vdqOGI8rP6" mode=""></image>
|
||||
<view class="txt">
|
||||
蜂箱数量:10
|
||||
蜂场数量:{{tjobj.apiaryCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip_cont" style="margin-top: 48rpx;">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ufgkE5w8AND4eLZD94RR" mode=""></image>
|
||||
<view class="txt">
|
||||
蜂箱数量:10
|
||||
预警数量:{{tjobj.warnCount}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -112,7 +112,7 @@
|
|||
电量不足
|
||||
</view>
|
||||
<view class="cont_bot">
|
||||
0
|
||||
{{yjobj[4].count}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
|
@ -120,7 +120,7 @@
|
|||
出勤异常
|
||||
</view>
|
||||
<view class="cont_bot">
|
||||
0
|
||||
{{yjobj[5].count}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
|
@ -128,7 +128,7 @@
|
|||
重量异常
|
||||
</view>
|
||||
<view class="cont_bot">
|
||||
0
|
||||
{{yjobj[3].count}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
|
@ -136,7 +136,7 @@
|
|||
温度异常
|
||||
</view>
|
||||
<view class="cont_bot">
|
||||
0
|
||||
{{yjobj[1].count}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
|
@ -144,7 +144,7 @@
|
|||
湿度异常
|
||||
</view>
|
||||
<view class="cont_bot">
|
||||
0
|
||||
{{yjobj[2].count}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
|
@ -152,7 +152,7 @@
|
|||
声音异常
|
||||
</view>
|
||||
<view class="cont_bot">
|
||||
0
|
||||
{{yjobj[6].count}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -192,27 +192,89 @@
|
|||
activeSwiperHeight: 500, // 激活的swiper高度
|
||||
swiperItems: [1, 2, ], // Placeholder for swiper items
|
||||
numdata:[],
|
||||
haveApiary:true
|
||||
haveApiary:true,
|
||||
yeartime: {
|
||||
year: '',
|
||||
month: '',
|
||||
day:''
|
||||
},
|
||||
yeartimes: {
|
||||
year: '',
|
||||
month: '',
|
||||
day:''
|
||||
},
|
||||
chartData3:[],
|
||||
chartData4:[],
|
||||
tjobj:{},
|
||||
yjobj:[]
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
|
||||
|
||||
this.ishave()
|
||||
// setTimeout(() => {
|
||||
|
||||
|
||||
|
||||
// this.$refs.canvas4.init(this.initChart4)
|
||||
|
||||
// }, 200);
|
||||
|
||||
this.gettj()
|
||||
this.getyj()
|
||||
setTimeout(() => {
|
||||
this.$refs.canvas3.init(this.initChart3)
|
||||
this.$refs.canvas4.init(this.initChart4)
|
||||
}, 1000);
|
||||
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()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 统计
|
||||
gettj(){
|
||||
this.$u.get(`/farmer/report/statistic`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.tjobj = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 预警
|
||||
getyj(){
|
||||
this.$u.get(`/farmer/report/warnCount`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.yjobj = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 重量图表
|
||||
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}&beehiveId=${''}`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.chartData3 = res.data.map(item => item.value)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 出勤图表
|
||||
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}&beehiveId=${''}`).then(res => {
|
||||
if(res.code == 200){
|
||||
this.chartData4 = res.data.map(item => item.value)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
addApiary(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/Apiary/AddApiary'
|
||||
|
@ -377,7 +439,7 @@
|
|||
}, ]),
|
||||
},
|
||||
},
|
||||
data: that.numdata.map(item => item.value),
|
||||
data: that.chartData3,
|
||||
}],
|
||||
};
|
||||
chart = echarts.init(canvas, null, {
|
||||
|
@ -386,7 +448,7 @@
|
|||
devicePixelRatio: canvasDpr
|
||||
})
|
||||
|
||||
|
||||
option.series[0].data = that.chartData4
|
||||
canvas.setChart(chart)
|
||||
chart.setOption(option)
|
||||
return chart
|
||||
|
@ -487,7 +549,7 @@
|
|||
}, ]),
|
||||
},
|
||||
},
|
||||
data: that.numdata.map(item => item.value),
|
||||
data: that.chartData3,
|
||||
}],
|
||||
};
|
||||
chart = echarts.init(canvas, null, {
|
||||
|
@ -496,7 +558,7 @@
|
|||
devicePixelRatio: canvasDpr
|
||||
})
|
||||
|
||||
|
||||
option.series[0].data = that.chartData3
|
||||
canvas.setChart(chart)
|
||||
chart.setOption(option)
|
||||
return chart
|
||||
|
|
169
pages/my.vue
169
pages/my.vue
|
@ -4,9 +4,15 @@
|
|||
title-size='36' :title-bold='true' height='45' id="navbar">
|
||||
</u-navbar>
|
||||
<view class="atv">
|
||||
<image src="" mode="">
|
||||
|
||||
</image>
|
||||
<button
|
||||
v-if="imglist == ''" style="border: 0;outline: none;width: 220rpx;padding-left: 0rpx;height: 220rpx;border-radius: 50%;"
|
||||
type="primary reverse" open-type="chooseAvatar" @chooseavatar="getImage">
|
||||
</button>
|
||||
<button
|
||||
v-else style="border: 0;outline: none;width: 220rpx;padding-left: 0rpx;height: 220rpx;border-radius: 50%;"
|
||||
type="primary reverse" open-type="chooseAvatar" @chooseavatar="getImage">
|
||||
<image :src="imglist" mode=""></image>
|
||||
</button>
|
||||
</view>
|
||||
<view class="change">
|
||||
身份切换
|
||||
|
@ -16,14 +22,15 @@
|
|||
</view>
|
||||
<view class="btn_li">
|
||||
用户协议 <view class="iconfont icon-xiangyou1"></view>
|
||||
</view><view class="btn_li">
|
||||
</view>
|
||||
<view class="btn_li">
|
||||
关于我们 <view class="iconfont icon-xiangyou1"></view>
|
||||
</view><view class="btn_li">
|
||||
</view>
|
||||
<view class="btn_li" @click="btnsz">
|
||||
设置 <view class="iconfont icon-xiangyou1"></view>
|
||||
</view>
|
||||
<tab-bar :indexs='4' style=""></tab-bar>
|
||||
|
||||
|
||||
<tab-bar :indexs='4' style=""></tab-bar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -35,69 +42,115 @@
|
|||
backgroundColor: " #F4FAF8",
|
||||
},
|
||||
title: "我的",
|
||||
|
||||
userobj:{},
|
||||
imglist:'',
|
||||
token:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
this.getQiniuToken()
|
||||
this.getyh()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
getyh() {
|
||||
this.$u.get(`app/user/userInfo`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.userobj = res.data
|
||||
this.imglist = res.data.avatar
|
||||
}
|
||||
})
|
||||
},
|
||||
btnsz(){
|
||||
uni.navigateTo({
|
||||
url:'/page_user/user_set'
|
||||
})
|
||||
},
|
||||
getImage(e) {
|
||||
let _this = this
|
||||
let math = 'static/' + _this.$u.guid(20)
|
||||
const tempFilePaths = e.detail.avatarUrl
|
||||
wx.uploadFile({
|
||||
url: 'https://up-z2.qiniup.com',
|
||||
name: 'file',
|
||||
filePath: tempFilePaths,
|
||||
formData: {
|
||||
token: _this.token,
|
||||
key: 'smartmeter/img/' + math
|
||||
},
|
||||
success: function(res) {
|
||||
let str = JSON.parse(res.data)
|
||||
console.log(str.key)
|
||||
let img = 'https://api.ccttiot.com/' + str.key
|
||||
_this.imglist = img
|
||||
}
|
||||
})
|
||||
},
|
||||
getQiniuToken() {
|
||||
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.token = res.token
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" >
|
||||
page{
|
||||
background-color:#FAFDFD;
|
||||
}
|
||||
.page{
|
||||
// position: relative;
|
||||
width: 750rpx;
|
||||
.atv{
|
||||
width: 206rpx;
|
||||
height: 206rpx;
|
||||
background: #D8D8D8;
|
||||
border-radius: 50%;
|
||||
margin: 100rpx auto 0;
|
||||
image{
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FAFDFD;
|
||||
}
|
||||
|
||||
.page {
|
||||
// position: relative;
|
||||
width: 750rpx;
|
||||
|
||||
.atv {
|
||||
width: 206rpx;
|
||||
height: 206rpx;
|
||||
background: #D8D8D8;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
}
|
||||
.change{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 38rpx;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
.btn_li{
|
||||
margin: 38rpx auto 0;
|
||||
padding: 22rpx;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 658rpx;
|
||||
height: 88rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.15);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
margin: 100rpx auto 0;
|
||||
|
||||
</style>
|
||||
image {
|
||||
width: 222rpx;
|
||||
height: 222rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.change {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 38rpx;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
.btn_li {
|
||||
margin: 38rpx auto 0;
|
||||
padding: 22rpx;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 658rpx;
|
||||
height: 88rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.15);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user