index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Component({
  2. data: {
  3. selected: 0,
  4. show: true,
  5. color: "#7A7E83",
  6. selectedColor: "#00B760",
  7. list: [
  8. {
  9. "pagePath": "/pages/index/position",
  10. "text": "求职",
  11. "iconPath": "/static/img/position.png",
  12. "selectedIconPath": "/static/img/position-fill.png"
  13. },
  14. {
  15. "pagePath": "/pages/index/communicate",
  16. "text": "沟通",
  17. "iconPath": "/static/img/message.png",
  18. "selectedIconPath": "/static/img/message-fill.png"
  19. },
  20. {
  21. "pagePath": "/pages/index/welfare",
  22. "text": "会员福利",
  23. "center": true,
  24. "iconPath": "/static/img/welfare.png",
  25. "selectedIconPath": "/static/img/welfare.png"
  26. },
  27. {
  28. "pagePath": "/pages/index/crowdsourcing",
  29. "text": "赏金",
  30. "iconPath": "/static/img/pin.png",
  31. "selectedIconPath": "/static/img/pin-fill.png"
  32. },
  33. {
  34. "pagePath": "/pages/index/my",
  35. "text": "我的",
  36. "iconPath": "/static/img/my.png",
  37. "selectedIconPath": "/static/img/my-fill.png"
  38. }
  39. ]
  40. },
  41. lifetimes: {
  42. },
  43. methods: {
  44. switchTab(e) {
  45. const data = e.currentTarget.dataset
  46. const url = data.path
  47. wx.switchTab({
  48. url
  49. })
  50. this.setData({
  51. selected: data.index
  52. })
  53. }
  54. }
  55. })