|
|
@@ -47,7 +47,7 @@ |
|
|
|
{{progress.number ? "(秒:"+progress.number+"件,剩:"+(progress.number - progress.sold)+"件)": ""}} |
|
|
|
</view> |
|
|
|
<view class="price-box"> |
|
|
|
<view class="price">¥{{item.sales_price}} <del class="market_price">¥{{item.market_price}}</del> |
|
|
|
<view class="price">¥{{item.sales_price|million}} |
|
|
|
</view> |
|
|
|
<!-- <text class="number">x 1</text> --> |
|
|
|
<uni-number-box v-if="progress.number" class="step" :min="1" |
|
|
@@ -55,7 +55,7 @@ |
|
|
|
:disabled="item.number>=(progress.number - progress.sold)" :value="item.number" |
|
|
|
:isMax="(progress.number - progress.sold) <= item.number?true:false" |
|
|
|
:isMin="item.number===1" :index="index" @eventChange="numberChange"></uni-number-box> |
|
|
|
<uni-number-box v-else class="step" :min="1" :max="item.stock" |
|
|
|
<uni-number-box v-else class="step" :min="1" :max="Number(item.stock)" |
|
|
|
:disabled="item.number>=item.stock" :value="item.number" |
|
|
|
:isMax="item.stock <= item.number?true:false" :isMin="item.number===1" :index="index" |
|
|
|
@eventChange="numberChange"></uni-number-box> |
|
|
@@ -89,7 +89,7 @@ |
|
|
|
<view class="yt-list"> |
|
|
|
<view class="yt-list-cell b-b"> |
|
|
|
<view class="cell-tit clamp">总共合计</view> |
|
|
|
<view class="cell-tip">¥{{price}}</view> |
|
|
|
<view class="cell-tip">¥{{price|million}}</view> |
|
|
|
</view> |
|
|
|
<view class="yt-list-cell b-b" v-if="couponList && couponList.length"> |
|
|
|
<view class="cell-tit clamp">优惠金额</view> |
|
|
@@ -119,7 +119,7 @@ |
|
|
|
<view class="price-content"> |
|
|
|
<text>实付款</text> |
|
|
|
<text class="price-tip">¥</text> |
|
|
|
<text class="price">{{total}}</text> |
|
|
|
<text class="price">{{total|million}}</text> |
|
|
|
</view> |
|
|
|
<text class="submit" @click="submit">提交订单</text> |
|
|
|
</view> |
|
|
@@ -205,6 +205,12 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() {}, |
|
|
|
filters: { |
|
|
|
million: function (value) { |
|
|
|
if (!value) return 0; |
|
|
|
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 将整数部分逢三一断 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 计算百分比 |
|
|
|
percentage(number, sold) { |
|
|
@@ -354,13 +360,14 @@ |
|
|
|
let price = 0; |
|
|
|
let number = 0; // 产品数量 |
|
|
|
let product = this.product; |
|
|
|
|
|
|
|
console.log(this.product) |
|
|
|
product.forEach(item => { |
|
|
|
price = price + parseFloat(item.sales_price) * item.number; |
|
|
|
price = price + parseFloat(item.sales_price.replace(/,/g, "")) * item.number; |
|
|
|
number = number + item.number; |
|
|
|
}); |
|
|
|
|
|
|
|
this.price = price.toFixed(2); |
|
|
|
console.log(this.price) |
|
|
|
let total = price; |
|
|
|
|
|
|
|
// 检查当前优惠券是否满足使用条件 |
|
|
|