showList.js 912 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. let playUrl = e.currentTarget.dataset.url
  37. const index = e.currentTarget.dataset.index
  38. const str = JSON.stringify(this.data.list[index])
  39. wx.navigateTo({
  40. url: '/pages/playShow/playShow?str='+str,
  41. })
  42. }
  43. },
  44. })