<template>
	<uni-collapse>
		<!-- :open="true" -->
		<uni-collapse-item :show-animation="true" :title="scanTitle" :open="true">
			<view class="content">
				<!-- 	<view class="tit_bot_box">扫描目标库位</view> -->
				<uni-easyinput ref='scanInput' v-model="locationCode" :focus="inputFocus" @confirm="getLocation"
					@clear="clear" style='font-size: 18px;padding: 10rpx 20rpx;'>
				</uni-easyinput>
			</view>
		</uni-collapse-item>
	</uni-collapse>
</template>

<script>
	export default {
		name: 'winScanToLocation',
		components: {},
		props: {
			scanTitle: {
				type: String,
				default: '扫描目标库位'
			},
		},
		data() {
			return {
				locationCode: '',
				inputFocus: true
			}
		},

		created() {

		},
		methods: {
			getLocation() {
				if (this.locationCode == '') return;
				this.$emit('getLocationCode', this.locationCode)
			},
			clearLocation() {
				this.locationCode = '';
			},
			gotFocus() {
				this.inputFocus = true;
				this.$nextTick(r => {
					this.inputFocus = true;
				});
			},
			loseFocus() {
				this.inputFocus = false;
				this.$nextTick(r => {
					this.inputFocus = false;
				});
			},
			clear() {
				this.$emit('clear')
			}
		}
	}
</script>

<style>
</style>
