my.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. if(app.globalData.isIOS){
  59. wx.navigateTo({
  60. url: `../../pages/groupPage/my-group/my-group?title=我的助力`
  61. });
  62. }else {
  63. wx.navigateTo({
  64. url: `../../pages/groupPage/my-group/my-group?title=${title}`
  65. });
  66. }
  67. }
  68. }