视频列表获取优化

This commit is contained in:
GaoHao 2024-12-26 19:32:01 +08:00
parent 0362307423
commit e01198b1dd
3 changed files with 31 additions and 10 deletions

View File

@ -407,7 +407,8 @@
scale: 1, scale: 1,
// 防抖使用的变量 // 防抖使用的变量
appearTimeout: null, appearTimeout: null,
isOrder: true isOrder: true,
isGetDataList: false,
}; };
}, },
onUnload() { onUnload() {
@ -432,7 +433,7 @@
if (data.flag == true) { if (data.flag == true) {
that.showPay = false that.showPay = false
that.getDataList(that.courseId, that.courseDetailsId, true); that.getDataList(that.courseId, that.courseDetailsId, true);
that.getMyLoveStatus() // that.getMyLoveStatus()
that.getMoneyList() that.getMoneyList()
that.getMyMoney() that.getMyMoney()
} }
@ -539,7 +540,7 @@
this.courseDetailsId = e.courseDetailsId this.courseDetailsId = e.courseDetailsId
} }
console.log(this.courseDetailsId) console.log(this.courseDetailsId)
this.getMyLoveStatus() // this.getMyLoveStatus()
this.getMoneyList() this.getMoneyList()
this.getMyMoney() this.getMyMoney()
} else { } else {
@ -550,7 +551,7 @@
if (arr[1] && arr[1] != 'null') { if (arr[1] && arr[1] != 'null') {
this.courseDetailsId = arr[1] this.courseDetailsId = arr[1]
} }
this.getMyLoveStatus() // this.getMyLoveStatus()
this.getMoneyList() this.getMoneyList()
this.getMyMoney() this.getMyMoney()
} }
@ -577,6 +578,10 @@
videoPlay(videoId, courseDetailsId) { videoPlay(videoId, courseDetailsId) {
if (!this.playFlag) { if (!this.playFlag) {
this.playFlag = true this.playFlag = true
if ( this.isGetDataList) {
this.getDataList(this.courseId, courseDetailsId,true);
}
this.isGetDataList = true;
httpsRequest.getT('app/course/viewCourse', { httpsRequest.getT('app/course/viewCourse', {
courseId: this.courseId, courseId: this.courseId,
courseDetailsId: courseDetailsId, courseDetailsId: courseDetailsId,
@ -1306,11 +1311,16 @@
id: courseId, id: courseId,
token: uni.getStorageSync('token') ? uni.getStorageSync('token') : '' token: uni.getStorageSync('token') ? uni.getStorageSync('token') : ''
}; };
console.log(courseDetailsId) console.log("getDataList==="+courseDetailsId)
httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => { httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => {
if (res.code == 0) { if (res.code == 0) {
console.log(res) console.log(res)
if (res.data && res.data.isCollect && res.data.isCollect > 0) {
this.isCollect = true
} else {
this.isCollect = false
}
if (res.data.listsDetail) { if (res.data.listsDetail) {
this.info = res.data; this.info = res.data;
this.title = this.info.title; this.title = this.info.title;

View File

@ -446,6 +446,7 @@
getRedEnvelopeTips: '', getRedEnvelopeTips: '',
scale: 1, scale: 1,
isOrder: true, isOrder: true,
isGetDataList: false
}; };
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
@ -573,7 +574,7 @@
this.tt_episode_id = scene[5] this.tt_episode_id = scene[5]
} }
this.getDataList(this.courseId, this.courseDetailsId); this.getDataList(this.courseId, this.courseDetailsId);
this.getMyLoveStatus() // this.getMyLoveStatus()
} }
this.isGuanggao = uni.getStorageSync('isGuanggao') // this.isGuanggao = uni.getStorageSync('isGuanggao') //
this.isGuanggaody = uni.getStorageSync('isGuanggaody') // this.isGuanggaody = uni.getStorageSync('isGuanggaody') //
@ -603,7 +604,7 @@
this.courseDetailsId = e.courseDetailsId this.courseDetailsId = e.courseDetailsId
} }
console.log(this.courseDetailsId, '跳转进来的id') console.log(this.courseDetailsId, '跳转进来的id')
this.getMyLoveStatus() // this.getMyLoveStatus()
} }
if (e.tt_album_id) { if (e.tt_album_id) {
this.tt_album_id = e.tt_album_id this.tt_album_id = e.tt_album_id
@ -624,7 +625,7 @@
if (arr[1] && arr[1] != 'null') { if (arr[1] && arr[1] != 'null') {
this.courseDetailsId = arr[1] this.courseDetailsId = arr[1]
} }
this.getMyLoveStatus() // this.getMyLoveStatus()
this.getMoneyList() this.getMoneyList()
this.getMyMoney() this.getMyMoney()
} }
@ -1459,6 +1460,7 @@
this.num = item.num this.num = item.num
} }
}) })
this.playFlag = false
}, },
// //
setVideoList(index) { setVideoList(index) {
@ -1546,6 +1548,11 @@
this.dyCourseId = "" + res.data.dyCourseId; this.dyCourseId = "" + res.data.dyCourseId;
console.log("dyCourseId__" + this.dyCourseId) console.log("dyCourseId__" + this.dyCourseId)
} }
if (res.data && res.data.isCollect && res.data.isCollect > 0) {
this.isCollect = true
} else {
this.isCollect = false
}
if (res.data.listsDetail) { if (res.data.listsDetail) {
this.info = res.data this.info = res.data
this.title = this.info.title this.title = this.info.title
@ -1942,7 +1949,10 @@
videoPlay(videoId) { videoPlay(videoId) {
// this.courseDetailsId = courseDetailsId // this.courseDetailsId = courseDetailsId
if (!this.playFlag) { if (!this.playFlag) {
if ( this.isGetDataList) {
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,true); this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,true);
}
this.isGetDataList = true;
this.playFlag = true this.playFlag = true
this.$Request.getT('app/course/viewCourse', { this.$Request.getT('app/course/viewCourse', {
courseId: this.courseId, courseId: this.courseId,

View File

@ -47,7 +47,7 @@
src="../../static/images/signIn_icon1.png" mode="" /> src="../../static/images/signIn_icon1.png" mode="" />
<view class="radius"></view> <view class="radius"></view>
<view class="_label">{{item.showText}}</view> <view class="_label">{{item.showText}}</view>
<view class="_label" style="font-size: 18rpx;color: #999;margin-top: 2rpx;">{{item.signDay.slice(5,10)}}</view> <view class="_label" style="font-size: 18rpx;color: #999;margin-top: 2rpx;">{{item.signDay.slice(6,10)}}</view>
</view> </view>
</view> </view>
@ -271,6 +271,7 @@
} else if (item.jumpType == 1) { } else if (item.jumpType == 1) {
let source, buttonUrl; let source, buttonUrl;
buttonUrl = item.buttonUrl buttonUrl = item.buttonUrl
console.log(item.title && item.title.indexOf('每周打卡奖励') != -1)
if (item.title && item.title.indexOf('每周打卡奖励') != -1) { if (item.title && item.title.indexOf('每周打卡奖励') != -1) {
source = 2 source = 2
buttonUrl = item.buttonUrl + '?source=' + source buttonUrl = item.buttonUrl + '?source=' + source