index.js 887 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const app = getApp()
  2. Component({
  3. data: {
  4. selected: '',
  5. color: "#7A7E83",
  6. selectedColor: "#409eff",
  7. list: [{
  8. "pagePath": "/pages/home/index",
  9. "iconPath": "/image/home1.png",
  10. "selectedIconPath": "/image/home2.png",
  11. "text": "首页"
  12. },
  13. {
  14. "pagePath": "/pages/reserve/index",
  15. "iconPath": "/image/reserve1.png",
  16. "selectedIconPath": "/image/reserve2.png",
  17. "text": "报餐"
  18. },
  19. {
  20. "pagePath": "/pages/my/index",
  21. "iconPath": "/image/my1.png",
  22. "selectedIconPath": "/image/my2.png",
  23. "text": "我的"
  24. }]
  25. },
  26. attached() {
  27. },
  28. methods: {
  29. switchTab(e) {
  30. const { index, path } = e.currentTarget.dataset;
  31. wx.switchTab({ url: path })
  32. // wx.switchTab({ url })
  33. // wx.reLaunch({ url })
  34. // this.setData({
  35. // selected: data.index
  36. // })
  37. }
  38. }
  39. })