<template>
	<view class="content">
		<homenav :iStatusBarHeight="iStatusBarHeight" :title="'适配车型'"></homenav>
		<view class="box">
			<!-- <view class="detail-container">
				<view class="title1">{{optdata.title}}</view>
				<view class="title2">{{optdata.title2}}</view>
			</view> -->
			<view class="lineBox" v-for="(item,index) in list" @click="Ick(item)">
				<view class="line" >
					<view class="lineTitle">
						<span>{{item.brand}}</span>
					</view>
					<image class="jtImg" v-if="item.ck" src="/static/img/icon_arrow_up.png" mode=""></image>
					<image class="jtImg" v-if="!item.ck" src="/static/img/icon_arrow_down.png" mode=""></image>
				</view>
				<view v-if="item.ck">
				   <view class="spcarline" v-for="(v,i) in item.list">{{v.title}}</view>
				</view>
			</view>
			


		</view>

	</view>
</template>

<script>
	import nodata from '../../components/nodata/nodata.vue'
	import homenav from "../../components/homenav/nav.vue"
	export default {
		components: {
            nodata,homenav
		},
		data() {
			return {
              iStatusBarHeight:'',
			  optdata:'',
			  list:'',
			}
		},
		onLoad(opt) {
			  console.log(opt)
			   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
              this.optdata=opt;
			 uni.showLoading({ title: '加载中'});
			 this.$http('partsByOpen/queryCarModelGroupByPartsID', {
			    partsId:opt.partsId
			 },'POST').then(res => {
			 	uni.hideLoading();
			 	res.data.forEach(item=>{
			 	  item.ck=false
			 	})
			 	 this.list = res.data
			 })
		},
		methods: {
			Ick(item){
			      item.ck=!item.ck
			},
			
		}
	}
</script>

<style scoped>
.content{
	min-height: 100vh;
	background:#f4f5f7 ;
}
.jtImg{
	width: 26rpx;height: 26rpx;
}
.line{
	font-size: 30rpx;
	display: flex;
	justify-content: space-between;
	color: #22222;
}
.lineBox{
/* 	padding: 24rpx; */
	border-bottom: 1px solid #eaeaea;
}
.line2{
	padding: 10rpx;color: #999;
}
.spcarline{
	font-weight: 400;
	color: #666;
	font-size: 24rpx;
	padding: 24rpx;	
}
.line{
	padding: 24rpx;
	background: #fff;
}
.detail-container{
	background: #ffffff;
	margin-bottom: 20rpx;
	padding: 24rpx;
}
.title1{
	font-weight: 600;    color: #333;font-size: 30rpx;
}
.title2{
	color: #999;font-size: 26rpx;
	padding-top: 10rpx;
}
</style>