From 51d60f2dcb12f0ed33927a1227ad1c5186ef78ab Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Sat, 7 Dec 2024 18:26:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=91=E5=B8=81=E8=A7=A3?= =?UTF-8?q?=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 12 ++++----- me/detail/detail.nvue | 58 +++++++++++++++++++++++++++------------- me/detail/detail.vue | 50 +++++++++++++++++++++------------- me/detail/detailIOS.nvue | 43 +++++++++++++++++++++-------- pages/index/index.vue | 2 +- 5 files changed, 110 insertions(+), 55 deletions(-) diff --git a/common/config.js b/common/config.js index d614bd8..73a8e9c 100644 --- a/common/config.js +++ b/common/config.js @@ -1,10 +1,10 @@ -const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; // -const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名 -const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名 +// const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; // +// const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名 +// const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名 -// const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // -// const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 -// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 +const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // +const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 +const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 module.exports = { APIHOST: ROOTPATH, diff --git a/me/detail/detail.nvue b/me/detail/detail.nvue index d4dda41..587bcd0 100644 --- a/me/detail/detail.nvue +++ b/me/detail/detail.nvue @@ -151,13 +151,13 @@ {{getRedEnvelopeTips}} - - + + {{countPrice}}元解锁单集视频 @@ -387,9 +387,9 @@ 'width': '750rpx', }, isShowVideo: '', - noBuyVideoIndex:null, playFlag: false, - getRedEnvelopeTips: '' + getRedEnvelopeTips: '', + scale: 1, }; }, onUnload() { @@ -487,6 +487,7 @@ this.getRedEnvelopeTips= res.data } }) + this.getScale() }, onLoad(e) { //是开启整部购买 @@ -510,6 +511,7 @@ this.boxStyle.height = this.wHeight + 5; // 记录跳转过来的视频总id跟单集id if (e.id) { + console.log(e) this.courseId = e.id; if (e.courseDetailsId && e.courseDetailsId != 'null') { this.courseDetailsId = e.courseDetailsId @@ -518,8 +520,19 @@ this.getMoneyList() this.getMyMoney() } + }, methods: { + /** + * 获取金币比例 + */ + getScale () { + httpsRequest.getT("app/common/type/914", {}).then(res => { + if (res.code == 0) { + this.scale = Number(res.data.value) + } + }); + }, //播放时的回掉 videoPlay(videoId,courseDetailsId) { this.courseDetailsId = courseDetailsId @@ -927,17 +940,23 @@ let data = { courseId: this.courseId } - if (type != 1) { //购买单集 - data.courseDetailsId = this.videoList[this.current].courseDetailsId - } + + data.courseDetailsId = this.videoList[this.current].courseDetailsId httpsRequest.getT('/app/order/insertCourseOrders', data).then(res => { if (res.code == 0) { this.ordersId = res.data.orders.ordersId //记录订单id this.payMoney = res.data.orders.payMoney //记录订单价格 - this.closePay() //关闭购买选择弹窗 - this.payPrice = res.data.orders.payMoney //需要支付的价格 - this.openPopusPay() //显示充值弹窗 + if (type == 1) { //金币 + this.showPay = false + this.showMoney = false + 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({ @@ -962,6 +981,7 @@ this.closePay() that.showPay = false that.showMoney = false + that.noBuyVideoIndex = null setTimeout(() => { that.getDataList(that.courseId, that.videoList[that.current].courseDetailsId, true); @@ -976,12 +996,11 @@ }, //打开购买弹窗 openPay() { - //获取总价跟单集价格 + this.zongPrice = this.info.price this.countPrice = this.videoList[this.current].price this.$refs.popupPya.open('bottom') this.noBuyVideoIndex=this.current - console.log(this.noBuyVideoIndex) }, //关闭购买弹窗 closePay() { @@ -1110,14 +1129,15 @@ }, //滚动到指定位置 goListPosition(courseDetailsId) { + let _this = this; this.$nextTick(() => { console.log(courseDetailsId, '开始移动了') - const el = this.$refs['list' + courseDetailsId][0] + const el = _this.$refs['list' + courseDetailsId][0] listDom.scrollToElement(el, { animated: false }) - this.$forceUpdate() - console.log(el, '移动结束') + _this.$forceUpdate() + console.log('移动结束',el) }) }, /** @@ -1139,6 +1159,7 @@ const indexs = arr.findIndex(menu => menu.courseDetailsId === Number(courseDetailsId)); this.current = indexs + console.log(this.current) this.scrollIntoView = 'video' + indexs arr.map((item, index) => { item.num = index + 1; @@ -1151,6 +1172,7 @@ }); //菜单数组 this.meunList = arr; + console.log(type) if (type == true) { //购买视频后返回的 console.log('购买视频后返回的') let courseDetailsIds = this.videoList[this.current].courseDetailsId; @@ -1168,7 +1190,7 @@ } }) }) - if(this.noBuyVideoIndex!==null&&this.noBuyVideoIndex==indexss){ + if(this.noBuyVideoIndex!==null&&this.noBuyVideoIndex==indexs){ this.noBuyVideoIndex=null return uni.navigateTo({ url:'/me/choujiang/choujiang?orderId'+2144 diff --git a/me/detail/detail.vue b/me/detail/detail.vue index 97b1184..07cdeb7 100644 --- a/me/detail/detail.vue +++ b/me/detail/detail.vue @@ -196,21 +196,15 @@ {{getRedEnvelopeTips}} - - - + {{countPrice}}元解锁单集视频 - - (解锁后永久有效) - - + + {{countPrice}}元解锁单集视频 @@ -365,6 +365,7 @@ isCollect: false, playFlag: false, getRedEnvelopeTips: '' + scale: 1, }; }, @@ -474,6 +475,8 @@ this.getRedEnvelopeTips= res.data } }) + this.getScale() + }, onLoad(e) { let that = this @@ -504,6 +507,16 @@ } }, methods: { + /** + * 获取金币比例 + */ + getScale () { + httpsRequest.getT("app/common/type/914", {}).then(res => { + if (res.code == 0) { + this.scale = Number(res.data.value) + } + }); + }, //播放时的回掉 videoPlay(videoId,courseDetailsId) { this.courseDetailsId = courseDetailsId @@ -915,17 +928,23 @@ let data = { courseId: this.courseId } - if (type != 1) { //购买单集 - data.courseDetailsId = this.videoList[this.current].courseDetailsId - } + + data.courseDetailsId = this.videoList[this.current].courseDetailsId httpsRequest.getT('/app/order/insertCourseOrders', data).then(res => { if (res.code == 0) { this.ordersId = res.data.orders.ordersId //记录订单id this.payMoney = res.data.orders.payMoney //记录订单价格 - this.closePay() //关闭购买选择弹窗 - this.payPrice = res.data.orders.payMoney //需要支付的价格 - this.openPopusPay() //显示充值弹窗 + if (type == 1) { //金币 + this.showPay = false + this.showMoney = false + 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 { @@ -944,13 +963,15 @@ if (res.code == 0) { uni.hideLoading() uni.showToast({ - title: '已解锁,支付' + payMoney + '金豆', + title: '已解锁,支付' + payMoney + '金币', icon: 'none' }) this.closePopusPay() this.closePay() that.showPay = false that.showMoney = false + that.noBuyVideoIndex = null + setTimeout(() => { that.getDataList(that.courseId, that.videoList[that.current].courseDetailsId, true); diff --git a/pages/index/index.vue b/pages/index/index.vue index 1b5c0b4..d27b9fe 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -176,7 +176,7 @@