aaa
This commit is contained in:
parent
55eed01238
commit
c543391de9
|
@ -175,7 +175,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/uk7CvwzeU0ukxvS9cBtD" mode=""></image>
|
||||
</view>
|
||||
<view class="top_cont">
|
||||
当前 {{obj.totalWeight == 999999 ? '--' : obj.totalWeight}}Kg
|
||||
当前 {{obj.totalWeight == 999999 ? '--' : obj.totalWeight}}g
|
||||
</view>
|
||||
<view class="top_right">
|
||||
<view style="width: 1rpx;">
|
||||
|
@ -200,7 +200,7 @@
|
|||
<image src="https://api.ccttiot.com/smartmeter/img/static/uhsU6Y1K35jxA4aRauzy" mode=""></image>
|
||||
</view>
|
||||
<view class="top_cont">
|
||||
当前 {{obj.ioCount}}只
|
||||
当前 {{obj.ioCountDay}}只
|
||||
</view>
|
||||
<view class="top_right">
|
||||
<view style="width: 1rpx;">
|
||||
|
@ -318,6 +318,7 @@
|
|||
加热:{{jrkg}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" v-if="showtq"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -338,7 +339,7 @@
|
|||
bgc: {
|
||||
backgroundColor: " #FAFDFD",
|
||||
},
|
||||
title: "添加视频监控",
|
||||
title: "蜂箱详情",
|
||||
latitude: '39.916527',
|
||||
longitude: ' 116.397128',
|
||||
isMap: false,
|
||||
|
@ -1471,6 +1472,15 @@
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mask{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #3D3D3D;
|
||||
opacity: .6;
|
||||
}
|
||||
page {
|
||||
background-color: #FAFDFD;
|
||||
}
|
||||
|
|
|
@ -13,67 +13,20 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="set_log_box" v-if="false">
|
||||
<view class="tit">
|
||||
选择操作类型
|
||||
</view>
|
||||
<view class="set_type_box">
|
||||
<view class="type_li" v-for="item in 7" :key="item" :class='item==1?"act1":""'>
|
||||
换脾
|
||||
</view>
|
||||
</view>
|
||||
<view class="tit" style="margin-top: 48rpx;">
|
||||
上传操作图片
|
||||
</view>
|
||||
<view class="icon">
|
||||
|
||||
<view class="imgbox" v-for="(item,index) in imglist " :key="index">
|
||||
<image :src="item" mode=""></image>
|
||||
</view>
|
||||
<view class="imgbox" @click="btn">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ulkCEWjWYqwijg7yhdY9" mode=""></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="tit" style="margin-top: 48rpx;">
|
||||
操作说明描述
|
||||
</view>
|
||||
<view class="input-container">
|
||||
<view class="placeholder" v-if="!textValue">在此输入文字描述(选填)</view>
|
||||
<textarea class="custom-textarea" v-model="textValue" @focus="hidePlaceholder" style="border: none;"
|
||||
@input="updateWordCount" @blur="showPlaceholder"></textarea>
|
||||
<text class="word-count">{{ currentCount }}/500</text>
|
||||
</view>
|
||||
<view class="xy" @click="showxy=!showxy">
|
||||
<view class="yuans">
|
||||
<image src="https://lxnapi.ccttiot.com/bike/img/static/u7F851ikY9rkASzNSNkO" v-if='showxy' mode=""></image>
|
||||
</view>
|
||||
|
||||
<view class="txt">
|
||||
该蜂场的所有蜂箱进行此日志,并记录蜂场日志
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
确认添加
|
||||
</view>
|
||||
<!-- <view class="img_cont">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ulkCEWjWYqwijg7yhdY9" mode=""></image>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="cont_box" v-if="true">
|
||||
<view class="cont_box">
|
||||
<view class="left">
|
||||
<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_box" v-for="(item, index) in tabs" :key="index"
|
||||
@click="changeTag(index,item.type)" :class="currentIndex === index ? 'act4' : ''">
|
||||
<view class="left_cont" :class="[
|
||||
index=== currentIndex? 'act1' : '',
|
||||
index + 1 === currentIndex? 'act2' : '',
|
||||
index- 1 === currentIndex? 'act3' : ''
|
||||
]">
|
||||
{{item.name}}
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<scroll-view class="right" v-if="wuflag" scroll-y="true" @scrolltolower="loadMore">
|
||||
<view class="right_cont" v-for="(item,index) in rzlist" :key="index">
|
||||
<view class="right_cont_top">
|
||||
<view class="cont_left">
|
||||
|
@ -106,28 +59,29 @@
|
|||
{{item.content}}
|
||||
</view>
|
||||
|
||||
<view class="imgcont">
|
||||
<view class="img_box" v-for="(val,index) in item.picture" :key="index">
|
||||
<view class="imgcont" v-if="item.picture != ''">
|
||||
<view class="img_box" v-for="(val,indexs) in item.picture" :key="indexs" @click="btnimg(index)">
|
||||
<image :src="val" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="log_info">
|
||||
<view class="txt">
|
||||
{{item.apiaryName}}
|
||||
{{item.beehiveName}}
|
||||
</view>
|
||||
<view class="txt">
|
||||
{{item.beehiveSn}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="log_work">
|
||||
<view class="work_cont">
|
||||
<view class="work_cont" @click="btnedit(item.id)">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uqvAxjb2kVb4s6Zrx5s8" mode="">
|
||||
</image>
|
||||
<view class="cont_xtx">
|
||||
编辑
|
||||
</view>
|
||||
</view>
|
||||
<view class="work_cont" style="margin-left: 34rpx ;">
|
||||
<view class="work_cont" style="margin-left: 34rpx;" @click="btndel(item.id)">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uWikdpHsjtd8ggSA49gS" mode=""
|
||||
style="width: 27rpx;height: 30rpx;"> </image>
|
||||
<view class="cont_xtx">
|
||||
|
@ -137,7 +91,19 @@
|
|||
|
||||
</view>
|
||||
</view>
|
||||
<view class="addtj">
|
||||
|
||||
</scroll-view>
|
||||
|
||||
<view class="no_cont" v-else>
|
||||
<view class="img">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uUZ3MF84e3bKgwAei8Rz" mode=""></image>
|
||||
</view>
|
||||
<view class="txt">
|
||||
当前暂无日志...
|
||||
</view>
|
||||
</view>
|
||||
<view class="addtj" @click="btnadd">
|
||||
<view class="">
|
||||
添加日志
|
||||
</view>
|
||||
</view>
|
||||
|
@ -156,92 +122,171 @@
|
|||
showmiyuan: false,
|
||||
title: "操作日志",
|
||||
currentIndex: 0,
|
||||
wuflag: false,
|
||||
tabs: [{
|
||||
title: '京东超市',
|
||||
title: '全部',
|
||||
type: null
|
||||
},
|
||||
{
|
||||
title: '男装',
|
||||
title: '换脾',
|
||||
type: 1
|
||||
},
|
||||
{
|
||||
title: '奢侈品',
|
||||
title: '饲喂',
|
||||
type: 2
|
||||
},
|
||||
{
|
||||
title: '女装',
|
||||
title: '取蜜',
|
||||
type: 3
|
||||
},
|
||||
{
|
||||
title: '鞋靴',
|
||||
title: '加牌',
|
||||
type: 4
|
||||
},
|
||||
{
|
||||
title: '内衣饰品',
|
||||
imageSrc: ''
|
||||
title: '除螨',
|
||||
type: 5
|
||||
},
|
||||
{
|
||||
title: '箱包',
|
||||
imageSrc: ''
|
||||
title: '换王',
|
||||
type: 6
|
||||
},
|
||||
{
|
||||
title: '美妆护肤',
|
||||
imageSrc: ''
|
||||
title: '换位置',
|
||||
type: 7
|
||||
},
|
||||
|
||||
],
|
||||
textValue: '',
|
||||
currentCount: 0,
|
||||
showxy:false,
|
||||
apiaryId:'',
|
||||
beehiveId:'',
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
rzlist:[],
|
||||
fclist:[],
|
||||
apiaryName:''
|
||||
showxy: false,
|
||||
apiaryId: '',
|
||||
beehiveId: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
rzlist: [],
|
||||
fclist: [],
|
||||
apiaryName: '',
|
||||
type: null,
|
||||
total: 0,
|
||||
imglist: []
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
// console.log(option);
|
||||
this.apiaryId = option.apiaryId
|
||||
this.getfxlb()
|
||||
this.getfc()
|
||||
this.apiaryName = option.name
|
||||
},
|
||||
onShow() {
|
||||
|
||||
this.pageNum = 1
|
||||
this.rzlist = []
|
||||
this.getfc()
|
||||
this.getfxrz()
|
||||
},
|
||||
methods: {
|
||||
confirmmy(e){
|
||||
this.rzlist = []
|
||||
// btnimg(index) {
|
||||
// uni.previewImage({
|
||||
// current: this.rzlist[index].picture,
|
||||
// urls: this.rzlist[index].picture.map(item => item),
|
||||
// success: function(res) {
|
||||
// // 预览成功
|
||||
// },
|
||||
// fail: function(err) {
|
||||
// // 预览失败
|
||||
// console.log(err);
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// 编辑日志
|
||||
btnedit(id){
|
||||
uni.navigateTo({
|
||||
url:'/pages/Apiary/addrizhi?id=' + id
|
||||
})
|
||||
},
|
||||
// 删除日志
|
||||
btndel(id){
|
||||
this.$u.delete(`/farm/beehive/log/${id}`).then(res=>{
|
||||
if(res.code == 200){
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
this.rzlist = this.rzlist.filter(item => item.id !== id)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
loadMore() {
|
||||
if (this.rzlist.length < this.total) {
|
||||
this.getfxrz()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '没有更多日志了',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
},
|
||||
confirmmy(e) {
|
||||
// this.rzlist = []
|
||||
this.apiaryId = e[0].value
|
||||
this.apiaryName = e[0].label
|
||||
this.getfxlb()
|
||||
this.getfxrz()
|
||||
},
|
||||
// 查询指定蜂箱列表
|
||||
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()
|
||||
btnadd() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/Apiary/addrizhi'
|
||||
})
|
||||
},
|
||||
|
||||
// 查询蜂箱日志
|
||||
getfxrz() {
|
||||
let queryParams = {
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
withApiary: true,
|
||||
apiaryId: this.apiaryId,
|
||||
type: this.type
|
||||
};
|
||||
if (this.type == null) {
|
||||
delete queryParams.type;
|
||||
}
|
||||
let queryString = Object.keys(queryParams).filter(key => queryParams[key] != null).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(queryParams[key])}`).join('&');
|
||||
this.$u.get(`/farm/beehive/log/list?${queryString}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.total
|
||||
if (res.total < 1) {
|
||||
this.wuflag = false
|
||||
} else {
|
||||
this.pageNum++
|
||||
this.wuflag = true
|
||||
if (this.type == null) {
|
||||
this.rzlist = [...this.rzlist, ...res.rows.map(row => ({
|
||||
...row,
|
||||
picture: row.picture.split(',')
|
||||
}))]
|
||||
} else {
|
||||
let existingBeehiveIds = new Set(this.rzlist.filter(row => row.type == this.type).map(row => row.id));
|
||||
let filteredAndDeduplicatedNewRows = res.rows.filter(row => row.type == this.type).filter(row => !existingBeehiveIds.has(row.id)).map(row => ({
|
||||
...row,
|
||||
picture: row.picture.split(',')
|
||||
}));
|
||||
this.rzlist = [...this.rzlist.filter(row => row.type == this.type), ...filteredAndDeduplicatedNewRows]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询蜂箱日志
|
||||
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(){
|
||||
getfc() {
|
||||
this.$u.get(`farm/apiary/listAll`).then(res => {
|
||||
if(res.code == 200){
|
||||
if (res.code == 200) {
|
||||
this.fclist = res.data.map(item => ({
|
||||
value: item.apiaryId,
|
||||
label: item.name
|
||||
|
@ -249,7 +294,7 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
hidePlaceholder() {
|
||||
this.placeholderVisible = false;
|
||||
},
|
||||
|
@ -260,14 +305,6 @@
|
|||
},
|
||||
updateWordCount() {
|
||||
this.currentCount = this.textValue.trim().replace(/\s+/g, '').length;
|
||||
// if (this.currentCount > 500) {
|
||||
// this.textValue = this.textValue.slice(0, this.textValue.lastIndexOf(' ', 500)).trim();
|
||||
// uni.showToast({
|
||||
// title: '字数已超过500字限制',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// }
|
||||
|
||||
},
|
||||
btn() {
|
||||
let _this = this
|
||||
|
@ -276,14 +313,7 @@
|
|||
count: 9,
|
||||
type: 'all',
|
||||
success(res) {
|
||||
// tempFilePath可以作为img标签的src属性显示图片
|
||||
const tempFilePaths = res.tempFiles
|
||||
// let tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
// console.log(tempFilePaths)
|
||||
// tempFilePaths.forEach(item=>{
|
||||
// // 上传图片到七牛云
|
||||
|
||||
// })
|
||||
let tempFilePaths = res.tempFiles
|
||||
wx.uploadFile({
|
||||
url: 'https://up-z2.qiniup.com',
|
||||
name: 'file',
|
||||
|
@ -293,10 +323,10 @@
|
|||
key: 'smartmeter/img/' + math
|
||||
},
|
||||
success: function(res) {
|
||||
console.log(res,'resres');
|
||||
console.log(res, 'resres');
|
||||
let str = JSON.parse(res.data)
|
||||
console.log(str.key)
|
||||
_this.userImgs = _this.upurl +'/'+ str.key
|
||||
_this.userImgs = _this.upurl + '/' + str.key
|
||||
console.log(_this.userImgs)
|
||||
_this.imglist.push(_this.userImgs)
|
||||
}
|
||||
|
@ -304,8 +334,12 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
changeTag(beehiveId,idx) {
|
||||
this.beehiveId = beehiveId
|
||||
changeTag(idx, type) {
|
||||
if(idx == 0){
|
||||
this.rzlist = []
|
||||
}
|
||||
this.pageNum = 1
|
||||
this.type = type
|
||||
this.currentIndex = idx
|
||||
this.getfxrz()
|
||||
},
|
||||
|
@ -328,27 +362,61 @@
|
|||
page {
|
||||
background-color: #F4FAF8;
|
||||
}
|
||||
.addtj{
|
||||
width: 300rpx;
|
||||
height: 90rpx;
|
||||
background-color: #FFCC25;
|
||||
color: #fff;
|
||||
|
||||
.addtj {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
// background-color: #FFCC25;
|
||||
// background-color: #fff;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
bottom: 300rpx;
|
||||
border-radius: 10rpx;
|
||||
left: 220rpx;
|
||||
bottom: 0;
|
||||
font-size: 36rpx;
|
||||
padding-left: 80rpx;
|
||||
padding-top: 30rpx;
|
||||
box-sizing: border-box;
|
||||
view{
|
||||
width: 336rpx;
|
||||
height: 88rpx;
|
||||
background-color: #FFCC25;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.page {
|
||||
// position: relative;
|
||||
width: 750rpx;
|
||||
|
||||
.no_cont {
|
||||
margin: 152rpx auto 0;
|
||||
width: 432rpx;
|
||||
|
||||
.img {
|
||||
image {
|
||||
width: 432rpx;
|
||||
height: 432rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.txt {
|
||||
margin-top: 50rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
|
||||
.set_log_box {
|
||||
padding: 50rpx 56rpx;
|
||||
.btn{
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
@ -363,14 +431,16 @@
|
|||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.xy{
|
||||
|
||||
.xy {
|
||||
margin-top: 46rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.yuans{
|
||||
|
||||
.yuans {
|
||||
margin-top: 2rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -379,24 +449,27 @@
|
|||
height: 34rpx;
|
||||
border-radius: 50%;
|
||||
border: #808080 solid 2rpx;
|
||||
image{
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.txt{
|
||||
|
||||
.txt {
|
||||
margin-left: 10rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #808080;
|
||||
span{
|
||||
|
||||
span {
|
||||
color: #3D3D3D;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.input-container {
|
||||
position: relative;
|
||||
width: 612rpx;
|
||||
|
@ -410,7 +483,7 @@
|
|||
box-sizing: border-box;
|
||||
border: 2rpx solid #C7C7C7;
|
||||
}
|
||||
|
||||
|
||||
.placeholder {
|
||||
position: absolute;
|
||||
top: 18rpx;
|
||||
|
@ -420,6 +493,7 @@
|
|||
pointer-events: none;
|
||||
/* 确保点击事件可以穿透到textarea上 */
|
||||
}
|
||||
|
||||
.custom-textarea {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -430,7 +504,7 @@
|
|||
box-sizing: border-box;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
|
||||
.word-count {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
|
@ -438,22 +512,24 @@
|
|||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
margin-top: 40rpx;
|
||||
|
||||
|
||||
.imgbox {
|
||||
width: 33%;
|
||||
|
||||
|
||||
image {
|
||||
width: 222rpx;
|
||||
height: 222rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
|
@ -521,18 +597,19 @@
|
|||
|
||||
.left {
|
||||
margin-left: 48rpx;
|
||||
width: 216rpx;
|
||||
width: 170rpx;
|
||||
|
||||
.left_cont_box {
|
||||
width: 216rpx;
|
||||
width: 170rpx;
|
||||
height: 100rpx;
|
||||
background: #fff;
|
||||
|
||||
.left_cont {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 216rpx;
|
||||
// justify-content: center;
|
||||
padding-left: 30rpx;
|
||||
width: 170rpx;
|
||||
height: 100rpx;
|
||||
font-weight: 600;
|
||||
font-size: 36rpx;
|
||||
|
@ -570,13 +647,18 @@
|
|||
padding: 16rpx;
|
||||
margin-left: -10rpx;
|
||||
width: 100%;
|
||||
height: 100vn;
|
||||
height: 82vh;
|
||||
background: #fff;
|
||||
overflow: scroll;
|
||||
padding-bottom: 200rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.right_cont {
|
||||
padding: 20rpx 26rpx;
|
||||
border: 2rpx solid #D8D8D8;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.log_work {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
|
|
|
@ -49,6 +49,9 @@
|
|||
<view class="btn" @click="btnedit" v-else>
|
||||
确认修改
|
||||
</view>
|
||||
<view class="btns" @click="btndel" v-if="title != '添加蜂箱'">
|
||||
删除蜂场
|
||||
</view>
|
||||
<!-- 选择蜂场 -->
|
||||
<u-select v-model="showmiyuan" :list="miyuancolumns" title='选择蜂场' @confirm="confirmmy"></u-select>
|
||||
</view>
|
||||
|
@ -89,6 +92,46 @@
|
|||
|
||||
},
|
||||
methods: {
|
||||
btndel() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: '确定要删除此蜂箱?请谨慎操作',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.$u.delete(`/farm/beehive/${that.beehiveId}`).then(res => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '删除蜂箱成功',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta:2
|
||||
});
|
||||
}, 1500);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('删除蜂场失败:', error);
|
||||
uni.showToast({
|
||||
title: '删除蜂场失败,请稍后再试',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 修改部分
|
||||
geteditxq(){
|
||||
this.$u.get(`/farm/beehive/${this.beehiveId}`).then(res => {
|
||||
|
@ -239,9 +282,24 @@
|
|||
height: 222rpx;
|
||||
}
|
||||
}
|
||||
.btns {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: auto;
|
||||
margin-top: 50rpx;
|
||||
width: 658rpx;
|
||||
height: 88rpx;
|
||||
background: #D8D8D8;
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 160rpx auto;
|
||||
margin-bottom: 0;
|
||||
// position: fixed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
@ -62,6 +62,13 @@
|
|||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},{
|
||||
"path": "pages/Apiary/addrizhi",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/Apiary/Apiary_detail",
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
当前还没有添加蜂场哦
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view class="Apiary_box" scroll-y="true" @scrolltolower="loadMore">
|
||||
<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">
|
||||
|
@ -74,7 +74,7 @@
|
|||
},
|
||||
onShow() {
|
||||
this.pagesum = 1
|
||||
this.list = []
|
||||
// this.list = []
|
||||
this.ishave()
|
||||
},
|
||||
methods: {
|
||||
|
@ -125,20 +125,18 @@
|
|||
this.total = res.total
|
||||
if(this.total < 1){
|
||||
this.logoflag = true
|
||||
}else{
|
||||
let uniqueIds = new Set(this.list.map(item => item.apiaryId))
|
||||
let uniqueRows = res.rows.filter(row => !uniqueIds.has(row.apiaryId))
|
||||
uniqueRows.forEach(row => uniqueIds.add(row.apiaryId))
|
||||
this.list = this.list.concat(uniqueRows)
|
||||
this.pagesum++
|
||||
this.logoflag = false
|
||||
}
|
||||
let uniqueIds = new Set(this.list.map(item => item.apiaryId))
|
||||
let uniqueRows = res.rows.filter(row => !uniqueIds.has(row.apiaryId))
|
||||
uniqueRows.forEach(row => uniqueIds.add(row.apiaryId))
|
||||
this.list = this.list.concat(uniqueRows)
|
||||
this.pagesum++
|
||||
this.logoflag = false
|
||||
// console.log(this.logoflag);
|
||||
} else {
|
||||
this.logoflag = true
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
// console.log(this.logoflag);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -221,7 +221,7 @@
|
|||
},
|
||||
btncaozuo(){
|
||||
uni.navigateTo({
|
||||
url:'/page_Beehive/Beehive_log?apiaryId=' + this.apiaryId
|
||||
url:'/page_Beehive/Beehive_log?apiaryId=' + this.apiaryId + '&name=' + this.apiaryobj.name
|
||||
})
|
||||
},
|
||||
btnpage(){
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<u-navbar :is-back="false" title="我的" :border-bottom="false" :background="bgc" title-color='#000'
|
||||
<u-navbar :is-back="false" title="蜂箱" :border-bottom="false" :background="bgc" title-color='#3D3D3D '
|
||||
title-size='36' height='45' id="navbar">
|
||||
</u-navbar>
|
||||
<view class="top_cont">
|
||||
|
@ -36,8 +36,8 @@
|
|||
@change="swiperchange">
|
||||
<swiper-item >
|
||||
<scroll-view class="swiper-item" scroll-y="true" @scrolltolower="loadMore">
|
||||
<view v-if="total == 0" style="width: 100%;margin: auto;margin-top: 200rpx;text-align: center;color: #ccc;">该蜂场没有蜂箱...</view>
|
||||
<view v-else class="card_box" v-for="(item,index) in fxlist" :key="index" @click="todetail(item.beehiveId)">
|
||||
<!-- <view v-if="total == 0" style="width: 100%;margin: auto;margin-top: 200rpx;text-align: center;color: #ccc;">该蜂场没有蜂箱...</view> -->
|
||||
<view class="card_box" v-for="(item,index) in fxlist" :key="index" @click="todetail(item.beehiveId)">
|
||||
<view class="card">
|
||||
<view class="card_top">
|
||||
<view class="name">
|
||||
|
@ -235,7 +235,7 @@
|
|||
this.indextab = index
|
||||
this.pagesum = 1
|
||||
this.apiaryId = item.value
|
||||
this.fxlist = []
|
||||
// this.fxlist = []
|
||||
this.getlist()
|
||||
},
|
||||
getlist(){
|
||||
|
@ -249,12 +249,26 @@
|
|||
this.total = res.total
|
||||
if(this.total < 1){
|
||||
this.logoflag = true
|
||||
}else{
|
||||
this.logoflag = false
|
||||
// let uniqueIds = new Set(this.fxlist.map(item => item.sn))
|
||||
// let uniqueRows = res.rows.filter(row => !uniqueIds.has(row.sn))
|
||||
// uniqueRows.forEach(row => uniqueIds.add(row.sn))
|
||||
// this.fxlist = this.fxlist.concat(uniqueRows)
|
||||
let oldSnSet = new Set(this.fxlist.map(item => item.sn));
|
||||
let result = [];
|
||||
res.rows.forEach(row => {
|
||||
if (oldSnSet.has(row.sn)) {
|
||||
result.push(row)
|
||||
oldSnSet.delete(row.sn);
|
||||
} else {
|
||||
result.push(row);
|
||||
}
|
||||
})
|
||||
this.fxlist = this.fxlist.filter(item => oldSnSet.has(item.sn));
|
||||
this.fxlist = result;
|
||||
this.pagesum++
|
||||
}
|
||||
let uniqueIds = new Set(this.fxlist.map(item => item.apiaryId))
|
||||
let uniqueRows = res.rows.filter(row => !uniqueIds.has(row.apiaryId))
|
||||
uniqueRows.forEach(row => uniqueIds.add(row.apiaryId))
|
||||
this.fxlist = this.fxlist.concat(uniqueRows)
|
||||
this.pagesum++
|
||||
}else{
|
||||
// uni.showToast({
|
||||
// title: res.msg,
|
||||
|
@ -318,6 +332,8 @@
|
|||
<style lang="scss">
|
||||
#active{
|
||||
border-bottom: 3px solid #FFC107;
|
||||
font-weight: 600;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
#status{
|
||||
background-color: #808080;
|
||||
|
@ -360,15 +376,15 @@
|
|||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
image{
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.li_txt{
|
||||
margin-left: 22rpx;
|
||||
margin-left: 12rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
font-size: 30rpx;
|
||||
color: #3D3D3D;
|
||||
span{
|
||||
font-size: 20rpx;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="no_cont" @click="addApiary()" v-if="!haveApiary">
|
||||
<view class="no_cont" @click="addApiary()" v-if="haveApiary == false">
|
||||
<view class="img" >
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uUZ3MF84e3bKgwAei8Rz" mode=""></image>
|
||||
</view>
|
||||
|
@ -321,14 +321,15 @@
|
|||
pageSize: 10
|
||||
}
|
||||
this.$u.get('/farm/apiary/list?', data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.total > 1) {
|
||||
if (res.code == 200) {
|
||||
if (res.total >= 1) {
|
||||
this.getnum()
|
||||
this.getnums()
|
||||
this.haveApiary = true
|
||||
} else {
|
||||
this.haveApiary = false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
swiperchange(e) {
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||
borderColor:'#fff',
|
||||
borderRadius:5,
|
||||
bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
// bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
}
|
||||
})
|
||||
// this.covers.push(shopCover)
|
||||
|
@ -208,7 +208,7 @@
|
|||
textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
|
||||
borderColor:'#fff',
|
||||
borderRadius:5,
|
||||
bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
// bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
}
|
||||
})
|
||||
// this.covers.push(shopCover)
|
||||
|
@ -248,7 +248,7 @@
|
|||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uYrX2QTRLdVVDTB3E5cp',
|
||||
borderColor:'#fff',
|
||||
borderRadius:5,
|
||||
bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
// bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
})
|
||||
// this.covers.push(shopCover)
|
||||
});
|
||||
|
@ -262,7 +262,7 @@
|
|||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/ukbyhyrDcp3VzgyeJo2G',
|
||||
borderColor:'#fff',
|
||||
borderRadius:5,
|
||||
bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
// bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
})
|
||||
// this.covers.push(shopCover)
|
||||
});
|
||||
|
@ -285,7 +285,7 @@
|
|||
rotate: 20,
|
||||
borderColor:'#fff',
|
||||
borderRadius:5,
|
||||
bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
// bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
}
|
||||
})
|
||||
// this.covers.push(shopCover)
|
||||
|
@ -307,7 +307,7 @@
|
|||
rotate: 20,
|
||||
borderColor:'#fff',
|
||||
borderRadius:5,
|
||||
bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
// bgColor: 'rgba(255, 255, 255, 0.7)'
|
||||
}
|
||||
})
|
||||
// this.covers.push(shopCover)
|
||||
|
|
Loading…
Reference in New Issue
Block a user