任务中心调试
This commit is contained in:
parent
ca6baa5254
commit
6f931f7157
|
|
@ -3,7 +3,7 @@
|
|||
<list :bounce="false" :loadmoreoffset="wHeight*3" :show-scrollbar="false" ref="listBox" :pagingEnabled="true"
|
||||
:scrollable="true">
|
||||
<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">
|
||||
<!-- 视频 -->
|
||||
<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>
|
||||
</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-item" @click="payVideo(1)">
|
||||
<image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image>
|
||||
<text class="pay-content-items">
|
||||
{{countPrice*scale}}金币解锁整部视频
|
||||
{{countPrice*scale}}金币解锁单集视频
|
||||
</text>
|
||||
</view>
|
||||
<view class="pay-content-item" @click="payVideo(2)">
|
||||
|
|
@ -535,6 +538,7 @@
|
|||
videoPlay(videoId,courseDetailsId) {
|
||||
this.courseDetailsId = courseDetailsId
|
||||
if ( !this.playFlag ) {
|
||||
console.log(this.courseDetailsId)
|
||||
this.playFlag = true
|
||||
httpsRequest.getT('app/course/viewCourse', {
|
||||
courseId: this.courseId,
|
||||
|
|
@ -576,6 +580,27 @@
|
|||
this.setHistor(this.videoList[index].courseId, this.videoList[index].courseDetailsId);
|
||||
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) {
|
||||
if (e.show == false) {
|
||||
|
|
@ -972,7 +997,7 @@
|
|||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '已解锁',
|
||||
title: '已成功解锁',
|
||||
icon: 'none'
|
||||
})
|
||||
this.closePopusPay()
|
||||
|
|
|
|||
|
|
@ -1249,7 +1249,7 @@
|
|||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '已解锁',
|
||||
title: '已成功解锁',
|
||||
icon: 'none'
|
||||
})
|
||||
that.showPay = false
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<text class="" style="font-size: 24rpx;color: #999;padding: 0 34rpx;margin: 20rpx 0; auto;text-align: left;width: 100%;">
|
||||
{{getRedEnvelopeTips}}
|
||||
{{this.courseDetailsId}}
|
||||
</text>
|
||||
<view class="pay-content">
|
||||
<view class="pay-content-item" @click="payVideo(1)">
|
||||
|
|
@ -961,7 +961,7 @@
|
|||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '已解锁',
|
||||
title: '已成功解锁',
|
||||
icon: 'none'
|
||||
})
|
||||
this.closePopusPay()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<view class="subhead u-font-24">{{ item.detail }}</view>
|
||||
</view>
|
||||
<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" @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> -->
|
||||
|
|
@ -36,8 +36,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
|
|
@ -69,17 +68,20 @@
|
|||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getvipdata()
|
||||
this.getTaskdata()
|
||||
},
|
||||
methods: {
|
||||
//
|
||||
/**
|
||||
* 跳转
|
||||
* @param {Object} item
|
||||
*/
|
||||
goNav( item ) {
|
||||
console.log(url)
|
||||
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
|
||||
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
|
||||
// buttonUrl
|
||||
|
||||
if ( item.type == 1) {
|
||||
if ( item.jumpType == 1) {
|
||||
console.log(item.buttonUrl)
|
||||
uni.navigateTo({
|
||||
url: item.buttonUrl
|
||||
})
|
||||
|
|
@ -89,11 +91,37 @@
|
|||
url: item.buttonUrl
|
||||
})
|
||||
} else {
|
||||
|
||||
plus.runtime.openURL(item.buttonUrl)
|
||||
}
|
||||
} 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 = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
|
|
@ -101,14 +129,18 @@
|
|||
this.$Request.getT('app/taskCenter/selectTaskCenter', data).then(res => {
|
||||
if (res.code == 0 ) {
|
||||
this.cellList = res.data.records
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 下拉加载
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
console.log(2)
|
||||
this.getTaskdata();
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue