index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import {
  2. getMyInfo,
  3. } from '~/api/user'
  4. import event from '~/mixins/event'
  5. import {
  6. getSaleData
  7. } from '~/api/sale'
  8. import {
  9. createStoreBindings
  10. } from 'mobx-miniprogram-bindings'
  11. import {
  12. store
  13. } from '~/store/index'
  14. Page({
  15. behaviors: [event],
  16. data: {
  17. allIncome: {}
  18. },
  19. async onLoad() {
  20. // 手工绑定
  21. this.storeBindings = createStoreBindings(this, {
  22. store,
  23. fields: {
  24. userInfo: 'userInfo',
  25. }
  26. })
  27. },
  28. async onShow() {
  29. let allIncome = await getSaleData()
  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. onShareAppMessage() {
  45. // #if MP
  46. return {
  47. title: '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
  48. path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
  49. imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300.png',
  50. }
  51. // #elif ANDROID
  52. return {
  53. title: '这个小程序太赞了!孩子朗读能力蹭蹭上涨,推荐你试试!',
  54. userName: 'gh_50f61361ad1d',
  55. path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
  56. imagePath: '/static/375-300-1.jpg',
  57. webpageUrl: 'http://www.efunbox.cn',
  58. withShareTicket: true,
  59. miniprogramType: 1,
  60. scene: 0,
  61. }
  62. // #endif
  63. }
  64. })