Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

62 righe
1.4 KiB

  1. let app = getApp();
  2. Component({
  3. data: {
  4. home_a_img:[],
  5. selected: 0,
  6. "color": "#abb1be",
  7. "selectedColor": "#FD782D",
  8. "list": [{
  9. "pagePath": "/pages/index/index",
  10. "iconPath": "assets/images/home_btn_ic_sy.png",
  11. "selectedIconPath": "assets/images/home_btn_ic_sy1.png",
  12. "text": "首页"
  13. },
  14. {
  15. "pagePath": "/pages/course/course",
  16. "iconPath": "assets/images/home_btn_ic_kc.png",
  17. "selectedIconPath": "assets/images/home_btn_ic_kc1.png",
  18. "text": "课程"
  19. },
  20. {
  21. "pagePath": "/pages/user/user",
  22. "iconPath": "assets/images/home_btn_ic_wd.png",
  23. "selectedIconPath": "assets/images/home_btn_ic_wd1.png",
  24. "text": "我的"
  25. },
  26. ]
  27. },
  28. // lifetimes: {
  29. // attached: function () {
  30. // // 在组件实例进入页面节点树时执行
  31. // },
  32. // },
  33. attached() {
  34. },
  35. methods: {
  36. switchTab(e) {
  37. // this.setData({
  38. // list: this.data.home_a_img
  39. // })
  40. // console.log(this.data.home_a_img)
  41. const data = e.currentTarget.dataset;
  42. this.setData({
  43. selected: data.index
  44. })
  45. console.log(data.index)
  46. const url = data.path;
  47. if (data.index == 0 || data.index == 3) {
  48. this.getTemplateId()
  49. }
  50. tt.switchTab({
  51. url
  52. });
  53. },
  54. }
  55. })