| | |
| | | <template> |
| | | <view class=""> |
| | | <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" /> |
| | | </view> |
| | | <u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line /> |
| | | <z-paging ref="paging" v-model="list" :auto="false" @query="queryList" @onRefresh="refreshList" |
| | | loading-more-no-more-text="没有更多了"> |
| | | <view class="tab" slot="top" v-show="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" :page-type="type" /> |
| | | </view> |
| | | </z-paging> |
| | | <!-- <u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line /> --> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | list: [], |
| | | currentPage: 1, |
| | | loadingStatus: 'nomore', |
| | | eventType: "" |
| | | eventType: "", |
| | | type: "" |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | if (option.type) { |
| | | this.eventType = option.type; |
| | | if (option.type == 0) { |
| | | this.tabList = [{ |
| | | dictKey: "", |
| | | dictValue: "公益报名" |
| | | }] |
| | | } else { |
| | | this.tabList = [{ |
| | | dictKey: "", |
| | | dictValue: "选举调查" |
| | | }] |
| | | } |
| | | this.getNoticeList() |
| | | console.log(option); |
| | | if (option.type == 1) { |
| | | // this.eventType = option.type; |
| | | // if (option.type == 0) { |
| | | // this.tabList = [{ |
| | | // dictKey: "", |
| | | // dictValue: "公益报名" |
| | | // }] |
| | | // } else { |
| | | // this.tabList = [{ |
| | | // dictKey: "", |
| | | // dictValue: "选举调查" |
| | | // }] |
| | | // } |
| | | // this.getNoticeList() |
| | | uni.setNavigationBarTitle({ |
| | | title: "公共收益" |
| | | }) |
| | | this.type = option.type; |
| | | this.$refs.paging.reload(); |
| | | |
| | | } else if (option.type == 6) { |
| | | uni.setNavigationBarTitle({ |
| | | title: "反诈宣传" |
| | | }) |
| | | this.type = option.type; |
| | | this.$refs.paging.reload(); |
| | | } else { |
| | | this.getCateList() |
| | | } |
| | | }, |
| | | onReachBottom() { |
| | | this.currentPage++ |
| | | this.getPageList() |
| | | }, |
| | | // onReachBottom() { |
| | | // this.currentPage++ |
| | | // this.getNoticeList() |
| | | // }, |
| | | |
| | | methods: { |
| | | refreshList() { |
| | | this.$refs.paging.reload(); |
| | | }, |
| | | |
| | | changeTab(e) { |
| | | this.tabIndex = e.index; |
| | | this.tabId = e.dictKey; |
| | | this.list = []; |
| | | this.currentPage = 1; |
| | | this.getNoticeList() |
| | | this.$refs.paging.reload(); |
| | | // this.getNoticeList() |
| | | }, |
| | | |
| | | getCateList() { |
| | |
| | | dictKey: "", |
| | | dictValue: "全部" |
| | | }) |
| | | |
| | | this.tabList = data; |
| | | // this.tabId = data[0].dictKey; |
| | | this.getNoticeList() |
| | | // this.getNoticeList() |
| | | this.$refs.paging.reload(); |
| | | }) |
| | | }, |
| | | |
| | | |
| | | queryList(pageNo, pageSize) { |
| | | getPage({ |
| | | current: pageNo, |
| | | size: pageSize, |
| | | articleType: this.tabId, |
| | | eventType: this.eventType, |
| | | type: this.type, |
| | | houseCode: uni.getStorageSync("siteInfo").houseCode |
| | | }).then(res => { |
| | | this.$refs.paging.complete(res.data.records); |
| | | }) |
| | | }, |
| | | |
| | | |
| | | async getNoticeList() { |
| | | this.loadingStatus = 'loadingmore' |
| | |
| | | .tab { |
| | | width: 100%; |
| | | height: 88rpx; |
| | | position: fixed; |
| | | // position: fixed; |
| | | /*#ifdef H5*/ |
| | | top: 88rpx; |
| | | /*#endif*/ |
| | |
| | | } |
| | | |
| | | .list { |
| | | margin-top: 108rpx; |
| | | margin-top: 20rpx; |
| | | padding: 0 30rpx; |
| | | } |
| | | </style> |