<van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
<custom id="Custom" isOldPrice='{{true}}' />
<Yl_ListBox id='ListBox' bind:getlist='getList'>
	<navigator url="#" wx:for="{{list}}" wx:key="itemid" class="item-box">
		<view class="top" bindtap="changeResults" data-id="{{item[idname]}}" data-item="{{item}}" bindtap="{{item.groupqty!=0 && item.maxQty<=0?'':'changeResult'}}">
			<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">
					<text class="line-1">{{item.itemname}}</text>
					<van-checkbox wx:if="{{!(item.groupqty!=0 && item.maxQty<=0)}}" custom-class="iconfont" shape='square' icon-size='24rpx' value="{{ decide.checked(item.itemid,result) }}" />
				</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}})
				</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">
						起订量:{{item.orderminqty}}，增减量:{{item.orderaddqty}}
					</view>
				</view>
				<van-stepper value="{{ item.qty }}" min="{{item.orderminqty}}" max="{{item.maxQty||'99999999'}}" disabled="{{item.groupqty!=0 && item.maxQty<=0}}" step="{{item.orderaddqty||1}}" input-class='input-class' data-index="{{index}}" data-iscatch="catch" catch:minus='stepperChange' catch:plus='stepperChange' catch:blur='inputBlur' />
			</view>
	</navigator>
	<view style="height: 100rpx;" />
	<Yl_Empty wx:if="{{list.length==0}}" />
</Yl_ListBox>
<footer wx:if="{{butText=='生成订单'}}" id='Footer' disabled='{{!result.length}}' bind:onClick='updateCart' />


<!-- 底部 -->
<block wx:else>
	<view style="height: 130rpx;" />
	<view class="footer">
		<view class="left">
			已选{{result.length}}个
		</view>
		<van-button custom-class='but' disabled='{{!result.length}}' bind:click="submit">{{butText}}</van-button>
	</view>
</block>

<wxs src="/utils/hidePrice.wxs" module="handleHide" />
<wxs module="decide">
	module.exports = {
		checked: function (id, list) {
			return list.some(function (v) {
				return v == id
			});
		}
	}
</wxs>
<wxs module="gap">
	module.exports.price = function (figure, defaultamount) {
		return (figure - defaultamount).toFixed(2)
	}
</wxs>