index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const app = getApp();
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. },
  8. data: {
  9. selected: null,
  10. color: "#999999",
  11. selectedColor: "#508FF4",
  12. list: [{
  13. "selectedIconPath": "/pages/images/f-sy2.png",
  14. "iconPath": "/pages/images/f-sy.png",
  15. "pagePath": "/pages/index/index",
  16. "text": "首页"
  17. },
  18. {
  19. "selectedIconPath": "/pages/images/f-gk2.png",
  20. "iconPath": "/pages/images/f-gk.png",
  21. "pagePath": "/pages/publics/index/index",
  22. "text": "公开"
  23. },
  24. {
  25. "pagePath": "/pages/nais/nais",
  26. "isSpecial": true,
  27. "text": "这是南岸"
  28. },
  29. {
  30. "selectedIconPath": "/pages/images/f-fw2.png",
  31. "iconPath": "/pages/images/f-fw.png",
  32. "pagePath": "/pages/serve/serve",
  33. "text": "服务"
  34. },
  35. {
  36. "selectedIconPath": "/pages/images/f-wd2.png",
  37. "iconPath": "/pages/images/f-wd.png",
  38. "pagePath": "/pages/myCenter/myCenter",
  39. "text": "我的"
  40. }
  41. ]
  42. },
  43. methods: {
  44. switchTab(e) {
  45. const data = e.currentTarget.dataset
  46. const url = data.path
  47. this.setData({
  48. selected: data.index
  49. })
  50. wx.switchTab({url})
  51. }
  52. }
  53. })