[综法]
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<view>
|
||||
<block v-if="inputType == 'price'">
|
||||
<input type="digit" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
|
||||
<input v-if="blurPrice" type="digit" :placeholder="'最小金额为:' + blurPrice" placeholder-class="placeholderClass" :value="blurValue" @blur="minInput($event, blurPrice)"/>
|
||||
|
||||
<input v-else type="digit" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
|
||||
<text>元</text>
|
||||
</block>
|
||||
<block v-else-if="inputType == 'number'">
|
||||
@@ -48,12 +50,29 @@
|
||||
inputTitle: {
|
||||
type : String,
|
||||
default : ''
|
||||
},
|
||||
blurPrice: {
|
||||
type : String,
|
||||
default : ''
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
methods: {
|
||||
blurInput(e){
|
||||
this.$emit('onValue', e.detail.value)
|
||||
},
|
||||
|
||||
minInput(e, blurPrice){
|
||||
if(parseInt(e.detail.value) < parseInt(blurPrice)) {
|
||||
uni.showToast({
|
||||
title: '最小值不可以小于' + blurPrice,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
this.$emit('onValue', '')
|
||||
return
|
||||
}
|
||||
this.$emit('onValue', e.detail.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user