| | |
| | | <template> |
| | | <view class=""> |
| | | <view class="tab"> |
| | | <u-tabs :list="tabList" :current="tabIndex" keyName="dictValue" @change="changeTab" :inactiveStyle="{color:'#999999'}" :activeStyle="{color:'#017BFC'}"></u-tabs> |
| | | <u-tabs :list="tabList" :current="tabIndex" keyName="dictValue" @change="changeTab" |
| | | :inactiveStyle="{color:'#999999'}" :activeStyle="{color:'#017BFC'}"></u-tabs> |
| | | </view> |
| | | <view v-for="(item,index) in noticeList" :key="index" class="list"> |
| | | <view class="notic-list bgc-ff" @click="navTo(item.id)"> |
| | | <view class="f-28 mb-30"> |
| | | {{item.title}} |
| | | </view> |
| | | <view class="flex a-i-c j-c-s-b"> |
| | | <view class="f-28 flex a-i-c"> |
| | | <!-- <view class="flex a-i-c mr-30"> |
| | | <view class="list"> |
| | | <view class="notic-list bgc-ff" v-for="(item,index) in noticeList" key="index" @click="navTo(item.id)"> |
| | | <view class="f-28 mb-30"> |
| | | {{item.title}} |
| | | </view> |
| | | <view class="flex a-i-c j-c-s-b"> |
| | | <view class="f-28 flex a-i-c"> |
| | | <!-- <view class="flex a-i-c mr-30"> |
| | | <u-icon name="thumb-up-fill" size="24" color="#CECECE"></u-icon> |
| | | <text class="f-24 c-99 ml-10">{{item.countNumber}}</text> |
| | | </view> --> |
| | | <view class="flex a-i-c"> |
| | | <u-icon name="eye-fill" size="22" color="#CECECE"></u-icon> |
| | | <text class="f-24 c-99 ml-10">{{item.viewNumber}}</text> |
| | | <view class="flex a-i-c"> |
| | | <u-icon name="eye-fill" size="20" color="#CECECE"></u-icon> |
| | | <text class="f-24 c-99 ml-10">{{item.viewNumber}}</text> |
| | | </view> |
| | | </view> |
| | | <text class="f-24 c-99">{{item.createTime}}</text> |
| | | </view> |
| | | <text class="f-24 c-99">{{item.createTime}}</text> |
| | | </view> |
| | | <u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line /> |
| | | </view> |
| | | </view> |
| | | <u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | getCategory |
| | | } from "@/api/article/article.js"; |
| | | export default { |
| | | data(){ |
| | | data() { |
| | | return { |
| | | tabList:[], |
| | | tabId:"", |
| | | tabIndex:0, |
| | | tabList: [], |
| | | tabId: "", |
| | | tabIndex: 0, |
| | | noticeList: [], |
| | | currentPage:1, |
| | | currentPage: 1, |
| | | loadingStatus: 'nomore' |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.getCateList() |
| | | |
| | | |
| | | }, |
| | | onReachBottom() { |
| | | this.currentPage++ |
| | | this.getPageList() |
| | | }, |
| | | |
| | | methods:{ |
| | | |
| | | changeTab(e){ |
| | | |
| | | methods: { |
| | | |
| | | changeTab(e) { |
| | | this.tabIndex = e.index; |
| | | this.tabId = e.dictKey; |
| | | this.noticeList = []; |
| | | this.currentPage = 1; |
| | | this.getNoticeList() |
| | | }, |
| | | |
| | | getCateList(){ |
| | | |
| | | getCateList() { |
| | | getCategory({ |
| | | parentId:'1722966265111248897' |
| | | }).then(res=>{ |
| | | parentId: '1722966265111248897' |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.tabList = res.data; |
| | | this.tabId = res.data[0].dictKey; |
| | | let data = res.data; |
| | | data.unshift({ |
| | | dictKey: "", |
| | | dictValue: "全部" |
| | | }) |
| | | this.tabList = data; |
| | | // this.tabId = data[0].dictKey; |
| | | this.getNoticeList() |
| | | }) |
| | | }, |
| | | |
| | | |
| | | async getNoticeList() { |
| | | this.loadingStatus = 'loadingmore' |
| | | const param = { |
| | | size: 10, |
| | | current: this.currentPage, |
| | | articleType:this.tabId |
| | | articleType: this.tabId |
| | | } |
| | | const res = await getPage(param) |
| | | const { |
| | |
| | | } |
| | | this.noticeList = [...this.noticeList, ...records] |
| | | this.loadingStatus = 'nomore' |
| | | |
| | | |
| | | }, |
| | | navTo(id){ |
| | | navTo(id) { |
| | | this.$u.func.globalNavigator(`detail?id=${id}`, "navTo") |
| | | } |
| | | } |
| | |
| | | </script> |
| | | |
| | | <style> |
| | | page{ |
| | | background-color:#f5f5f5; |
| | | page { |
| | | background-color: #f5f5f5; |
| | | } |
| | | .tab{ |
| | | width:100%; |
| | | height:88rpx; |
| | | position:fixed; |
| | | |
| | | .tab { |
| | | width: 100%; |
| | | height: 88rpx; |
| | | position: fixed; |
| | | /*#ifdef H5*/ |
| | | top:88rpx; |
| | | top: 88rpx; |
| | | /*#endif*/ |
| | | /*#ifdef MP-WEIXIN*/ |
| | | top:0; |
| | | /*#ifdef MP-WEIXIN*/ |
| | | top: 0; |
| | | /*#endif*/ |
| | | left:0; |
| | | background-color:#fff; |
| | | padding:0 30rpx; |
| | | left: 0; |
| | | background-color: #fff; |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | z-index: 999; |
| | | |
| | | |
| | | } |
| | | .list{ |
| | | margin-top:108rpx; |
| | | |
| | | .list { |
| | | margin-top: 108rpx; |
| | | } |
| | | |
| | | .notic-list { |
| | | padding: 30rpx; |
| | | border-bottom: 1px solid #f5f5f5; |