aaa
This commit is contained in:
parent
86bb6d7a96
commit
f042c7bf6b
|
@ -175,11 +175,12 @@
|
|||
},
|
||||
methods: {
|
||||
tofx(id){
|
||||
uni.setStorageSync('targetId', id);
|
||||
uni.setStorageSync('targetId', id);
|
||||
uni.switchTab({
|
||||
url: '/pages/fengxiang/index'
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
searchFn() {
|
||||
// 清除之前的定时器
|
||||
clearTimeout(this.timer);
|
||||
|
|
|
@ -31,13 +31,25 @@
|
|||
<u-tabs :list="tabitems" @click="clicktabs($event)" :current='currentindex'></u-tabs>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-if="masks" class="konghezi">
|
||||
<u-empty mode="list" text="暂无蜂箱">
|
||||
<view class="tjbutton">
|
||||
<u-button @click="xinzeng" size="large" shape="circle" text="添 加"
|
||||
color="#23693f"></u-button>
|
||||
</view>
|
||||
</u-empty>
|
||||
</view>
|
||||
|
||||
<!-- listData.length > 0 -->
|
||||
<view v-if="listData.length > 0" style="margin-top: 130rpx;">
|
||||
|
||||
<view v-else style="margin-top: 130rpx;">
|
||||
|
||||
<view class=" group_6">
|
||||
|
||||
|
||||
<view class="space-y-13">
|
||||
<view class="list-item" @scrolltolower="onReachBottom" v-for="(item, index) in listData" :key="index">
|
||||
<view class="list-item" @scrolltolower="onReachBottom" v-for="(item, index) in listData"
|
||||
:key="index">
|
||||
<view class="group_7 bianhao-top-yi">
|
||||
<view class="bianhao-zuo">
|
||||
<text class="font_2" @click="detilsq(item)">{{item.name}}</text>
|
||||
|
@ -46,32 +58,33 @@
|
|||
<text class="font_33" @click="detilsq(item)">{{item.status_text}}</text>
|
||||
<!-- <text class="font_3">在线</text> -->
|
||||
</view>
|
||||
|
||||
<image v-if="item.warning_battery_low" @click="addyujings(item)" class=" image_7 image_8"
|
||||
src="../../static/蜂箱-电量预警.png" />
|
||||
<image v-if="item.warning_shake" @click="addyujings(item)" class=" image_7 image_9"
|
||||
src="../../static/蜂箱-震动预警.png" />
|
||||
<image v-if="item.warning_temperature" @click="addyujings(item)" class=" image_7 image_10"
|
||||
src="../../static/蜂箱-温度预警.png" />
|
||||
<image v-if="item.warning_humidity" @click="addyujings(item)" class=" image_7 image_11"
|
||||
src="../../static/蜂箱-湿度预警.png" />
|
||||
<image v-if="item.warning_weight" @click="addyujings(item)" class=" image_7 image_12"
|
||||
src="../../static/蜂箱-重量预警.png" />
|
||||
<image class=" image_7 image_13" @click="addyujings(item)" src="../../static/蜂箱-蜂场预警.png"
|
||||
v-if="item.warning_attendance" />
|
||||
|
||||
<image v-if="item.warning_battery_low" @click="addyujings(item)"
|
||||
class=" image_7 image_8" src="../../static/蜂箱-电量预警.png" />
|
||||
<image v-if="item.warning_shake" @click="addyujings(item)"
|
||||
class=" image_7 image_9" src="../../static/蜂箱-震动预警.png" />
|
||||
<image v-if="item.warning_temperature" @click="addyujings(item)"
|
||||
class=" image_7 image_10" src="../../static/蜂箱-温度预警.png" />
|
||||
<image v-if="item.warning_humidity" @click="addyujings(item)"
|
||||
class=" image_7 image_11" src="../../static/蜂箱-湿度预警.png" />
|
||||
<image v-if="item.warning_weight" @click="addyujings(item)"
|
||||
class=" image_7 image_12" src="../../static/蜂箱-重量预警.png" />
|
||||
<image class=" image_7 image_13" @click="addyujings(item)"
|
||||
src="../../static/蜂箱-蜂场预警.png" v-if="item.warning_attendance" />
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 按钮 -->
|
||||
<view class="" style="display: flex;">
|
||||
<view class="shuaxin" @click="btnsx(item)">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uQyHxbK49U3S5f4uLU6m"
|
||||
<image
|
||||
src="https://api.ccttiot.com/smartmeter/img/static/uQyHxbK49U3S5f4uLU6m"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view @click.stop="HiddenClick(item)" class="dianbox">
|
||||
<image class="image_14" src="/static/16994974061914098024.png" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<!-- 气泡框 -->
|
||||
<view v-if="item.ShowHidden">
|
||||
|
@ -93,7 +106,7 @@
|
|||
<view @click.stop="tanceng(item)" class="mask-box"></view>
|
||||
</view>
|
||||
<!-- 向上弹窗 -->
|
||||
|
||||
|
||||
<u-popup :closeOnClickOverlay="false" :round="30" :show="flage" mode="center"
|
||||
:safeAreaInsetBottom="true" overlayOpacity="0.1">
|
||||
<view class="popup-box">
|
||||
|
@ -111,7 +124,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
|
||||
<!-- <view class="xiugainame" v-if="flage">
|
||||
<view class="mm">
|
||||
<text>重新命名</text> <text @click="flageupdate">X</text>
|
||||
|
@ -122,15 +135,15 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="maskname" v-if="flage"></view> -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="d-baseline" style="display: flex;">
|
||||
<text class="font_4" style="padding-top: 20rpx;">{{item.qrcode}}</text>
|
||||
<text class="font_4 text_6" style="padding-top: 20rpx;">丨 {{item.update_time}}</text>
|
||||
<text class="font_4 text_6" style="padding-top: 20rpx;">丨{{item.update_time}}</text>
|
||||
<text class="font_4 text_7" style="padding-top: 20rpx;">丨</text>
|
||||
<text class="font_4 text_8" style="padding-top: 20rpx;">{{item.address}}</text>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="felx-99">
|
||||
<!-- 重量 -->
|
||||
|
@ -145,17 +158,19 @@
|
|||
<view class="flex-taxt">
|
||||
<image class=" image_16" src="../../static/蜂箱-温度.png" />
|
||||
<text class="font_5 text_9 text-l">箱内</text>
|
||||
<text class=" font_5 text_13">{{item.temperature_in_box.substring(0, 3) < -40 || item.temperature_in_box.substring(0, 3) > 100 ? '--' : item.temperature_in_box}}</text>
|
||||
<text
|
||||
class=" font_5 text_13">{{item.temperature_in_box.substring(0, 3) < -40 || item.temperature_in_box.substring(0, 3) > 100 ? '--' : item.temperature_in_box}}</text>
|
||||
</view>
|
||||
<view class="flex-taxt">
|
||||
<image class=" image_17" src="../../static/蜂箱-湿度.png" />
|
||||
<text class="font_5 text_9 text-l">箱内</text>
|
||||
<text class=" font_5 text_13">{{item.temperature_in_box.substring(0, 3) < -40 || item.temperature_in_box.substring(0, 3) > 100? '--' : item.humidity_in_box}}</text>
|
||||
<text
|
||||
class=" font_5 text_13">{{item.temperature_in_box.substring(0, 3) < -40 || item.temperature_in_box.substring(0, 3) > 100? '--' : item.humidity_in_box}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 箱内温度 -->
|
||||
<view class="group_7 view_3">
|
||||
|
||||
|
||||
<view class="flex-taxt">
|
||||
<image class=" image_15" src="../../static/蜂箱-出勤.png" />
|
||||
<text class="font_5 text_9 text-l">出勤</text>
|
||||
|
@ -166,19 +181,21 @@
|
|||
<view class="flex-taxt">
|
||||
<image class=" image_16" src="../../static/蜂箱-温度.png" />
|
||||
<text class="font_5 text_9 text-l">箱外</text>
|
||||
<text class=" font_5 text_13">{{item.temperature_out_box.substring(0, 3) < -40 || item.temperature_out_box.substring(0, 3) > 100 ? '--' : item.temperature_out_box}}</text>
|
||||
<text
|
||||
class=" font_5 text_13">{{item.temperature_out_box.substring(0, 3) < -40 || item.temperature_out_box.substring(0, 3) > 100 ? '--' : item.temperature_out_box}}</text>
|
||||
</view>
|
||||
<view class="flex-taxt">
|
||||
<image class=" image_17" src="../../static/蜂箱-湿度.png" />
|
||||
<text class="font_5 text_9 text-l">箱外</text>
|
||||
<text class=" font_5 text_13">{{item.temperature_out_box.substring(0, 3) < -40 || item.temperature_out_box.substring(0, 3) > 100 ? '--' :item.humidity_out_box}}</text>
|
||||
<text
|
||||
class=" font_5 text_13">{{item.temperature_out_box.substring(0, 3) < -40 || item.temperature_out_box.substring(0, 3) > 100 ? '--' :item.humidity_out_box}}</text>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<!-- 箱内湿度 -->
|
||||
<view class="group_7 view_3">
|
||||
|
||||
|
||||
<view class="flex-taxt1">
|
||||
<image class=" image_15" src="../../static/蜂箱-电量.png" />
|
||||
<text class="font_5 text_9 text-l">电量</text>
|
||||
|
@ -187,9 +204,9 @@
|
|||
<view class="group_8 space-x-6 flex-taxt2" @click="warmbuts(item)">
|
||||
<image class=" image_19" src="../../static/加热.png" />
|
||||
<text class="font_5">加热</text>
|
||||
<switch @change="warmbut(item)" disabled="disabledflag"
|
||||
<switch @change="warmbut(item)" disabled="disabledflag"
|
||||
:checked="item.heat == 1 ? true : false" class=" image_201"
|
||||
:color="'#3a942b'" style="transform:scale(0.5)"/>
|
||||
:color="'#3a942b'" style="transform:scale(0.5)" />
|
||||
</view>
|
||||
<view class="group_9 flex-taxt3" @click="fenlampbuts(item)">
|
||||
<image class=" image_21" src="../../static/蜂箱-风扇.png" />
|
||||
|
@ -200,33 +217,23 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="warm-tip">
|
||||
<!-- - 没有更多了, 亲! - -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- <view class=" section_3 space-y-7">
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<!-- 空状态 -->
|
||||
<view v-if="listData.length == 0" class="konghezi">
|
||||
<u-empty mode="list" text="暂无蜂箱">
|
||||
<view class="tjbutton">
|
||||
<u-button @click="xinzeng" size="large" shape="circle" text="添 加" color="#23693f"></u-button>
|
||||
</view>
|
||||
</u-empty>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<u-picker @cancel="showfengzhong=false" @confirm="confirmfengzhong" :show="showfengzhong"
|
||||
:columns="fengzhongcolumns"></u-picker>
|
||||
|
||||
|
||||
<!-- 二维码展示 -->
|
||||
<view class="mask"
|
||||
style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;background-color: #fff;z-index: 98;text-align: center;"
|
||||
|
@ -239,16 +246,16 @@
|
|||
关闭分享
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mask" v-if="masks" style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;background-color: #333;opacity: .5;z-index: 99;">
|
||||
|
||||
</view>
|
||||
<!-- 加载状态 -->
|
||||
|
||||
|
||||
<!-- <view class="maskgun" v-if="maskgun"></view> -->
|
||||
|
||||
|
||||
<!-- <view class="mask" v-if="masks" style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;background-color: #333;opacity: .5;z-index: 99;"> -->
|
||||
|
||||
</view>
|
||||
<!-- 加载状态 -->
|
||||
|
||||
|
||||
<!-- <view class="maskgun" v-if="maskgun"></view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -293,39 +300,42 @@
|
|||
ewmflag: false,
|
||||
disabledflag: false,
|
||||
tokenflag: false,
|
||||
total:0,
|
||||
showflag:false,
|
||||
masks:false
|
||||
total: 0,
|
||||
showflag: false,
|
||||
masks: false,
|
||||
quchongid:''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true,
|
||||
success: function() {
|
||||
// 显示成功的回调
|
||||
},
|
||||
});
|
||||
this.loadData();
|
||||
// uni.showLoading({
|
||||
// title: '加载中...',
|
||||
// mask: true,
|
||||
// success: function() {
|
||||
// // 显示成功的回调
|
||||
// },
|
||||
// });
|
||||
// this.listData = []
|
||||
this.page = 1
|
||||
this.loadData()
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
}, 1000)
|
||||
}, 5000)
|
||||
// this.cheshi()
|
||||
this.tabitems = [{
|
||||
name: '全部'
|
||||
}]
|
||||
name: '全部'
|
||||
}]
|
||||
},
|
||||
onHide() {
|
||||
uni.removeStorageSync('targetId');
|
||||
// Clear the interval when the component is destroyed
|
||||
clearInterval(this.intervalId);
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
// this.listData = []
|
||||
setTimeout(() => {
|
||||
this.loadData();
|
||||
}, 2000)
|
||||
},
|
||||
// onPullDownRefresh() {
|
||||
// // this.listData = []
|
||||
// setTimeout(() => {
|
||||
// this.loadData();
|
||||
// }, 2000)
|
||||
// },
|
||||
watch: {
|
||||
id(newId, oldId) {
|
||||
// 在这里执行你的监听操作,比如触发事件、调用函数等
|
||||
|
@ -341,24 +351,23 @@
|
|||
},
|
||||
async loadData() {
|
||||
// 先执行获取数据的方法
|
||||
await this.getfengchangList();
|
||||
// await this.getfengchangList();
|
||||
|
||||
// 获取targetId
|
||||
|
||||
setTimeout(() => {
|
||||
const targetId = uni.getStorageSync('targetId');
|
||||
if (targetId) {
|
||||
// 如果存在,赋值给this.checkid
|
||||
this.checkid = targetId;
|
||||
const index = this.tabitems.findIndex(item => item.id === this.checkid);
|
||||
|
||||
// 将索引赋值给this.currentindex
|
||||
this.currentindex = index;
|
||||
this.pageData('', this.checkid)
|
||||
} else {
|
||||
this.getfengchangList()
|
||||
}
|
||||
}, 300);
|
||||
// setTimeout(() => {
|
||||
const targetId = uni.getStorageSync('targetId');
|
||||
if (targetId) {
|
||||
// 如果存在,赋值给this.checkid
|
||||
this.checkid = targetId;
|
||||
const index = this.tabitems.findIndex(item => item.id === this.checkid);
|
||||
// 将索引赋值给this.currentindex
|
||||
this.currentindex = index;
|
||||
this.pageData('', this.checkid)
|
||||
} else {
|
||||
this.getfengchangList()
|
||||
}
|
||||
// }, 300);
|
||||
// this.refresh();
|
||||
// 设置定时刷新
|
||||
// this.intervalId = setInterval(() => {
|
||||
|
@ -371,6 +380,9 @@
|
|||
} else {
|
||||
this.pageData('', this.checkid)
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
}, 5000)
|
||||
},
|
||||
fenlampbut(item) {
|
||||
if (this.switchk) {
|
||||
|
@ -410,7 +422,7 @@
|
|||
// return array.findIndex(i => i.name === item.name) === index;
|
||||
// });
|
||||
// } catch (error) {
|
||||
|
||||
|
||||
// }
|
||||
// },
|
||||
// 点击刷新
|
||||
|
@ -602,35 +614,41 @@
|
|||
mask: true
|
||||
})
|
||||
request.post('/api/beehive/removePeel/' + item.id, {}).then(res => {
|
||||
request.get('/api/beehive/detail/' + item.id, {}).then(res => {
|
||||
const newData = res.data.data;
|
||||
const existingItem = that.listData.find(item => item.id === newData.id);
|
||||
if (existingItem) {
|
||||
// 如果找到,替换原数据
|
||||
const index = that.listData.indexOf(existingItem);
|
||||
that.listData.splice(index, 1, newData);
|
||||
} else {
|
||||
that.listData.push(newData);
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
request.get('/api/beehive/detail/' + item.id, {}).then(res => {
|
||||
const newData = res.data.data;
|
||||
const existingItem = that.listData.find(item => item.id === newData
|
||||
.id);
|
||||
if (existingItem) {
|
||||
// 如果找到,替换原数据
|
||||
const index = that.listData.indexOf(existingItem)
|
||||
that.listData.splice(index, 1, newData)
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
that.listData.push(newData);
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
// uni.hideLoading()
|
||||
}, 6000)
|
||||
request.get('/api/beehive/detail/' + item.id, {}).then(res => {
|
||||
const newData = res.data.data;
|
||||
const existingItem = that.listData.find(item => item.id ===
|
||||
newData.id);
|
||||
if (existingItem) {
|
||||
// 如果找到,替换原数据
|
||||
const index = that.listData.indexOf(existingItem);
|
||||
that.listData.splice(index, 1, newData);
|
||||
} else {
|
||||
that.listData.push(newData);
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
request.get('/api/beehive/detail/' + item
|
||||
.id, {}).then(res => {
|
||||
const newData = res.data.data;
|
||||
const existingItem = that.listData
|
||||
.find(item => item.id ===
|
||||
newData
|
||||
.id);
|
||||
if (existingItem) {
|
||||
// 如果找到,替换原数据
|
||||
const index = that.listData
|
||||
.indexOf(existingItem)
|
||||
that.listData.splice(index, 1,
|
||||
newData)
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
that.listData.push(newData);
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
// uni.hideLoading()
|
||||
}, 6000)
|
||||
})
|
||||
|
||||
} else if (res.cancel) {}
|
||||
|
@ -727,9 +745,9 @@
|
|||
}
|
||||
await request.get('/api/apiary/index', {}).then(res => {
|
||||
if (res.msg == '用户凭证不存在') {
|
||||
console.log(11);
|
||||
uni.hideLoading()
|
||||
this.masks = true
|
||||
this.tokenflag = false
|
||||
uni.hideLoading()
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
this.tokenflag = true
|
||||
|
@ -770,21 +788,83 @@
|
|||
qrcode
|
||||
}
|
||||
}).then(res => {
|
||||
this.masks = false
|
||||
uni.hideLoading()
|
||||
wx.setStorageSync('user_id', res.data.data[0].user_id);
|
||||
this.total = res.data.total
|
||||
if (res.data.data.length > 0) {
|
||||
// 有数据,追加到列表
|
||||
this.listData = this.listData.concat(res.data.data)
|
||||
this.page++
|
||||
// uni.hideLoading()
|
||||
}
|
||||
// 停止下拉刷新状态
|
||||
wx.stopPullDownRefresh();
|
||||
// this.$forceUpdate()
|
||||
if(res.statusCode == 200){
|
||||
wx.setStorageSync('user_id', res.data.data[0].user_id);
|
||||
this.total = res.data.total
|
||||
if(this.total > 0){
|
||||
this.masks = false
|
||||
}else{
|
||||
this.masks = true
|
||||
}
|
||||
if (res.data.data.length > 0) {
|
||||
// 有数据,追加到列表
|
||||
// this.listData = this.listData.concat(res.data.data)
|
||||
this.listData.push(...res.data.data)
|
||||
if (this.quchongid === '') {
|
||||
let filteredData = this.listData
|
||||
let uniqueIds = new Set()
|
||||
let uniqueData = filteredData.filter(item => {
|
||||
if (!uniqueIds.has(item.id)) {
|
||||
uniqueIds.add(item.id);
|
||||
return true;
|
||||
}
|
||||
return false
|
||||
})
|
||||
uniqueData.sort((a, b) => {
|
||||
// 首先根据 status_text 排序
|
||||
if (a.status_text !== b.status_text) {
|
||||
// 假设 "在线" 应该排在 "离线" 前面
|
||||
return a.status_text === '在线' ? -1 : 1;
|
||||
}
|
||||
|
||||
// status_text 相同,则根据 name 排序
|
||||
// 尝试将 name 转换为数字,如果失败则保留为字符串
|
||||
const numA = Number(a.name);
|
||||
const numB = Number(b.name);
|
||||
|
||||
// 检查 name 是否可以转换为数字
|
||||
if (!isNaN(numA) && !isNaN(numB)) {
|
||||
// 两者都是数字,按数字大小排序
|
||||
return numA - numB;
|
||||
} else if (!isNaN(numA)) {
|
||||
// a 是数字,b 不是数字,数字排前面
|
||||
return -1;
|
||||
} else if (!isNaN(numB)) {
|
||||
// b 是数字,a 不是数字,b 排后面
|
||||
return 1;
|
||||
} else {
|
||||
// 两者都不是数字,按字符串排序
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
});
|
||||
// this.listData = filteredData;
|
||||
this.listData = uniqueData;
|
||||
} else {
|
||||
let filteredData = this.listData.filter(item => item.apiary_id === this.quchongid)
|
||||
let uniqueIds = new Set()
|
||||
let uniqueData = filteredData.filter(item => {
|
||||
if (!uniqueIds.has(item.id)) {
|
||||
uniqueIds.add(item.id);
|
||||
return true;
|
||||
}
|
||||
return false
|
||||
})
|
||||
this.listData = uniqueData;
|
||||
}
|
||||
|
||||
this.page++
|
||||
}
|
||||
uni.hideLoading()
|
||||
// 停止下拉刷新状态
|
||||
wx.stopPullDownRefresh();
|
||||
// this.$forceUpdate()
|
||||
}else{
|
||||
this.masks = true
|
||||
}
|
||||
}).catch(e => {})
|
||||
},
|
||||
|
||||
|
||||
// 跳转添加蜂箱页面
|
||||
xinzeng() {
|
||||
if (this.tokenflag == true) {
|
||||
|
@ -826,26 +906,31 @@
|
|||
})
|
||||
},
|
||||
clicktabs(event) {
|
||||
console.log(event);
|
||||
if(event.id){
|
||||
this.quchongid = event.id
|
||||
}else{
|
||||
this.quchongid = ''
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
this.page = 1
|
||||
this.listData = []
|
||||
this.masks = true
|
||||
// this.listData = []
|
||||
if (event.index = 0) {
|
||||
this.checkid = ''
|
||||
this.currentindex = 0
|
||||
|
||||
|
||||
} else {
|
||||
this.checkid = event.id
|
||||
const index = this.tabitems.findIndex(item => item.id === this.checkid);
|
||||
this.currentindex = index
|
||||
|
||||
|
||||
}
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
this.refresh()
|
||||
},1000)
|
||||
}, 1000)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -855,6 +940,7 @@
|
|||
/deep/ .u-popup__content {
|
||||
width: 750rpx;
|
||||
}
|
||||
|
||||
.shuaxin {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
|
@ -864,7 +950,7 @@
|
|||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.maskgun {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
|
@ -1020,7 +1106,7 @@
|
|||
text-align: center;
|
||||
width: 100rpx;
|
||||
height: 50rpx;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 气泡框的样式
|
||||
|
@ -1158,7 +1244,7 @@
|
|||
background-color: #f7f7f7;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-x: hidden;
|
||||
// height: 100vh;
|
||||
}
|
||||
|
||||
|
@ -1408,7 +1494,7 @@
|
|||
border-radius: 16rpx;
|
||||
width: 65rpx;
|
||||
height: 26rpx;
|
||||
vertical-align: top;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.view_5 {
|
||||
|
|
|
@ -125,6 +125,9 @@
|
|||
},
|
||||
getPhoneNumber(e) {
|
||||
console.log(this.flage,'that.flage');
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
})
|
||||
let that = this;
|
||||
if(that.flage==false){
|
||||
console.log('没确认');
|
||||
|
@ -182,12 +185,14 @@
|
|||
console.log(res.data, 'resres');
|
||||
if(res.data.code==0){
|
||||
console.log('进入跳转');
|
||||
uni.hideLoading()
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
// console.log(this.formData
|
||||
} catch (error) {
|
||||
uni.hideLoading()
|
||||
console.log(error, 'aaa')
|
||||
if (error.data.code == 401) {
|
||||
// this.userlogin()
|
||||
|
|
|
@ -5,10 +5,8 @@
|
|||
<view class="group">
|
||||
<view class="group-zi">
|
||||
<view class="image-r">
|
||||
<image
|
||||
class="self-center image_5"
|
||||
:src="userImage"
|
||||
/>
|
||||
<image v-if="userImage" class="self-center image_5" :src="userImage"/>
|
||||
<image v-else class="self-center image_5" src="https://api.ccttiot.com/smartmeter/img/static/usaBta7T92keDZwpiqjM"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="self-stretch group_2 mt-73">
|
||||
|
@ -79,11 +77,13 @@ import request from '../../utils/request'
|
|||
async setuser() {
|
||||
const res = await request.get('/api/user/info')
|
||||
console.log(res)
|
||||
if(res.code == 401){
|
||||
this.tokenflag = false
|
||||
}else{
|
||||
if(res.statusCode == 200){
|
||||
this.tokenflag = true
|
||||
this.userImage = res.data.data.avatar
|
||||
}else{
|
||||
console.log(1010);
|
||||
this.tokenflag = false
|
||||
this.userImage = 'https://api.ccttiot.com/smartmeter/img/static/usaBta7T92keDZwpiqjM'
|
||||
}
|
||||
|
||||
},
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<view class="text-box">具体位置</view>
|
||||
<view @click="gotomap">
|
||||
<u--input class="input-b" shape="circle" placeholder="请选择具体位置" border="surround"
|
||||
v-model="form.lng"></u--input>
|
||||
v-model="form.addresss">{{form.addresss}}</u--input>
|
||||
<!-- <view class="input-b">{{form.lng}},{{form.lat}}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
@ -91,6 +91,7 @@
|
|||
lng: '',
|
||||
lat: '',
|
||||
address: '',
|
||||
addresss:'',
|
||||
bee_type: '',
|
||||
honey_source: '',
|
||||
remark: '',
|
||||
|
@ -136,7 +137,7 @@
|
|||
addressData: ['北京市', '北京市', '东城区'],
|
||||
fileList1: [],
|
||||
uploadfileList: [],
|
||||
title: '添加蜂场'
|
||||
title: '添加蜂场',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -163,10 +164,30 @@
|
|||
return res
|
||||
},
|
||||
gotomap() {
|
||||
console.log("跳转到地图")
|
||||
uni.navigateTo({
|
||||
url: '/pagesFengChang/components/map',
|
||||
})
|
||||
uni.chooseLocation({
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
this.form.lng = res.latitude
|
||||
this.form.lat = res.longitude
|
||||
this.form.addresss = res.address
|
||||
},
|
||||
fail: function(err) {
|
||||
// 检查错误消息,看是否是用户取消了位置选择
|
||||
if (err.errMsg && err.errMsg.indexOf('chooseLocation:cancel') === 0) {
|
||||
uni.showToast({
|
||||
title: '您取消了位置选择',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
console.log('选择位置失败', err);
|
||||
// 处理其他失败情况
|
||||
}
|
||||
},
|
||||
});
|
||||
// console.log("跳转到地图")
|
||||
// uni.navigateTo({
|
||||
// url: '/pagesFengChang/components/map',
|
||||
// })
|
||||
},
|
||||
|
||||
submit() {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<view class="group_7 bianhao-top-yi">
|
||||
<view class="bianhao-zuo">
|
||||
<view class="font_2">{{listdata.name}}</view>
|
||||
<view class=" justify-start self-start text-wrapper"
|
||||
<view class=" justify-start self-start text-wrapper" style="background-color: red;"
|
||||
:id="listdata.status_text == '在线' ? 'text-wrapper-bgc1' : '<strong></strong>text-wrapper-bgc2'">
|
||||
<view class="font_33">{{listdata.status_text}}</view>
|
||||
</view>
|
||||
|
@ -48,6 +48,9 @@
|
|||
:latitude="map.latitude" :longitude="map.longitude" :markers="map.markers" :enable-satellite="map.isMap"
|
||||
show-location>
|
||||
</map>
|
||||
<view class="maskmap" v-if="maskflag">
|
||||
未获取到定位信息
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情 -->
|
||||
<view class="detailbox">
|
||||
|
@ -207,6 +210,7 @@
|
|||
return {
|
||||
loading: true,
|
||||
switchk: true,
|
||||
maskflag:false,
|
||||
listdata: {},
|
||||
id: null,
|
||||
chartdataObj: {},
|
||||
|
@ -883,22 +887,18 @@
|
|||
listDataFn() {
|
||||
request.get('/api/beehive/detail/' + this.id, {}).then(res => {
|
||||
this.idss = res.data.data.id
|
||||
// this.user_id = res.data.data.user_id
|
||||
// console.log(wx.getStorageSync('user_id'),this.user_id);
|
||||
// if (wx.getStorageSync('user_id') != this.user_id) {
|
||||
// uni.reLaunch({
|
||||
// url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id
|
||||
// })
|
||||
// }
|
||||
this.getServerDatas()
|
||||
console.log(res);
|
||||
this.listdata = {
|
||||
...res.data.data
|
||||
}
|
||||
this.map.longitude = this.listdata.lng
|
||||
this.map.latitude = this.listdata.lat
|
||||
// this.map.markers[0].latitude = this.listdata.latGcj02
|
||||
// this.map.markers[0].longitude = this.listdata.lngGcj02
|
||||
if(this.listdata.lng == ''){
|
||||
this.maskflag = true
|
||||
}else{
|
||||
this.map.longitude = this.listdata.lng
|
||||
this.map.latitude = this.listdata.lat
|
||||
this.maskflag = false
|
||||
}
|
||||
if (this.listdata.status_text == '离线') {
|
||||
this.map.markers.push({
|
||||
latitude: this.listdata.lat,
|
||||
|
@ -907,9 +907,6 @@
|
|||
height: 15,
|
||||
id: this.listdata.id,
|
||||
iconPath: '../../../static/a22.png',
|
||||
// label: {
|
||||
// content: item.name,
|
||||
// }
|
||||
})
|
||||
} else {
|
||||
this.map.markers.push({
|
||||
|
@ -919,9 +916,6 @@
|
|||
height: 15,
|
||||
id: this.listdata.id,
|
||||
iconPath: '../../../static/a11.png',
|
||||
// label: {
|
||||
// content: item.name,
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1105,7 +1099,20 @@
|
|||
.wendubox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.maskmap{
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 0rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 599rpx;
|
||||
background: #ccc;
|
||||
opacity: .5;
|
||||
color: red;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.flex-taxt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -1268,6 +1275,7 @@
|
|||
|
||||
.mapbox {
|
||||
height: 600rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.detailbox {
|
||||
|
|
|
@ -52,6 +52,9 @@
|
|||
:latitude="map.latitude" :longitude="map.longitude" :markers="map.markers" :enable-satellite="map.isMap"
|
||||
show-location>
|
||||
</map>
|
||||
<view class="maskmap" v-if="maskflag">
|
||||
未获取到定位信息
|
||||
</view>
|
||||
</view>
|
||||
<!-- 详情 -->
|
||||
<view class="detailbox">
|
||||
|
@ -213,6 +216,7 @@
|
|||
listdata: {},
|
||||
id: null,
|
||||
chartdataObj: {},
|
||||
maskflag:false,
|
||||
map: {
|
||||
zoomSize: 15,
|
||||
latitude: null,
|
||||
|
@ -901,8 +905,13 @@
|
|||
...res.data.data
|
||||
}
|
||||
// console.log(this.listdata,'121212')
|
||||
this.map.longitude = this.listdata.lng
|
||||
this.map.latitude = this.listdata.lat
|
||||
if(this.listdata.lng == ''){
|
||||
this.maskflag = true
|
||||
}else{
|
||||
this.map.longitude = this.listdata.lng
|
||||
this.map.latitude = this.listdata.lat
|
||||
this.maskflag = false
|
||||
}
|
||||
// this.map.markers[0].latitude = this.listdata.latGcj02
|
||||
// this.map.markers[0].longitude = this.listdata.lngGcj02
|
||||
if(this.listdata.status_text == '离线'){
|
||||
|
@ -1075,6 +1084,20 @@
|
|||
.dflex1 {
|
||||
display: flex;
|
||||
}
|
||||
.maskmap{
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 0rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 599rpx;
|
||||
background: #ccc;
|
||||
opacity: .5;
|
||||
color: red;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.image_7 {
|
||||
border-radius: 4rpx;
|
||||
|
@ -1276,6 +1299,7 @@
|
|||
|
||||
.mapbox {
|
||||
height: 600rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.detailbox {
|
||||
|
|
Loading…
Reference in New Issue
Block a user