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.openClass = (e) => {
    let classId = e.currentTarget.dataset.classid;
    let title = e.currentTarget.dataset.title;
    wx.navigateTo({
      url: `../social/works/works?id=${classId}&title=${title}`
    })
  }
}