<template>
	<view class="content">
		<view class="top">
			<view class="inputBox">
				<img src="../../static/img/icon_search.png" alt="" class="searchImg">
				<input v-model="om" type="text" placeholder="OE/品牌号" class="topInput" @confirm="inputconfirm">
				<image src="../../static/img/icon_close.png" class="searchClose" v-if="vin!=''"
					@click="clear"></image>
				<!-- <image src="../../static/img/icon_camera.png" mode="" class="cameraImg"></image> -->
			</view>
		</view>
		<view class="history">
			<view class="historyTop">
				<view class="historyTopTxt">示例数据</view>
				<!-- <image src="../../static/img/icon_delete.png" mode="" class="historyDelImg"></image> -->
			</view>
			<view v-for="(item,index) in 1" class="historyLIneBox">
				<view class="historyLIne" @click="gogroup2('16176RTA004')">16176RTA004</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				om: ''
			}
		},
		onLoad() {
           
		},
		methods: {
			clear(){
				this.om = ''
				this.$emit('search','');
			},
			inputconfirm(){
				console.log(this.om)
				// if (this.vin.length != 17) {
				// 	uni.showToast({
				// 		title: '请输入正确VIN',
				// 		icon: 'none',
				// 		duration: 3000
				// 	});
				// 	return;
				// }
				
				this.$http('advancedEpc/parts/find', {
					partsnums: this.om,
				}, 'GET').then(res => {
					/* uni.hideLoading(); */
					//console.log(res.data.number);
					if (res.data.number == 200 || res.data.number == 5212) {
						this.gogroup()
				
					} else {
						uni.showToast({
							title: res.data.message,
							icon: 'none',
							duration: 3000
						});
					}
				
				});
			},
            gogroup(){
				uni.navigateTo({
					url:'OESearch?om='+this.om
				})
			},
			gogroup2(om){
				uni.navigateTo({
					url:'OESearch?om='+om
				})
			}
		}
	}
</script>

<style scoped>
	.comment{
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.top{
		height: 96rpx;
		border-bottom: 1px solid #EEEEEE;
		padding-top: 24rpx;
	}
	.searchImg{
		width: 40rpx;
		height: 40rpx;
		margin-top: 16rpx;
		margin-left: 20rpx;
	}
	.inputBox{
		width: 702rpx;
		height: 72rpx;
		background: #F4F5F7;
		border-radius: 36rpx;
		margin-left: 24rpx;
		display:flex;
		position: relative;
	}
	.topInput{
		font-size: 28rpx;
		height: 72rpx;
		line-height: 72rpx;
		padding-left: 16rpx;
		width: 500rpx;
	}
	.searchClose {
		position: absolute;
		width: 36rpx;
		height: 36rpx;
		right: 36rpx;
		top: 20rpx;
	
	}
	.cameraImg{
		position: absolute;
		width: 40rpx;
		height: 40rpx;
		top: 16rpx;
		right: 20rpx;
	}
	.history{
		padding: 24rpx;
	}
	.historyTop{
		display: flex;
		justify-content: space-between;
	}
	.historyDelImg{
		width: 34rpx;height: 34rpx;
	}
	.historyTopTxt{
		font-size: 28rpx;
		font-weight: 400;
		color: #666666;
		line-height: 34rpx;
	}
	.historyLIne{
		color: #333333;font-size: 24rpx;
		height: 64rpx;
		background: #F4F5F7;
		border-radius: 32rpx;
		line-height: 64rpx;
		padding: 0 24rpx;
		margin-top: 20rpx;
	}
	.historyLIneBox{
		display: flex;
	}
</style>
