|
@@ -4,17 +4,19 @@
|
|
|
<block slot="backText">返回</block>
|
|
|
<block slot="content">我的喜欢</block>
|
|
|
</cu-custom>
|
|
|
-
|
|
|
- <scroll-view class="content-wrap" :scroll-y="true" @scrolltolower="lower" enable-flex >
|
|
|
- <publicVideoList :videoList="videoList" @onLower="handleLower" isShowDoctorName></publicVideoList>
|
|
|
+
|
|
|
+ <scroll-view class="content-wrap" :scroll-y="true" @scrolltolower="lower" enable-flex>
|
|
|
+ <publicVideoList :videoList="videoList" @onLower="handleLower" isShowDoctorName></publicVideoList>
|
|
|
</scroll-view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import publicVideoList from '@/components/public-videoList/public-videoList.vue'
|
|
|
- import {reqGetMyLikeList} from '../../api/home.js'
|
|
|
+ import {
|
|
|
+ reqGetMyLikeList
|
|
|
+ } from '../../api/home.js'
|
|
|
export default {
|
|
|
name: "myLike",
|
|
|
components: {
|
|
@@ -22,47 +24,57 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- videoList: [], // 视频列表
|
|
|
- queryParams: { // 请求视频列表参数
|
|
|
+ videoList: [], // 视频列表
|
|
|
+ payload: { // 请求视频列表参数
|
|
|
pageIndex: 1,
|
|
|
- pageSize: 10
|
|
|
+ pageSize: 5
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取视频列表数据
|
|
|
- async getList(){
|
|
|
- const response = await reqGetMyLikeList(this.queryParams)
|
|
|
+ async getList() {
|
|
|
+ const response = await reqGetMyLikeList(this.payload)
|
|
|
+ uni.hideLoading()
|
|
|
console.log("get video list response: ", response)
|
|
|
- if(response.isSuccess && response.resultCode === 200) {
|
|
|
- this.videoList = response.resultObject
|
|
|
+ if (response.isSuccess && response.resultCode === 200) {
|
|
|
+ if (response.pager.totalItemCount > this.videoList.length) {
|
|
|
+ this.videoList = [...this.videoList, ...response.resultObject]
|
|
|
+ this.payload.pageIndex++
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '没有更多数据了...',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '服务器异常...',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 触底事件
|
|
|
lower(e) {
|
|
|
- console.log(e)
|
|
|
-
|
|
|
-/* uni.showLoading({
|
|
|
+ uni.showLoading({
|
|
|
title: '加载中...',
|
|
|
mask: true
|
|
|
- }) */
|
|
|
- setTimeout(_=>{
|
|
|
- uni.hideLoading()
|
|
|
- }, 1500)
|
|
|
+ })
|
|
|
+ this.getList()
|
|
|
}
|
|
|
},
|
|
|
- onLoad(){
|
|
|
+ onLoad() {
|
|
|
console.log(111)
|
|
|
},
|
|
|
- onShow(){
|
|
|
+ onShow() {
|
|
|
this.getList()
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
-.content-wrap {
|
|
|
- height: calc(100vh);
|
|
|
- padding: 8rpx;
|
|
|
-}
|
|
|
+ .content-wrap {
|
|
|
+ height: calc(100vh);
|
|
|
+ padding: 8rpx;
|
|
|
+ }
|
|
|
</style>
|