// components/shoping-tabbar/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    selected: {
      type: Number,
      value: 0 
    }
  },  

  /**
   * 组件的初始数据
   */
  data: {
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    list: [
      {
        pagePath: "/pages/Home/Home",
        text: "首页",
        iconPath: "/assets/taddar/首页 (1).png",
        selectedIconPath: "/assets/taddar/首页 (2).png"
      },
      {
        pagePath: "/shoping/Soil Acidification/Soil Acidification",
        text: "反酸模型",
        iconPath: "/assets/taddar/pH值.png",
        selectedIconPath: "/assets/taddar/pH值 (1).png"
      },
      {
        pagePath: "/shoping/Soil Deacidification/Soil Deacidification",
        text: "降酸模型",
        iconPath: "/assets/taddar/酸碱度.png",
        selectedIconPath: "/assets/taddar/酸碱度 (1).png"
      },
      {
        pagePath: "/pages/admin/admin",
        text: "管理员登录",
        iconPath: "/assets/taddar/我的 (1).png",
        selectedIconPath: "/assets/taddar/我的.png"
      }
    ]
  },


  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      let data = e.currentTarget.dataset
      let url = data.path
      wx.redirectTo({
        url
      })
    }
  }
})
