index.js 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {
  2. getVipInfo,
  3. } from '~/api/user'
  4. import {
  5. formatDate
  6. } from '~/utils/util'
  7. Component({
  8. data: {
  9. show: false,
  10. vipTime: ''
  11. },
  12. methods: {
  13. open() {
  14. if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  15. this.getTabBar().setData({
  16. mask: true
  17. })
  18. }
  19. this.getVipInfo()
  20. this.setData({
  21. show: true
  22. })
  23. },
  24. closeModal() {
  25. this.setData({
  26. show: false
  27. })
  28. if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  29. this.getTabBar().setData({
  30. mask: false
  31. })
  32. }
  33. },
  34. async getVipInfo() {
  35. let vipTime = await getVipInfo()
  36. this.setData({
  37. vipTime
  38. })
  39. },
  40. }
  41. })