productList.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // pages/promotional/modules/productList.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. total: {
  8. type: String,
  9. value: "0"
  10. },
  11. list: {
  12. type: Array,
  13. value: []
  14. }
  15. },
  16. options: {
  17. addGlobalClass: true,
  18. shareData: null
  19. },
  20. /**
  21. * 组件的初始数据
  22. */
  23. data: {},
  24. /**
  25. * 组件的方法列表
  26. */
  27. methods: {
  28. toDetail(e) {
  29. const {
  30. item
  31. } = e.currentTarget.dataset;
  32. //type 1图片 2视频 3图文
  33. wx.navigateTo({
  34. url: `/pages/promotional/details?id=${item.sat_sharematerialid}&type=${item.type}`,
  35. })
  36. },
  37. handleShare(e) {
  38. const {
  39. item,
  40. index
  41. } = e.currentTarget.dataset;
  42. this.setData({
  43. shareData: item,
  44. [`list[${index}].sharecount`]: item.sharecount + 1
  45. })
  46. }
  47. }
  48. })