|
|
@@ -16,6 +16,13 @@
|
|
|
<view class="loading" v-if="loadingtf">
|
|
|
<image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
|
|
|
</view>
|
|
|
+ <view class="tab-box">
|
|
|
+ <view v-for="(item,index) in equipArr" :key="index"
|
|
|
+ @click="tabClick(index,item)" :class="['tab-item',active==index?'active':'']">
|
|
|
+ <text>{{item.type_name}}</text>
|
|
|
+ <text class="bottom-line"></text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="prevents">
|
|
|
<view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
|
|
|
<image
|
|
|
@@ -91,6 +98,8 @@
|
|
|
content: "",
|
|
|
allqingchong: false,
|
|
|
showLastTime: false,
|
|
|
+ active:0,
|
|
|
+ equipArr:[{type_name:'杀虫灯',id:2,device_model:0},{type_name:'风吸式杀虫灯',id:2,device_model:101}]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -112,6 +121,26 @@
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ async usertype() {
|
|
|
+ const res = await this.$myRequest({
|
|
|
+ url: '/api/api_gateway?method=home.homes.user_device_type',
|
|
|
+ data:{
|
|
|
+ model:'防治'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('防治设备列表',res)
|
|
|
+ this.equipArr = res
|
|
|
+ this.eqlist()
|
|
|
+
|
|
|
+ },
|
|
|
+ tabClick(index, item) {
|
|
|
+
|
|
|
+ this.active = index
|
|
|
+ this.page = 1
|
|
|
+ this.eqlistdata = []
|
|
|
+ this.eqlist()
|
|
|
+
|
|
|
+ },
|
|
|
async eqlist() { //设备列表
|
|
|
this.loadingtf = true
|
|
|
const res = await this.$myRequest({
|
|
|
@@ -121,7 +150,8 @@
|
|
|
page: this.page,
|
|
|
page_size: "10",
|
|
|
device_status: this.device_status,
|
|
|
- device_id: this.imports
|
|
|
+ device_id: this.imports,
|
|
|
+ device_model:this.equipArr[this.active].device_model
|
|
|
}
|
|
|
})
|
|
|
this.loadingtf = false
|
|
|
@@ -237,7 +267,7 @@
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.getworm()
|
|
|
- this.eqlist()
|
|
|
+ this.usertype()
|
|
|
uni.getStorage({
|
|
|
key: "jurisdiction",
|
|
|
success: (res) => {
|
|
|
@@ -309,11 +339,47 @@
|
|
|
height: 40rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ .tab-box {
|
|
|
+ position: fixed;
|
|
|
+ top: 170px;
|
|
|
+ font-size: 30rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ background-color: #ffffff;
|
|
|
+ width: 100vw;
|
|
|
+ z-index: 2;
|
|
|
+ overflow-y: hidden;
|
|
|
+ overflow-x: auto;
|
|
|
+ white-space: nowrap;
|
|
|
+ margin-top: -10rpx;
|
|
|
+ .tab-item {
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ padding: 10rpx 20rpx;
|
|
|
+ text-align: center;
|
|
|
+ display: inline-block;
|
|
|
+ span{
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .tab-item.active {
|
|
|
+ .bottom-line {
|
|
|
+ bottom: 0;
|
|
|
+ position: absolute;
|
|
|
+ display: inline-block;
|
|
|
+ width: 90rpx;
|
|
|
+ height: 6rpx;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ margin: auto;
|
|
|
+ background: $uni-color-success;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.prevents {
|
|
|
width: 100%;
|
|
|
position: absolute;
|
|
|
- top: 140px;
|
|
|
+ top: 180px;
|
|
|
|
|
|
.prevents_item {
|
|
|
width: 95%;
|