bug 回滚

This commit is contained in:
GYJ
2025-01-05 11:25:49 +08:00
parent 9e3860fdb1
commit 63a432c07c

View File

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