index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Component({
  2. data: {
  3. selected: 0,
  4. color: "#7A7E83",
  5. selectedColor: "#3cc51f",
  6. list: [
  7. {
  8. pagePath: "/pages/index/index",
  9. text: "首页",
  10. iconPath: "/static/tabbar/index.png",
  11. selectedIconPath: "/static/tabbar/index-active.png"
  12. },
  13. {
  14. pagePath: "/pages/store/store",
  15. text: "门店",
  16. iconPath: "/static/tabbar/store.png",
  17. selectedIconPath: "/static/tabbar/store-active.png"
  18. },
  19. {
  20. pagePath: "/pages/mine/mine",
  21. text: "我的",
  22. iconPath: "/static/tabbar/me.png",
  23. selectedIconPath: "/static/tabbar/me-active.png"
  24. }
  25. ],
  26. showShare: false,
  27. },
  28. methods: {
  29. switchTab(e) {
  30. const { path, index } = e.currentTarget.dataset
  31. wx.switchTab({ url: path })
  32. this.setData({ selected: index })
  33. },
  34. onCloseShare() {
  35. this.setData({ showShare: false })
  36. },
  37. openShare() {
  38. this.setData({ showShare: true })
  39. },
  40. // 分享逻辑
  41. onShareAppMessage() {
  42. return {
  43. title: '这里是分享标题',
  44. path: '/pages/index/index',
  45. imageUrl: '/static/tabbar/weixin.png'
  46. }
  47. },
  48. // onShareTimeline() {
  49. // return {
  50. // title: '分享到朋友圈标题',
  51. // query: 'id=123',
  52. // imageUrl: '/static/tabbar/tp.png'
  53. // }
  54. // },
  55. }
  56. })