my.js 1.3 KB

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