diff --git a/pages/activity/goods_bargain_details/index.vue b/pages/activity/goods_bargain_details/index.vue index acbc2128..1b9f4e7b 100644 --- a/pages/activity/goods_bargain_details/index.vue +++ b/pages/activity/goods_bargain_details/index.vue @@ -16,8 +16,8 @@ {{ bargainInfo.name }} - 最低价:¥{{ fen2yuan(bargainInfo.bargainPrice) }} - 剩余:{{ bargainInfo.stock }} {{bargainInfo.unitName}} + 最低价:¥{{ fen2yuan(bargainInfo.bargainMinPrice) }} + 剩余:{{ bargainInfo.stock }} {{bargainInfo.unitName}} 当前: ¥ {{ fen2yuan(buyPrice) }} @@ -40,22 +40,22 @@ + :class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''"> 已砍¥{{ fen2yuan(bargainUserInfo.price - bargainUserInfo.payPrice) }} + :class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">¥{{ fen2yuan(bargainUserInfo.bargainFirstPrice - bargainUserInfo.bargainPrice) }} 还剩¥{{ fen2yuan(bargainUserInfo.remainPrice) }} + :class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">¥{{ fen2yuan(bargainUserInfo.remainPrice) }} + :class="new Date().getTime() >= bargainUserInfo.endTime ? 'bg_qian': ''"> - 一 已有{{ bargainInfo.successCount }}位好友砍价成功 一 + 一 已有{{ bargainInfo.successUserCount }}位好友砍价成功 一 @@ -187,7 +187,7 @@ - + 暂无商品详情 @@ -308,7 +308,7 @@ // ========== 砍价记录 ========== storeBargainId: 0, // 砍价记录 id - startBargainUid: 0, // 开启砍价用户 uid + startBargainUid: 0, // 开启砍价用户 uid TODO 芋艿:目前很多逻辑基于 startBargainUid 是不太合理的,应该通过后端返回的 userId 处理;等后续优化代码,在考虑 bargainUserInfo: {}, // 开启砍价用户信息 action: 0, // 拼团记录的参与动作 helpAction: 0, // 帮砍动作 @@ -419,7 +419,7 @@ BargainApi.getBargainActivityDetail(this.id).then(res => { const bargainInfo = res.data; this.bargainInfo = bargainInfo; - this.buyPrice = this.bargainInfo.price; + this.buyPrice = this.bargainInfo.bargainFirstPrice; this.pages = '/pages/activity/goods_bargain_details/index?id=' + this.id + '&startBargainUid=' + this.uid + '&scene=' + this.uid + '&storeBargainId=' + this.storeBargainId; uni.setNavigationBarTitle({ @@ -479,10 +479,11 @@ this.action = this.calculateAction(bargainUserInfo); this.helpAction = bargainUserInfo.helpAction; this.storeBargainId = bargainUserInfo.id || this.storeBargainId; - this.buyPrice = this.bargainUserInfo.payPrice || this.buyPrice; - if (bargainUserInfo.payPrice >= 0 && bargainUserInfo.bargainPrice >= 0) { - bargainUserInfo.remainPrice = bargainUserInfo.payPrice - bargainUserInfo.bargainPrice; // 剩余可砍的金额 - bargainUserInfo.pricePercent = 100 * (bargainUserInfo.price - bargainUserInfo.payPrice) / (bargainUserInfo.price - bargainUserInfo.bargainPrice) + this.buyPrice = this.bargainUserInfo.bargainPrice || this.buyPrice; + if (bargainUserInfo.bargainPrice >= 0 && this.bargainInfo.bargainMinPrice >= 0) { + bargainUserInfo.remainPrice = bargainUserInfo.bargainPrice - this.bargainInfo.bargainMinPrice; // 剩余可砍的金额 + bargainUserInfo.pricePercent = 100 * (bargainUserInfo.bargainFirstPrice - bargainUserInfo.bargainPrice) + / (bargainUserInfo.bargainFirstPrice - this.bargainInfo.bargainMinPrice) } // 获得助力列表 @@ -547,8 +548,10 @@ var that = this; BargainApi.createBargainRecord(this.id).then(res => { this.storeBargainId = res.data.storeBargainUserId; - // 自己给自己助力 - this.setBargainHelp(); + // 自己给自己助力 TODO 芋艿:目前自己不能给自己助力 + // this.setBargainHelp(); + // 获得拼团记录的最新信息 + this.gobargainUserInfo(); }, error => { that.$util.Tips({ title: error