提交 be989434 authored 作者: 王鹏飞's avatar 王鹏飞

持证人展示支持分页展示

上级 0641a0a3
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
</ul> </ul>
</div> </div>
<div class="tap-item-box" style="padding:40px 0"> <div class="tap-item-box" style="padding:40px 0">
<div class="avatar-list" v-if="showIndex === 1"> <div v-show="showIndex === 1">
<div class="avatar-list">
<div class="avatar-item" v-for="item in list" :key="item.id"> <div class="avatar-item" v-for="item in list" :key="item.id">
<div class="content"> <div class="content">
<p>中国PRP持证人</p> <p>中国PRP持证人</p>
...@@ -15,7 +16,11 @@ ...@@ -15,7 +16,11 @@
<p>证书编号</p> <p>证书编号</p>
<p style="color:#cfb181">{{ item.number }}</p> <p style="color:#cfb181">{{ item.number }}</p>
</div> </div>
<img :src="item.avatar" class="pic" /> <img :src="item.avatar + '?x-oss-process=image/resize,m_fill,h_360,w_300'" class="pic" />
</div>
</div>
<div style="text-align:center" v-if="hasMore">
<el-button :loading="false" @click="loadmore">加载更多</el-button>
</div> </div>
</div> </div>
<app-upload-avatar v-if="showIndex === 2"></app-upload-avatar> <app-upload-avatar v-if="showIndex === 2"></app-upload-avatar>
...@@ -31,7 +36,10 @@ export default { ...@@ -31,7 +36,10 @@ export default {
data() { data() {
return { return {
showIndex: 1, showIndex: 1,
list: [] list: [],
page: 1,
false: false,
hasMore: true
} }
}, },
watch: { watch: {
...@@ -52,9 +60,21 @@ export default { ...@@ -52,9 +60,21 @@ export default {
this.showIndex = n this.showIndex = n
}, },
getAvatarList() { getAvatarList() {
getAvatarList({ page: 1, page_size: 100 }).then(response => { this.loading = true
this.list = response.list getAvatarList({ page: this.page, page_size: 18 })
.then(response => {
if (response.list.length < 18) {
this.hasMore = false
}
this.list = this.list.concat(response.list)
}) })
.finally(() => {
this.loading = false
})
},
loadmore() {
this.page++
this.getAvatarList()
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论