<view class="head" />
<custom id="Custom" />
<Yl_ListBox id='ListBox' bind:getlist='getList'>
	<van-swipe-cell wx:for="{{list}}" wx:key="itemid" id="swipe-cell" right-width="{{ 65 }}" async-close data-item="{{item}}" bind:close="deteleItem">
		<view url="#" class="item-box">
			<view class="top" catch:tap="changeResults" 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}}" 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 shape='square' disabled="{{sa_brandid && sa_brandid!=item.sa_brandid}}" icon-size='24rpx' value="{{ decide.checked(item.sa_shoppingcartid,results) }}" />
					</view>
					<view class="exp">编号：{{item.itemno}}</view>
					<view class="exp">型号：{{item.model ||" --"}}</view>
					<view class="exp">品牌：{{item.brandname ||" --"}}</view>
					<view class="exp">领域：{{item.tradefield_shoppingcart ||" --"}}</view>
					<view class="exp" wx:if="{{item.iscustomsize}}" data-item="{{item}}" catch:tap="customization" style="color:#085CDF;">
						{{item.customText}}
						<van-icon name="arrow-down" />
					</view>
					<view class="price" style="bottom: {{item.iscustomsize?'40rpx':'0rpx'}};">{{handleHide.verify(item.showPrice,'购物车价格',privacyFieldC)}}/{{item.unitname}}</view>
				</view>
			</view>
			<view class="bottom">
				<view class="check label-class">
					起订量:{{item.orderminqty}}，增减量:{{item.orderaddqty}}，包装数量:{{item.packageqty}}
				</view>
				<van-stepper button-size='{{32}}' value="{{ item.qty }}" min="{{item.orderminqty}}" step="{{item.orderaddqty||1}}" input-class='input-class' data-index="{{index}}" bind:minus='stepperChange' bind:plus='stepperChange' bind:blur='inputBlur' />
			</view>
		</view>
		<view slot="right" class="cell-right">删 除</view>
	</van-swipe-cell>
	<Yl_Empty wx:if="{{list.length === 0}}" />
	<view style="height: 120px;" />
</Yl_ListBox>
<view class="footer-box">
	<view class="footer">
		<view class="left">
			<view style="margin-top: 8rpx;">
				<van-checkbox icon-size="26rpx" shape='square' value="{{ isAll }}" bind:change="setIsAll">全选 <text class="selected">已选{{results.length}}件</text></van-checkbox>
			</view>
			<view class="sum">
				合计:<text>{{handleHide.verify(sum,'购物车价格',privacyFieldC)}}</text>
			</view>
			<view class="transport">
				{{logistics}}
			</view>
		</view>
		<picker wx:if="{{classList.length>=2}}" range='{{classList}}' range-key='name' disabled='{{!results.length}}' bindchange="submit">
			<van-button custom-class='but' disabled='{{!results.length}}' bind:click="clickBut">生成订单</van-button>
		</picker>
		<van-button wx:else custom-class='but' disabled='{{!results.length}}' bind:click="clickBut">生成订单</van-button>
	</view>
</view>
<wxs module="decide">
	module.exports = {
		checked: function (id, list) {
			return list.some(function (v) {
				return v == id
			});
		}
	}
</wxs>
<wxs src="/utils/hidePrice.wxs" module="handleHide" />