index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Component({
  2. data: {
  3. selected: 0,
  4. selectedColor: "#1195db",
  5. color: "#8a8a8a",
  6. list: [
  7. {
  8. pagePath: "/pages/takePhoto/takePhoto",
  9. text: "货盘",
  10. selectedIconPath: "../images/tabs/camera-.png",
  11. iconPath: "../images/tabs/camera.png",
  12. },
  13. {
  14. pagePath: "/pages/cert/cert",
  15. text: "证书",
  16. selectedIconPath: "../images/tabs/cert-.png",
  17. iconPath: "../images/tabs/cert.png",
  18. },
  19. {
  20. pagePath: "/pages/maritime/maritime",
  21. text: "海事/法务",
  22. selectedIconPath: "../images/tabs/ship-.png",
  23. iconPath: "../images/tabs/ship.png",
  24. },
  25. {
  26. pagePath: "/pages/securityCheck/securityCheck",
  27. text: "年检",
  28. selectedIconPath: "../images/tabs/check-.png",
  29. iconPath: "../images/tabs/check.png",
  30. },
  31. {
  32. pagePath: "/pages/shipyard/shipyard",
  33. text: "船厂",
  34. selectedIconPath: "../images/tabs/oilPrice-.png",
  35. iconPath: "../images/tabs/oilPrice.png",
  36. },
  37. {
  38. pagePath: "/pages/school/school",
  39. text: "学校",
  40. selectedIconPath: "../images/tabs/legal-.png",
  41. iconPath: "../images/tabs/legal.png",
  42. },
  43. ],
  44. },
  45. attached() {},
  46. methods: {
  47. switchTab(e) {
  48. const data = e.currentTarget.dataset;
  49. const url = data.path;
  50. wx.switchTab({
  51. url,
  52. success: () => {
  53. this.setData({
  54. selected: data.index,
  55. });
  56. },
  57. });
  58. },
  59. },
  60. });