diff --git a/me/detail/detail.nvue b/me/detail/detail.nvue index d0aa717..26b3d55 100644 --- a/me/detail/detail.nvue +++ b/me/detail/detail.nvue @@ -575,11 +575,7 @@ }, //播放时的回掉 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 httpsRequest.getT('app/course/viewCourse', { courseId: this.courseId, @@ -622,12 +618,14 @@ 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) //插入历史记录 @@ -1066,30 +1064,37 @@ //单集解锁 data.courseDetailsId = this.videoList[this.current].courseDetailsId } + console.log(this.videoList[this.current].courseDetailsId) + console.log((num && num == 10) ? '/app/order/insertCourseOrders/limit10' : + '/app/order/insertCourseOrders') httpsRequest.getT((num && num == 10) ? '/app/order/insertCourseOrders/limit10' : '/app/order/insertCourseOrders', data).then(res => { - console.log(3) + console.log(res) if (res.code == 0) { - 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) { //支付宝 - this.closePay() //关闭购买选择弹窗 - this.payPrice = res.data.orders.payMoney //需要支付的价格 - this.openPopusPay() //显示充值弹窗 - } - - // this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney) - } else { + + console.log(res.status && res.status == 1) 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) { //支付宝 + this.closePay() //关闭购买选择弹窗 + this.payPrice = res.data.orders.payMoney //需要支付的价格 + this.openPopusPay() //显示充值弹窗 + } + } + + // this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney) + } else { + uni.showToast({ title: res.msg, icon: 'none' @@ -1102,7 +1107,8 @@ console.log("orderId==" + orderId) httpsRequest.postT("/app/order/payOrders", { orderId: orderId, - }).then(res => { + }).then(res => { + console.log("orderIds==" + res) if (res.code == 0) { uni.hideLoading() uni.showToast({ @@ -1228,9 +1234,9 @@ //播放结束后播放下一集 ended() { if (this.current < this.videoList.length - 1) { - // this.current += 1 this.$nextTick(() => { - let courseDetailsId = this.videoList[this.current + 1].courseDetailsId + this.current += 1 + let courseDetailsId = this.videoList[this.current].courseDetailsId console.log(courseDetailsId, '开始移动了') const el = this.$refs['list' + courseDetailsId][0] listDom.scrollToElement(el, {}) @@ -1300,6 +1306,7 @@ id: courseId, token: uni.getStorageSync('token') ? uni.getStorageSync('token') : '' }; + console.log(courseDetailsId) httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => { if (res.code == 0) {