index.js 971 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const cf = require("../../utils/checkFile")
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. butType: {
  8. type: String,
  9. value: "下载"
  10. },
  11. list: {
  12. type: Array,
  13. value: []
  14. },
  15. callBack: {
  16. type: Function
  17. }
  18. },
  19. options: {
  20. addGlobalClass: true
  21. },
  22. /**
  23. * 组件的初始数据
  24. */
  25. data: {
  26. },
  27. /**
  28. * 组件的方法列表
  29. */
  30. methods: {
  31. butClick(e) {
  32. const {
  33. item
  34. } = e.currentTarget.dataset;
  35. if (this.data.butType == '播放') return this.triggerEvent("callBack", item);
  36. },
  37. checkFile(e) {
  38. const {
  39. item
  40. } = e.currentTarget.dataset;
  41. if (this.data.butType == '播放') return this.triggerEvent("callBack", item);
  42. cf.checkFile(item);
  43. }
  44. }
  45. })