index.js 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {
  2. getMyInfo,
  3. } from '~/api/user'
  4. import {
  5. getSaleData
  6. } from '~/api/sale'
  7. import {
  8. createStoreBindings
  9. } from 'mobx-miniprogram-bindings'
  10. import {
  11. store
  12. } from '~/store/index'
  13. Page({
  14. data: {
  15. userInfo: {},
  16. allIncome: {}
  17. },
  18. async onLoad() {
  19. // 手工绑定
  20. this.storeBindings = createStoreBindings(this, {
  21. store,
  22. fields: {
  23. userInfo: 'userInfo',
  24. }
  25. })
  26. },
  27. async onShow() {
  28. let allIncome = await getSaleData()
  29. console.log(allIncome);
  30. this.setData({
  31. allIncome
  32. })
  33. },
  34. jump({
  35. currentTarget
  36. }) {
  37. wx.navigateTo({
  38. url: `/salesperson/pages/${currentTarget.dataset.url}/index`,
  39. })
  40. },
  41. openInvite() {
  42. this.selectComponent("#InvitePop").openInvite()
  43. },
  44. /**
  45. * 用户点击右上角分享
  46. */
  47. onShareAppMessage() {
  48. }
  49. })