import httpRequestApi from '../../utils/APIClient'; export const hotInit = (that) => { that.setData({ hotData: { title: '热门', imgUrls: [ 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' ], indicatorDots: true, autoplay: true, interval: 5000, duration: 700, circular: true, hotWareCardFirst: 'hotWareCardFirst', hotWareCard : 'hotWareCard', hotSearch: '鹅鹅鹅', wareCards:[ { title:"铺满色巴掌的水泥道", grade:"一年级 上学期", img: "../../static/image/timg.jpg", plays: "1", likes: "2", classId: "1" }, { title:"铺满金色巴掌的水泥道", grade:"一年级 上学期", img: "../../static/image/timg.jpg", plays: "12345", likes: "54321", classId: "2" }, { title:"铺满金色巴掌的水泥道", grade:"一年级 上学期", img: "../../static/image/timg.jpg", plays: "12345", likes: "54321", classId: "2" }, ] } }), // 搜索方法 that.searchHandler = () => { console.log('搜索按钮') console.log(that.data.hotInput); }, // 输入框输入 that.inputHandler = (e) => { that.setData({ hotInput: e.detail.value }); console.log(that.data.hotInput) } // 打开课程页面 that.openBooks = (e) =>{ wx.navigateTo({ url: `../main/books/books` }) } // 打开课程页面 that.openClass = (e) =>{ let classId = e.currentTarget.dataset.classid; let title = e.currentTarget.dataset.title; wx.navigateTo({ url: `../main/class/class?id=${classId}&title=${title}` }) } // 打开用户作品页面 that.openWorks = (e) =>{ let classId = e.currentTarget.dataset.classid; let title = e.currentTarget.dataset.title; wx.navigateTo({ url: `../social/works/works?id=${classId}&title=${title}` }) } that.getIndex = (uid)=>{ httpRequestApi.getIndex({ uid }).success((res)=>{ console.log(res); }) } that.getHotRecommend = (uid,pageNo,pageSize)=>{ console.log(pageNo) httpRequestApi.getHotRecommend( uid, pageNo, pageSize ).success((res)=>{ console.log(res); }) } that.getIndex(1); that.getHotRecommend(1,1,3) }