小数点键盘
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
<view class="solid-top margin-top-sm shadow-warp">
|
||||
<view class="cu-form-group">
|
||||
<view class="title">加油升数</view>
|
||||
<input type="number" v-model="vol" @input="calcMoney" placeholder="请输入加油升数" name="input" />
|
||||
<input type="digit" v-model="vol" @input="calcMoney" placeholder="请输入加油升数" name="input" />
|
||||
<text>约¥{{money.total|numberFilter}}</text>
|
||||
</view>
|
||||
<view class="my-cell">
|
||||
@@ -126,18 +126,22 @@
|
||||
vol: this.vol,
|
||||
oilPrice: this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice,
|
||||
gunId: this.gunId + 1,
|
||||
realPay:this.money.realPay
|
||||
realPay: this.money.realPay
|
||||
|
||||
}
|
||||
console.log('被选中的', data5)
|
||||
this.$emit('confirmVol', data5)
|
||||
},
|
||||
calcMoney() {
|
||||
calcMoney(e) {
|
||||
// var vol;
|
||||
// vol = e.detail.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');
|
||||
// this.vol = vol
|
||||
|
||||
this.price = this.selected.xkPrice ? this.selected.xkPrice : this.selected.lvPrice
|
||||
this.money.total = this.vol * this.selected.standardPrice
|
||||
this.money.discount = this.money.total - this.vol * (this.selected.standardPrice - this.price)
|
||||
this.money.realPay = (this.money.total - this.money.discount).toFixed(2)
|
||||
console.log('总金额','折扣','实际支付')
|
||||
console.log('总金额', '折扣', '实际支付')
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
@@ -145,7 +149,7 @@
|
||||
value = value - 1 + 1
|
||||
if (value) {
|
||||
return value.toFixed(2)
|
||||
}else{
|
||||
} else {
|
||||
return '0.00'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
<template>
|
||||
<!-- 客服热线 -->
|
||||
<view class="color-999 text-center padding" @tap="callHotline">
|
||||
全国统一客服/投诉热线:
|
||||
<text class="text-red">
|
||||
4008-56-5166
|
||||
</text>
|
||||
<view class="">
|
||||
<view class="round text-center">
|
||||
<button class="cu-btn round bg-main-oil" open-type='contact'>
|
||||
<text class="cuIcon-servicefill padding-right-xs"></text>
|
||||
联系在线客服</button>
|
||||
</view>
|
||||
<view class="color-999 text-center padding" @tap="callHotline">
|
||||
全国统一客服/投诉热线:
|
||||
<text class="text-red">
|
||||
4008-56-5166
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// key: value
|
||||
@@ -18,7 +25,7 @@
|
||||
methods: {
|
||||
callHotline() {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber:'4008-56-5166'
|
||||
phoneNumber: '4008-56-5166'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<view class="shadow-warp bg-white">
|
||||
<view class="cu-form-group">
|
||||
<view class="title">加油升数</view>
|
||||
<input placeholder="请输入加油升数" type="number" @input="calcMoney" v-model="insertResult.vol" name="input" />
|
||||
<input placeholder="请输入加油升数" type="digit" @input="calcMoney" v-model="insertResult.vol" name="input" />
|
||||
<text>约¥{{insertResult.vMoney|numberFilter}}</text>
|
||||
</view>
|
||||
<view class="my-cell">
|
||||
|
||||
Reference in New Issue
Block a user