<!-- 骨架屏 -->
<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="cover" 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}}
	</view>
	<view class="tags">
		<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">￥{{detail.gradeprice}}</text>
			<text class="old-price">￥{{detail.oldprice}}</text>
		</view>
		<text class="unit">单位/{{detail.unitname}}</text>
	</view>
	<view class="else">
		<text>起订量:10</text>
		<text>库存:1200 紧缺</text>
	</view>
</view>
<!-- 选择型号 -->
<view class="model">
	<view class="label">
		选择商品
	</view>
	<view class="product-box">
		<navigator url="#" class="product {{itemno===item.itemno?'active':''}}" wx:for="{{rows}}" wx:key="itemno" bindtap="changeItemno" data-item="{{item}}">{{item.spec}}</navigator>
	</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.spec}}
			</view>
			<view class="row">
				型号：{{detail.model}}
			</view>
			<view class="row">
				材质：—
			</view>
		</view>
	</van-tab>
	<van-tab title="产品资料">
		<view class="tab-box">
			<view class="row">
				产品手册:
			</view>
			<navigator class="row" url="#">
				紫铜快接产品册-2022
			</navigator>
			<view class="row">
				安装指南：
			</view>
			<navigator class="row" url="#">
				紫铜快接产品册-2022
			</navigator>
			<view class="row">
				安装教程：
			</view>
			<navigator class="row" url="#">
				紫铜快接产品册-2022
			</navigator>
		</view>
	</van-tab>
</van-tabs>
<!-- 底部 -->
<view style="height: 150rpx;" />
<view class="footer">
	<picker wx:if="{{detail.tradefield.length>=2}}" range='{{detail.tradefield}}' range-key='tradefield' bindchange='storage'>
		<van-button custom-class='but' bindtap="clickBut">加入购物车</van-button>
	</picker>
	<van-button wx:else custom-class='but' bindtap="clickBut">加入购物车</van-button>
</view>

<!-- 购物车按钮 -->
<Float id="Float" />