问星数据小程序

tabbar.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // components/tabbar/tabbar.js
  2. const app = getApp();
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. properties: {
  8. selected: {
  9. type: Number,
  10. value: 0
  11. },
  12. },
  13. /**
  14. * 组件的初始数据
  15. */
  16. data: {
  17. selected: 0,
  18. isIpx: app.data.systemInfo.isIpx ? true : false, //底部按钮适配Iphone X
  19. color: "#A0A0A0",
  20. selectedColor: "#2662FF",
  21. list: [
  22. {
  23. "pagePath": "/pages/index/index",
  24. "text": "首页",
  25. "iconPath": "/assets/newTab/home.png",
  26. "selectedIconPath": "/assets/newTab/home_yes.png"
  27. },
  28. {
  29. "pagePath": "/pages/sphRank/index",
  30. "text": "视频号榜单",
  31. "iconPath": "/assets/newTab/sphRank.png",
  32. "selectedIconPath": "/assets/newTab/sphRank_yes.png"
  33. },
  34. {
  35. "pagePath": "/pages/live/hotLive/index",
  36. "text": "直播大厅",
  37. "iconPath": "/assets/newTab/live.png",
  38. "selectedIconPath": "/assets/newTab/live.png"
  39. },
  40. {
  41. "pagePath": "/pages/cyRank/index",
  42. "text": "创意中心",
  43. "iconPath": "/assets/newTab/cyRank.png",
  44. "selectedIconPath": "/assets/newTab/cyRank_yes.png"
  45. },
  46. {
  47. "pagePath": "/pages/mine/mine",
  48. "text": "个人中心",
  49. "iconPath": "/assets/newTab/wode.png",
  50. "selectedIconPath": "/assets/newTab/wode_yes.png"
  51. }
  52. ]
  53. },
  54. /**
  55. * 组件的方法列表
  56. */
  57. methods: {
  58. changeTab(e){
  59. const url=e.currentTarget.dataset.pagepath
  60. wx.switchTab({url})
  61. }
  62. }
  63. })