index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. path: '/pages/index/index',
  44. imageUrl: '/static/tabbar/weixin.png'
  45. }
  46. },
  47. // onShareTimeline() {
  48. // return {
  49. // title: '分享到朋友圈标题',
  50. // query: 'id=123',
  51. // imageUrl: '/static/tabbar/tp.png'
  52. // }
  53. // },
  54. }
  55. })