bug 回滚
This commit is contained in:
@@ -133,7 +133,7 @@
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 购买弹窗 -->
|
||||
<uni-popup ref="popupPya" @change="popupPyaClose" :safe-area="false">
|
||||
<uni-popup ref="popupPya" :safe-area="false">
|
||||
<view class="pay">
|
||||
<view class="list-title">
|
||||
<view class="list-title-l">
|
||||
@@ -371,7 +371,7 @@
|
||||
num: 1, //当前播放的集数
|
||||
showPay: false, //购买视频的弹窗
|
||||
info: {}, //整部的信息
|
||||
courseDetailsId: null, //详情id
|
||||
courseDetailsId: '', //详情id
|
||||
scrollIntoView: '', //当前播放视频的位置
|
||||
scrollIntoViews: 'video0', //当前播放视频的位置
|
||||
isVips: '否', //是否显示会员
|
||||
@@ -406,9 +406,7 @@
|
||||
getRedEnvelopeTips: '',
|
||||
scale: 1,
|
||||
// 防抖使用的变量
|
||||
appearTimeout: null,
|
||||
isOrder: true,
|
||||
isGetDataList: false,
|
||||
appearTimeout: null
|
||||
};
|
||||
},
|
||||
onUnload() {
|
||||
@@ -433,7 +431,7 @@
|
||||
if (data.flag == true) {
|
||||
that.showPay = false
|
||||
that.getDataList(that.courseId, that.courseDetailsId, true);
|
||||
// that.getMyLoveStatus()
|
||||
that.getMyLoveStatus()
|
||||
that.getMoneyList()
|
||||
that.getMyMoney()
|
||||
}
|
||||
@@ -536,8 +534,11 @@
|
||||
// 记录跳转过来的视频总id跟单集id
|
||||
if (e.id) {
|
||||
this.courseId = e.id;
|
||||
|
||||
// this.getMyLoveStatus()
|
||||
if (e.courseDetailsId && e.courseDetailsId != 'null') {
|
||||
this.courseDetailsId = e.courseDetailsId
|
||||
}
|
||||
console.log(this.courseDetailsId)
|
||||
this.getMyLoveStatus()
|
||||
this.getMoneyList()
|
||||
this.getMyMoney()
|
||||
} else {
|
||||
@@ -545,8 +546,10 @@
|
||||
if (e.allId) {
|
||||
const arr = e.allId.split('-')
|
||||
this.courseId = arr[0];
|
||||
|
||||
// this.getMyLoveStatus()
|
||||
if (arr[1] && arr[1] != 'null') {
|
||||
this.courseDetailsId = arr[1]
|
||||
}
|
||||
this.getMyLoveStatus()
|
||||
this.getMoneyList()
|
||||
this.getMyMoney()
|
||||
}
|
||||
@@ -571,12 +574,12 @@
|
||||
},
|
||||
//播放时的回掉
|
||||
videoPlay(videoId, courseDetailsId) {
|
||||
console.log(courseDetailsId)
|
||||
console.log(this.playFlag)
|
||||
// this.courseDetailsId = courseDetailsId
|
||||
if (!this.playFlag) {
|
||||
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId, true);
|
||||
this.playFlag = true
|
||||
if ( this.isGetDataList) {
|
||||
this.getDataList(this.courseId, courseDetailsId,true);
|
||||
}
|
||||
this.isGetDataList = true;
|
||||
httpsRequest.getT('app/course/viewCourse', {
|
||||
courseId: this.courseId,
|
||||
courseDetailsId: courseDetailsId,
|
||||
@@ -618,14 +621,12 @@
|
||||
console.log("appear===" + e)
|
||||
console.log("appear===" + index)
|
||||
// this.courseDetailsId = e
|
||||
console.log(e)
|
||||
this.current = index
|
||||
this.showControls = true
|
||||
this.isShowVideo = e
|
||||
this.scrollIntoViews = 'video' + index
|
||||
this.scrollIntoView = 'video' + index
|
||||
console.log(this.scrollIntoViews, '当前位置')
|
||||
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId);
|
||||
//播放并更新video的上下文
|
||||
this.startPlay(index)
|
||||
//插入历史记录
|
||||
@@ -810,19 +811,10 @@
|
||||
console.log('nvue payType=' + paytype);
|
||||
httpsRequest.getT("/app/wuyou/payOrder/" + this.ordersId + '?payType=' + paytype, {}).then(ret => {
|
||||
// plus.runtime.openURL(ret.data.h5Url)
|
||||
if(ret.code == 0 ) {
|
||||
uni.hideLoading()
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/pays/pays?ordersId=' + this.ordersId + '&url=' + ret.data.h5Url
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
icon: res.msg,
|
||||
title: '支付失败!'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/index/webView?ordersId='+this.ordersId+'url=' + ret.data.h5Url
|
||||
@@ -1043,24 +1035,12 @@
|
||||
}
|
||||
|
||||
},
|
||||
popupPyaClose() {
|
||||
this.isOrder = true
|
||||
console.log(this.isOrder)
|
||||
},
|
||||
/**
|
||||
* @param {Object} type 类型
|
||||
* 1:购买整部视频
|
||||
* 2:购买单集视频
|
||||
*/
|
||||
payVideo(type, num) {
|
||||
console.log(this.isOrder)
|
||||
if(!this.isOrder){
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
this.isOrder = false
|
||||
if (uni.getStorageSync('token')) {
|
||||
this.submitPay(type, num)
|
||||
} else {
|
||||
@@ -1079,36 +1059,28 @@
|
||||
//单集解锁
|
||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||
}
|
||||
|
||||
httpsRequest.getT((num && num == 10) ? '/app/order/insertCourseOrders/limit10' :
|
||||
'/app/order/insertCourseOrders', data).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
|
||||
if (res.status && res.status == 1) {
|
||||
this.showPay = false //关闭购买选择弹窗
|
||||
this.isOrder = true
|
||||
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,
|
||||
true);
|
||||
return;
|
||||
} else{
|
||||
this.ordersId = res.data.orders.ordersId //记录订单id
|
||||
this.payMoney = res.data.orders.payMoney //记录订单价格
|
||||
|
||||
if (type == 1) { //金币
|
||||
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
} else if (type == 2) { //支付宝
|
||||
uni.hideLoading()
|
||||
this.closePay() //关闭购买选择弹窗
|
||||
this.payPrice = res.data.orders.payMoney //需要支付的价格
|
||||
this.openPopusPay() //显示充值弹窗
|
||||
}
|
||||
|
||||
}
|
||||
console.log(this.isOrder)
|
||||
|
||||
// this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
|
||||
} else {
|
||||
this.isOrder = true
|
||||
if (res.status && res.status == 1) {
|
||||
this.showPay = false //关闭购买选择弹窗
|
||||
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,
|
||||
true);
|
||||
return;
|
||||
}
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
@@ -1122,7 +1094,6 @@
|
||||
httpsRequest.postT("/app/order/payOrders", {
|
||||
orderId: orderId,
|
||||
}).then(res => {
|
||||
console.log("orderIds==", res)
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
@@ -1150,7 +1121,6 @@
|
||||
// this.payPrice = payMoney //需要支付的价格
|
||||
// this.openPopusPay() //显示充值弹窗
|
||||
}
|
||||
this.isOrder = true
|
||||
});
|
||||
},
|
||||
//打开购买弹窗
|
||||
@@ -1164,7 +1134,6 @@
|
||||
},
|
||||
//关闭购买弹窗
|
||||
closePay() {
|
||||
console.log(1)
|
||||
this.$refs.popupPya.close()
|
||||
},
|
||||
//选择播放
|
||||
@@ -1249,9 +1218,9 @@
|
||||
//播放结束后播放下一集
|
||||
ended() {
|
||||
if (this.current < this.videoList.length - 1) {
|
||||
// this.current += 1
|
||||
this.$nextTick(() => {
|
||||
this.current += 1
|
||||
let courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||
let courseDetailsId = this.videoList[this.current + 1].courseDetailsId
|
||||
console.log(courseDetailsId, '开始移动了')
|
||||
const el = this.$refs['list' + courseDetailsId][0]
|
||||
listDom.scrollToElement(el, {})
|
||||
@@ -1321,30 +1290,16 @@
|
||||
id: courseId,
|
||||
token: uni.getStorageSync('token') ? uni.getStorageSync('token') : ''
|
||||
};
|
||||
console.log("getDataList==="+courseDetailsId)
|
||||
console.log("getDataList===",data)
|
||||
httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => {
|
||||
|
||||
if (res.code == 0) {
|
||||
console.log(res)
|
||||
if (res.data && res.data.isCollect && res.data.isCollect > 0) {
|
||||
this.isCollect = true
|
||||
} else {
|
||||
this.isCollect = false
|
||||
}
|
||||
if( res.data && res.data.courseDetailsId && !this.courseDetailsId && !courseDetailsId) {
|
||||
this.courseDetailsId = res.data.courseDetailsId
|
||||
courseDetailsId = res.data.courseDetailsId
|
||||
}
|
||||
|
||||
if (res.data.listsDetail) {
|
||||
this.info = res.data;
|
||||
this.title = this.info.title;
|
||||
let arr = JSON.parse(JSON.stringify(res.data.listsDetail));
|
||||
const indexs = arr.findIndex(menu => menu.courseDetailsId ===
|
||||
Number(courseDetailsId));
|
||||
//如果未找到将current值改为0,否则会导致选集无法弹窗,弹窗后点击相对应集数也无反应
|
||||
this.current = indexs===-1?0:indexs;
|
||||
this.current = indexs
|
||||
this.scrollIntoViews = 'video' + indexs
|
||||
this.scrollIntoView = 'video' + indexs
|
||||
console.log(this.current)
|
||||
@@ -1401,12 +1356,8 @@
|
||||
this.videoContext = uni.createVideoContext(this
|
||||
.videoContextId,
|
||||
this);
|
||||
if (this.videoList[this.current].videoUrl) {
|
||||
console.log(this.videoContext);
|
||||
this.videoContext.play();
|
||||
}else {
|
||||
console.log("播放失败")
|
||||
this.getDataList(this.courseId, courseDetailsIds, true);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
@@ -1490,7 +1441,8 @@
|
||||
type: 1
|
||||
};
|
||||
console.log(data, '记录了')
|
||||
httpsRequest.postJson('/app/courseCollect/insertCourseCollect', data).then(res => {})
|
||||
httpsRequest.postJson('/app/courseCollect/insertCourseCollect', data).then(res => {
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -1617,11 +1569,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.popuppay {
|
||||
width: 750rpx;
|
||||
background-color: #ffffff;
|
||||
@@ -1867,11 +1814,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.bs {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -2147,7 +2089,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
.pay {
|
||||
width: 750rpx;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user