index.js 881 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const app = getApp()
  2. const bus = app.globalData.bus
  3. Component({
  4. data: {
  5. curtTab: 0,
  6. tabBar: {
  7. textColor: "#6C6C6C",
  8. selectedColor: "#1ECDB9",
  9. items: [
  10. {
  11. pagePath: "/pages/index/index",
  12. name: "租车",
  13. icon: "/static/resource/images/home-w.png",
  14. activeIcon: "/static/resource/images/home-b.png"
  15. },
  16. {
  17. pagePath: "/pages/my/my",
  18. name: "我的",
  19. icon: "/static/resource/images/my-w.png",
  20. activeIcon: "/static/resource/images/my-b.png"
  21. }
  22. ]
  23. }
  24. },
  25. methods: {
  26. navToInputPage() {
  27. bus.emit('join')
  28. my.switchTab({
  29. url: '/pages/index/index'
  30. })
  31. },
  32. switchTab(e) {
  33. const {dataset: { index, item: { pagePath = '' }} = {}} = e.target
  34. my.switchTab({
  35. url: pagePath
  36. })
  37. }
  38. }
  39. })