|
|
|
@ -6,9 +6,9 @@ |
|
|
|
:style="'width:'+imgWidth+';height:'+imgHeight" :src="item.imgUrl" @click="targetDetail(item)" |
|
|
|
mode=""></image> |
|
|
|
</view> |
|
|
|
<view class="ad-view"> |
|
|
|
<!-- <view class="ad-view"> |
|
|
|
<ad adpid="__UNI__069D14D" type="banner" @load="onload" @close="onclose" @error="onerror"></ad> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -25,34 +25,51 @@ |
|
|
|
imgWidth: 0, // 图片宽 |
|
|
|
imgHeight: 0, // 图片高 |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 4, |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.userInfo = uni.getStorageSync('userInfo') |
|
|
|
uni.getSystemInfo({ |
|
|
|
success: res => { |
|
|
|
console.log(res) |
|
|
|
this.imgWidth = res.windowWidth - 60 + 'rpx' |
|
|
|
this.imgHeight = (res.windowWidth - 60) * 2 - 30 + 'rpx' |
|
|
|
this.getImgList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.getImgList(); |
|
|
|
}, |
|
|
|
// 下拉刷新 |
|
|
|
onPullDownRefresh() { |
|
|
|
//TODO 此處待優化 |
|
|
|
console.log(1111) |
|
|
|
this.pageNum = 1 |
|
|
|
this.imgList = [] |
|
|
|
this.getImgList() |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
}, |
|
|
|
// 上划加载更多 |
|
|
|
onReachBottom() { |
|
|
|
console.log(2222) |
|
|
|
if (this.imgList.length > 3) { |
|
|
|
this.pageNum += 1 |
|
|
|
this.getImgList() |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 收藏图片列表 |
|
|
|
// 收藏图片分頁 |
|
|
|
async getImgList() { |
|
|
|
const res = await listTiktokCollection({ |
|
|
|
userId: this.userInfo.id |
|
|
|
userId: this.userInfo.id, |
|
|
|
pageNum: this.pageNum, |
|
|
|
pageSize: this.pageSize |
|
|
|
}) |
|
|
|
if (res.data.code === 200) { |
|
|
|
for (let i = 0; i < res.data.data.length; i++) { |
|
|
|
this.imgList = res.data.data |
|
|
|
console.log('res',res) |
|
|
|
for (let i = 0; i < res.data.rows.length; i++) { |
|
|
|
this.imgList = res.data.rows |
|
|
|
} |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
@ -78,15 +95,15 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onload(e) { |
|
|
|
console.log("加载了广告"); |
|
|
|
}, |
|
|
|
onclose(e) { |
|
|
|
console.log("关闭了广告: " + e.detail); |
|
|
|
}, |
|
|
|
onerror(e) { |
|
|
|
console.log("onerror: " + e.detail.errCode + " message:: " + e.detail.errMsg); |
|
|
|
} |
|
|
|
// onload(e) { |
|
|
|
// console.log("加载了广告"); |
|
|
|
// }, |
|
|
|
// onclose(e) { |
|
|
|
// console.log("关闭了广告: " + e.detail); |
|
|
|
// }, |
|
|
|
// onerror(e) { |
|
|
|
// console.log("onerror: " + e.detail.errCode + " message:: " + e.detail.errMsg); |
|
|
|
// } |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
|