Component({
  data: {
    selected: 0,
    color: "#999999",
    selectedColor: "#4A90C2",
    list: [
      {
        pagePath: "/pages/home/home",
        text: "首页",
        icon: "⌂"
      },
      {
        pagePath: "/pages/orders/orders", 
        text: "出行",
        icon: "⟐"
      },
      {
        pagePath: "/pages/mall/mall",
        text: "积分",
        icon: "◈"
      },
      {
        pagePath: "/pages/mine/mine",
        text: "我的",
        icon: "⚬"
      }
    ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url,
        success: () => {
          this.setData({
            selected: data.index
          })
        },
        fail: (err) => {
          console.error('Tab switch failed:', err)
        }
      })
    }
  }
})
