修改视频列表的错误
This commit is contained in:
parent
205176ee94
commit
854788c1a7
@ -203,7 +203,7 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<scroll-view scroll-y="true" v-if="currentNav === 3" class="video-list"
|
||||
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :refresher-triggered="isTriggered" @scrolltolower="GetList()" >
|
||||
:style="'width: '+ windowWidth +'px; height: '+ windowHeight +'px;'" :refresher-triggered="isTriggered" @scrolltolower="getGoods()" >
|
||||
<block v-for="(item,index) in cateGoods" :key="index">
|
||||
<view class="goods_item" @click="gogogo(item)">
|
||||
<image class="goods_img" :src="item.image[0]" mode="aspectFill"></image>
|
||||
@ -388,10 +388,11 @@
|
||||
where: {
|
||||
category_id: -1,
|
||||
page: 1,
|
||||
limit: 10
|
||||
limit: 5
|
||||
},
|
||||
communityId:'',
|
||||
Listcount:''
|
||||
Listcount:'',
|
||||
loadMore: true,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -426,7 +427,6 @@
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options);
|
||||
this.getOptions(options);
|
||||
this.videoID = options.id;
|
||||
this.isUser = options.user == 1 ? true : false;
|
||||
@ -451,27 +451,6 @@
|
||||
},
|
||||
onReady: function() {},
|
||||
methods: {
|
||||
async GetList(){
|
||||
// if(this.cateGoods.length > )
|
||||
console.log(this.Listcount);
|
||||
if(this.cateGoods.length < this.Listcount){
|
||||
console.log('123');
|
||||
const {data} = await graphicLstApi({
|
||||
category_id:-1,
|
||||
page: this.page++,
|
||||
limit: this.limit,
|
||||
})
|
||||
this.cateGoods.push(...data.list)
|
||||
if(data.list.length < this.limit){
|
||||
this.$util.Tips({
|
||||
title: '没有更多了',
|
||||
});
|
||||
}
|
||||
}
|
||||
// console.log(this.cateGoods.length);
|
||||
|
||||
},
|
||||
|
||||
giveStart(item) {
|
||||
let status = item.relevance_id ? 0 : 1
|
||||
graphicStartApi(item.community_id, {
|
||||
@ -514,6 +493,7 @@
|
||||
this.page = 1;
|
||||
this.loadVideo = true;
|
||||
this.dataList = [];
|
||||
this.loadMore = true;
|
||||
n == 1 ? this.get() : '';
|
||||
n == 2 ? this.getFocusList() : '';
|
||||
n == 3 ? this.getGoods() : '';
|
||||
@ -528,12 +508,17 @@
|
||||
this.navTap(1)
|
||||
},
|
||||
async getGoods() {
|
||||
if (!this.loadMore) {
|
||||
return;
|
||||
}
|
||||
const {
|
||||
data
|
||||
} = await graphicLstApi(this.where)
|
||||
console.log(data);
|
||||
this.Listcount=data.count
|
||||
this.cateGoods = data.list
|
||||
this.cateGoods.push(...data.list)
|
||||
this.where.page++
|
||||
if(data.list.length < this.where.limit){
|
||||
this.loadMore = false
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取个人用户信息
|
||||
@ -713,68 +698,15 @@
|
||||
this.communityId = this.dataList[this.k]['community_id'];
|
||||
},
|
||||
animationfinish(event) {
|
||||
// 1.这里进行判断,如果是最后一个视频就进入 get() 方法加载视频进入列表
|
||||
if (this.k == this.dataList.length - 1 && this.currentNav !== 2) {
|
||||
this.loadVideo = true;
|
||||
this.GET()
|
||||
}else if(this.currentNav == 2){
|
||||
this.loadVideo = true
|
||||
this.getFocusList()
|
||||
}
|
||||
},
|
||||
//每一组结束时新的请求
|
||||
GET() {
|
||||
let that = this
|
||||
if (!that.loadVideo) return
|
||||
that.loadVideo = true
|
||||
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
|
||||
});
|
||||
}) :
|
||||
videoList({
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
id: that.videoID
|
||||
}).then(res => {
|
||||
that.loadVideo = false
|
||||
that.videoData(res.data.list)
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
icon: 'none',
|
||||
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()
|
||||
if (!that.loadVideo || !that.loadMore) return
|
||||
if (this.k == this.dataList.length - 1 && this.currentNav === 1) {
|
||||
that.loadVideo = false
|
||||
this.get()
|
||||
}
|
||||
if (this.k == this.dataList.length - 1 && this.currentNav === 2) {
|
||||
that.loadVideo = false
|
||||
this.getFocusList()
|
||||
}
|
||||
},
|
||||
get() {
|
||||
@ -787,8 +719,10 @@
|
||||
is_star: that.isSatrt,
|
||||
community_id: that.videoID
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
that.videoData(res.data.list)
|
||||
if (res.data.list.length < that.limit) {
|
||||
this.loadMore = false;
|
||||
}
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
@ -802,6 +736,9 @@
|
||||
id: that.videoID
|
||||
}).then(res => {
|
||||
that.videoData(res.data.list)
|
||||
if (res.data.list.length < that.limit) {
|
||||
this.loadMore = false;
|
||||
}
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
@ -809,26 +746,20 @@
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
that.loadVideo = true
|
||||
},
|
||||
getFocusList() {
|
||||
let that = this;
|
||||
if (!that.loadVideo) return
|
||||
that.loadVideo = true
|
||||
focusArticleLst({
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
type: 2
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
that.loadVideo = false
|
||||
// const arr=[]
|
||||
// res.data.list.forEach(item=>{
|
||||
// if(item.is_type == '2'){
|
||||
// return arr.push(item)
|
||||
// }
|
||||
// })
|
||||
// this.limit=arr.length
|
||||
that.loadVideo = true
|
||||
that.videoData(res.data.list)
|
||||
if (res.data.list.length < that.limit) {
|
||||
this.loadMore = false;
|
||||
}
|
||||
}).catch(err => {
|
||||
return uni.showToast({
|
||||
title: err,
|
||||
|
Loading…
x
Reference in New Issue
Block a user