|
@@ -62,6 +62,9 @@ Page({
|
|
|
goBackHome: true
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.uid = wx.getStorageSync('uid');
|
|
|
let stackSize = 1;
|
|
|
if (option.stackSize) {
|
|
@@ -71,8 +74,7 @@ Page({
|
|
|
|
|
|
id,
|
|
|
myUid: this.uid,
|
|
|
- stackSize,
|
|
|
- option
|
|
|
+ stackSize
|
|
|
})
|
|
|
this.getWorks(this.uid, id);
|
|
|
}, (error) => {
|
|
@@ -83,33 +85,25 @@ Page({
|
|
|
return;
|
|
|
});
|
|
|
},
|
|
|
- addRecord: function(){
|
|
|
- const data = {
|
|
|
- "shareTypeEnum": "POSTER",
|
|
|
- "shareContentEnum": "READ",
|
|
|
- "productId": this.data.productId
|
|
|
- }
|
|
|
- if(this.data.option.shareCard){
|
|
|
- data.shareTypeEnum = 'LINK'
|
|
|
- httpRequestApi.shareTagRecord(data).success(res=>{
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- }
|
|
|
- if(this.data.option.scene){
|
|
|
- httpRequestApi.shareTagRecord(data).success(res=>{
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
onHide: function () {
|
|
|
|
|
|
- console.log(this.data.stackSize)
|
|
|
+
|
|
|
if (this.innerAudioContext) {
|
|
|
this.innerAudioContext.pause();
|
|
|
}
|
|
|
this.videoCtx = null
|
|
|
},
|
|
|
onUnload: function () {
|
|
|
+ const data = {
|
|
|
+ "title": this.data.title,
|
|
|
+ "lessonId": this.data.classId,
|
|
|
+ "productId": this.data.productId,
|
|
|
+ "playStopTime": this.videoPlayTime || 0,
|
|
|
+ "userReadId": this.data.userReadId
|
|
|
+ }
|
|
|
+ httpRequestApi.playLogReport(data).success(res =>{
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
if (this.innerAudioContext) {
|
|
|
this.innerAudioContext.destroy();
|
|
|
}
|
|
@@ -147,17 +141,14 @@ Page({
|
|
|
classId: works.lessonId,
|
|
|
isLike: res.data.data.isLike,
|
|
|
isFans: res.data.data.isFans,
|
|
|
- title: works.title
|
|
|
- });
|
|
|
- httpRequestApi.userIntoPage('pages/social/works/works','用户作品页面').success((res)=>{
|
|
|
-
|
|
|
+ title: works.title,
|
|
|
+ userReadId: works.id
|
|
|
})
|
|
|
httpRequestApi.checkLesson(works.lessonId).success(res => {
|
|
|
const productId = res.data.data[0];
|
|
|
this.setData({
|
|
|
productId
|
|
|
})
|
|
|
- this.addRecord();
|
|
|
});
|
|
|
|
|
|
this.innerAudioContext = wx.createInnerAudioContext();
|
|
@@ -260,7 +251,9 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- videoEnd: function () {
|
|
|
+ videoEnd: function (e) {
|
|
|
+ console.log(e)
|
|
|
+
|
|
|
this.innerAudioContext.stop();
|
|
|
},
|
|
|
videoPause: function () {
|
|
@@ -283,6 +276,7 @@ Page({
|
|
|
videoTimeupdate: function (e) {
|
|
|
console.log('视频播放进度发生变化')
|
|
|
console.log('视频当前时长', e.detail.currentTime);
|
|
|
+ this.videoPlayTime = e.detail.currentTime
|
|
|
console.log('音频当前时长', this.innerAudioContext.currentTime)
|
|
|
if (e.detail.currentTime - this.innerAudioContext.currentTime >= 1) {
|
|
|
this.innerAudioContext.seek(e.detail.currentTime - 0.1);
|
|
@@ -338,26 +332,16 @@ Page({
|
|
|
console.log(this.data.productId);
|
|
|
const data = {
|
|
|
shareTypeEnum: 'LINK',
|
|
|
- shareContentEnum: 'READ'
|
|
|
- }
|
|
|
- httpRequestApi.shareRecord(data).success((res)=>{
|
|
|
+ shareContentEnum: 'READ',
|
|
|
+ productId: this.data.productId
|
|
|
+ }
|
|
|
+ httpRequestApi.shareRecord(data).success((res) => {
|
|
|
console.log(res)
|
|
|
})
|
|
|
return {
|
|
|
title: '一样的课文,不一样的味道!我的配音表演已开始,求各位大咖围观、点评!',
|
|
|
path: `pages/social/works/works?id=${this.data.id}&title=${this.data.title}&shareCard=true`,
|
|
|
imageUrl: `https://efunbox.lingjiao.cn/reader/resource/share/read_${this.data.productId}.jpg`,
|
|
|
- success: function (res) {
|
|
|
-
|
|
|
- const data = {
|
|
|
- shareTypeEnum: 'LINK',
|
|
|
- shareContentEnum: 'READ',
|
|
|
- productId:this.data.productId
|
|
|
- }
|
|
|
- httpRequestApi.shareRecord(data).success((res)=>{
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- },
|
|
|
}
|
|
|
},
|
|
|
follow: function () {
|
|
@@ -473,6 +457,7 @@ Page({
|
|
|
},
|
|
|
|
|
|
sendHandler: function () {
|
|
|
+ console.log(this.data.productId)
|
|
|
if (this.data.inputValue !== '') {
|
|
|
|
|
|
let data = {
|
|
@@ -480,7 +465,7 @@ Page({
|
|
|
colunmNames: 'what',
|
|
|
|
|
|
"detailDesc": this.data.inputValue,
|
|
|
- "productId": this.data.productId
|
|
|
+ productId: this.data.productId
|
|
|
}
|
|
|
httpRequestApi.postReply(this.uid, data).success(res => {
|
|
|
this.setData({
|
|
@@ -519,7 +504,8 @@ Page({
|
|
|
replySB: function () {
|
|
|
const data = {
|
|
|
postsId: this.data.replySBId,
|
|
|
- content: this.data.inputSBValue
|
|
|
+ content: this.data.inputSBValue,
|
|
|
+ productId: this.data.productId
|
|
|
}
|
|
|
httpRequestApi.postReplyComment(this.uid, data).success(res => {
|
|
|
const replyWho = this.data.replyList[this.data.replyIndex];
|