import APIClient from '../../utils/APIClient';
const app = getApp();
export const myInit = (that) => {
  that.setData({
    myData: {
      title: '修改资料',
      concern: '我的关注',
      course: '我的课程',
      read: '我的朗读',
      keep: '我的收藏',
      collage: '我的拼团',
      wallet: '我的钱包',
      schoolCity: '',
      schoolName: '',
      user: {},
      isIOS: app.globalData.isIOS
    }
  });
  that.getUserWorksInfo();
  that.toMyEdit = (e) => {
      let title = e.currentTarget.dataset.title;
      wx.navigateTo({
        url: `../user/myEdit/myEdit?title=${title}`
      });
    },
    that.toMyConcern = e => {
      let title = e.currentTarget.dataset.title;
      wx.navigateTo({
        url: `../user/myconcern/myconcern?title=${title}`
      });
    }
  that.toMyWallet = e => {
      let title = e.currentTarget.dataset.title;
      wx.navigateTo({
        url: `../user/myWallet/myWallet?title=${title}`
      });
    },
    that.toMyCourse = e => {
      let title = e.currentTarget.dataset.title;
      wx.navigateTo({
        url: `../user/mycourse/mycourse?title=${title}`
      });
    },
    that.toMyRead = e => {
      let title = e.currentTarget.dataset.title;
      wx.navigateTo({
        url: `../user/myread/myread?title=${title}`
      });
    },
    that.toMyKeep = e => {
      let title = e.currentTarget.dataset.title;
      wx.navigateTo({
        url: `../user/mycollection/mycollection?title=${title}`
      });
    },
    that.toMyCollage = e => {
      let title = e.currentTarget.dataset.title;
      if(app.globalData.isIOS){
        wx.navigateTo({
          url: `../../pages/groupPage/my-group/my-group?title=我的助力`
        });
      }else {
        wx.navigateTo({
          url: `../../pages/groupPage/my-group/my-group?title=${title}`
        });
      }
      
    }
    
}