Commit a03ea557 authored by 刘用法's avatar 刘用法

材料也转换成数字

parent fc7beaf6
......@@ -35,7 +35,7 @@
<view class="other-space">
<text class="input-title">金额:</text>
<view class="input-content">
<u-input v-model="item.value" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
<u-input v-model="item.value" type="number" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
</view>
......@@ -100,10 +100,10 @@
money() { // 总额
var amount = 0
for (var item of this.list) {
amount += Math.max(item.consumption - item.freeAmount, 0) * item.price
amount += Math.max(Number(item.consumption) - Number(item.freeAmount), 0) * Number(item.price)
}
for (var item of this.other) {
if (item.value) {
if (item.value && Number(item.value)) {
amount += Number(item.value)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment