From 421a3fe4f150d96420e5334329696a1aa17ce450 Mon Sep 17 00:00:00 2001 From: GYJ <1157756119@qq.com> Date: Sat, 14 Dec 2024 11:09:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86h5=E6=97=A0=E7=97=95=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 34 +++++++-------- common/config.js | 12 +++--- me/detail/detail.nvue | 60 +++++++++++++------------- me/detail/detail.vue | 95 +++++++++++++++++++++++------------------- pages/index/index.vue | 1 - pages/login/login.vue | 14 +++++-- 6 files changed, 114 insertions(+), 102 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 9cade79..063c551 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,27 +2,23 @@ "version" : "1.0", "configurations" : [ { - "app-plus" : - { - "launchtype" : "local" - }, - "default" : - { - "launchtype" : "local" - }, - "h5" : - { - "launchtype" : "local" - }, - "mp-weixin" : - { - "launchtype" : "local" - }, - "provider" : "aliyun", - "type" : "uniCloud" + "app-plus" : { + "launchtype" : "local" + }, + "default" : { + "launchtype" : "local" + }, + "h5" : { + "launchtype" : "local" + }, + "mp-weixin" : { + "launchtype" : "local" + }, + "provider" : "aliyun", + "type" : "uniCloud" }, { - "playground" : "custom", + "playground" : "standard", "type" : "uni-app:app-android" } ] diff --git a/common/config.js b/common/config.js index c91f33f..ff61669 100644 --- a/common/config.js +++ b/common/config.js @@ -2,13 +2,13 @@ // 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"; //后台服务域名 -const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; // -const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名 -const ROOTPATH2 = "http://192.168.1.5:8100"; //后台服务域名 +// const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; // +// const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名 +// const ROOTPATH2 = "http://192.168.1.5:8100"; //后台服务域名 module.exports = { APIHOST: ROOTPATH, diff --git a/me/detail/detail.nvue b/me/detail/detail.nvue index 6896ada..6583eec 100644 --- a/me/detail/detail.nvue +++ b/me/detail/detail.nvue @@ -407,9 +407,9 @@ if (this.videoContext) { this.videoContext.play() } - const noBuyVideoIndex= uni.getStorageSync('noBuyVideoIndex') - if(noBuyVideoIndex!==null&&noBuyVideoIndex!==undefined){ - this.noBuyVideoIndex=noBuyVideoIndex + const noBuyVideoIndex = uni.getStorageSync('noBuyVideoIndex') + if (noBuyVideoIndex !== null && noBuyVideoIndex !== undefined) { + this.noBuyVideoIndex = noBuyVideoIndex } this.isVips = uni.getStorageSync('isVips') ? uni.getStorageSync('isVips') : '否' let that = this @@ -528,19 +528,19 @@ this.getMyLoveStatus() this.getMoneyList() this.getMyMoney() - }else{ - if(e.allId){ - const arr=e.allId.split('-') + } else { + if (e.allId) { + const arr = e.allId.split('-') this.courseId = arr[0]; - if (arr[1] && arr[1] != 'null') { - this.courseDetailsId = arr[1] + if (arr[1] && arr[1] != 'null') { + this.courseDetailsId = arr[1] } this.getMyLoveStatus() this.getMoneyList() this.getMyMoney() } } - + }, methods: { @@ -767,13 +767,13 @@ this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data)); }) } else if (this.openWay == 1) { - let paytype='h5' + let paytype = 'h5' // #ifdef APP - paytype='app' + paytype = 'app' // #endif // APP支付宝支付 - console.log('nvue payType='+paytype); - httpsRequest.getT("/app/wuyou/payOrder/" + this.ordersId+'?payType='+paytype, {}).then(ret => { + console.log('nvue payType=' + paytype); + httpsRequest.getT("/app/wuyou/payOrder/" + this.ordersId + '?payType=' + paytype, {}).then(ret => { // plus.runtime.openURL(ret.data.h5Url) uni.navigateTo({ @@ -913,16 +913,16 @@ this.$refs.popuppay.open('bottom') return // 通过 id 获取 nvue 子窗体 - const subNVue = uni.getSubNVueById('pay') - subNVue.setStyle({ - height: '350rpx', - }) - // 打开 nvue 子窗体 - subNVue.show('slide-in-bottom', 300, function() { - // 打开后进行一些操作... - // - console.log('subnvue open') - }); + // const subNVue = uni.getSubNVueById('pay') + // subNVue.setStyle({ + // height: '350rpx', + // }) + // // 打开 nvue 子窗体 + // subNVue.show('slide-in-bottom', 300, function() { + // // 打开后进行一些操作... + // // + // console.log('subnvue open') + // }); // 关闭 nvue 子窗体 // subNVue.hide('fade-out', 300) @@ -1084,7 +1084,7 @@ this.countPrice = this.videoList[this.current].price this.$refs.popupPya.open('bottom') this.noBuyVideoIndex = this.current - uni.setStorageSync('noBuyVideoIndex',this.current) + uni.setStorageSync('noBuyVideoIndex', this.current) }, //关闭购买弹窗 closePay() { @@ -1280,9 +1280,9 @@ } }) }) - - if (this.noBuyVideoIndex !== null&& this.videoList[this - .noBuyVideoIndex].videoUrl) { + + if (this.noBuyVideoIndex !== null && this.videoList[this + .noBuyVideoIndex].videoUrl) { this.noBuyVideoIndex = null uni.removeStorageSync('noBuyVideoIndex') this.videoContext.stop() @@ -1293,7 +1293,7 @@ uni.navigateTo({ url: '/me/choujiang/choujiang' }) - }else{ + } else { this.videoContext.play(); } }) @@ -1312,7 +1312,7 @@ console.log('this.noBuyVideoIndex', this.noBuyVideoIndex) if (this.videoList[indexss].videoUrl) { //有播放权限 - console.log('有播放权限进入是否抽取转盘判断') + console.log('有播放权限进入是否抽取转盘判断') let numIdCurr = this.videoList[indexss].courseDetailsId; this.videoContextId = 'myVideo' + numIdCurr; this.videoContext = uni.createVideoContext(this @@ -1327,7 +1327,7 @@ uni.navigateTo({ url: '/me/choujiang/choujiang' }) - }else{ + } else { this.videoContext.play(); } }) diff --git a/me/detail/detail.vue b/me/detail/detail.vue index 6e1d292..fb25cae 100644 --- a/me/detail/detail.vue +++ b/me/detail/detail.vue @@ -194,8 +194,10 @@ 当前视频 没有播放权限 - {{getRedEnvelopeTips}} - + + {{getRedEnvelopeTips}} + + @@ -212,8 +214,8 @@ 开通会员 #ifdef MP-TOUTIAO || MP-WEIXIN--> - - + @@ -245,7 +247,7 @@ - + - + @@ -311,7 +313,7 @@ data() { return { //记录未购买视频索引 - noBuyVideoIndex:null, + noBuyVideoIndex: null, //奖品列表 prizeList: [{ id: 'coupon88', @@ -580,11 +582,18 @@ if (e.tt_episode_id) { this.tt_episode_id = e.tt_episode_id } - if(e.allId){ - const arr=e.allId.split('-') + if (e.allId) { + console.log("allId ---- "); + + // 如果存在allId 并且没有登录 则表示使用无痕浏览器查看,弹出提示 + if (!uni.getStorageSync('token')) { + uni.setStorageSync("isSafeView", "1") + } + + const arr = e.allId.split('-') this.courseId = arr[0]; - if (arr[1] && arr[1] != 'null') { - this.courseDetailsId = arr[1] + if (arr[1] && arr[1] != 'null') { + this.courseDetailsId = arr[1] } this.getMyLoveStatus() this.getMoneyList() @@ -633,11 +642,11 @@ if (this.videoContext) { this.videoContext.play() } - const noBuyVideoIndex= uni.getStorageSync('noBuyVideoIndex') - if(noBuyVideoIndex!==null&&noBuyVideoIndex!==undefined){ - this.noBuyVideoIndex=noBuyVideoIndex + const noBuyVideoIndex = uni.getStorageSync('noBuyVideoIndex') + if (noBuyVideoIndex !== null && noBuyVideoIndex !== undefined) { + this.noBuyVideoIndex = noBuyVideoIndex } - + try { this.playType = Number(uni.getStorageSync('playType')) } catch (e) { @@ -693,12 +702,12 @@ } // #endif this.isVips = uni.getStorageSync('isVips') ? uni.getStorageSync('isVips') : '否' - if(this.courseId){ + if (this.courseId) { this.getDataList(this.courseId, this.courseDetailsId); } this.$Request.getT('app/course/getRedEnvelopeTips').then(res => { if (res.code == 0) { - this.getRedEnvelopeTips= res.data + this.getRedEnvelopeTips = res.data } }) @@ -709,7 +718,7 @@ // } // }) this.getScale() - + }, onReady() { // #ifdef MP-WEIXIN || MP-KUAISHOU @@ -760,11 +769,11 @@ /** * 获取金币比例 */ - getScale () { + getScale() { this.$Request.getT("app/common/type/914", {}).then(res => { if (res.code == 0) { this.scale = Number(res.data.value) - } + } }); }, onDone(index) { @@ -791,7 +800,7 @@ this.zongPrice = this.info.price this.countPrice = this.videoList[this.current].price this.showPay = true - this.noBuyVideoIndex=this.current + this.noBuyVideoIndex = this.current }, // 获取收藏状态 getMyLoveStatus() { @@ -1052,8 +1061,8 @@ // #endif // console.log(e.detail.currentTime) // console.log(e.detail.duration) - if (e.detail.currentTime > e.detail.duration*0.9) { - if ( this.playFlag) { + if (e.detail.currentTime > e.detail.duration * 0.9) { + if (this.playFlag) { this.playFlag = false this.$Request.getT('app/course/viewCourse', { courseId: this.courseId, @@ -1064,7 +1073,7 @@ }) } } - + }, //缓冲中 waiting(e) { @@ -1222,8 +1231,8 @@ console.log(data) // data.h5Url 跳转地址 this.showMoney = false //显示充值弹窗 - uni.setStorageSync('noBuyVideoIndex',this.current) - this.noBuyVideoIndex=this.current + uni.setStorageSync('noBuyVideoIndex', this.current) + this.noBuyVideoIndex = this.current // this.payOrder(this.ordersId, this.payMoney) // #ifdef APP uni.navigateTo({ @@ -1231,9 +1240,9 @@ }); // #endif // #ifdef H5 - window.location.href = data.h5Url + window.location.href = data.h5Url // #endif - + }, //自组件关闭的回调 closeMoney(data) { @@ -1244,7 +1253,7 @@ let data = { courseId: this.courseId } - + data.courseDetailsId = this.videoList[this.current].courseDetailsId this.$Request.getT('/app/order/insertCourseOrders', data).then(res => { if (res.code == 0) { @@ -1255,12 +1264,12 @@ // this.showPay = false // this.showMoney = false this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney); - } else if(type == 2){ //支付宝 + } else if (type == 2) { //支付宝 this.showPay = false //关闭购买选择弹窗 this.payPrice = res.data.orders.payMoney //需要支付的价格 this.showMoney = true //显示充值弹窗 } - + } else { uni.showToast({ title: res.msg, @@ -1493,10 +1502,10 @@ } }) }) - if(this.noBuyVideoIndex!==null){ - this.noBuyVideoIndex=null + if (this.noBuyVideoIndex !== null) { + this.noBuyVideoIndex = null return uni.navigateTo({ - url:'/me/choujiang/choujiang' + url: '/me/choujiang/choujiang' }) } } else { //直接跳转进来的 @@ -1582,12 +1591,13 @@ this.zongPrice = this.info.price this.countPrice = this.videoList[this.current].price this.showPay = true - this.noBuyVideoIndex=this.current - }else{ + this.noBuyVideoIndex = this.current + } else { console.log('到达判断抽奖'); // if (this.noBuyVideoIndex != null ) { - console.log(this.noBuyVideoIndex); - if (this.noBuyVideoIndex !== null&&this.noBuyVideoIndex !== undefined&&this.noBuyVideoIndex !=='' && this.videoList[this + console.log(this.noBuyVideoIndex); + if (this.noBuyVideoIndex !== null && this.noBuyVideoIndex !== + undefined && this.noBuyVideoIndex !== '' && this.videoList[this .noBuyVideoIndex].videoUrl) { this.$Request.getT('app/discSpinning/drawCount').then(res => { console.log('转盘抽奖次数') @@ -1595,12 +1605,11 @@ uni.navigateTo({ url: '/me/choujiang/choujiang' }) - }else{ - } + } else {} }) uni.removeStorageSync('noBuyVideoIndex') this.noBuyVideoIndex = null - } + } } }) @@ -1753,7 +1762,7 @@ this.zongPrice = this.info.price this.countPrice = this.videoList[this.current].price this.showPay = true - this.noBuyVideoIndex=this.current + this.noBuyVideoIndex = this.current } this.$nextTick(() => { //插入历史记录 @@ -1796,7 +1805,7 @@ this.zongPrice = this.info.price this.countPrice = this.videoList[this.current].price this.showPay = true - this.noBuyVideoIndex=this.current + this.noBuyVideoIndex = this.current } }, //播放时的回掉 diff --git a/pages/index/index.vue b/pages/index/index.vue index 4a27757..987bfee 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -261,7 +261,6 @@ } }, onLoad(options) { - // barWidth // #ifdef MP-WEIXIN || MP-TOUTIAO || MP-KUAISHOU // 获取胶囊按钮位置信息 diff --git a/pages/login/login.vue b/pages/login/login.vue index 6435e5b..05139b2 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -58,7 +58,15 @@ checked: false }; }, - + onLoad() { + if (uni.getStorageSync('isSafeView')) { + uni.showModal({ + title: '提示', + content: '您正在使用无痕浏览,可能导致登录状态失效,建议切换浏览模式', + }) + uni.setStorageSync("isSafeView", null) + } + }, methods: { // 注册 register() { @@ -240,12 +248,12 @@ // this.$queue.loginClear(); // let openid = this.$queue.getData('openid'); if (!this.checked) { - return this.$refs.uToast.show({ + return this.$refs.uToast.show({ title: '请阅读并同意《隐私政策》和《用户服务协议》', duration: 1500 }) } - + let openid = uni.getStorageSync('openId') const { mobile,