|
@@ -27,7 +27,6 @@ Page({
|
|
},
|
|
},
|
|
onLoad: function (option) {
|
|
onLoad: function (option) {
|
|
console.log(option)
|
|
console.log(option)
|
|
- debugger;
|
|
|
|
let id = option.id ? option.id : option.scene.replace('QR', '')
|
|
let id = option.id ? option.id : option.scene.replace('QR', '')
|
|
|
|
|
|
wx.setNavigationBarTitle({
|
|
wx.setNavigationBarTitle({
|
|
@@ -41,13 +40,13 @@ Page({
|
|
this.uid = wx.getStorageSync('uid');
|
|
this.uid = wx.getStorageSync('uid');
|
|
this.getWorks(this.uid, id);
|
|
this.getWorks(this.uid, id);
|
|
},
|
|
},
|
|
- onHide: function(){
|
|
|
|
- if(this.innerAudioContext){
|
|
|
|
|
|
+ onHide: function () {
|
|
|
|
+ if (this.innerAudioContext) {
|
|
this.innerAudioContext.stop();
|
|
this.innerAudioContext.stop();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onUnload: function(){
|
|
|
|
- if(this.innerAudioContext){
|
|
|
|
|
|
+ onUnload: function () {
|
|
|
|
+ if (this.innerAudioContext) {
|
|
this.innerAudioContext.stop();
|
|
this.innerAudioContext.stop();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -60,7 +59,7 @@ Page({
|
|
const works = res.data.data.userRead;
|
|
const works = res.data.data.userRead;
|
|
const othersTemp = [];
|
|
const othersTemp = [];
|
|
others.forEach((item) => {
|
|
others.forEach((item) => {
|
|
- const temp = {};
|
|
|
|
|
|
+ const temp = {};
|
|
temp.uid = item.userRead.id;
|
|
temp.uid = item.userRead.id;
|
|
temp.title = item.userRead.title;
|
|
temp.title = item.userRead.title;
|
|
temp.image = item.user.avatar;
|
|
temp.image = item.user.avatar;
|
|
@@ -68,7 +67,7 @@ Page({
|
|
othersTemp.push(temp);
|
|
othersTemp.push(temp);
|
|
});
|
|
});
|
|
this.setData({
|
|
this.setData({
|
|
- user: othersTemp,
|
|
|
|
|
|
+ user: othersTemp,
|
|
totalRead: res.data.data.totalRead,
|
|
totalRead: res.data.data.totalRead,
|
|
author: author.wechatName,
|
|
author: author.wechatName,
|
|
authorAvatar: author.avatar,
|
|
authorAvatar: author.avatar,
|
|
@@ -141,11 +140,37 @@ Page({
|
|
this.innerAudioContext.pause();
|
|
this.innerAudioContext.pause();
|
|
},
|
|
},
|
|
goToReading: function () {
|
|
goToReading: function () {
|
|
- let id = this.data.id;
|
|
|
|
- let title = this.data.title;
|
|
|
|
- wx.navigateTo({
|
|
|
|
- url: `../../main/reading/reading?id=${this.data.classId}`
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ // wx.navigateTo({
|
|
|
|
+ // url: `../../main/reading/reading?id=${this.data.classId}`
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ const classId = this.data.classId;
|
|
|
|
+ httpRequestApi.checkLesson(classId).success(res => {
|
|
|
|
+ const productId = res.data.data[0];
|
|
|
|
+ httpRequestApi.areYouSuper(res.data.data).success(res => {
|
|
|
|
+ if (res.data.success) {
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `../../main/reading/reading?id=${classId}`
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: '您未购买过本书,不能朗读',
|
|
|
|
+ content: '超值团购进行中,快去看看',
|
|
|
|
+ success(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ console.log('用户点击确定')
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: `../../groupPage/grade-details/grade-details?productId=${productId}`
|
|
|
|
+ })
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
+ console.log('用户点击取消')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
},
|
|
},
|
|
onShareAppMessage: function (res) {
|
|
onShareAppMessage: function (res) {
|
|
if (res.from === 'button') {
|
|
if (res.from === 'button') {
|
|
@@ -204,7 +229,7 @@ Page({
|
|
// 去其他用户的作品页
|
|
// 去其他用户的作品页
|
|
goToOthers: function (e) {
|
|
goToOthers: function (e) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
- url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}`
|
|
|
|
|
|
+ url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}`
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 查询回复
|
|
// 查询回复
|