|
@@ -100,7 +100,8 @@ Page({
|
|
|
// 获取推荐列表
|
|
|
if (myIndex == 0) {
|
|
|
this.setData({
|
|
|
- videoList: []
|
|
|
+ videoList: [],
|
|
|
+ isSwiper: true
|
|
|
}, () => {
|
|
|
this.getHotRecommend(this.uid);
|
|
|
})
|
|
@@ -131,7 +132,8 @@ Page({
|
|
|
// 刷新关注列表
|
|
|
if (myIndex == 1) {
|
|
|
this.setData({
|
|
|
- videoList: []
|
|
|
+ videoList: [],
|
|
|
+ isSwiper: true
|
|
|
}, () => {
|
|
|
this.getFollowData()
|
|
|
})
|
|
@@ -141,7 +143,8 @@ Page({
|
|
|
if (myIndex == 3) {
|
|
|
this.setData({
|
|
|
videoList: [],
|
|
|
- templates: 'my'
|
|
|
+ templates: 'my',
|
|
|
+ isSwiper: false
|
|
|
}, () => {
|
|
|
myInit(this);
|
|
|
})
|
|
@@ -208,7 +211,7 @@ Page({
|
|
|
getOpenidNoLogin((res) => {
|
|
|
let winH = this.data.winH * this.data.devicePixelRatio;
|
|
|
// let minusNumber = 860;
|
|
|
- let minusNumber = (winH * 880) / 1206;
|
|
|
+ let minusNumber = (winH * 920) / 1206;
|
|
|
|
|
|
// if(winH < 510){
|
|
|
// minusNumber = 400;
|
|
@@ -260,7 +263,7 @@ Page({
|
|
|
uid
|
|
|
).success((res) => {
|
|
|
// 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
|
|
|
- const recommendRes = res.data.data;
|
|
|
+ /* const recommendRes = res.data.data;
|
|
|
console.log(res)
|
|
|
recommendRes.hotReader.forEach(item => {
|
|
|
const temp = {};
|
|
@@ -268,27 +271,30 @@ 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.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
|
|
|
temp.classId = item.userRead.lessonId;
|
|
|
temp.time = formatDate(item.userRead.gmtCreated, 3);
|
|
|
temp.avatar = item.user ? item.user.avatar : '';
|
|
|
temp.uid = item.user ? item.user.uid : '';
|
|
|
temp.url = item.userRead.originVideo;
|
|
|
+ temp.type = item.userRead.type;
|
|
|
// temp.avatar = item.user.avatar;
|
|
|
temp.nickName = item.user ? item.user.wechatName : '';
|
|
|
temp.id = item.userRead.id;
|
|
|
- // recommendWorks.push(temp);
|
|
|
- // that.data.hotData.hotWorks.push(temp);
|
|
|
+ temp.isLike = item.isLike;
|
|
|
+ temp.isFavorite = item.isFavorites;
|
|
|
this.data.videoList.push(temp);
|
|
|
});
|
|
|
this.setData({
|
|
|
videoList: this.data.videoList
|
|
|
- })
|
|
|
- this.getHotRecommendSecond(this.uid, 1, 5)
|
|
|
+ }) */
|
|
|
+ this.getHotRecommendSecond(1, 5)
|
|
|
})
|
|
|
},
|
|
|
// 获取热门作品 算法出来的
|
|
|
- getHotRecommendSecond: function (uid, pageNo, pageSize) {
|
|
|
- httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
|
|
|
+ getHotRecommendSecond: function (pageNo, pageSize) {
|
|
|
+ let grade = 'PRIMARY_FIRST_GRADE'
|
|
|
+ httpRequestApi.getHotRecommendSecond(grade, pageNo, pageSize).success(res => {
|
|
|
console.log(res)
|
|
|
const recommendRes = res.data.data.list;
|
|
|
if (recommendRes.length === 0) return;
|
|
@@ -300,15 +306,19 @@ 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.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
|
|
|
+ temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
|
|
|
temp.time = formatDate(item.userRead.gmtCreated, 3);
|
|
|
temp.avatar = item.user.avatar;
|
|
|
temp.profession = item.user.profession;
|
|
|
temp.uid = item.user.uid;
|
|
|
- temp.url = item.userRead.originVideo;
|
|
|
+ temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
|
|
|
temp.id = item.userRead.id;
|
|
|
+ temp.type = item.userRead.type;
|
|
|
// temp.avatar = item.user.avatar;
|
|
|
temp.nickName = item.user.wechatName;
|
|
|
+ temp.isLike = item.isLike;
|
|
|
+ temp.isFavorite = item.isFavorites;
|
|
|
// recommendWorks.push(temp);
|
|
|
this.data.videoList.push(temp);
|
|
|
|
|
@@ -467,9 +477,9 @@ Page({
|
|
|
// 获取我的朗读
|
|
|
getMyRead: function () {
|
|
|
httpRequestApi.myRead().success(res => {
|
|
|
- console.log(res)
|
|
|
+ console.log(123123,res)
|
|
|
console.log('mydata', this.data.myData)
|
|
|
- const myList = res.data.data.list;
|
|
|
+ const myList = res.data.data;
|
|
|
if (myList.length === 0) return;
|
|
|
// const recommendWorks = [];
|
|
|
myList.forEach(item => {
|
|
@@ -482,11 +492,11 @@ Page({
|
|
|
temp.img = item.iconImg;
|
|
|
temp.plays = item.playAmount;
|
|
|
temp.likes = item.likeAmount;
|
|
|
- temp.classId = item.lessonId;
|
|
|
+ temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
|
|
|
temp.time = formatDate(item.gmtCreated, 3);
|
|
|
temp.avatar = this.data.userInfo.avatar;
|
|
|
temp.uid = this.uid;
|
|
|
- temp.url = item.originVideo;
|
|
|
+ temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
|
|
|
temp.id = item.id;
|
|
|
// temp.avatar = item.user.avatar;
|
|
|
temp.nickName = this.data.userInfo.wechatName;
|
|
@@ -514,9 +524,9 @@ Page({
|
|
|
this.setData({
|
|
|
commentShow: !this.data.commentShow,
|
|
|
commentId: e.detail.activeId,
|
|
|
- commentList: []
|
|
|
+ // commentList: []
|
|
|
});
|
|
|
- this.getReply(e.detail.activeId);
|
|
|
+ // this.getReply(e.detail.activeId);
|
|
|
},
|
|
|
// 获取评论信息
|
|
|
getReply: function (columnId) {
|
|
@@ -528,7 +538,7 @@ Page({
|
|
|
console.log('reply', res)
|
|
|
const commentList = res.data.data.list;
|
|
|
const commentNum = res.data.data.totalSize;
|
|
|
-
|
|
|
+ console.log('评论数量',commentNum)
|
|
|
commentList.forEach((item) => {
|
|
|
const temp = {};
|
|
|
temp.nickName = item.user.wechatName;
|
|
@@ -617,11 +627,11 @@ 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.id;
|
|
|
+ temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
|
|
|
temp.time = formatDate(item.userRead.gmtCreated, 3);
|
|
|
temp.avatar = item.user ? item.user.avatar : '';
|
|
|
temp.uid = item.user ? item.user.uid : '';
|
|
|
- temp.url = item.userRead.originVideo;
|
|
|
+ temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
|
|
|
temp.nickName = item.user ? item.user.wechatName : '';
|
|
|
temp.id = item.userRead.id;
|
|
|
this.data.videoList.push(temp);
|
|
@@ -651,6 +661,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
goToReading: function (e) {
|
|
|
+ console.log('去朗读',e)
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/main/reading/reading?id=${e.detail.activeId}`
|
|
|
});
|