|
@@ -51,7 +51,8 @@ Page({
|
|
|
modalCloseShow: true,
|
|
|
hide: true,
|
|
|
addComeOut: '',
|
|
|
- flowerNum: '6'
|
|
|
+ flowerNum: '6',
|
|
|
+ readIsRisky: ''
|
|
|
|
|
|
},
|
|
|
showAlert: function () {
|
|
@@ -113,15 +114,16 @@ Page({
|
|
|
},
|
|
|
onHide: function () {
|
|
|
|
|
|
- console.log('hide')
|
|
|
+ console.log('=================================hide')
|
|
|
if (this.innerAudioContext) {
|
|
|
console.log('音频应该被暂停')
|
|
|
this.innerAudioContext.pause();
|
|
|
+ this.innerAudioContext.volume = 0;
|
|
|
}
|
|
|
|
|
|
},
|
|
|
onUnload: function () {
|
|
|
- console.log(this.data.productId)
|
|
|
+ console.log('-------------------页面雨鞋')
|
|
|
if (this.videoPlayTime) {
|
|
|
const data = {
|
|
|
"title": this.data.title,
|
|
@@ -134,6 +136,11 @@ Page({
|
|
|
httpRequestApi.playLogReport(data).success(res => {
|
|
|
console.log(res)
|
|
|
})
|
|
|
+ if (this.innerAudioContext) {
|
|
|
+ console.log('音频应该被暂停')
|
|
|
+ this.innerAudioContext.pause();
|
|
|
+ this.innerAudioContext.volume = 0;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (this.innerAudioContext) {
|
|
@@ -167,12 +174,12 @@ Page({
|
|
|
authorAvatar: author.avatar,
|
|
|
authorProfession: author.profession,
|
|
|
authorUid: author.uid,
|
|
|
- videoSrc: works.originVideo,
|
|
|
audioSrc: works.audioPath,
|
|
|
iconImg: works.iconImg,
|
|
|
classId: works.lessonId,
|
|
|
isLike: res.data.data.isLike,
|
|
|
isFans: res.data.data.isFans,
|
|
|
+ videoSrc: works.originVideo,
|
|
|
title: works.title,
|
|
|
userReadId: works.id
|
|
|
})
|
|
@@ -182,6 +189,17 @@ Page({
|
|
|
productId: productId
|
|
|
})
|
|
|
});
|
|
|
+ if(this.data.fromReading){
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.openShare()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (works.isRisky === 'DEL') {
|
|
|
+ this.setData({
|
|
|
+ readIsRisky: 'DEL'
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
this.innerAudioContext = wx.createInnerAudioContext();
|
|
|
this.innerAudioContext.onPause((res) => {
|
|
@@ -189,32 +207,39 @@ Page({
|
|
|
console.log('音频暂停')
|
|
|
})
|
|
|
this.innerAudioContext.src = this.data.audioSrc;
|
|
|
- if(this.data.fromReading){
|
|
|
- setTimeout(()=>{
|
|
|
- this.openShare()
|
|
|
- })
|
|
|
- }
|
|
|
|
|
|
|
|
|
});
|
|
|
},
|
|
|
onShow() {
|
|
|
+ console.log('------------------------------------------------')
|
|
|
if(this.data.myUid){
|
|
|
this.setData({
|
|
|
replyList: [],
|
|
|
pageNo: 1,
|
|
|
- pageSize: 2
|
|
|
+ pageSize: 8
|
|
|
}, () => {
|
|
|
this.getReply();
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
videoPlayHandler: function () {
|
|
|
+ if (this.data.readIsRisky === 'DEL') {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '作品还在审核中,请稍后收听(一分钟内)。',
|
|
|
+ confirmText: '我知道了',
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {
|
|
|
+ console.log('用户点击确定')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
this.setData({
|
|
|
videoLoad: true
|
|
|
}, () => {
|
|
|
this.videoCtx = wx.createVideoContext('worksVideo', this);
|
|
|
- debugger
|
|
|
this.videoCtx.play();
|
|
|
})
|
|
|
},
|
|
@@ -285,7 +310,27 @@ Page({
|
|
|
noScroll: ''
|
|
|
})
|
|
|
},
|
|
|
- videoPlay: function () {
|
|
|
+ videoPlay: function (event) {
|
|
|
+ console.log(11111, this.videoPlayTime)
|
|
|
+ if (this.data.readIsRisky === 'DEL') {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '作品还在审核中,请稍后收听(一分钟内)。',
|
|
|
+ confirmText: '我知道了',
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {
|
|
|
+ console.log('用户点击确定')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (this.innerAudioContext) {
|
|
|
+ this.innerAudioContext.volume = 1;
|
|
|
+ if (this.videoPlayTime) {
|
|
|
+ this.innerAudioContext.seek(this.videoPlayTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('============', this.data.goBackHome)
|
|
|
|
|
|
|
|
|
|
|
@@ -307,9 +352,11 @@ Page({
|
|
|
|
|
|
this.innerAudioContext.stop();
|
|
|
},
|
|
|
- videoPause: function () {
|
|
|
+ videoPause: function (event) {
|
|
|
console.log('视频暂停')
|
|
|
+ console.log('暂停', event)
|
|
|
this.innerAudioContext.pause();
|
|
|
+ this.innerAudioContext.volume = 0;
|
|
|
},
|
|
|
videoWaiting: function () {
|
|
|
console.log('视频缓冲')
|
|
@@ -324,12 +371,18 @@ Page({
|
|
|
},
|
|
|
videoTimeupdate: function (e) {
|
|
|
this.videoPlayTime = e.detail.currentTime
|
|
|
- if (e.detail.currentTime - this.innerAudioContext.currentTime >= 1) {
|
|
|
- this.innerAudioContext.seek(e.detail.currentTime - 0.1);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
goToReading: function () {
|
|
|
const classId = this.data.classId;
|
|
|
+ if (this.innerAudioContext && this.videoCtx) {
|
|
|
+ this.videoCtx.pause();
|
|
|
+ this.innerAudioContext.pause();
|
|
|
+ this.innerAudioContext.volume = 0;
|
|
|
+ console.log('关闭音频')
|
|
|
+ }
|
|
|
getOpenidSessionKey((res) => {
|
|
|
httpRequestApi.areYouSuper(this.data.productId).success(res => {
|
|
|
if (res.data.success) {
|
|
@@ -344,13 +397,12 @@ Page({
|
|
|
},
|
|
|
fail () {
|
|
|
wx.showModal({
|
|
|
- title: '无法开启您的录音权限',
|
|
|
- content: '点击右上角浮点按钮->设置,进行授权',
|
|
|
+ title: '录音前请打开麦克风权限',
|
|
|
+ content: '点击右上角浮点...,选择:设置-麦克风,点击/打开。',
|
|
|
confirmText: '我知道了',
|
|
|
showCancel: false,
|
|
|
success(res) {
|
|
|
console.log('用户点击确定')
|
|
|
- dialogFlag = false;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -395,11 +447,6 @@ Page({
|
|
|
this.setData({
|
|
|
hide: !this.data.hide
|
|
|
})
|
|
|
- if (this.innerAudioContext && this.videoCtx) {
|
|
|
- this.videoCtx.stop();
|
|
|
- this.innerAudioContext.pause();
|
|
|
- console.log('关闭音频')
|
|
|
- }
|
|
|
return;
|
|
|
});
|
|
|
},
|
|
@@ -507,11 +554,13 @@ Page({
|
|
|
temp.time = formatDate(item.gmtCreated, 3);
|
|
|
temp.likes = item.postsAttributeInfo.favors || 0;
|
|
|
temp.isLike = item.isLike;
|
|
|
- this.data.replyList.push(temp);
|
|
|
+ if (item.isRisky === 'NORMAL') {
|
|
|
+ this.data.replyList.push(temp);
|
|
|
+ }
|
|
|
});
|
|
|
this.setData({
|
|
|
replyList: this.data.replyList,
|
|
|
- total: res.data.data.totalSize,
|
|
|
+ total: this.data.replyList.length,
|
|
|
totalPage: res.data.data.totalNo
|
|
|
})
|
|
|
});
|