<template>
	<view>
		<block v-if="inputType == 'price'">
			<input type="digit" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
			<text>元</text>
		</block>
		<block v-else-if="inputType == 'number'">
			<input type="number" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
		</block>
		<block v-else-if="inputType == 'day'">
			<input type="number" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
			<text>天</text>
		</block>
		<block v-else-if="inputType == 'password'">
			<input type="text" password :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
		</block>
		<block v-else-if="inputType == 'mobile'">
			<input type="number" maxlength="11" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
		</block>
		<block v-else>
			<input v-if="inputKey == 'card_no'" type="number" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
			<input v-else type="text" :placeholder="'请输入' + inputTitle" placeholder-class="placeholderClass" :value="blurValue" @blur="blurInput"/>
		</block>
	</view>
</template>

<script>
	export default{
		name: 'mouldInput',
		data(){
			return {
				workIndex: 0
			}
		},
		props: {
			inputKey: {
				type	: String,
				default : ''
			},
			inputType: {
				type	: String,
				default : ''
			},
			blurValue: {
				type	: String,
				default : ''
			},
			inputTitle: {
				type	: String,
				default : ''
			}
		},
		onLoad() {},
		methods: {
			blurInput(e){
				this.$emit('onValue', e.detail.value)
			}
		}
	}
</script>

<style>
	input {
		width: 100%;
		height: 100%;
	}
</style>