my.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import APIClient from '../../utils/APIClient'
  2. export const myInit = (that) => {
  3. that.setData({
  4. myData: {
  5. title: '修改资料',
  6. concern: '我的关注',
  7. address:['北京海淀','中关村','三小'],
  8. playNum: 31549,
  9. attentionCount: 10254,
  10. point: 6317,
  11. flowerNum: 56245,
  12. user: {}
  13. }
  14. })
  15. that.toMyEdit = (e) => {
  16. let title = e.currentTarget.dataset.title;
  17. wx.navigateTo({
  18. url: `../user/myEdit/myEdit?title=${title}`
  19. });
  20. },
  21. that.toMyConcern = e => {
  22. let title = e.currentTarget.dataset.title;
  23. wx.navigateTo({
  24. url: `../user/myconcern/myconcern?title=${title}`
  25. });
  26. }
  27. that.toMyWallet = e => {
  28. let title = e.currentTarget.dataset.title;
  29. wx.navigateTo({
  30. url: `../user/myWallet/myWallet?title=${title}`
  31. });
  32. }
  33. that.userInfo = function () {
  34. // APIClient.getUserInfo()
  35. const userInfo = wx.getStorageSync('user');
  36. console.log(userInfo);
  37. // getOpenidSessionKey((res) => {
  38. // console.log('个人',res);
  39. // that.data.myData.user = res.data.data.data;
  40. // that.setData({
  41. // myData: that.data.myData
  42. // })
  43. // },(error) => {
  44. //
  45. // })
  46. }()
  47. }