| | |
| | | <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> |
| | |
| | | } from "@/api/article/article.js"; |
| | | import noticeList from "@/components/noticeList/noticeList.vue" |
| | | export default { |
| | | components:{ |
| | | components: { |
| | | noticeList |
| | | }, |
| | | data() { |
| | |
| | | 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++ |
| | |
| | | |
| | | getCateList() { |
| | | getCategory({ |
| | | parentId: '1722966265111248897' |
| | | parentId: '1722966265111248897', |
| | | }).then(res => { |
| | | console.log(res) |
| | | let data = res.data; |
| | |
| | | const param = { |
| | | size: 10, |
| | | current: this.currentPage, |
| | | articleType: this.tabId |
| | | articleType: this.tabId, |
| | | eventType: this.eventType |
| | | } |
| | | const res = await getPage(param) |
| | | const { |
| | |
| | | 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") |
| | | } |
| | | } |
| | | } |
| | |
| | | page { |
| | | background-color: #f5f5f5; |
| | | } |
| | | |
| | | .tab { |
| | | width: 100%; |
| | | height: 88rpx; |
| | |
| | | box-sizing: border-box; |
| | | z-index: 999; |
| | | } |
| | | |
| | | .list { |
| | | margin-top: 108rpx; |
| | | padding:0 30rpx; |
| | | padding: 0 30rpx; |
| | | } |
| | | </style> |