index.js 1.2 KB

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