C端小程序
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

87 wiersze
2.3 KiB

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