<!--扫描组件-->
<template>
	<uni-popup ref="popup">
		<view class="popup_box">
			<view class="pop_title">
				扫描信息
				<text class="fr" @click="closeScanPopup()">关闭</text>
			</view>
			<view class="pop_tab">
				<view class="uni-flex uni-row">
					<view class="tab_tit tab_tit_active">扫描产品标签</view>
				</view>
				<view class="tab_info">
					<win-com-scan-product @getScanResult="getScanResult" placeholder="请扫描产品标签"></win-com-scan-product>
				</view>
			</view>
		</view>
	</uni-popup>

</template>
<script>
	import winComScanProduct from '@/mycomponents/wincom/winComScanProduct.vue'
	export default {
		name: "winScanByProduct",
		components: {
			winComScanProduct
		},
		props: {
			placeholder: {
				type: String,
				default: '请扫描产品标签'
			},
			clearResult: {
				type: Boolean,
				default: true
			},
			boxFocus: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				scanResult: {}
			}
		},
		created() {

		},
		methods: {
			openScanPopup(content) {
				this.$refs.popup.open('bottom');
			},
			closeScanPopup(content) {
				this.$refs.popup.close();
			},
			getScanResult(result) {
				if (result != null) {
					this.scanResult = result;
				}
				this.callBack();
			},
			callBack() {
				this.$emit("getScanResult", this.scanResult);
			},
			getfocus() {
				this.$refs.comscan.getfocus();
			},
		}
	}
</script>
<style scoped lang="scss">

</style>
