| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <view>
- <view class="status_bar"></view>
- <view class="" style="position: relative;top: 40px;">
- <view style="position: fixed;z-index: 100;background-color: #FFFFFF;height: 80px;">
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="设备搜索"></uni-nav-bar>
- <view class="search_top_input">
- <input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinp" />
- <u-icon name="search" size="40" class="icon" @click="search"></u-icon>
- </view>
- </view>
- <view class="prevents">
- <view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
- <image :src="item.is_online==1?$imageURL+ '/bigdata_app/image/prevention/6.png':$imageURL+ '/bigdata_app/image/prevention/7.png'"
- mode="" class="prevents_item_img"></image>
- <view class="prevents_item_top">
- <p>设备名称:{{item.device_name==""?"无":item.device_name}}</p>
- <p :class="item.is_online==1?'green':'red'" v-text="item.is_online==1?'在线':'离线'"></p>
- </view>
- <view class="prevents_item_bot">
- <p>设备 ID:{{item.imei}}</p>
- <p>最新上报时间:{{item.addtime|timeFormat()}}</p>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- Debounce,
- Throttle
- } from "../../util/anitthro.js"
- export default {
- data() {
- return {
- imports: '',
- eqlistdata: [],
- page: 1,
- size: 10,
- show: false,
- value: '',
- options1: [{
- text: "杀虫灯",
- id: 2
- },
- {
- text: "虫情测报",
- id: 3
- },
- {
- text: "孢子仪",
- id: 7
- },
- {
- text: "性诱设备",
- id: 4
- },
- ]
- }
- },
- methods: {
- async eqlist() { //设备列表
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
- data: {
- device_type_id: 2,
- page: this.page,
- size: this.size,
- device_id: this.imports
- }
- })
- this.eqlistdata = this.eqlistdata.concat(res.data)
- console.log(this.eqlistdata)
- },
- clickLeft() {
- uni.navigateBack({
- delta: 1
- })
- },
- search() {
- this.eqlistdata = []
- this.eqlist()
- },
- searchinp() {
- Debounce(() => {
- this.eqlistdata = []
- this.eqlist()
- }, 1000)()
- },
- actionSheetCallback(index) { //选择框
- this.value = this.options1[index].text;
- // this.id = this.options1[index].id
- },
- eqdetails(data) {
- uni.navigateTo({
- url: "./equipmentdetails?shebei=" + JSON.stringify(data)
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .search_top_input {
- width: 90%;
- height: 54rpx;
- background-color: #E4E4E4;
- border-radius: 27rpx;
- position: absolute;
- top: 100rpx;
- right: 5%;
- padding-top: 8rpx;
- box-sizing: border-box;
- input {
- width: 85%;
- // text-indent: 1rem;
- font-size: 26rpx;
- padding-left: 20px;
- box-sizing: border-box;
- }
- .icon {
- position: absolute;
- top: 8rpx;
- right: 26rpx;
- }
- }
- .prevents {
- width: 100%;
- position: absolute;
- top: 84px;
- .prevents_item {
- width: 95%;
- margin: 0 auto 30rpx;
- border-radius: 10rpx;
- box-shadow: 0 0 10rpx #bcb9ca;
- padding: 20rpx 40rpx 20rpx 80rpx;
- position: relative;
- box-sizing: border-box;
- .prevents_item_img {
- width: 30rpx;
- height: 50rpx;
- position: absolute;
- top: -4rpx;
- left: 30rpx;
- }
- .prevents_item_top {
- display: flex;
- justify-content: space-between;
- height: 60rpx;
- border-bottom: 2rpx solid #F4F4F4;
- line-height: 60rpx;
- font-size: 26rpx;
- .red {
- color: #ff0000;
- }
- .green {
- color: #7DBB91;
- }
- }
- .prevents_item_bot {
- margin-top: 20rpx;
- font-size: 26rpx;
- color: #BDBDBD;
- }
- }
- }
- </style>
|