my.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import APIClient from '../../utils/APIClient';
  2. const app = getApp();
  3. export const myInit = (that) => {
  4. that.setData({
  5. myData: {
  6. title: '修改资料',
  7. concern: '我的关注',
  8. course: '我的课程',
  9. read: '我的朗读',
  10. keep: '我的收藏',
  11. collage: '我的拼团',
  12. wallet: '我的钱包',
  13. schoolCity: '',
  14. schoolName: '',
  15. user: {},
  16. isIOS: app.globalData.isIOS
  17. }
  18. });
  19. that.getUserWorksInfo();
  20. that.toMyEdit = (e) => {
  21. let title = e.currentTarget.dataset.title;
  22. wx.navigateTo({
  23. url: `../user/myEdit/myEdit?title=${title}`
  24. });
  25. },
  26. that.toMyConcern = e => {
  27. let title = e.currentTarget.dataset.title;
  28. wx.navigateTo({
  29. url: `../user/myconcern/myconcern?title=${title}`
  30. });
  31. }
  32. that.toMyWallet = e => {
  33. let title = e.currentTarget.dataset.title;
  34. wx.navigateTo({
  35. url: `../user/myWallet/myWallet?title=${title}`
  36. });
  37. },
  38. that.toMyCourse = e => {
  39. let title = e.currentTarget.dataset.title;
  40. wx.navigateTo({
  41. url: `../user/mycourse/mycourse?title=${title}`
  42. });
  43. },
  44. that.toMyRead = e => {
  45. let title = e.currentTarget.dataset.title;
  46. wx.navigateTo({
  47. url: `../user/myread/myread?title=${title}`
  48. });
  49. },
  50. that.toMyKeep = e => {
  51. let title = e.currentTarget.dataset.title;
  52. wx.navigateTo({
  53. url: `../user/mycollection/mycollection?title=${title}`
  54. });
  55. },
  56. that.toMyCollage = e => {
  57. let title = e.currentTarget.dataset.title;
  58. wx.navigateTo({
  59. url: `../../pages/groupPage/my-group/my-group?title=${title}`
  60. });
  61. }
  62. }