diff --git a/pages/activity/seckill.vue b/pages/activity/seckill.vue index 4f25a34..887aa09 100644 --- a/pages/activity/seckill.vue +++ b/pages/activity/seckill.vue @@ -250,7 +250,7 @@ handleTargetGoods(sharpGoodsId) { let count_down_time = new Date(this.tabbar[this.curTabIndex].count_down_time.replace(/-/g, '/')) .getTime() - new Date().getTime() - + console.log(count_down_time) uni.navigateTo({ url: '/pages/goods/seckillDetail?activeTimeId=' + this.getCurTabbarId() + '&sharpGoodsId=' + sharpGoodsId + "&isSeckill=" + true + '&isBuy=' + count_down_time + '&seckillText=' + (this.tabbar[this diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index 9e67ee9..734e422 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -33,7 +33,7 @@ ¥{{goods.line_price_min?Number(goods.line_price_min):0}} - + @@ -45,16 +45,18 @@ ¥{{goods.cost_price_min?Number(goods.cost_price_min):0}} - ¥{{(goods.line_price_min>0&&goods.goods_price_min>0)?Number((Number(goods.line_price_min)-Number(goods.goods_price_min)).toFixed(2)):0}} + ¥{{(goods.line_price_min>0&&goods.goods_price_min>0)?Number((Number(goods.line_price_min)-Number(goods.goods_price_min)).toFixed(2)):0}} - + + + 限时抢购 - - 距活动{{seckillText}} - 距活动结束 + { if (res.status == 200) { that.$toast("设置成功"); + that.getGoodsDetail() this.$refs.setRange.afterSale = false; setTimeout(() => { that.getGoodsDetail(1); @@ -689,6 +693,7 @@ }, setPirce() { let item = this.findItemById(this.goods.skuList, this.goods.goods_id) + console.log('item', item) if (item) { this.$refs.setRange.startTime = item.sec_start_time; this.$refs.setRange.sec_hour = item.sec_hour @@ -970,6 +975,19 @@ GoodsApi.detail(this.goodsId) .then(result => { let info = result.data.detail; + let item = this.findItemById(info.skuList, info.goods_id) + if (item) { + if (item.sec_start_time) { + that.seckillCountTime = new Date(item.sec_start_time + .replace(/-/g, '/')) + .getTime() - new Date().getTime() + } else { + that.seckillCountTime = 0 + } + } else { + that.seckillCountTime = 0 + } + that.seckillCountTime = that.seckillCountTime > 0 ? that.seckillCountTime : 0 that.goods.skuList = []; that.godds = {} info.goods_images1 = [] @@ -1389,11 +1407,18 @@ } } - .right { + .right2 { display: flex; align-items: center; margin-right: 40rpx; flex-flow: column; + } + + .right { + display: flex; + align-items: center; + margin-right: 40rpx; + // flex-flow: column; .rightPrice { overflow: hidden;