Browse Source

feature-tiktok-1.0:我的收藏图片展示优化

feature-1.0
chengkun 4 years ago
parent
commit
3a1988fe82
  1. 16
      pages/creator/creator.vue
  2. 9
      pages/userInfo/myCollection/myCollection.vue

16
pages/creator/creator.vue

@ -119,20 +119,13 @@
}); });
} }
}, },
// // banner
linkTo(item) { linkTo(item) {
console.log(item) console.log(item)
if (item.id) { if (item.id) {
uni.setStorage({ uni.navigateTo({
key: 'detailId', url: 'pages/index'
data: item.id, });
success() {
console.log(111111)
uni.navigateTo({
url: '../creator/imgDetail'
})
}
})
} }
}, },
@ -160,7 +153,6 @@
}) })
if (res.data.code === 200) { if (res.data.code === 200) {
this.creatorImgList.push(...res.data.rows) this.creatorImgList.push(...res.data.rows)
console.log('creatorImgList', this.creatorImgList)
} else { } else {
uni.showModal({ uni.showModal({
content: '用户图片列表加载失败!', content: '用户图片列表加载失败!',

9
pages/userInfo/myCollection/myCollection.vue

@ -38,9 +38,6 @@
} }
}) })
}, },
onLoad() {
this.getImgList();
},
// //
onPullDownRefresh() { onPullDownRefresh() {
//TODO //TODO
@ -52,7 +49,6 @@
}, },
// //
onReachBottom() { onReachBottom() {
console.log(2222)
if (this.imgList.length > 3) { if (this.imgList.length > 3) {
this.pageNum += 1 this.pageNum += 1
this.getImgList() this.getImgList()
@ -67,10 +63,7 @@
pageSize: this.pageSize pageSize: this.pageSize
}) })
if (res.data.code === 200) { if (res.data.code === 200) {
console.log('res',res) this.imgList.push(...res.data.rows)
for (let i = 0; i < res.data.rows.length; i++) {
this.imgList = res.data.rows
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,

Loading…
Cancel
Save