<import src="./index.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" />

<van-search class="search" value="{{ condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
<van-tabs wx:if="{{packageList.length}}" active="{{ params.content.where.packagetypemx }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
	<van-tab wx:for="{{packageList}}" wx:key="index" title="{{item}}" name='{{item}}' />
</van-tabs>
<custom id="Custom" isOldPrice='{{true}}' />
<view style="height: 20rpx;" />
<Yl_ListBox id='ListBox' bind:getlist='getList'>
	<view wx:for="{{searchList}}" wx:key="itemid" class="item-box">
		<view class="top" data-id="{{item[idname]}}" data-item="{{item}}">
			<view class="image">
				<van-image width="100%" height="100%" fit="cover" src="{{item.attinfos[0].subfiles[0].url||item.attinfos[0].url||item.cover||123123}}" use-loading-slot use-error-slot lazy-load>
					<van-loading slot="loading" type="spinner" size="20" vertical />
					<text slot="error">暂无图片</text>
				</van-image>
			</view>
			<view class="content">
				<view class="title line-1">
					{{item.itemname}}
				</view>
				<view class="exp">编号：{{item.itemno}}</view>
				<view class="exp">规格：{{item.standards ||" --"}}</view>
				<view class="exp">型号：{{item.model ||" --"}}</view>
				<view class="exp"><text style="font-size: 24rpx;font-weight: 600;color: #FF3B30;">{{handleHide.verify(item.showPrice||item.newPrice,'列表金额',privacyFieldC)}}</text><text style="font-size: 20rpx; text-decoration:line-through; margin-left: 6rpx;">{{handleHide.verify(item.newOldPrice||item.oldPrice,'列表金额',privacyFieldC)}}</text></view>
				<view wx:if="{{item.iscustomsize}}" class="exp" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
					{{item.customText}}
					<van-icon name="arrow-down" />
				</view>
				<view class="exp">特征码：{{item.signaturecode ||" --"}}</view>
				<view class="exp">
					包装数量：{{item.packageqty}} ({{item.unitname || item.unit}})
				</view>
				<view class="exp">可购数量：{{item.groupqty==0?'不限购':(item.groupqty-item.saledqty)<=0?'已售罄':item.maxQty}} </view>
				</view>
			</view>

			<view class="bottom">
				<view class="check" bindtap="changeResults" data-item="{{item}}">
					<view class="label-class" style="font-size: 26rpx;">
						数量:
					</view>
				</view>
				<van-stepper value="{{ item.orderminqty }}" min="{{item.orderminqty}}" max="{{item.maxQty||'99999999'}}" disabled="true" step="{{item.orderaddqty||1}}" input-class='input-class' data-index="{{index}}" data-iscatch="catch" catch:minus='stepperChange' catch:plus='stepperChange' catch:blur='inputBlur' />
			</view>
		</view>
		<view style="height: 200rpx;" />
		<Yl_Empty wx:if="{{searchList.length==0}}" />
</Yl_ListBox>

<van-dialog id="Dialog" use-slot show="{{ dialogShow }}" asyncClose confirm-button-color='#085CDF' show-cancel-button>
	<view class="qty-box">
		<view class="title">
			{{params.content.where.packagetypemx}}
		</view>
		<view class="change-qty-box">
			购买套数：
			<van-stepper custom-class='stepper' value="{{ submitQty }}" integer min="1" max="99999999999" step="1" input-width='50px' button-size='30px' bind:change='changeQtySte' />
		</view>
	</view>
</van-dialog>

<!-- 底部 -->
<view style="height: 130rpx;" />
<view class="footer">
	<view class="left">
		选择：{{params.content.where.packagetypemx}}
	</view>
	<van-button custom-class='but' disabled="{{!list.length}}" bind:click="submit">{{butText}}</van-button>
</view>

<wxs src="/utils/hidePrice.wxs" module="handleHide" />