凉纪 2 anni fa
parent
commit
8d9104a199

+ 35 - 30
src/components/scroll/scroll.vue

@@ -31,15 +31,10 @@ export default {
       type: Boolean,
       default: true,
     },
-    pullupUp: {
+    pullup: {
       type: Boolean,
       default: true,
     },
-    // 是否显示加载更多
-    showLoadMore: {
-      type: Boolean,
-      default: false,
-    },
   },
   data() {
     return {
@@ -49,12 +44,19 @@ export default {
       showLoadMoreText: false, // 是否显示加载更多
       refreshText: '下拉刷新', // 刷新文本
       loadMoreText: '加载更多', // 加载更多文本
+      pullupUp: true,
     };
   },
   mounted() {
     // 初始化 better-scroll
     this.initScroll();
   },
+  watch: {
+    pullup(val) {
+      console.log('状态改变')
+      this.pullupUp = val
+    }
+  },
   methods: {
     // 初始化 better-scroll
     initScroll() {
@@ -69,33 +71,36 @@ export default {
         },
       });
 
-      if(this.pullupDown){
+
         // 监听下拉刷新事件
-        this.bs.on('pullingDown', () => {
-          this.isRefreshing = true;
-          this.refreshText = '正在刷新';
-          this.$emit('refresh');
-          // 这里可以执行刷新操作,例如发送请求获取数据
-          // 刷新完成后,调用 this.refreshFinish() 结束刷新
-          setTimeout(() => {
-            this.refreshFinish();
-          }, 300);
+        this.bs.on('pullingDown', (pos) => {
+          console.log(pos,'pos')
+          if(this.pullupDown) {
+            this.isRefreshing = true;
+            //this.refreshText = '正在刷新';
+            this.$emit('refresh');
+            // 这里可以执行刷新操作,例如发送请求获取数据
+            // 刷新完成后,调用 this.refreshFinish() 结束刷新
+            setTimeout(() => {
+              this.refreshFinish();
+            }, 300);
+          }
         });
-      }
-
-      if(this.pullupUp){
+        console.log(this.pullupUp,'pullingUp1')
         // 监听上拉加载事件
         this.bs.on('pullingUp', () => {
-          this.showLoadMoreText = true;
-          this.loadMoreText = '正在加载...';
-          this.$emit('loadMore');
-          // 这里可以执行加载更多操作,例如发送请求获取数据
-          // 加载完成后,调用 this.loadMoreFinish() 结束加载更多
-          setTimeout(() => {
-            this.loadMoreFinish();
-          }, 500);
+          console.log(this.pullupUp,'pullingUp2')
+          if(this.pullupUp) {
+            this.showLoadMoreText = true;
+            this.loadMoreText = '正在加载...';
+            this.$emit('loadMore');
+            // 这里可以执行加载更多操作,例如发送请求获取数据
+            // 加载完成后,调用 this.loadMoreFinish() 结束加载更多
+            setTimeout(() => {
+              this.loadMoreFinish();
+            }, 500);
+          }
         });
-      }
       // better-scroll 初始化完成后,刷新 scroll
       this.bs.refresh();
     },
@@ -141,7 +146,7 @@ export default {
   text-align: center;
   height: 80px;
   line-height: 80px;
-  font-size: 14px;
+  font-size: 28px;
   color: #666;
 }
 
@@ -149,7 +154,7 @@ export default {
   text-align: center;
   height: 80px;
   line-height: 80px;
-  font-size: 14px;
+  font-size: 28px;
   color: #666;
 }
 

+ 3 - 15
src/router/router.config.js

@@ -134,13 +134,7 @@ export let routers = [
         path: '/nfc',
         name: 'nfc',
         component: () => import('@/views/menu/NFCmanage/index'),
-        meta: { title: '履职登记', keepAlive: false }
-      },
-      {
-        path: '/lvzhi',
-        name: 'lvzhi',
-        component: () => import('@/views/menu/LZRegister/index'),
-        meta: { title: '履职登记', keepAlive: true }
+        meta: { title: 'NFC管理', keepAlive: false }
       },
       {
         path: '/protection',
@@ -155,12 +149,6 @@ export let routers = [
         meta: { title: '防区信息', keepAlive: false }
       },
       {
-        path: '/lz-edit',
-        name: 'lz-edit',
-        component: () => import('@/views/menu/LZRegister/edit'),
-        meta: { title: '履职', keepAlive: false ,hideTabBar:true}
-      },
-      {
         path: '/monitoringCall',
         name: 'monitoringCall',
         component: () => import('@/views/menu/monitoringCall/index'),
@@ -242,13 +230,13 @@ export let routers = [
         path: '/resumption',
         name: 'resumption',
         component: () => import('@/views/menu/resumption/list.vue'),
-        meta: { title: '履职任务', keepAlive: false }
+        meta: { title: '履职登记', keepAlive: true }
       },
       {
         path: '/resumption_detail',
         name: 'resumption_detail',
         component: () => import('@/views/menu/resumption/detail.vue'),
-        meta: { title: '履职登记', keepAlive: false ,hideTabBar:true}
+        meta: { title: '履职', keepAlive: false ,hideTabBar:true}
       },
     ],
   },

+ 40 - 9
src/views/menu/message/index.vue

@@ -1,6 +1,5 @@
 <template>
 <div class="message">
-  <NavBar v-show="!show" />
   <div v-if="!show" class="page-container">
     <van-tabs v-model="query.type" @change="refreshData">
       <van-tab title="公告/通知" name="1"></van-tab>
@@ -12,6 +11,7 @@
       <Scroll
         @refresh="refreshData"
         @loadMore="getDataList"
+        :pullup="pullup"
         class="wrapper"
         ref="wrapper">
         <van-cell-group  v-for="(v,i) in dataList">
@@ -39,6 +39,17 @@
     <van-panel v-if="selected" :title="selected.title" :desc="selected.orgName">
       <div class="message-content">
         <p>{{selected.content}}</p>
+        <div class="file-box" >
+          <div>
+            <a :href="imgUrl(v.url)" v-for="(v,i) in selected.fileList" :key="v.name" type="download">{{v.name}}</a>
+          </div>
+          <div>
+            <div v-if="v.img" class="nfc-img" v-for="(v,i) in imageList" :key="v.img" @click="preViewNFC(i)">
+              <img :src="imgUrl(v.img)" alt="" >
+              <span>{{v.checkName}}</span>
+            </div>
+          </div>
+        </div>
         <p class="cell-time">{{selected.publishTime}}</p>
       </div>
     </van-panel>
@@ -50,9 +61,9 @@
 <script>
 import NavBar from '@/components/NavBar'
 import Scroll from '@/components/scroll/scroll'
-import {msgList,dataList,Msg} from './api'
+import {msgList,dataList} from './api'
 import {mapGetters} from "vuex";
-import day from "dayjs";
+
 export default {
   components: {
     NavBar,
@@ -68,8 +79,9 @@ export default {
         pageNum:1,
         pageSize:1,
       },
-      pullup:false,
+      pullup:true,
       message:null,
+      total:0,
     };
   },
   computed:{
@@ -83,15 +95,29 @@ export default {
       this.show = false;
     },
     clickItem(v){
+      v.fileList.forEach(v=>{
+        //p:获取url中的后缀名
+        let p = v.url.split('.');
+        console.log(p,'pppppppp')
+        //v.type = url.
+      })
       this.selected = v;
       this.show = true;
     },
     refreshData(){
       this.query.pageNum = 1;
-      this.dataList = []
+      this.total = 0;
+      this.dataList = [];
+      this.pullup = true;
       this.getDataList();
     },
     getDataList(){
+      if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
+        console.log(456,'456')
+        this.pullup = false;
+        this.$toast('已加载完毕');
+        return;
+      }
       let data = {};
       if(this.query.type == 1){
         data = {
@@ -101,12 +127,12 @@ export default {
           tagRoleIds:this.roleList.map(v=>{return v.roleId}),
         }
         msgList(data).then(res=>{
+          this.total = res.total;
           if(this.dataList.length < res.total) {
             this.dataList = [...this.dataList,...res.rows] ;
+            console.log(123,'123')
             this.pullup = true;
             this.query.pageNum++;
-          }else {
-            this.pullup = false;
           }
         })
         return;
@@ -140,8 +166,8 @@ export default {
 
 }
 .card-list{
-  padding: 20px;
-  height: calc(100vh - 290px);
+  padding: 20px ;
+  height: calc(100vh - 190px);
   overflow:  auto;
 }
 .list-item{
@@ -193,5 +219,10 @@ export default {
     word-break: break-word;
     width: 100%;
   }
+  .file-box{
+    width: 100%;
+    min-height: 40px;
+    padding: 20px 0;
+  }
 }
 </style>

+ 4 - 4
src/views/menu/resumption/list.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="lvzhi" ref="container">
     <NavBar :go="{ type: 'push', path: '/menu' }"/>
-    <van-sticky :container="container">
-      <DatePicker ref="DatePicker" @change="changeDate"></DatePicker>
-    </van-sticky>
     <div class="lz-container" id="lz-container" @scroll="handleScroll">
+      <van-sticky :container="container">
+        <DatePicker ref="DatePicker" @change="changeDate"></DatePicker>
+      </van-sticky>
       <div class="lz-list">
         <div class="list-item">
           <p>每日履职</p>
@@ -244,7 +244,7 @@ export default {
   overflow: hidden;
 }
 .lz-container{
-  height: calc(100vh - 190px);
+  height: calc(100vh - 192px);
   overflow: scroll;
 }
 .top-date-box{