| | |
| | | <text>{{item.articleTypeName}}</text> |
| | | </view> |
| | | </scroll-view> |
| | | <scroll-view class="list-right" scroll-y="true"> |
| | | <scroll-view class="list-right" scroll-y="true" @scrolltolower="scrolltolower()"> |
| | | <navigator :url="'./knowledgeDetail?id='+item.id" hover-class="none" v-for="item in list"> |
| | | <view class="list-right-row"> |
| | | <image class="product-img" :src="item.image?item.image:'../../static/images/no-img.png'"></image> |
| | |
| | | </view> |
| | | </navigator> |
| | | <no-record :isShow="!list.length"></no-record> |
| | | <view v-if="list.length"> |
| | | <uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue'; |
| | | export default { |
| | | components: { |
| | | uniLoadMore |
| | | }, |
| | | data(){ |
| | | return{ |
| | | typeList: [], |
| | | list: [], |
| | | typeId: '' |
| | | typeId: '', |
| | | loadStatus: 'more', |
| | | pageNum: 1 |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | this.loadTypeList() |
| | | }, |
| | | onPullDownRefresh(){ |
| | | this.reloadData(); |
| | | let timer = setTimeout(function () { |
| | | uni.startPullDownRefresh(); |
| | | clearTimeout(timer); |
| | | timer = null; |
| | | }, 800); |
| | | }, |
| | | methods:{ |
| | | reloadData(){ |
| | | this.list = []; |
| | | this.pageNum = 1; |
| | | this.loadStatus = 'more'; |
| | | this.loadList(); |
| | | }, |
| | | scrolltolower(){ |
| | | this.loadList() |
| | | }, |
| | | loadTypeList(){ |
| | | this.$httpUtils.request('/api/know/findKnowledgeType').then((res) => { |
| | | if(res.status == 200){ |
| | |
| | | }) |
| | | }, |
| | | loadList(){ |
| | | if(this.loadStatus!=='more'){ |
| | | return; |
| | | } |
| | | this.$httpUtils.request('/api/know/findArticleList', { |
| | | pageNum: 1, |
| | | pageSize: 100, |
| | | pageNum: this.pageNum, |
| | | pageSize: 10, |
| | | typeId: this.typeId |
| | | }, 'POST').then((res) => { |
| | | if(res.status == 200){ |
| | | this.list = res.rows; |
| | | let result = res.rows; |
| | | if(result.length < 10){ |
| | | this.loadStatus = 'noMore'; |
| | | } else { |
| | | this.pageNum ++ ; |
| | | this.loadStatus = 'more'; |
| | | } |
| | | this.list = this.list.concat(result); |
| | | } |
| | | }) |
| | | }, |
| | | changeType(id){ |
| | | this.typeId = id; |
| | | this.loadList() |
| | | this.reloadData() |
| | | } |
| | | } |
| | | } |