index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // components/shoping-tabbar/index.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. selected: {
  8. type: Number,
  9. value: 0
  10. }
  11. },
  12. /**
  13. * 组件的初始数据
  14. */
  15. data: {
  16. color: "#7A7E83",
  17. selectedColor: "#3cc51f",
  18. list: [
  19. {
  20. pagePath: "/pages/Home/Home",
  21. text: "首页",
  22. iconPath: "/assets/taddar/首页 (1).png",
  23. selectedIconPath: "/assets/taddar/首页 (2).png"
  24. },
  25. {
  26. pagePath: "/shoping/Soil Acidification/Soil Acidification",
  27. text: "反酸模型",
  28. iconPath: "/assets/taddar/pH值.png",
  29. selectedIconPath: "/assets/taddar/pH值 (1).png"
  30. },
  31. {
  32. pagePath: "/shoping/Soil Deacidification/Soil Deacidification",
  33. text: "降酸模型",
  34. iconPath: "/assets/taddar/酸碱度.png",
  35. selectedIconPath: "/assets/taddar/酸碱度 (1).png"
  36. },
  37. {
  38. pagePath: "/pages/admin/admin",
  39. text: "管理员登录",
  40. iconPath: "/assets/taddar/我的 (1).png",
  41. selectedIconPath: "/assets/taddar/我的.png"
  42. }
  43. ]
  44. },
  45. /**
  46. * 组件的方法列表
  47. */
  48. methods: {
  49. switchTab(e) {
  50. let data = e.currentTarget.dataset
  51. let url = data.path
  52. wx.redirectTo({
  53. url
  54. })
  55. }
  56. }
  57. })