| | |
| | | v-for="(item, index) in newsList" :key="index"> |
| | | <view class="left"> |
| | | <view class="info"> |
| | | [中国空间站] 神舟十二号载人发射任务取得圆满成功 |
| | | {{item.title}} |
| | | </view> |
| | | <view class="date"> |
| | | <image src="/static/images/home/date.png" class="icon" mode=""></image> |
| | | 2021.06.17 |
| | | <!-- <image src="/static/images/home/date.png" class="icon" mode=""></image> --> |
| | | <view class="advisory-title-name">{{item.sourceName}}</view> |
| | | <view class="advisory-title-time">{{item.createTime}}</view> |
| | | </view> |
| | | </view> |
| | | <image src="/static/workbench/huojian.png" mode="" class="img"></image> |
| | | <image :src="item.url" mode="" class="img"></image> |
| | | </navigator> |
| | | <u-loadmore :status="status" /> |
| | | </view> |
| | |
| | | positionArr: [], |
| | | status: 'loadmore', |
| | | list: 15, |
| | | page: 0, |
| | | page: 1, |
| | | pagesize: 2, |
| | | keyword: '', |
| | | focus: false, |
| | | bannerList: [], |
| | | noticeList: [], |
| | | newsList: [{}, {}], |
| | | newsList: [], |
| | | navButton: [], |
| | | serviceButton: [], |
| | | tabbar:this.$store.state.tabbar |
| | |
| | | fakeServiceButton().then(data => { |
| | | this.serviceButton = data; |
| | | }); |
| | | //获取新闻信息 |
| | | this.getArtcilePageList(); |
| | | }, |
| | | onReachBottom() { |
| | | |
| | | // 后续将改为与后端联动 |
| | | if (this.page >= 3) return; |
| | | this.status = 'loading'; |
| | |
| | | this.list += 10; |
| | | if (this.page >= 3) this.status = 'nomore'; |
| | | else this.status = 'loading'; |
| | | this.newsList.push(...[{}, {}]); |
| | | // this.newsList.push(...[{}, {}]); |
| | | this.getArtcilePageList(); |
| | | }, 2000); |
| | | }, |
| | | methods: { |
| | |
| | | url:url |
| | | }) |
| | | } |
| | | }, |
| | | //获取资讯信息 |
| | | getArtcilePageList() { |
| | | var that = this; |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + '/article/article/page', |
| | | method: 'GET', |
| | | data: { |
| | | current: this.page, |
| | | size: this.pagesize |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.code == 200) { |
| | | if (res.data.data.records) { |
| | | //如果总数小于pageSize,不做其他操作 |
| | | if (res.data.data.total < this.pagesize) { |
| | | that.newsList = res.data.data.records; |
| | | } else { |
| | | if (res.data.data.records.length < this.pagesize) { |
| | | //如果数量小于分页数量,则为最后一页 |
| | | this.status = 'nomore' |
| | | } else { |
| | | //如果数量小于分页数量,则为最后一页 |
| | | this.status = 'loading'; |
| | | } |
| | | res.data.data.records.forEach(item =>{ |
| | | that.newsList.push(item); |
| | | }) |
| | | } |
| | | } else { |
| | | // this.isLoadMore=true; |
| | | // this.loadStatus='nomore'; |
| | | } |
| | | uni.stopPullDownRefresh(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | |
| | | |
| | | font-size: 28rpx; |
| | | font-family: PingFang SC; |
| | | font-weight: 500; |
| | | font-weight: 550; |
| | | color: #585b61; |
| | | line-height: 36rpx; |
| | | letter-spacing: 1px; |
| | | } |
| | | |
| | | .date { |
| | |
| | | font-family: PingFang SC; |
| | | font-weight: 500; |
| | | color: #a6abb5; |
| | | |
| | | |
| | | .advisory-title-name{ |
| | | font-size: 0.7rem; |
| | | letter-spacing: 1px; |
| | | } |
| | | |
| | | .advisory-title-time{ |
| | | margin-left: 0.8rem; |
| | | font-size: 0.7rem; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .img { |
| | | flex-shrink: 0; |
| | | width: 252rpx; |
| | | height: 160rpx; |
| | | width: 232rpx; |
| | | height: 140rpx; |
| | | border-radius: 20rpx; |
| | | background-color: #82848a; |
| | | } |