relativeGoodsList.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Component({
  2. properties: {
  3. list: {
  4. type: Array,
  5. value: []
  6. },
  7. needAuth: {
  8. type: Boolean,
  9. value: false
  10. }
  11. },
  12. data: {
  13. disabled: false
  14. },
  15. methods: {
  16. openSku: function (e) {
  17. if (this.data.needAuth) {
  18. this.triggerEvent("authModal");
  19. return;
  20. }
  21. let idx = e.currentTarget.dataset.idx;
  22. this.setData({ disabled: false })
  23. let spuItem = this.data.list[idx];
  24. this.triggerEvent("openSku", {
  25. actId: spuItem.actId,
  26. skuList: spuItem.skuList,
  27. promotionDTO: spuItem.promotionDTO || '',
  28. allData: {
  29. spuName: spuItem.spuName,
  30. skuImage: spuItem.skuImage,
  31. actPrice: spuItem.actPrice,
  32. canBuyNum: spuItem.spuCanBuyNum,
  33. stock: spuItem.spuCanBuyNum,
  34. marketPrice: spuItem.marketPrice,
  35. oneday_limit_count: spuItem.oneday_limit_count,
  36. total_limit_count: spuItem.total_limit_count,
  37. one_limit_count: spuItem.one_limit_count,
  38. goods_start_count: spuItem.goods_start_count
  39. }
  40. })
  41. }
  42. }
  43. })