index.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. var t = require("../../utils/public");
  2. var app = getApp();
  3. Component({
  4. properties: {
  5. spuItem: {
  6. type: Object,
  7. value: {
  8. spuId: "",
  9. skuId: "",
  10. spuImage: "",
  11. spuName: "",
  12. endTime: 0,
  13. beginTime: "",
  14. actPrice: ["", ""],
  15. marketPrice: ["", ""],
  16. spuCanBuyNum: "",
  17. soldNum: "",
  18. actId: "",
  19. limitMemberNum: "",
  20. limitOrderNum: "",
  21. serverTime: "",
  22. isLimit: false,
  23. skuList: [],
  24. spuDescribe: "",
  25. is_take_fullreduction: 0,
  26. label_info: ""
  27. }
  28. },
  29. isPast: {
  30. type: Boolean,
  31. value: false
  32. },
  33. actEnd: {
  34. type: Boolean,
  35. value: false
  36. },
  37. reduction: {
  38. type: Object,
  39. value: {
  40. full_money: '',
  41. full_reducemoney: '',
  42. is_open_fullreduction: 0
  43. }
  44. },
  45. isShowListCount: {
  46. type: Number,
  47. value: 0
  48. }
  49. },
  50. attached() {
  51. this.setData({ placeholdeImg: app.globalData.placeholdeImg})
  52. },
  53. data: {
  54. disabled: false,
  55. placeholdeImg: ''
  56. },
  57. methods: {
  58. openSku: function() {
  59. console.log( 'step1');
  60. console.log(this.data.spuItem.spuCanBuyNum)
  61. this.setData({
  62. stopClick:true,
  63. disabled:false
  64. })
  65. this.triggerEvent("openSku", {
  66. actId:this.data.spuItem.actId,
  67. skuList: this.data.spuItem.skuList,
  68. promotionDTO: this.data.spuItem.promotionDTO,
  69. allData: {
  70. spuName: this.data.spuItem.spuName,
  71. skuImage: this.data.spuItem.skuImage,
  72. actPrice: this.data.spuItem.actPrice,
  73. canBuyNum: this.data.spuItem.spuCanBuyNum,
  74. stock: this.data.spuItem.spuCanBuyNum,
  75. marketPrice: this.data.spuItem.marketPrice
  76. }
  77. });
  78. },
  79. countDownEnd: function() {
  80. this.setData({
  81. actEnd: true
  82. });
  83. },
  84. submit2: function(e) {
  85. (0, t.collectFormIds)(e.detail.formId);
  86. }
  87. }
  88. });