showList.js 850 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // pages/Component/showList/showList.js
  2. const util = require("../../../utils/util")
  3. const urlDef = require("../../../utils/urls")
  4. Component({
  5. lifetimes:{
  6. attached:function(){
  7. }
  8. },
  9. /**
  10. * 组件的属性列表
  11. */
  12. properties: {
  13. list: {
  14. type: Array,
  15. value: []
  16. },
  17. },
  18. /**
  19. * 组件的初始数据
  20. */
  21. data: {
  22. },
  23. /**
  24. * 组件的方法列表
  25. */
  26. methods: {
  27. doThumbsUp: function (e) {
  28. let id = e.currentTarget.dataset.id
  29. this.properties.list.map(o => {
  30. if (o.videoId == id) {
  31. this.triggerEvent('callThumbsUp', o)
  32. }
  33. })
  34. },
  35. doPlay: function (e) {
  36. const index = e.currentTarget.dataset.index
  37. let o = this.data.list[index]
  38. wx.navigateTo({
  39. url: '/pages/playShow/playShow?vid='+o.videoId,
  40. })
  41. }
  42. },
  43. })