itemCard.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // components/itemCard.js
  2. const util = require('../../utils/util.js')
  3. Component({
  4. options: {
  5. styleIsolation: 'apply-shared'
  6. },
  7. /**
  8. * 组件的属性列表
  9. */
  10. properties: {
  11. item: Object
  12. },
  13. /**
  14. * 组件的初始数据
  15. */
  16. data: {
  17. show: true
  18. },
  19. /**
  20. * 组件的方法列表
  21. */
  22. methods: {
  23. getPublisherInfo: function () {
  24. wx.navigateTo({
  25. url: '/pages/publisher/publisher',
  26. }).then(res => {
  27. res.eventChannel.emit('loadCommonData', {
  28. data: this.data.item.publisher
  29. })
  30. })
  31. },
  32. getActivityInfo: function () {
  33. wx.navigateTo({
  34. url: '/pages/activity/activity',
  35. events: {
  36. deleteMessage: () => {
  37. this.setData({
  38. show: false
  39. })
  40. }
  41. }
  42. }).then(res => {
  43. res.eventChannel.emit('loadCommonData', {
  44. data: this.data.item
  45. })
  46. })
  47. },
  48. filterMsgType: function (e) {
  49. this.triggerEvent('filtermsgtype', {
  50. type: this.data.item.type[0]
  51. })
  52. },
  53. filterTag: function (e) {
  54. this.triggerEvent('filtertag', {
  55. tag: e.currentTarget.dataset.tag
  56. })
  57. }
  58. }
  59. })