|
@@ -41,7 +41,10 @@ Page({
|
|
|
console.log(option);
|
|
|
this.videoCtx = null;
|
|
|
const uid = wx.getStorageSync('uid')
|
|
|
- httpRequestApi.getClassDetail(option.id).success(res => {
|
|
|
+ this.getClassInfo(option.id)
|
|
|
+ },
|
|
|
+ getClassInfo: function (id) {
|
|
|
+ httpRequestApi.getClassDetail(id).success(res => {
|
|
|
console.log('课程信息', res)
|
|
|
let reg = /\\n/g
|
|
|
this.setData({
|
|
@@ -54,13 +57,8 @@ Page({
|
|
|
grade: res.data.data.userRead.grade,
|
|
|
exampleId: res.data.data.userRead.exampleId,
|
|
|
summary: res.data.data.userRead.summary
|
|
|
- // productId: res.data.data.product.id
|
|
|
-
|
|
|
})
|
|
|
- console.log(this.data.readingText)
|
|
|
- console.log(this.data.img)
|
|
|
- this.getReadInfo(option.id)
|
|
|
-
|
|
|
+ this.getReadInfo(id)
|
|
|
httpRequestApi.userIntoPage('pages/reading/reading', '朗读页面').success((res) => {
|
|
|
|
|
|
})
|
|
@@ -160,6 +158,20 @@ Page({
|
|
|
* 2 录音结束
|
|
|
***/
|
|
|
audioRecord: function () {
|
|
|
+ /* wx.getSetting({
|
|
|
+ success(res) {
|
|
|
+ if (res.authSetting['scope.record']) {
|
|
|
+ that.videoComplete();
|
|
|
+ }else {
|
|
|
+ wx.showToast({
|
|
|
+ title: 'onError',
|
|
|
+ icon: 'fail',
|
|
|
+ duration: 500
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }) */
|
|
|
+
|
|
|
console.log('recordFlag', this.data.recordFlag)
|
|
|
if (this.data.recordFlag === 0) {
|
|
|
// this.recordStart();
|
|
@@ -176,20 +188,15 @@ Page({
|
|
|
// this.innerAudioContext.stop();
|
|
|
// }
|
|
|
const that = this;
|
|
|
- wx.getSetting({
|
|
|
- success(res) {
|
|
|
- if (res.authSetting['scope.record']) {
|
|
|
- that.videoComplete();
|
|
|
- }
|
|
|
- // else {
|
|
|
- // wx.showToast({
|
|
|
- // title: 'onError',
|
|
|
- // icon: 'fail',
|
|
|
- // duration: 500
|
|
|
- // })
|
|
|
- // }
|
|
|
- }
|
|
|
- })
|
|
|
+ that.videoComplete();
|
|
|
+
|
|
|
+ // wx.getSetting({
|
|
|
+ // success(res) {
|
|
|
+ // if (res.authSetting['scope.record']) {
|
|
|
+ // that.videoComplete();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
return;
|
|
|
}
|
|
|
// 录音结束后
|
|
@@ -339,7 +346,7 @@ Page({
|
|
|
})
|
|
|
|
|
|
if (this.data.audioPath) {
|
|
|
- this.shareWorks(uid, this.data.audioPath)
|
|
|
+ this.shareWorks(this.data.audioPath)
|
|
|
} else {
|
|
|
const recordSource = this.data.recordSource;
|
|
|
wx.uploadFile({
|
|
@@ -397,12 +404,12 @@ Page({
|
|
|
});
|
|
|
const pages = getCurrentPages();
|
|
|
const prevPage = pages[pages.length - 2];
|
|
|
- console.log('上一个页面',prevPage);
|
|
|
+ console.log('上一个页面', prevPage);
|
|
|
console.log('上一个页面', res.data.data.id);
|
|
|
prevPage.setData({
|
|
|
workId: res.data.data.id, // 有id就塞到第一位
|
|
|
}, () => {
|
|
|
- console.log('上一个页面',prevPage);
|
|
|
+ console.log('上一个页面', prevPage);
|
|
|
wx.navigateBack({
|
|
|
delta: 1
|
|
|
})
|
|
@@ -424,7 +431,7 @@ Page({
|
|
|
pageSize: 3,
|
|
|
type: 'READ'
|
|
|
};
|
|
|
- httpRequestApi.getClassRead(this.uid, data).success(res => {
|
|
|
+ httpRequestApi.getClassRead(data).success(res => {
|
|
|
const readInfo = res.data.data.list;
|
|
|
console.log(res)
|
|
|
readInfo.forEach(item => {
|
|
@@ -433,7 +440,7 @@ Page({
|
|
|
temp.img = item.userRead.iconImg;
|
|
|
temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
|
|
|
temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
|
|
|
- temp.classId = item.userRead.lessonId;
|
|
|
+ temp.classId = item.userRead.exampleId;
|
|
|
temp.time = formatDate(item.userRead.gmtCreated, 3);
|
|
|
temp.avatar = item.user ? item.user.avatar : '';
|
|
|
temp.uid = item.user ? item.user.uid : '';
|
|
@@ -441,6 +448,7 @@ Page({
|
|
|
// temp.avatar = item.user.avatar;
|
|
|
temp.nickName = item.user ? item.user.wechatName : '';
|
|
|
temp.id = item.userRead.id;
|
|
|
+ item.noReading = true;
|
|
|
// recommendWorks.push(temp);
|
|
|
// that.data.hotData.hotWorks.push(temp);
|
|
|
this.data.videoList.push(temp);
|
|
@@ -479,4 +487,12 @@ Page({
|
|
|
commentId: e.detail.activeId,
|
|
|
});
|
|
|
},
|
|
|
+ goToReading: function(e){
|
|
|
+ this.setData({
|
|
|
+ pageNo: 1,
|
|
|
+ videoList:[]
|
|
|
+ })
|
|
|
+ const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
|
|
|
+ this.getClassInfo(id)
|
|
|
+ }
|
|
|
})
|