index.js 1.3 KB

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