index.js 1.3 KB

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