index.js 544 B

12345678910111213141516171819202122232425262728293031
  1. const app = getApp()
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. userList: {
  8. type: Array
  9. }
  10. },
  11. /**
  12. * 组件的初始数据
  13. */
  14. data: {
  15. },
  16. /**
  17. * 组件的方法列表
  18. */
  19. methods: {
  20. loginAccount(e) {
  21. //全局储存
  22. wx.setStorageSync('token', this.data.userList[e.currentTarget.dataset.index].token)
  23. wx.reLaunch({
  24. url: '/pages/tabbarPage/Home/index'
  25. })
  26. }
  27. }
  28. })