Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    list: [
      {
        pagePath: "/pages/index/index",
        text: "首页",
        iconPath: "/static/tabbar/index.png",
        selectedIconPath: "/static/tabbar/index-active.png"
      },
      {
        pagePath: "/pages/store/store",
        text: "门店",
        iconPath: "/static/tabbar/store.png",
        selectedIconPath: "/static/tabbar/store-active.png"
      },
      {
        pagePath: "/pages/mine/mine",
        text: "我的",
        iconPath: "/static/tabbar/me.png",
        selectedIconPath: "/static/tabbar/me-active.png"
      }
    ],
    showShare: false,
  },
  methods: {
    switchTab(e) {
      const { path, index } = e.currentTarget.dataset
      wx.switchTab({ url: path })
      this.setData({ selected: index })
    },
    onCloseShare() {
      this.setData({ showShare: false })
    },
    openShare() {
      this.setData({ showShare: true })
    },
    // 分享逻辑
    onShareAppMessage() {
      return {
        title: '这里是分享标题',
        path: '/pages/index/index',
        imageUrl: '/static/tabbar/weixin.png'
      }
    },
    // onShareTimeline() {
    //   return {
    //     title: '分享到朋友圈标题',
    //     query: 'id=123',
    //     imageUrl: '/static/tabbar/tp.png'
    //   }
    // },
  }
})
