login-pannel.js 763 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { loginByUserInfo } from './../../utils/login'
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. visible: Boolean
  8. },
  9. /**
  10. * 组件的初始数据
  11. */
  12. data: {
  13. show: false
  14. },
  15. ready () {
  16. this.showPannel()
  17. },
  18. /**
  19. * 组件的方法列表
  20. */
  21. methods: {
  22. bindgetuserinfo () {
  23. loginByUserInfo().then(res => {
  24. this.triggerEvent('loginSuccess')
  25. })
  26. },
  27. showPannel () {
  28. this.animation = wx.createAnimation({
  29. duration: 200,
  30. timingFunction: 'ease'
  31. })
  32. this.animation.translateY(8).step()
  33. this.setData({
  34. animationData: this.animation.export(),
  35. show: true
  36. })
  37. },
  38. hide () {
  39. this.triggerEvent('hide')
  40. }
  41. }
  42. })