wjt
2024-06-22 95688fbabcde0e4fd8dbb622cc1b890aee1cc8ca
pages/hqzc/list.vue
@@ -1,6 +1,20 @@
<template>
   <view class="box">
      <view class="item">
      <view class="item" v-for="(item,index) in list1">
         <view class="name">
            {{item.docTitle}}
         </view>
         <view class="time">
            {{item.createTime}}
         </view>
         <view class="bottom" @click="chakan(item.docId)">
            <view class="left">
               查看详情
            </view>
            <img src="/static/i08.png" class="img" alt="" />
         </view>
      </view>
   <!--    <view class="item">
         <view class="name">
            涨了,本月起发放!一图看懂养老金怎么调
         </view>
@@ -41,33 +55,50 @@
            </view>
            <img src="/static/i08.png" class="img" alt="" />
         </view>
      </view>
      <view class="item">
         <view class="name">
            涨了,本月起发放!一图看懂养老金怎么调
         </view>
         <view class="time">
            2023.04.05 12:23
         </view>
         <view class="bottom">
            <view class="left">
               查看详情
            </view>
            <img src="/static/i08.png" class="img" alt="" />
         </view>
      </view>
      </view> -->
   </view>
</template>
<script>
   import {  docList } from '@/api/index.js'
   export default {
      data() {
         return {
            list1:[],
            queryParams: {
               pageNum: 1,
               pageSize: 10
            },
            total: 1,
         }
      },
      onShow() {
         this.list1 = []
         this.queryParams.pageNum = 1
         this.getList()
      },
      onReachBottom() {
         if(this.list1.length == this.total) {
            return
         }
         this.queryParams.pageNum++
         this.getList()
      },
      methods: {
         chakan(id){
            uni.navigateTo({
               url: `/pages/hqzc/details?id=${id}`
            })
         },
         getList() {
            docList({...this.queryParams}).then(val => {
               // console.log(val.data)
               this.total = val.data.total
               this.list1 = [...this.list1,...val.data.rows]
            })
         },
      }
   }
</script>