<!--pages/cardetail/cardetail.wxml-->
<import src="../../module/header.wxml"/>
<!-- <scroll-view 
  class="conent"
  style="height:{{windowh}}rpx;{{openlog?'filter: blur(5rpx)':''}}"
  scroll-y="{{openlog?'false':'true'}}"
> -->
<template 
	is="header"
	data="{{title:'车辆详情',headerheight:headerheight,hasback:true}}"
/>
<swc-scroll 
  className="content"
  styleSheet="height:{{windowh-headerheight}}rpx;"
  scroll-y="{{openlog?'false':'true'}}"
  scrollitem="{{scrollitem}}"
  bind:swc="swcItem"
  scrollto="{{scrollto}}"
>
	<view 
		style="display: {{scrollindex==0?'none':'flex'}};top:{{headerheight}}rpx;"
		class="cardetail_nav">
		<view class="cardetail_nav_i {{scrollindex==1?'cardetail_nav_active':''}}" bindtap="toScroll" data-index="0">
			车源
		</view>
		<view class="cardetail_nav_i {{scrollindex==2?'cardetail_nav_active':''}}" bindtap="toScroll" data-index="1">
			图文
		</view>
		<view class="cardetail_nav_i {{scrollindex==3?'cardetail_nav_active':''}}" bindtap="toScroll" data-index="2">
			检测
		</view>
	</view>
	<view 
		class="cardetail_img"
	>
		<swiper 
			class='detail_img_t' 
			autoplay='true' 
			interval='2000' 
			duration='300' 
			bindchange='switchTab'
			circular='true'
		>
			<block wx:for="{{detail.imgs}}" wx:key="item">
				<swiper-item>
				  <image class='detail_img_item' src="{{item}}"/>
				</swiper-item>
			</block>      
		</swiper>
		<view class="detail_code">
			车源编号：{{detail.sn}}
		</view>		
		<view class="banner_step">
			{{currentimg}}/{{detail.imgslength}}
		</view>
	</view>
	<view class="cardetail_info_c">
		<view class="cardetail_t">
			{{detail.name}}
		</view>
		<view class="cardetail_price">
			好车价：
			<view class="cardetail_price_v">{{detail.price}}万</view>
			<view class="cardetail_price_n">新车指导价：{{detail.guid_price}}万</view>
		</view>
		<view class="cardetail_flex">
			<view class="cardetail_time">
				<view class="cardetail_flex_v">
					{{detail.first_plate_atname}}
				</view>
				<view class="cardetail_flex_name">
					首次上牌时间
				</view>
			</view>
			<view class="cardetail_mileage">
				<view class="cardetail_flex_v">
					{{detail.mileage}}万公里
				</view>
				<view class="cardetail_flex_name">
					表显里程
				</view>
			</view>
			<view class="cardetail_time">
				<view class="cardetail_flex_v">
					{{detail.emission}}
				</view>
				<view class="cardetail_flex_name">
					排放标准
				</view>
			</view>
		</view>
	</view>
	<view class="cardetail_shop">
		<view class="cardetail_shop_n">{{detail.shop_name}}</view>
		<view class="cardetail_shop_d">
			<image src="../../img/address.png"/>
			{{detail.work_address}}
		</view>
		<navigator 
			class="cardetail_shop_nav"
          	open-type="navigateTo"
			url="../shop/shop?id={{detail.merchant_id}}"
		>进店逛逛<image src="../../img/right.png"/></navigator>
	</view>
	<view
		class="cardetail_space cardetail_space_base">
		<view class="cardetail_space_t">基本信息</view>
		<view class="cardetail_baseinfo_c">
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.distance_at}}</view>
				<view class="cardetail_baseinfo_n">{{detail.first_plate_at}}首次上牌</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.mileage}}万公里</view>
				<view class="cardetail_baseinfo_n">表显里程</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.emission}}</view>
				<view class="cardetail_baseinfo_n">排放标准</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.car_displacement}}</view>
				<view class="cardetail_baseinfo_n">排量</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.plate_province_name}}</view>
				<view class="cardetail_baseinfo_n">上牌地址</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.transfer_num}}次过户</view>
				<view class="cardetail_baseinfo_n">过户次数</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.maintain}}</view>
				<view class="cardetail_baseinfo_n">是否定期保养</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.year_check_at}}</view>
				<view class="cardetail_baseinfo_n">年检到期</view>
			</view>
			<view class="cardetail_baseinfo_i">
				<view class="cardetail_baseinfo_v">{{detail.insurance_at}}</view>
				<view class="cardetail_baseinfo_n">保险到期</view>
			</view>
		</view>
	</view>
	<view
		class="cardetail_space cardetail_space_dsc">
		<view class="cardetail_space_t">车辆描述</view>
		<image 
			bindtap="swdesc"
			class="cardetail_describe_op {{desopen?'cardetail_describe_opactive':''}}" src = "../../img/right.png"/>
		<view 
			style="{{desopen?'height:auto':''}}"
			class="cardetail_describe">
			{{detail.car_condition}}
		</view>
	</view>
	<view
		class="cardetail_space cardetail_space_col">
		<view class="cardetail_space_t">配置详情</view>
		<view class="cardetail_collocate">
			仅供参考，购买前请于销售确认
		</view>		
		<view class="cardetail_collocate_list">
			<block wx:for="{{collocatetype}}" wx:key="name">
				<view class="cardetail_collocate_item {{item.opened?'collocate_open':''}}">
					<view 
						class="cardetail_collocate_item_t"
						bindtap="swCollocate"
						data-name="{{item.name}}"
					>
						{{item.label}}
						<image
							src="../../img/down_icon.png" 
							class="cardetail_collocate_item_sw"
						/>
					</view>
					<view 
						class="cardetail_collocate_item_l"
						style="height:{{item.opened?detail[item.name].length*89:0}}rpx"
					>
						<block wx:for="{{detail[item.name]}}" wx:key="k" wx:for-item="info">
							<view class="cardetail_collocate_item_d">
								<view class="collocate_item_n">{{info.k}}</view>
								<view class="collocate_item_v">{{info.v}}</view>
							</view>
						</block>
					</view>
				</view>
			</block>
		</view>
	</view>
	<view 
		class="cardetail_space cardetail_space_pic">
		<view class="cardetail_space_t">车辆实拍</view>
		<view class="cardetail_img_l">
			<block wx:for="{{detail.imgs}}" wx:key="item">
				<image class='cardetail_img_i' src="{{item}}"/>
			</block>
		</view>
	</view>
	<view
		wx:if="{{detail.check_info.length>0}}"
		class="cardetail_space"
		bindtap="openCheck"
		>
		<view class="cardetail_space_t">检测报告</view>
		<view class="cardetail_check_report">
			<block wx:for="{{detail.check_info}}" wx:key="item">
				<view class="cardetail_check_i">
					<view class="cardetail_check_n">
						<image src = "../../img/{{imagemap[item.name]}}.png"/>
						<view class="cardetail_check_name">{{item.name}}</view>
					</view>
					<view class="cardetail_check_i">
						<view class="cardetail_check_unp" wx:if="{{item.unpassn>0}}">
							{{item.unpassn}}
							<image class="unpass_number" src="../../img/checknopass.png"/>
						</view>
						<view  class="cardetail_check_p">
							{{item.passn}}
							<image class="pass_number" src="../../img/checkpass.png"/>
						</view>
						<image class="cardetail_check_op" src = "../../img/right.png"/>
					</view>
				</view>
			</block>  
		</view>
	</view>
	<view class="no_more">——没有更多——</view>
	<view class="cardetail_op_list_space"></view>
	<view class="cardetail_op_list">
		<view 
			class="cardetail_op_collect"
			bindtap="collectCar"			
		>
			<image 
				src="../../img/{{detail.is_collect=='1'?'collect':'uncollect'}}.png"
			/>
			<view>收藏</view>
		</view>
		<view 
			class="cardetail_op_phone"
			bindtap="callPhone"
			>
			<image src="../../img/phone.png"/>
			<view>电话</view>
		</view>
		<view 
			bindtap="appointmentBuy"
			class="cardetail_op_appointment">
			预约看车
		</view>
		<view class="cardetail_op_line"></view>
		<view 
			bindtap="openScheme"
			class="cardetail_op_buy"
		>
			分期购车
		</view>
	</view>
</swc-scroll>
<view 
	style="left:{{openscheme?'0rpx':'100%'}}"
	class="buy_scheme">
	<view class="buy_scheme_box">
		<view class="buy_scheme_title">
			<view class="buy_scheme_tw">
				分期方案
			</view>
			<image 
				bindtap="closeScheme"
				src="../../img/close2.png"
				class="buy_scheme_close"/>
		</view>
		<view class="scheme_price">
			<view class="scheme_price_i">
				<view class="scheme_price_iw">
					车价
				</view>
				<view class="scheme_price_ip">
					¥{{detail.price}}万
				</view>
			</view>
			<view class="scheme_price_i">
				<view class="scheme_price_iw">
					首付款
				</view>
				<view class="scheme_price_ipb">
					{{firstpay/10000}}万
				</view>
			</view>
			<view class="scheme_price_i">
				<view class="scheme_price_iw">
					月供			
				</view>
				<view class="scheme_price_ipb">
					{{premonthpay}}元
				</view>
			</view>
		</view>
		<view class="scheme_item">
			<view class="scheme_item_t">
				首付
			</view>
			<view class="scheme_item_l">
				<block wx:for="{{loanscale}}" wx:key="item">					
					<view 
						bindtap="selectScale"
						data-n="{{index}}"
						class="scheme_item_el {{index==scaleindex?'active':''}}">
						{{item*100}}%
					</view>
				</block>		
			</view>
		</view>

		<view class="scheme_item">
			<view class="scheme_item_t">
				分期
			</view>
			<view class="scheme_item_l">
				<block wx:for="{{loantime}}" wx:key="item">					
					<view 					
					bindtap="selectTime"
					data-n="{{index}}"
					class="scheme_item_el {{index==timeindex?'active':''}}">
						{{item}}期
					</view>
				</block>	
			</view>
		</view>
		<view class="scheme_condition">
			<!-- <view>首付条件：</view>
			<view>一成 需芝麻信用分600分以上，需有房产证明；</view>
			<view>二成 需芝麻信用分550分以上</view>
			<view>三成 需芝麻信用分450分以上</view> -->
			<view class='scheme_condition_po'>※本页面试算结果仅供参考，实际结果以最终复批结果为准</view>
		</view>
	</view>
</view>
<view
  class="check_c"
  style="{{showcheck?'left:0rpx;':''}}"
  wx:if="{{detail.check_info.length>0}}"
>
	<view      
		style="height:{{headerheight}}rpx;"
	></view>
	<view 
	class="check_title"
	style="height:{{headerheight}}rpx;"
	>
		<view 
	      class="check_back"
	      bindtap="closeCheck">
	      <image 
	        src="../../img/back.png"/>
	    </view>
		<view class="check_title_w">检测报告</view>
	</view>
	<page-scroll 
		styleSheet="height:{{windowh-headerheight}}rpx;"
  		scroll-y=true
		class="cardetail_check_report">
		<view class="checkw_result">
			{{detail.check_result}}
		</view>
		<block wx:for="{{detail.check_info}}" wx:key="item">
			<view class="cardetailw_check_i">
				<view class="cardetailw_check_name">{{item.name}}</view>
				<view class="cardetailw_check_si">
					<block wx:for="{{item._child}}" wx:key="id" wx:for-item="sitem" wx:for-index="indext">
						<view class="cardetailw_check_sit">
							<view class="cardetailw_check_sitn">
								<view class="cardetailw_check_sitnw">{{sitem.name}}</view>
								<view class="cardetailw_check_unp" wx:if="{{sitem.unpassn>0}}">
									{{sitem.unpassn}}项
									<image class="unpass_number" src="../../img/checknopass.png"/>
								</view>
								<view  class="cardetailw_check_p">
									{{sitem.passn}}项
									<image class="pass_number" src="../../img/checkpass.png"/>
								</view>
								<image 
									bindtap="openSub"
									data-index="{{index}}"
									data-indext="{{indext}}"
									class="cardetail_check_op {{sitem.opensub?'cardetail_check_opactive':''}}" src = "../../img/right.png"/>
							</view>
							<view  
								style="height:{{sitem.opensub?'auto':'0rpx'}};"
								class="cardetailw_check_tit">
								<block wx:for="{{sitem._child}}" wx:key="id" wx:for-item="titem" wx:for-index="indexs">
									<view class="cardetailw_check_titn">
										<view class="cardetailw_check_titna">{{titem.name}}</view>
										<image class="titn_img" src="../../img/{{titem.state?'checkpass':'checknopass'}}.png"/>
									</view>
								</block>
							</view>
						</view>
					</block>
				</view>
			</view>
		</block>  
	</page-scroll>
</view>
<include src="../../module/logs/logs.wxml"/>