index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. Component({
  2. /**
  3. * 组件的属性列表
  4. */
  5. properties: {
  6. /* 列表 */
  7. tabsList: {
  8. type: Array
  9. },
  10. /* 下标 */
  11. tabsIndex: {
  12. type: Number,
  13. value: 0
  14. },
  15. /* 回调 */
  16. setIndex: {
  17. type: Function
  18. },
  19. /* 下载直播客户端 */
  20. liveDownload: {
  21. type: Boolean,
  22. value: false
  23. }
  24. },
  25. /**
  26. * 组件的初始数据
  27. */
  28. data: {
  29. informShow: false
  30. },
  31. /**
  32. * 组件的方法列表
  33. */
  34. methods: {
  35. setTabsIndex(e) {
  36. const {
  37. index
  38. } = e.target.dataset;
  39. this.setData({
  40. tabsIndex: index
  41. })
  42. this.triggerEvent("setIndex", index)
  43. },
  44. /* 开播指引 */
  45. downloadApp() {
  46. this.setData({
  47. informShow: true
  48. });
  49. setTimeout(() => {
  50. this.setData({
  51. informShow: false
  52. });
  53. }, 3000)
  54. },
  55. /* 关闭提示 */
  56. inform() {
  57. this.setData({
  58. informShow: false
  59. });
  60. }
  61. }
  62. })