修改无法生成订单问题
This commit is contained in:
@@ -133,7 +133,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
<!-- 购买弹窗 -->
|
<!-- 购买弹窗 -->
|
||||||
<uni-popup ref="popupPya" :safe-area="false">
|
<uni-popup ref="popupPya" @change="popupPyaClose" :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 @@ export default {
|
|||||||
num: 1, //当前播放的集数
|
num: 1, //当前播放的集数
|
||||||
showPay: false, //购买视频的弹窗
|
showPay: false, //购买视频的弹窗
|
||||||
info: {}, //整部的信息
|
info: {}, //整部的信息
|
||||||
courseDetailsId: '', //详情id
|
courseDetailsId: null, //详情id
|
||||||
scrollIntoView: '', //当前播放视频的位置
|
scrollIntoView: '', //当前播放视频的位置
|
||||||
scrollIntoViews: 'video0', //当前播放视频的位置
|
scrollIntoViews: 'video0', //当前播放视频的位置
|
||||||
isVips: '否', //是否显示会员
|
isVips: '否', //是否显示会员
|
||||||
@@ -406,7 +406,9 @@ export default {
|
|||||||
getRedEnvelopeTips: '',
|
getRedEnvelopeTips: '',
|
||||||
scale: 1,
|
scale: 1,
|
||||||
// 防抖使用的变量
|
// 防抖使用的变量
|
||||||
appearTimeout: null
|
appearTimeout: null,
|
||||||
|
isOrder: true,
|
||||||
|
isGetDataList: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
@@ -431,7 +433,7 @@ export default {
|
|||||||
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()
|
||||||
}
|
}
|
||||||
@@ -534,11 +536,8 @@ export default {
|
|||||||
// 记录跳转过来的视频总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.courseDetailsId = e.courseDetailsId
|
// this.getMyLoveStatus()
|
||||||
}
|
|
||||||
console.log(this.courseDetailsId)
|
|
||||||
this.getMyLoveStatus()
|
|
||||||
this.getMoneyList()
|
this.getMoneyList()
|
||||||
this.getMyMoney()
|
this.getMyMoney()
|
||||||
} else {
|
} else {
|
||||||
@@ -546,10 +545,8 @@ export default {
|
|||||||
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.courseDetailsId = arr[1]
|
// this.getMyLoveStatus()
|
||||||
}
|
|
||||||
this.getMyLoveStatus()
|
|
||||||
this.getMoneyList()
|
this.getMoneyList()
|
||||||
this.getMyMoney()
|
this.getMyMoney()
|
||||||
}
|
}
|
||||||
@@ -574,10 +571,12 @@ export default {
|
|||||||
},
|
},
|
||||||
//播放时的回掉
|
//播放时的回掉
|
||||||
videoPlay(videoId, courseDetailsId) {
|
videoPlay(videoId, courseDetailsId) {
|
||||||
console.log(courseDetailsId)
|
|
||||||
// this.courseDetailsId = 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,
|
||||||
@@ -606,6 +605,7 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
appear(e, index) {
|
appear(e, index) {
|
||||||
|
this.playFlag = false
|
||||||
this.courseDetailsId = e;
|
this.courseDetailsId = e;
|
||||||
// 清除已经设置的定时器
|
// 清除已经设置的定时器
|
||||||
clearTimeout(this.appearTimeout);
|
clearTimeout(this.appearTimeout);
|
||||||
@@ -618,12 +618,14 @@ export default {
|
|||||||
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)
|
||||||
//插入历史记录
|
//插入历史记录
|
||||||
@@ -808,10 +810,19 @@ export default {
|
|||||||
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
|
||||||
@@ -1032,12 +1043,24 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
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 {
|
||||||
@@ -1056,27 +1079,38 @@ export default {
|
|||||||
//单集解锁
|
//单集解锁
|
||||||
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
data.courseDetailsId = this.videoList[this.current].courseDetailsId
|
||||||
}
|
}
|
||||||
httpsRequest.getT((num && num == 10)?'/app/order/insertCourseOrders/limit10': '/app/order/insertCourseOrders', data).then(res => {
|
console.log(this.current)
|
||||||
|
console.log(data)
|
||||||
|
httpsRequest.getT((num && num == 10) ? '/app/order/insertCourseOrders/limit10' :
|
||||||
|
'/app/order/insertCourseOrders', data).then(res => {
|
||||||
|
console.log(res)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
|
||||||
|
if (res.status && res.status == 1) {
|
||||||
|
uni.hideLoading()
|
||||||
|
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 {
|
||||||
if ( res.status && res.status == 1) {
|
this.isOrder = true
|
||||||
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'
|
||||||
@@ -1090,6 +1124,7 @@ export default {
|
|||||||
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({
|
||||||
@@ -1117,6 +1152,7 @@ export default {
|
|||||||
// this.payPrice = payMoney //需要支付的价格
|
// this.payPrice = payMoney //需要支付的价格
|
||||||
// this.openPopusPay() //显示充值弹窗
|
// this.openPopusPay() //显示充值弹窗
|
||||||
}
|
}
|
||||||
|
this.isOrder = true
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//打开购买弹窗
|
//打开购买弹窗
|
||||||
@@ -1130,6 +1166,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//关闭购买弹窗
|
//关闭购买弹窗
|
||||||
closePay() {
|
closePay() {
|
||||||
|
console.log(1)
|
||||||
this.$refs.popupPya.close()
|
this.$refs.popupPya.close()
|
||||||
},
|
},
|
||||||
//选择播放
|
//选择播放
|
||||||
@@ -1214,9 +1251,9 @@ export default {
|
|||||||
//播放结束后播放下一集
|
//播放结束后播放下一集
|
||||||
ended() {
|
ended() {
|
||||||
if (this.current < this.videoList.length - 1) {
|
if (this.current < this.videoList.length - 1) {
|
||||||
// this.current += 1
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let courseDetailsId = this.videoList[this.current + 1].courseDetailsId
|
this.current += 1
|
||||||
|
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, {})
|
||||||
@@ -1286,18 +1323,33 @@ export default {
|
|||||||
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)
|
||||||
|
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) {
|
||||||
|
courseDetailsId = res.data.courseDetailsId
|
||||||
|
}
|
||||||
|
this.courseDetailsId = courseDetailsId
|
||||||
|
console.log(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;
|
||||||
|
console.log(indexs)
|
||||||
|
console.log(this.current)
|
||||||
this.scrollIntoViews = 'video' + indexs
|
this.scrollIntoViews = 'video' + indexs
|
||||||
this.scrollIntoView = 'video' + indexs
|
this.scrollIntoView = 'video' + indexs
|
||||||
console.log(this.current)
|
|
||||||
// this.scrollIntoView = 'video' + indexs
|
// this.scrollIntoView = 'video' + indexs
|
||||||
arr.map((item, index) => {
|
arr.map((item, index) => {
|
||||||
item.num = index + 1;
|
item.num = index + 1;
|
||||||
@@ -1344,6 +1396,22 @@ export default {
|
|||||||
this.videoContext.play();
|
this.videoContext.play();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
console.log('播放')
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
console.log('myVideo' + courseDetailsIds)
|
||||||
|
this.videoContextId = 'myVideo' + courseDetailsIds;
|
||||||
|
this.videoContext = uni.createVideoContext(this
|
||||||
|
.videoContextId,
|
||||||
|
this);
|
||||||
|
if (this.videoList[this.current].videoUrl) {
|
||||||
|
this.videoContext.play();
|
||||||
|
}else {
|
||||||
|
console.log("播放失败")
|
||||||
|
this.getDataList(this.courseId, courseDetailsIds, true);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
// console.log('this.noBuyVideoIndex', this.noBuyVideoIndex)
|
// console.log('this.noBuyVideoIndex', this.noBuyVideoIndex)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user