<!-- /packageA/market/detail?id={{item.sa_itemgroupid}}&itemno={{item.itemno}}&istool=1 -->
<view class="product" wx:for="{{list}}" wx:key="index">
    <view class="image-box">
        <van-image width="100%" wx:if="{{item.attinfos[0]||item.cover}}" height="100%" fit="cover" src="{{item.attinfos[0].subfiles[0].url||item.attinfos[0].url}}" use-loading-slot use-error-slot lazy-load>
            <van-loading slot="loading" type="spinner" size="20" vertical />
            <text slot="error">加载失败</text>
        </van-image>
        <van-image wx:else width="100%" height="100%" fit="cover" src="https://nb32663.obs.cn-east-2.myhuaweicloud.com:443/202302271677472008916B382a8d8b.jpg" 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="right-box">
        <view class="title line-1">{{item.itemname||'--'}}</view>
        <view class="type line-1">型号：{{item.model||'--'}} <text style="margin-left: 16rpx;">规格：{{item.spec||'--'}}</text></view>
        <view class="tags">
            <view style="background: #FA8C16;">
                {{item.brandname}}
            </view>
            <view wx:for="{{item.tradefield}}" wx:key="tradefield" style="background: #FF3B30;">
                {{item.tradefield}}
            </view>
        </view>
        <view class="price">
            <view>
                ￥ {{item.marketprice}}/{{item.unitname}}
            </view>
        </view>
        <block wx:if="{{userrole!='业务员'}}">
            <picker wx:if="{{item.tradefield.length>=2}}" range='{{item.tradefield}}' range-key='tradefield' data-item="{{item}}" bindchange='addToCart'>
                <navigator url="#" class="iconfont icon-gouwuche" bindtap="showTips" />
            </picker>
            <navigator url="#" class="iconfont icon-gouwuche" data-item="{{item}}" bindtap="addToCart" />
        </block>
    </view>
</view>
<Yl_Empty wx:if="{{list.length === 0}}" />