Lou
2023-11-25 ce21b378de4b5a075da8295404d2fdb3b2e3a22a
subPackage/article/list.vue
@@ -1,11 +1,11 @@
<template>
   <view class="">
      <view class="tab">
      <view class="tab" v-if="tabList.length">
         <u-tabs :list="tabList" :current="tabIndex" keyName="dictValue" @change="changeTab"
            :inactiveStyle="{color:'#999999'}" :activeStyle="{color:'#017BFC'}"></u-tabs>
      </view>
      <view class="list bgc-ff">
         <notice-list   :data="list"  />
         <notice-list :data="list" />
      </view>
      <u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
   </view>
@@ -18,7 +18,7 @@
   } from "@/api/article/article.js";
   import noticeList from "@/components/noticeList/noticeList.vue"
   export default {
      components:{
      components: {
         noticeList
      },
      data() {
@@ -28,12 +28,28 @@
            tabIndex: 0,
            list: [],
            currentPage: 1,
            loadingStatus: 'nomore'
            loadingStatus: 'nomore',
            eventType: ""
         }
      },
      onLoad() {
         this.getCateList()
      onLoad(option) {
         if (option.type) {
            this.eventType = option.type;
            if (option.type == 0) {
               this.tabList = [{
                  dictKey: "",
                  dictValue: "公益报名"
               }]
            } else {
               this.tabList = [{
                  dictKey: "",
                  dictValue: "选举调查"
               }]
            }
            this.getNoticeList()
         } else {
            this.getCateList()
         }
      },
      onReachBottom() {
         this.currentPage++
@@ -52,7 +68,7 @@
         getCateList() {
            getCategory({
               parentId: '1722966265111248897'
               parentId: '1722966265111248897',
            }).then(res => {
               console.log(res)
               let data = res.data;
@@ -71,7 +87,8 @@
            const param = {
               size: 10,
               current: this.currentPage,
               articleType: this.tabId
               articleType: this.tabId,
               eventType: this.eventType
            }
            const res = await getPage(param)
            const {
@@ -91,8 +108,8 @@
            this.loadingStatus = 'nomore'
         },
         navTo(id) {
            this.$u.func.globalNavigator(`detail?id=${id}`, "navTo")
         navTo(id, type) {
            this.$u.func.globalNavigator(`detail?id=${id}&type=${type}`, "navTo")
         }
      }
   }
@@ -102,6 +119,7 @@
   page {
      background-color: #f5f5f5;
   }
   .tab {
      width: 100%;
      height: 88rpx;
@@ -118,8 +136,9 @@
      box-sizing: border-box;
      z-index: 999;
   }
   .list {
      margin-top: 108rpx;
      padding:0 30rpx;
      padding: 0 30rpx;
   }
</style>