This commit is contained in:
GaoHao 2024-12-09 16:40:16 +08:00
commit 9bb1b060e3
4 changed files with 85 additions and 28 deletions

View File

@ -3,7 +3,7 @@
<list :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true" <list :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true"
:scrollable="true"> :scrollable="true">
<cell v-for="(item,i) in videoList" :key="i" :ref="'list'+item.courseDetailsId"> <cell v-for="(item,i) in videoList" :key="i" :ref="'list'+item.courseDetailsId">
<view class="swipers-items" @longpress="openBs()" @appear="appear(item.courseDetailsId,i)" <view class="swipers-items" @longpress="openBs()" @disappear="disappear(item.courseDetailsId,i)" @appear="appear(item.courseDetailsId,i)"
:style="boxStyle"> :style="boxStyle">
<!-- 视频 --> <!-- 视频 -->
<video :show-fullscreen-btn="false" @controlstoggle="controlstoggles" object-fit="contain" <video :show-fullscreen-btn="false" @controlstoggle="controlstoggles" object-fit="contain"
@ -145,11 +145,14 @@
<image class="list-title-rs" src="../../static/images/me/closeIconss.png" mode=""></image> <image class="list-title-rs" src="../../static/images/me/closeIconss.png" mode=""></image>
</view> </view>
</view> </view>
<text class="" style="font-size: 24rpx;color: #999;padding: 0 34rpx;margin: 20rpx 0; auto;text-align: left;width: 100%;">
{{getRedEnvelopeTips}}
</text>
<view class="pay-content"> <view class="pay-content">
<view class="pay-content-item" @click="payVideo(1)"> <view class="pay-content-item" @click="payVideo(1)">
<image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image> <image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image>
<text class="pay-content-items"> <text class="pay-content-items">
{{countPrice*scale}}金币解锁整部视频 {{countPrice*scale}}金币解锁单集视频
</text> </text>
</view> </view>
<view class="pay-content-item" @click="payVideo(2)"> <view class="pay-content-item" @click="payVideo(2)">
@ -535,6 +538,7 @@
videoPlay(videoId,courseDetailsId) { videoPlay(videoId,courseDetailsId) {
this.courseDetailsId = courseDetailsId this.courseDetailsId = courseDetailsId
if ( !this.playFlag ) { if ( !this.playFlag ) {
console.log(this.courseDetailsId)
this.playFlag = true this.playFlag = true
httpsRequest.getT('app/course/viewCourse', { httpsRequest.getT('app/course/viewCourse', {
courseId: this.courseId, courseId: this.courseId,
@ -576,6 +580,27 @@
this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId); this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId);
this.$forceUpdate() this.$forceUpdate()
}, },
disappear(e, index) {
if (this.videoContext) { //判断之前是否有视频的上下文
this.videoContext.stop();
this.videoContext = null;
}
let numIdCurr = this.videoList[index-1].courseDetailsId;
if (this.videoList[index-1].videoUrl) { //已经购买可直接播放
// 播放时记录当前播放的id
this.appear(numIdCurr,index-1)
this.videoContextId = 'myVideo' + numIdCurr;
this.videoContext = uni.createVideoContext(this.videoContextId, this);
console.log('走更新了')
this.$nextTick(() => {
//播放当前的
this.videoContext.play();
})
}
// this.$forceUpdate();
},
//选集弹窗的回调 //选集弹窗的回调
changeXj(e) { changeXj(e) {
if (e.show == false) { if (e.show == false) {
@ -972,7 +997,7 @@
if (res.code == 0) { if (res.code == 0) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '已解锁', title: '已成功解锁',
icon: 'none' icon: 'none'
}) })
this.closePopusPay() this.closePopusPay()

View File

@ -1249,7 +1249,7 @@
if (res.code == 0) { if (res.code == 0) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '已解锁', title: '已成功解锁',
icon: 'none' icon: 'none'
}) })
that.showPay = false that.showPay = false

View File

@ -144,7 +144,7 @@
</view> </view>
</view> </view>
<text class="" style="font-size: 24rpx;color: #999;padding: 0 34rpx;margin: 20rpx 0; auto;text-align: left;width: 100%;"> <text class="" style="font-size: 24rpx;color: #999;padding: 0 34rpx;margin: 20rpx 0; auto;text-align: left;width: 100%;">
{{getRedEnvelopeTips}} {{this.courseDetailsId}}
</text> </text>
<view class="pay-content"> <view class="pay-content">
<view class="pay-content-item" @click="payVideo(1)"> <view class="pay-content-item" @click="payVideo(1)">
@ -961,7 +961,7 @@
if (res.code == 0) { if (res.code == 0) {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
title: '已解锁', title: '已成功解锁',
icon: 'none' icon: 'none'
}) })
this.closePopusPay() this.closePopusPay()

View File

@ -22,7 +22,7 @@
<view class="subhead u-font-24">{{ item.detail }}</view> <view class="subhead u-font-24">{{ item.detail }}</view>
</view> </view>
<view class="cell_right flex"> <view class="cell_right flex">
<view v-if=" !item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.buttonTitle }}</view> <view v-if=" item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.buttonTitle }}</view>
<view v-else class="btn u-font-24 text-bold disabled">{{ item.buttonTitle }}</view> <view v-else class="btn u-font-24 text-bold disabled">{{ item.buttonTitle }}</view>
<!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> --> <!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> -->
<!-- <view v-if=" item.type ==4 " class="u-font-20 tip" @click="goNav('/me/gift/gift', item.type)">查看奖品列表</view> --> <!-- <view v-if=" item.type ==4 " class="u-font-20 tip" @click="goNav('/me/gift/gift', item.type)">查看奖品列表</view> -->
@ -36,8 +36,7 @@
<script> <script>
export default { export default {
components: {
},
data() { data() {
return { return {
title: '', title: '',
@ -69,31 +68,60 @@
} }
}, },
onShow() { onShow() {
this.getvipdata() this.getTaskdata()
}, },
methods: { methods: {
// /**
* 跳转
* @param {Object} item
*/
goNav( item ) { goNav( item ) {
console.log(url)
// jumpType (integer, optional): 1 2 , // jumpType (integer, optional): 1 2 ,
// type (integer, optional): 1 2 9 , // type (integer, optional): 1 2 9 ,
// buttonUrl // buttonUrl
if ( item.type == 1) {
if ( item.jumpType == 1) { if ( item.jumpType == 1) {
uni.navigateTo({ console.log(item.buttonUrl)
url: item.buttonUrl uni.navigateTo({
}) url: item.buttonUrl
})
} else if( item.jumpType == 3) {
uni.switchTab({ } else if( item.jumpType == 3) {
url: item.buttonUrl uni.switchTab({
}) url: item.buttonUrl
})
} else {
plus.runtime.openURL(item.buttonUrl)
}
} else { } else {
this.taskReceive(item.id)
} }
}, },
getvipdata() {
/**
* 领取
*/
taskReceive(id) {
let data = {
id: id
}
this.$Request.getT('app/taskCenter/taskReceive', data).then(res => {
if (res.code == 0 ) {
uni.showToast({
title: '领取成功',
icon: 'none'
})
this.getTaskdata()
}
})
},
/**
* 获取任务列表
*/
getTaskdata() {
let data = { let data = {
page: this.page, page: this.page,
limit: this.limit limit: this.limit
@ -101,14 +129,18 @@
this.$Request.getT('app/taskCenter/selectTaskCenter', data).then(res => { this.$Request.getT('app/taskCenter/selectTaskCenter', data).then(res => {
if (res.code == 0 ) { if (res.code == 0 ) {
this.cellList = res.data.records this.cellList = res.data.records
} else {
} }
uni.stopPullDownRefresh();
}) })
}, },
/**
* 下拉加载
*/
onPullDownRefresh: function() {
console.log(2)
this.getTaskdata();
},
} }
} }