productList.js 962 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. this.setData({
  39. shareData: e.currentTarget.dataset.item
  40. })
  41. console.log(this.data.shareData)
  42. }
  43. }
  44. })