<template>
	<view class="goodscontent">
		<view class="carSs">
			<view class="carssBox" >
				<img src="../../static/img/icon_search.png" alt="" class="carSsImg">
				<input type="text" placeholder="名称、规格、出厂编码、车型、品牌" class="carssInput" v-model="goodsName" @confirm="getgoodsList">
			</view>
			
		</view>
		<view class="listBox">
			<view class="listLine" v-for="(item,index) in list" @click="godetail(item)">
				<img :src="item.imgs.split(',')[0]|| require('../../static/img/pic_def_bj.png')" alt="图片加载失败" class="lineIMg">
			    <view class="listlineRight">
			    	<view class="lineName">{{ item.brand }} {{ item.name }}</view>
					<view class="linespecificationModel">{{ item.specificationModel }} | {{ item.factoryNumber }}</view>
					<view class="linemodelRemark">备注：{{ item.modelRemark||'--' }}</view>
			    </view>
			</view>
			
		</view>
		<view class="nodata" v-if="!list.length&&!loading">
			<img src="../../static/img/pic_empty_def.png" alt="" class="nodataImg">
			<view class="nodataTxt">暂无匹配商品</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		
		data() {
			return {
				list:[],
				goodsName:'',
				page:1,
				limit:10,
				loading:true,
			}
		},
		onLoad() {
      
		},
		methods: {
         getgoodsList(){
			 uni.showLoading({ title: '加载中'});
			 this.$http('partsByOpen/queryPartsList', {
			 	name:this.goodsName,
			 	page:this.page,
				limit:10,
			 }, 'POST').then(res => {
			 	this.list=res.data
			 	uni.hideLoading();
			 }) 
		 }
		},
		onReachBottom(){
			console.log("上拉")
		}
	}
</script>

<style scoped>
	.goodscontent{
		min-height:calc(100vh - 44px) ;
		background: #FFFFFF;
	}
	.carSs{
		width: 750rpx;
		height: 96rpx;
		background: #FFFFFF;
		padding-top: 24rpx;
		position: relative;
	}
	.carssBox{
		width: 702rpx;
		height: 72rpx;
		background: #F4F5F7;
		border-radius: 36rpx;
		margin: 0 auto;
		
	}
	.carSsImg{
		width: 40rpx;
		height: 40rpx;
		margin-top: 16rpx;
		margin-left: 20rpx;
	}
	.carssInput{
		line-height:72px;
		font-size: 28rpx;
		height:72rpx;
		padding-left: 16rpx;
		width: 600rpx;
	}
	.carssBox{
		display: flex;
	}
	.listBox{
		padding: 0 24rpx;
		background: #FFFFFF;
	}
	.lineIMg{
		width: 110rpx;
		height: 110rpx;
	}
	.listLine{
		padding: 20rpx 0;
		border-bottom: 1px solid #EEEEEE;
		display: flex;
	}
	.listlineRight{
		width: 600rpx;
		padding-left: 20rpx;
	}
	.lineName{
		color: #3C3C3C;font-size: 28rpx;
	}
	.linespecificationModel{
		color: #999999;font-size: 24rpx;padding-top: 5rpx;
	}
	.linemodelRemark{
		color: #999999;font-size: 24rpx;padding-top: 10rpx;
	}
	
	.nodataImg{
		width: 452rpx;
	}
	.nodata{
		text-align: center;
		height: calc(100vh - 310rpx );
	}
	.nodataTxt{
		color: #999999;
		line-height: 40px;
		font-size: 28rpx;
		padding-top: 12rpx;
	}
</style>
