<!-- 骨架屏 -->
<import src="./detail.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" />
<!-- 轮播图 -->
<swiper indicator-dots circular indicator-active-color='#333'>
	<swiper-item wx:for="{{files.images}}" wx:key="attachmentid" data-index="{{index}}" data-type='image' bindtap="viewMedias">
		<van-image width="100vw" height="464rpx" fit="contain" src="{{item.cover}}" use-loading-slot use-error-slot lazy-load>
			<van-loading slot="loading" type="spinner" size="20" vertical />
			<text slot="error">加载失败</text>
		</van-image>
	</swiper-item>
</swiper>
<!-- 产品介绍 -->
<view class="intr">
	<view class="title">
		{{detail.itemname}} <van-tag type="warning">{{detail.delistingstatus}}</van-tag>
	</view>
	<view class="tags">
		<text wx:if="{{detail.iscustomsize==1}}" style="background-color: #EE0A24;color: #fff;">定制</text>
		<text wx:for="{{detail.brand}}" wx:key="sa_brandid">{{item.brandname}}</text>
		<text wx:for="{{detail.tradefield}}" wx:key="index">{{item.tradefield}}</text>
	</view>
	<view class="offer">
		<view>
			<text class="price">{{handleHide.query(detail.gradeprice,hidePrice)}}</text>
		</view>
		<text class="unit">单位/{{detail.unitname}}</text>
	</view>
	<view class="else">
		<text>起订量：{{detail.orderminqty||' --'}}</text>
		<text>增量：{{detail.orderaddqty||' --'}}</text>
		<text>包装数量:{{detail.packageqty||' --'}}</text>
	</view>
</view>
<!-- 选择规格 -->
<view class="model">
	<block wx:if="{{specRows.length}}">
		<view class="label">
			规格
		</view>
		<view class="product-box">
			<navigator url="#" class="product {{content.spec===item.parm?'active':''}} {{item.flag?'':'disabled'}}" wx:for="{{specRows}}" wx:key="index" bindtap="changeItemno" data-valuename="spec" data-value="{{item}}">{{item.parm=='custom'?'自定义':item.parm}}</navigator>
		</view>
	</block>
	<block wx:if="{{colorRows.length}}">
		<view class="label">
			颜色
		</view>
		<view class="product-box">
			<navigator url="#" class="product {{content.color===item.parm?'active':''}} {{item.flag?'':'disabled'}}" wx:for="{{colorRows}}" wx:key="index" bindtap="changeItemno" data-valuename="color" data-value="{{item}}">{{item.parm}}</navigator>
		</view>
	</block>
	<block wx:if="{{materialRows.length}}">
		<view class="label">
			材质
		</view>
		<view class="product-box">
			<navigator url="#" class="product {{content.material===item.parm?'active':''}} {{item.flag?'':'disabled'}}" wx:for="{{materialRows}}" wx:key="index" bindtap="changeItemno" data-valuename="material" data-value="{{item}}">{{item.parm}}</navigator>
		</view>
	</block>
	<block wx:if="{{cheekRows.length}}">
		<view class="label">
			边框
		</view>
		<view class="product-box">
			<navigator url="#" class="product {{content.cheek===item.parm?'active':''}}  {{item.flag?'':'disabled'}}" wx:for="{{cheekRows}}" wx:key="index" bindtap="changeItemno" data-valuename="cheek" data-value="{{item}}">{{item.parm}}</navigator>
		</view>
	</block>
	<!-- 定制项 -->
	<view wx:if="{{detail.iscustomsize==1}}" style="padding-bottom: 20rpx;">
		<view class="label">
			定制
		</view>
		<block wx:if="{{cLength}}">
			<view class="label custom" wx:if="{{cLength.type == '自定义'}}">
				<view style="display: flex; align-items: center;">
					<view style="margin-right: 20rpx;">长:</view>
					<van-stepper plus-class='plus-class' value="{{ content.dlength  }}" input-width="60px" min="{{cLength.min}}" max="{{cLength.max}}" decimal-length="{{ cLength.decimalplaces }}" data-name="cLength" bind:plus='cahngeStepper' bind:blur='cahngeStepper' bind:minus='cahngeStepper' />
					<view class="explain">{{cLength.min+' ~ '+ cLength.max}},<text wx:if="{{cLength.decimalplaces}}">保留{{cLength.decimalplaces}}位小数</text><text wx:else>不保留小数</text></view>
				</view>
			</view>
			<view class="label custom" wx:else>
				<view style="display: flex;">
					<view style="margin-right: 20rpx;margin-top: 30rpx;">长:</view>
					<view class="product-box">
						<navigator url="#" class="product {{content.dlength===item.num?'active':''}}" wx:for="{{cLength.rowsdetail}}" wx:key="rowindex" bindtap="customParameter" data-valuename="dlength" data-value="{{item.num}}">{{item.num}}</navigator>
					</view>
				</view>
			</view>
		</block>
		<block wx:if="{{cWidth}}">
			<view class="label custom" wx:if="{{cWidth.type == '自定义'}}">
				<view style="display: flex; align-items: center;">
					<view style="margin-right: 10rpx;">宽:</view>
					<van-stepper plus-class='plus-class' value="{{ content.dwidth }}" input-width="60px" min="{{cWidth.min}}" max="{{cWidth.max}}" decimal-length="{{ cWidth.decimalplaces }}" data-name="cWidth" bind:plus='cahngeStepper' bind:blur='cahngeStepper' bind:minus='cahngeStepper' />
					<view class="explain">{{cWidth.min+' ~ '+ cWidth.max}},<text wx:if="{{cWidth.decimalplaces}}">保留{{cWidth.decimalplaces}}位小数</text><text wx:else>不保留小数</text></view>
				</view>
			</view>
			<view class="label custom" wx:else>
				<view style="display: flex;">
					<view style="margin-right: 20rpx;margin-top: 30rpx;">宽:</view>
					<view class="product-box">
						<navigator url="#" class="product {{content.dwidth===item.num?'active':''}}" wx:for="{{cWidth.rowsdetail}}" wx:key="rowindex" bindtap="customParameter" data-valuename="dwidth" data-value="{{item.num}}">{{item.num}}</navigator>
					</view>
				</view>
			</view>
		</block>
	</view>

</view>
<van-tabs custom-class='tabs' title-active-color='var(--assist)' color='var(--assist)'>
	<van-tab title="商品简介">
		<view class="tab-box">
			<view class="row">
				品号：{{detail.itemno}}
			</view>
			<view class="row">
				型号：{{detail.model || ' --'}}
			</view>
			<view class="row">
				规格：{{detail.standards || ' --'}}
			</view>
			<view class="row">
				特殊说明：{{detail.specalnote || ' --'}}
			</view>
		</view>
	</van-tab>
	<van-tab title="产品资料">
		<Yl_Empty wx:if="{{detail.technicalinfo.length==0}}" />
		<view wx:else class="document-box">
			<navigator class="document" url="#" wx:for="{{detail.technicalinfo}}" wx:key="index" bindtap="openDocument" data-item="{{item}}">{{item.document}}</navigator>
		</view>
	</van-tab>
</van-tabs>
<view style="height: 200rpx;" />
<view class="cu-bar bg-white tabbar border shop footer">
	<navigator url="#" class="action" style="height: 100%;display: flex; flex-direction: column; align-items: center;" bindtap="toCollect">
		<view class="cuIcon-cart">
			<view class="cu-tag badge">{{badge}}</view>
		</view>
		购物车
	</navigator>
	<picker wx:if="{{detail.tradefield.length>=2}}" range='{{detail.tradefield}}' range-key='tradefield' bindchange='storage'>
		<view class="bg-orange submit" bindtap="clickBut">加入购物车</view>
	</picker>
	<view wx:else class="bg-orange submit" bindtap="clickBut">加入购物车</view>
</view>
<wxs src="/utils/hidePrice.wxs" module="handleHide" />