trade:砍价记录的详情 50%

pull/5/head
YunaiV 2023-10-06 02:06:45 +08:00
parent 7ce062229f
commit c36415fcda
1 changed files with 20 additions and 17 deletions

View File

@ -16,7 +16,7 @@
</view> </view>
<view class='text acea-row row-column-around'> <view class='text acea-row row-column-around'>
<view class='line1'>{{ bargainInfo.name }}</view> <view class='line1'>{{ bargainInfo.name }}</view>
<view class="surplus">最低价{{ fen2yuan(bargainInfo.bargainPrice) }}</view> <view class="surplus">最低价{{ fen2yuan(bargainInfo.bargainMinPrice) }}</view>
<view class="surplus">剩余{{ bargainInfo.stock }} {{bargainInfo.unitName}}</view> <view class="surplus">剩余{{ bargainInfo.stock }} {{bargainInfo.unitName}}</view>
<view class='money font-color-red'> <view class='money font-color-red'>
当前: <text class='num'>{{ fen2yuan(buyPrice) }}</text> 当前: <text class='num'>{{ fen2yuan(buyPrice) }}</text>
@ -40,22 +40,22 @@
<!-- 砍价中 --> <!-- 砍价中 -->
<block v-if="action === 2"> <block v-if="action === 2">
<view class='money acea-row row-center' <view class='money acea-row row-center'
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'font_hui': ''"> :class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">
<view style="margin-right: 40rpx;">已砍<text class="font-color-red" <view style="margin-right: 40rpx;">已砍<text class="font-color-red"
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'font_hui': ''">{{ fen2yuan(bargainUserInfo.price - bargainUserInfo.payPrice) }}</text> :class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">{{ fen2yuan(bargainUserInfo.bargainFirstPrice - bargainUserInfo.bargainPrice) }}</text>
</view> </view>
<view>还剩<text class="font-color-red" <view>还剩<text class="font-color-red"
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'font_hui': ''">{{ fen2yuan(bargainUserInfo.remainPrice) }}</text> :class="new Date().getTime() >= bargainUserInfo.endTime ? 'font_hui': ''">{{ fen2yuan(bargainUserInfo.remainPrice) }}</text>
</view> </view>
</view> </view>
<view class="cu-progress acea-row row-middle round margin-top" <view class="cu-progress acea-row row-middle round margin-top"
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'bg_qian': ''"> :class="new Date().getTime() >= bargainUserInfo.endTime ? 'bg_qian': ''">
<view class='acea-row row-middle bg-red' <view class='acea-row row-middle bg-red'
:class="new Date().getTime() >= bargainUserInfo.expireTime ? 'bg-color-hui': ''" :class="new Date().getTime() >= bargainUserInfo.endTime ? 'bg-color-hui': ''"
:style="'width:'+ bargainUserInfo.pricePercent +'%;'" /> :style="'width:'+ bargainUserInfo.pricePercent +'%;'" />
</view> </view>
<view class='tip'> <view class='tip'>
已有{{ bargainInfo.successCount }}位好友砍价成功 已有{{ bargainInfo.successUserCount }}位好友砍价成功
</view> </view>
</block> </block>
@ -308,7 +308,7 @@
// ========== ========== // ========== ==========
storeBargainId: 0, // id storeBargainId: 0, // id
startBargainUid: 0, // uid startBargainUid: 0, // uid TODO startBargainUid userId
bargainUserInfo: {}, // bargainUserInfo: {}, //
action: 0, // action: 0, //
helpAction: 0, // helpAction: 0, //
@ -419,7 +419,7 @@
BargainApi.getBargainActivityDetail(this.id).then(res => { BargainApi.getBargainActivityDetail(this.id).then(res => {
const bargainInfo = res.data; const bargainInfo = res.data;
this.bargainInfo = bargainInfo; this.bargainInfo = bargainInfo;
this.buyPrice = this.bargainInfo.price; this.buyPrice = this.bargainInfo.bargainFirstPrice;
this.pages = '/pages/activity/goods_bargain_details/index?id=' + this.id + this.pages = '/pages/activity/goods_bargain_details/index?id=' + this.id +
'&startBargainUid=' + this.uid + '&scene=' + this.uid + '&storeBargainId=' + this.storeBargainId; '&startBargainUid=' + this.uid + '&scene=' + this.uid + '&storeBargainId=' + this.storeBargainId;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -479,10 +479,11 @@
this.action = this.calculateAction(bargainUserInfo); this.action = this.calculateAction(bargainUserInfo);
this.helpAction = bargainUserInfo.helpAction; this.helpAction = bargainUserInfo.helpAction;
this.storeBargainId = bargainUserInfo.id || this.storeBargainId; this.storeBargainId = bargainUserInfo.id || this.storeBargainId;
this.buyPrice = this.bargainUserInfo.payPrice || this.buyPrice; this.buyPrice = this.bargainUserInfo.bargainPrice || this.buyPrice;
if (bargainUserInfo.payPrice >= 0 && bargainUserInfo.bargainPrice >= 0) { if (bargainUserInfo.bargainPrice >= 0 && this.bargainInfo.bargainMinPrice >= 0) {
bargainUserInfo.remainPrice = bargainUserInfo.payPrice - bargainUserInfo.bargainPrice; // bargainUserInfo.remainPrice = bargainUserInfo.bargainPrice - this.bargainInfo.bargainMinPrice; //
bargainUserInfo.pricePercent = 100 * (bargainUserInfo.price - bargainUserInfo.payPrice) / (bargainUserInfo.price - bargainUserInfo.bargainPrice) bargainUserInfo.pricePercent = 100 * (bargainUserInfo.bargainFirstPrice - bargainUserInfo.bargainPrice)
/ (bargainUserInfo.bargainFirstPrice - this.bargainInfo.bargainMinPrice)
} }
// //
@ -547,8 +548,10 @@
var that = this; var that = this;
BargainApi.createBargainRecord(this.id).then(res => { BargainApi.createBargainRecord(this.id).then(res => {
this.storeBargainId = res.data.storeBargainUserId; this.storeBargainId = res.data.storeBargainUserId;
// // TODO
this.setBargainHelp(); // this.setBargainHelp();
//
this.gobargainUserInfo();
}, error => { }, error => {
that.$util.Tips({ that.$util.Tips({
title: error title: error