王飞
2025-03-07 c5e49c10499435802a6551b98772f95660c6f85a
pages/index/equipment.vue
@@ -2,7 +2,7 @@
   <view class="template-job tn-safe-area-inset-bottom tn-skeleton">
      <!-- 顶部自定义导航 -->
      <tn-nav-bar fixed style="position: absolute;z-index: 999999999;">
      <tn-nav-bar fixed :isBack="false" style="position: absolute;z-index: 999999999;">
         <text v-if="isAchor==false" class="title_linespan" style="color: #00aaff;text-decoration: underline;"
            @click="goAchor">基站</text>
         <text v-else class="title_linespan" @click="goAchor">基站</text>
@@ -10,7 +10,8 @@
      </tn-nav-bar>
      <view v-show="lock==false" class="page-wrap u-skeleton">
         <view style="display: flex;width: 50%;left: 5%":style="{display:'flex', top: topheight+'px',position: 'absolute',width: '50%',left: '5%'}">
         <view style="display: flex;width: 50%;left: 5%"
            :style="{display:'flex', top: topheight+'px',position: 'absolute',width: '50%',left: '5%'}">
         
            <view style="color: #00aaff;">在线:{{online}}</view>
            <view style="color: #00aaff;margin-left: 20px;">离线:{{offline}}</view>
@@ -30,8 +31,7 @@
               <view style="display: flex;margin-bottom: 10px;" class="flex flex-direction">
                  <u-badge v-if="item.anchormode==1" style="margin-top: 8px;margin-right: 8px;" :isDot="true"
                     type="success"></u-badge>
                  <u-badge v-else style="margin-top: 8px;margin-right: 8px;" :isDot="true"
                     type="info"></u-badge>
                  <u-badge v-else style="margin-top: 8px;margin-right: 8px;" :isDot="true" type="info"></u-badge>
                  <view>编号:{{item.anchorid}}</view>
                  <view v-if="item.anchormode==1" style="margin-left: 20px;">在线</view>
                  <view v-else style="margin-left: 20px;">离线</view>
@@ -51,17 +51,9 @@
               <u-line style="margin-left: 14px;margin-bottom: 10px;"></u-line>
               <!-- <view style="margin-left: 10px; background-color: rgba(255, 181, 166, 1.0); " >{{item.type}}</view> -->
               <!-- </view> -->
            </view>
         </data-list>
      </view>
      <tn-skeleton :show="showSkeleton"></tn-skeleton>
      <successCom ref="refSuccess"></successCom>
      <!-- <u-empty text="暂未开放" mode="list" style="width: 90%; top: 30%;left: 5%; position: absolute; "></u-empty> -->
@@ -142,7 +134,6 @@
         }
      },
      mounted() {
         console.log("打印数据=======》》》》》》》》》");
         this.topheight = this.vuex_custom_bar_height + 15
         setTimeout(() => {
            this.showSkeleton = false
@@ -166,16 +157,10 @@
         goAchor() {
            // this.isAchor = true
            this.lock = false
            console.log(2323323);
         },
         goTag() {
            this.isAchor = false
            this.lock = true
            console.log(2323323);
            // findTag
            // uni.reLaunch({
            //    url: '/pages/index/tag'
            // });
         },
         // 模拟请求加载数据
@@ -185,9 +170,8 @@
               size: data.size,
               company: this.company,
            }
            if (this.vuex_is_login) {
            findAchor(params).then((res) => {
               console.log(res);
               this.online = res.online
               this.offline = res.offline
               if (res.code == 0) {
@@ -197,7 +181,6 @@
                     for (var i = 0; i < res.data.records.length; i++) {
                        list.push(res.data.records[i]);
                     }
                     console.log(list);
                     this.list = [...this.list, ...list];
                     callback({
                        list: this.list,
@@ -206,17 +189,22 @@
                  }, 1500);
               }
            })
            }else{
               callback({
                  list: [],
                  total: 0
               });
            }
         },
         handleSearch(data, callback) {
            console.log(555555555);
            const params = {
               current: 1,
               size: 10,
               objectid: this.keyword,
               company: this.company,
            }
            if (this.vuex_is_login) {
            findAchor(params).then((res) => {
               console.log(res);
               this.online = res.online
               this.offline = res.offline
               this.list = []
@@ -227,7 +215,6 @@
                     for (var i = 0; i < res.data.records.length; i++) {
                        list.push(res.data.records[i]);
                     }
                     console.log(list);
                     this.list = [...this.list, ...list];
                     callback({
                        list: this.list,
@@ -236,30 +223,18 @@
                  }, 1500);
               }
            })
            // let name = this.keyword
            // console.log();
            // findPerson(name).then((res) => {
            //    if (res.code == 0) {
            //       this.perlist = res.data
            //       console.log(this.perlist);
            //    } else {
            //       this.$refs.refSuccess.showBox({
            //          type: 'error',
            //          txt: res.msg
            //       });
            //    }
            // })
            }
         },
         // 模拟请求数据刷新
         handleRefresh(data, callback) {
            console.log(555555555555555);
            const params = {
               current: data.page,
               size: data.size,
               objectid: data.objectid,
               company: this.company,
            }
            console.log(data);
            findAchor(data).then((res) => {
            if (this.vuex_is_login) {
               findAchor(params).then((res) => {
               this.online = res.online
               this.offline = res.offline
               if (res.code == 0) {
@@ -269,10 +244,8 @@
                     for (var i = 0; i < res.data.records.length; i++) {
                        list.push(res.data.records[i]);
                     }
                     console.log(list);
                     this.list = []
                     this.list = [...this.list, ...list];
                     console.log(this.list);
                     callback({
                        list: this.list,
                        total: res.data.total
@@ -280,14 +253,7 @@
                  }, 1500);
               }
            })
            // console.log(2222222222);
            // setTimeout(() => {
            //    this.list = [];
            //    for (var i = 0; i < 3; i++) {
            //       this.list.push(i);
            //    }
            //    callback({ list: this.list, total: 30 });
            // }, 1500);
            }
         },
      }
   }