postCell.js 711 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // components/postCell/postCell.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. data: {
  8. type: Object,
  9. value: {},
  10. },
  11. currentIndex: {
  12. type: Number,
  13. value: 0,
  14. },
  15. },
  16. /**
  17. * 组件的初始数据
  18. */
  19. data: {},
  20. /**
  21. * 组件的方法列表
  22. */
  23. methods: {
  24. tapDeleteAction() {
  25. const { currentIndex } = this.properties;
  26. this.triggerEvent("delete", { index: currentIndex });
  27. },
  28. handleCellAction() {
  29. const { id } = this.properties.data;
  30. // <!-- type = 1 文章 type = 2 视频 type = 3 帖子 -->
  31. wx.navigateTo({
  32. url: `/pages/newDetail/newDetail?newId=${id}`,
  33. });
  34. },
  35. },
  36. });