|
@@ -107,7 +107,13 @@ Page({
|
|
|
}
|
|
|
// 刷新资源
|
|
|
if (myIndex == 2) {
|
|
|
- groupInit(this);
|
|
|
+ this.setData({
|
|
|
+ videoList: [],
|
|
|
+ templates: 'coursestao'
|
|
|
+ }, () => {
|
|
|
+ this.getCoursesList();
|
|
|
+
|
|
|
+ })
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -215,6 +221,7 @@ Page({
|
|
|
this.setData({
|
|
|
nextMargin: nextMargin + 'rpx'
|
|
|
})
|
|
|
+ app.globalData.nextMargin = nextMargin;
|
|
|
this.updateData(0)
|
|
|
// hotInit(this)
|
|
|
}, (error) => {
|
|
@@ -261,7 +268,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.id;
|
|
|
+ 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 : '';
|
|
@@ -293,7 +300,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.id;
|
|
|
+ temp.classId = item.userRead.lessonId;
|
|
|
temp.time = formatDate(item.userRead.gmtCreated, 3);
|
|
|
temp.avatar = item.user.avatar;
|
|
|
temp.profession = item.user.profession;
|
|
@@ -333,7 +340,7 @@ Page({
|
|
|
[str]: userLocal
|
|
|
})
|
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
|
- console.log('getUserWorksInfo',res)
|
|
|
+ console.log('getUserWorksInfo', res)
|
|
|
this.data.myData.user = res.data.data;
|
|
|
httpRequestApi.userIntoPage('pages/index/index', '首页我的').success((res) => {})
|
|
|
if (this.data.myData.user.myRead) {
|
|
@@ -342,7 +349,7 @@ Page({
|
|
|
this.setData({
|
|
|
myData: this.data.myData,
|
|
|
userInfo: res.data.data.user
|
|
|
- },()=>{
|
|
|
+ }, () => {
|
|
|
this.getMyRead()
|
|
|
});
|
|
|
}).fail(error => {
|
|
@@ -458,16 +465,16 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
// 获取我的朗读
|
|
|
- getMyRead: function(){
|
|
|
- httpRequestApi.myRead().success(res=>{
|
|
|
+ getMyRead: function () {
|
|
|
+ httpRequestApi.myRead().success(res => {
|
|
|
console.log(res)
|
|
|
- console.log('mydata',this.data.myData)
|
|
|
+ console.log('mydata', this.data.myData)
|
|
|
const myList = res.data.data.list;
|
|
|
if (myList.length === 0) return;
|
|
|
// const recommendWorks = [];
|
|
|
myList.forEach(item => {
|
|
|
- console.log('mydata',this.data.myData)
|
|
|
- console.log('mydata',this.data.userInfo.user)
|
|
|
+ console.log('mydata', this.data.myData)
|
|
|
+ console.log('mydata', this.data.userInfo.user)
|
|
|
|
|
|
const temp = {};
|
|
|
temp.title = item.title;
|
|
@@ -632,7 +639,19 @@ Page({
|
|
|
httpRequestApi.followUser(this.uid, tapId).success(res => {
|
|
|
console.log(res)
|
|
|
})
|
|
|
- }
|
|
|
-
|
|
|
+ },
|
|
|
+ getCoursesList: function () {
|
|
|
+ httpRequestApi.getSearchResult('PRESCHOOL', 1, 10).success(res => {
|
|
|
+ console.log('资源', res)
|
|
|
+ this.setData({
|
|
|
+ coursesData: res.data.data.list
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ goToReading: function (e) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `../../pages/main/reading/reading?id=${e.detail.activeId}`
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
})
|