seckillItem.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. var util = require('../../utils/util.js');
  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. car_count: 0
  28. },
  29. observer: function (t) {
  30. let totNum = t.soldNum + t.spuCanBuyNum*1;
  31. let precent = parseInt((t.soldNum / totNum)*100) || 0;
  32. this.setData({ precent })
  33. }
  34. },
  35. actEnd: {
  36. type: Boolean,
  37. value: false
  38. },
  39. needAuth: {
  40. type: Boolean,
  41. value: false
  42. },
  43. theme: {
  44. type: Number,
  45. value: 0
  46. },
  47. begin: {
  48. type: Number,
  49. value: 1
  50. },
  51. skin: {
  52. type: Object
  53. }
  54. },
  55. attached() {
  56. this.setData({ placeholdeImg: app.globalData.placeholdeImg })
  57. },
  58. data: {
  59. disabled: false,
  60. placeholdeImg: '',
  61. precent: 0,
  62. goods_sale_unit: app.globalData.goods_sale_unit
  63. },
  64. methods: {
  65. openSku: function () {
  66. wx.navigateTo({
  67. url: '/lionfish_comshop/pages/goods/goodsDetail?id=' + this.data.spuItem.actId,
  68. })
  69. // if (this.data.needAuth) {
  70. // this.triggerEvent("authModal", true);
  71. // return;
  72. // }
  73. console.log('抢购')
  74. }
  75. }
  76. });