Component({
  data: {
    selected: 0,
    list: [
      {
        pagePath: 'pages/tab-bar/medicine-box/index',
        text: '电子药箱',
        icon: '💊',
      },
      {
        pagePath: 'pages/tab-bar/drug-wiki/index',
        text: '药品百科',
        icon: '📖',
      },
      {
        pagePath: 'pages/tab-bar/education/index',
        text: '惠教中心',
        icon: '🎓',
      },
      {
        pagePath: 'pages/tab-bar/profile/index',
        text: '我的',
        icon: '👤',
      },
    ],
  },
  methods: {
    switchTab(e: WechatMiniprogram.TouchEvent) {
      const { index, path } = e.currentTarget.dataset;
      wx.switchTab({ url: `/${path}` });
    },
  },
});
