From e7f5a17caebf657d7cbb4b18640c2d9f8df8b335 Mon Sep 17 00:00:00 2001 From: wangxiaohua <1214073490@qq.com> Date: Thu, 9 Dec 2021 17:39:32 +0800 Subject: [PATCH] init --- .../Customerportrait/Receivedetailabout.vue | 30 +++++---- pages/learning/Thefulltext/index.vue | 65 ++++++++++++------- pages/learning/Thefulltext/index2.vue | 39 +++++++---- pages/mine/details.vue | 32 +++++---- pages/mine/details2.vue | 30 +++++---- 5 files changed, 127 insertions(+), 69 deletions(-) diff --git a/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue b/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue index fec7b39..c179a2a 100644 --- a/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue +++ b/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue @@ -467,15 +467,6 @@ }; }, onShow() { - wx.enableAlertBeforeUnload({ - message: "是否确认退出详情页面?", - success: function (res) { - console.log("方法注册成功:", res); - }, - fail: function (errMsg) { - console.log("方法注册失败:", errMsg); - }, - }); this.intention=false; this.kehuyixiangcenterindex=0; this.buildingID = uni.getStorageSync('buildingID').id; @@ -517,14 +508,14 @@ // 在组件实例被从页面节点树移除时执行 destroyed: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, // 销毁实例 onUnload: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, @@ -739,10 +730,27 @@ // 播放监听 console.log('播放!'); this.audioPlay = true; + wx.enableAlertBeforeUnload({ + message: "是否确认退出详情页面?", + success: function (res) { + console.log("方法注册成功:", res); + }, + fail: function (errMsg) { + console.log("方法注册失败:", errMsg); + }, + }); }); }, onPause(){ this.innerAudioContext.onPause(() => { + wx.disableAlertBeforeUnload({ + success:function(res){ + console.log(res) + }, + fail:function(e){ + console.log(e) + } + }); // 暂停监听 console.log('暂停播放!'); this.audioPlay = false diff --git a/pages/learning/Thefulltext/index.vue b/pages/learning/Thefulltext/index.vue index b110568..b48cec8 100644 --- a/pages/learning/Thefulltext/index.vue +++ b/pages/learning/Thefulltext/index.vue @@ -212,15 +212,15 @@ },30000) }, onShow: function() { - wx.enableAlertBeforeUnload({ - message: "是否确认退出详情页面?", - success: function (res) { - console.log("方法注册成功:", res); - }, - fail: function (errMsg) { - console.log("方法注册失败:", errMsg); - }, - }); + // wx.enableAlertBeforeUnload({ + // message: "是否确认退出详情页面?", + // success: function (res) { + // console.log("方法注册成功:", res); + // }, + // fail: function (errMsg) { + // console.log("方法注册失败:", errMsg); + // }, + // }); this.initRecord(); let pages = getCurrentPages(); @@ -244,14 +244,14 @@ destroyed: function() { clearTimeout(this.timer) //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, // 销毁实例 onUnload: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, @@ -279,20 +279,37 @@ // console.log(res) }) }, - onPlay(){ - this.innerAudioContext.onPlay(() => { - // 播放监听 - console.log('播放!'); - this.audioPlay = true; - }); - }, - onPause(){ - this.innerAudioContext.onPause(() => { - // 暂停监听 - console.log('暂停播放!'); - this.audioPlay = false + onPlay(){ + this.innerAudioContext.onPlay(() => { + // 播放监听 + console.log('播放!'); + this.audioPlay = true; + wx.enableAlertBeforeUnload({ + message: "是否确认退出详情页面?", + success: function (res) { + console.log("方法注册成功:", res); + }, + fail: function (errMsg) { + console.log("方法注册失败:", errMsg); + }, }); - }, + }); + }, + onPause(){ + this.innerAudioContext.onPause(() => { + wx.disableAlertBeforeUnload({ + success:function(res){ + console.log(res) + }, + fail:function(e){ + console.log(e) + } + }); + // 暂停监听 + console.log('暂停播放!'); + this.audioPlay = false + }); + }, onCanplay() { this.innerAudioContext.onCanplay((callback) => { console.log("缓冲回调",this.innerAudioContext.duration); diff --git a/pages/learning/Thefulltext/index2.vue b/pages/learning/Thefulltext/index2.vue index de416a3..dcab089 100644 --- a/pages/learning/Thefulltext/index2.vue +++ b/pages/learning/Thefulltext/index2.vue @@ -242,15 +242,15 @@ },30000) }, onShow: function() { - wx.enableAlertBeforeUnload({ - message: "是否确认退出详情页面?", - success: function (res) { - console.log("方法注册成功:", res); - }, - fail: function (errMsg) { - console.log("方法注册失败:", errMsg); - }, - }); + // wx.enableAlertBeforeUnload({ + // message: "是否确认退出详情页面?", + // success: function (res) { + // console.log("方法注册成功:", res); + // }, + // fail: function (errMsg) { + // console.log("方法注册失败:", errMsg); + // }, + // }); this.initRecord(); if(this.stateisshow==2){ @@ -279,14 +279,14 @@ destroyed: function() { clearTimeout(this.timer) //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, // 销毁实例 onUnload: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, @@ -320,10 +320,27 @@ // 播放监听 console.log('播放!'); this.audioPlay = true; + wx.enableAlertBeforeUnload({ + message: "是否确认退出详情页面?", + success: function (res) { + console.log("方法注册成功:", res); + }, + fail: function (errMsg) { + console.log("方法注册失败:", errMsg); + }, + }); }); }, onPause(){ this.innerAudioContext.onPause(() => { + wx.disableAlertBeforeUnload({ + success:function(res){ + console.log(res) + }, + fail:function(e){ + console.log(e) + } + }); // 暂停监听 console.log('暂停播放!'); this.audioPlay = false diff --git a/pages/mine/details.vue b/pages/mine/details.vue index 0088085..c8681c9 100644 --- a/pages/mine/details.vue +++ b/pages/mine/details.vue @@ -268,15 +268,6 @@ this.stateisshow=options.stateisshow; }, onShow() { - wx.enableAlertBeforeUnload({ - message: "是否确认退出详情页面?", - success: function (res) { - console.log("方法注册成功:", res); - }, - fail: function (errMsg) { - console.log("方法注册失败:", errMsg); - }, - }); this.Menulist = uni.getStorageSync('weapp_session_Menu_data'); this.Menulist.forEach(item=>{ if(item.name=='标记有效无效接待'){ @@ -320,14 +311,14 @@ // 在组件实例被从页面节点树移除时执行 destroyed: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, // 销毁实例 onUnload: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, @@ -414,15 +405,32 @@ url: '/pages/learning/Keywordsearch?customerId='+this.customerId +"&status="+this.status +"&skpl="+"1" }) }, - onPlay(){ +onPlay(){ this.innerAudioContext.onPlay(() => { // 播放监听 console.log('播放!'); this.audioPlay = true; + wx.enableAlertBeforeUnload({ + message: "是否确认退出详情页面?", + success: function (res) { + console.log("方法注册成功:", res); + }, + fail: function (errMsg) { + console.log("方法注册失败:", errMsg); + }, + }); }); }, onPause(){ this.innerAudioContext.onPause(() => { + wx.disableAlertBeforeUnload({ + success:function(res){ + console.log(res) + }, + fail:function(e){ + console.log(e) + } + }); // 暂停监听 console.log('暂停播放!'); this.audioPlay = false diff --git a/pages/mine/details2.vue b/pages/mine/details2.vue index 932962d..9d64699 100644 --- a/pages/mine/details2.vue +++ b/pages/mine/details2.vue @@ -516,15 +516,6 @@ this.stateisshow=options.stateisshow; }, onShow() { - wx.enableAlertBeforeUnload({ - message: "是否确认退出详情页面?", - success: function (res) { - console.log("方法注册成功:", res); - }, - fail: function (errMsg) { - console.log("方法注册失败:", errMsg); - }, - }); this.Menulist = uni.getStorageSync('weapp_session_Menu_data'); this.Menulist.forEach(item=>{ if(item.name=='标记有效无效接待'){ @@ -568,14 +559,14 @@ // 在组件实例被从页面节点树移除时执行 destroyed: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, // 销毁实例 onUnload: function() { //暂停 - this.innerAudioContext.pause() + // this.innerAudioContext.pause() // 销毁 this.innerAudioContext.destroy(); }, @@ -1034,10 +1025,27 @@ // 播放监听 console.log('播放!'); this.audioPlay = true; + wx.enableAlertBeforeUnload({ + message: "是否确认退出详情页面?", + success: function (res) { + console.log("方法注册成功:", res); + }, + fail: function (errMsg) { + console.log("方法注册失败:", errMsg); + }, + }); }); }, onPause(){ this.innerAudioContext.onPause(() => { + wx.disableAlertBeforeUnload({ + success:function(res){ + console.log(res) + }, + fail:function(e){ + console.log(e) + } + }); // 暂停监听 console.log('暂停播放!'); this.audioPlay = false