视频列表的上拉刷新

This commit is contained in:
THK3121 2023-06-02 16:51:36 +08:00
parent ef90cf2e9b
commit ea85ebbfa9

View File

@ -203,8 +203,8 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
<scroll-view scroll-y="true" v-if="currentNav === 3" class="video-list" <scroll-view scroll-y="true" v-if="currentNav === 3" class="video-list"
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'"> :style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :refresher-triggered="isTriggered" @scrolltolower="GetList()" >
<block v-for="(item,index) in cateGoods" :key="item.uid"> <block v-for="(item,index) in cateGoods" :key="index">
<view class="goods_item" @click="gogogo(item)"> <view class="goods_item" @click="gogogo(item)">
<image class="goods_img" :src="item.image[0]" mode="aspectFill"></image> <image class="goods_img" :src="item.image[0]" mode="aspectFill"></image>
<view class="botm"> <view class="botm">
@ -320,6 +320,7 @@
}, mapGetters(['isLogin', 'uid'])), }, mapGetters(['isLogin', 'uid'])),
data() { data() {
return { return {
isTriggered:false,
imgHost: HTTP_REQUEST_URL, imgHost: HTTP_REQUEST_URL,
videoID: 0, videoID: 0,
pinlunNum: 0, pinlunNum: 0,
@ -422,6 +423,7 @@
} }
}, },
onLoad(options) { onLoad(options) {
console.log(options);
this.getOptions(options); this.getOptions(options);
this.videoID = options.id; this.videoID = options.id;
this.isUser = options.user == 1 ? true : false; this.isUser = options.user == 1 ? true : false;
@ -446,6 +448,18 @@
}, },
onReady: function() {}, onReady: function() {},
methods: { methods: {
async GetList(){
console.log('123');
const {data} = await graphicLstApi({
page: this.page++,
limit: this.limit,
is_star: this.isSatrt,
community_id: this.videoID
})
console.log(data);
this.cateGoods.push(...data.list)
},
giveStart(item) { giveStart(item) {
let status = item.relevance_id ? 0 : 1 let status = item.relevance_id ? 0 : 1
graphicStartApi(item.community_id, { graphicStartApi(item.community_id, {
@ -489,7 +503,6 @@
this.loadVideo = true; this.loadVideo = true;
this.dataList = []; this.dataList = [];
n == 1 ? this.get() : ''; n == 1 ? this.get() : '';
n == 2 ? this.getFocusList() : '';
n == 3 ? this.getGoods() : ''; n == 3 ? this.getGoods() : '';
}, },
/** /**
@ -691,6 +704,9 @@
if (this.k == this.dataList.length - 1 && this.currentNav !== 2) { if (this.k == this.dataList.length - 1 && this.currentNav !== 2) {
this.loadVideo = true; this.loadVideo = true;
this.GET() this.GET()
}else if(this.currentNav == 2){
this.loadVideo = true
this.getFocusList()
} }
}, },
//每一组结束时新的请求 //每一组结束时新的请求
@ -698,6 +714,7 @@
let that = this let that = this
if (!that.loadVideo) return if (!that.loadVideo) return
that.loadVideo = true that.loadVideo = true
if(this.currentNav !== 2 ){
that.isUser ? that.isUser ?
myVideoList(that.userUid, { myVideoList(that.userUid, {
page: that.page, page: that.page,
@ -728,6 +745,24 @@
duration: 2000 duration: 2000
}); });
}) })
}else if(this.currentNav == 2 ){
that.isUser ?
myVideoList(that.userUid, {
page: that.page,
limit: that.limit,
is_star: that.isSatrt,
community_id: that.videoID
}).then(res => {
that.videoData(res.data.list)
that.loadVideo = false
}).catch(err => {
return uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}) : this.getFocusList()
}
}, },
get() { get() {
let that = this let that = this