C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 line
2.4 KiB

  1. const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
  2. let ifStoreApp = extConfig.attr.ifStoreApp;
  3. Component({
  4. data: {
  5. selected: 0,
  6. "color": "#abb1be",
  7. "selectedColor": "#FD782D",
  8. "list": [
  9. {
  10. "pagePath": "/index/index",
  11. "iconPath": "../assets/images/home.png",
  12. "selectedIconPath": "../assets/images/home-a.png",
  13. "text": "首页"
  14. },
  15. {
  16. "pagePath": "/index/searchbar",
  17. "iconPath": "../assets/images/mendian.png",
  18. "selectedIconPath": "../assets/images/mendian-a.png",
  19. "text": "门店"
  20. },
  21. {
  22. "pagePath": "/index/passCar",
  23. "iconPath": "../assets/images/park.png",
  24. "selectedIconPath": "../assets/images/park-a.png",
  25. "text": "停车"
  26. },
  27. {
  28. "pagePath": "/index/user",
  29. "iconPath": "../assets/images/user.png",
  30. "selectedIconPath": "../assets/images/user-a.png",
  31. "text": "我的"
  32. }
  33. ]
  34. },
  35. attached() {
  36. if (ifStoreApp==1){
  37. this.setData({
  38. list: [
  39. {
  40. "pagePath": "/index/index",
  41. "iconPath": "../assets/images/home.png",
  42. "selectedIconPath": "../assets/images/home-a.png",
  43. "text": "首页"
  44. },
  45. {
  46. "pagePath": "/index/user",
  47. "iconPath": "../assets/images/user.png",
  48. "selectedIconPath": "../assets/images/user-a.png",
  49. "text": "我的"
  50. }
  51. ]
  52. })
  53. } else if (ifStoreApp == 2) {
  54. this.setData({
  55. list: [
  56. {
  57. "pagePath": "/index/index",
  58. "iconPath": "../assets/images/home.png",
  59. "selectedIconPath": "../assets/images/home-a.png",
  60. "text": "首页"
  61. },
  62. {
  63. "pagePath": "/index/searchbar",
  64. "iconPath": "../assets/images/mendian.png",
  65. "selectedIconPath": "../assets/images/mendian-a.png",
  66. "text": "门店"
  67. },
  68. {
  69. "pagePath": "/index/user",
  70. "iconPath": "../assets/images/user.png",
  71. "selectedIconPath": "../assets/images/user-a.png",
  72. "text": "我的"
  73. }
  74. ]
  75. })
  76. }
  77. },
  78. methods: {
  79. switchTab(e) {
  80. const data = e.currentTarget.dataset;
  81. const url = data.path;
  82. wx.switchTab({url});
  83. this.setData({
  84. selected: data.index
  85. })
  86. }
  87. }
  88. })