|
@@ -19,6 +19,7 @@ export const hotInit = (that) => {
|
|
|
banner: [],
|
|
|
recommend: [],
|
|
|
hotWorks: [],
|
|
|
+ winH: that.data.winH
|
|
|
}
|
|
|
}),
|
|
|
// 搜索方法
|
|
@@ -70,7 +71,7 @@ export const hotInit = (that) => {
|
|
|
httpRequestApi.getIndex(
|
|
|
uid
|
|
|
).success((res) => {
|
|
|
-
|
|
|
+
|
|
|
const banner = res.data.data.banner;
|
|
|
const recommend = res.data.data.recommendLesson;
|
|
|
const bannerTemp = [];
|
|
@@ -79,7 +80,7 @@ export const hotInit = (that) => {
|
|
|
temp.url = item.boothContent;
|
|
|
temp.type = item.operationType;
|
|
|
temp.id = item.operationContent;
|
|
|
-
|
|
|
+
|
|
|
bannerTemp.push(temp);
|
|
|
});
|
|
|
const recommendTemp = [];
|
|
@@ -105,24 +106,28 @@ export const hotInit = (that) => {
|
|
|
pageNo,
|
|
|
pageSize
|
|
|
).success((res) => {
|
|
|
- const recommendRes = res.data.data.list;
|
|
|
- const recommendWorks = [];
|
|
|
- recommendRes.forEach(item => {
|
|
|
- const temp = {};
|
|
|
- temp.title = item.userRead.title;
|
|
|
- temp.grade = item.userRead.title;
|
|
|
- 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;
|
|
|
- recommendWorks.push(temp);
|
|
|
- });
|
|
|
- const hotStr = 'hotData.hotWorks'
|
|
|
- that.setData({
|
|
|
- [hotStr]: recommendWorks
|
|
|
- })
|
|
|
+ console.log(res)
|
|
|
+ const recommendRes = res.data.data.list;
|
|
|
+ // const recommendWorks = [];
|
|
|
+ recommendRes.forEach(item => {
|
|
|
+ const temp = {};
|
|
|
+ temp.title = item.userRead.title;
|
|
|
+ temp.grade = item.userRead.title;
|
|
|
+ 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;
|
|
|
+ // recommendWorks.push(temp);
|
|
|
+ that.data.hotData.hotWorks.push(temp);
|
|
|
+ });
|
|
|
+ const hotStr = 'hotData.hotWorks'
|
|
|
+ that.setData({
|
|
|
+ [hotStr]: that.data.hotData.hotWorks,
|
|
|
+ recommendTotalNo: res.data.data.totalNo
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
// 去全部课本
|
|
|
that.goToBooks = () => {
|
|
|
wx.navigateTo({
|
|
@@ -134,10 +139,14 @@ export const hotInit = (that) => {
|
|
|
const id = e.currentTarget.dataset.id;
|
|
|
switch (type) {
|
|
|
case 'LESSON':
|
|
|
- that.openClass('tap',id);
|
|
|
+ that.openClass('tap', id);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ // 下拉加载
|
|
|
+ that.scrollUpdate = (e) => {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
that.getIndex();
|
|
|
that.getHotRecommend(1, 1, 3)
|
|
|
}
|