<import-sjs
  from="./index.sjs"
  name="utils"
/>
<import-sjs
  from="../../utils-component/index.sjs"
  name="numberUtils"
/>
<wrapper>
  <view
    class="deliver-goods-container"
    a:if="{{carCheckedList}}"
    onTap="handleCardClick"
    style="border: {{isChecked ? '4rpx solid #1677ff' : '4rpx solid #fff'}}"
  >
    <view class="goods-type-head">
      <view
        class="goods-type-container"
        style="color: {{isChecked ? '#1677ff' : '#383838'}}"
      >
        <view class="goods-type-title-container">
          <view class="goods-type-title">
            {{title || '标题'}}
          </view>
          <view
            a:if="{{showFlag && !item.canOrder && item.deliverType === 'DELIVERY_LOGISTICS'}}"
            class="deliver-achieve-btn"
          >
            差{{item.differencePrice}}元起送
          </view>
          <checkbox
            a:else
            checked="{{isChecked}}"
            controlled="{{true}}"
          />
        </view>
        <view class="goods-type-info">
          共{{carCheckedList.length}}件,合计：¥ {{numberUtils.calcNumber(disCountTotalPrice,packingFee)}}
          {{utils.getMoneyTipText({ deliveryCost, packingFee })}}
        </view>
      </view>
    </view>
    <!-- goodslist -->
    <view class="deliver-goods-list">
      <!-- scorll-view -->
      <scroll-view
        scroll-x="{{true}}"
        class="goods-scroll"
      >
        <block a:for="{{carCheckedList}}">
          <!-- item -->
          <view class="goods-scroll-item">
            <default-img
              class="img"
              src="{{item.picList[0]}}"
              height="120rpx"
              width="120rpx"
            />
            <view class="img-num-tag" a:if="{{item.quantity !== 1}}">
              {{item.quantity}}件
            </view>
            <!-- <view class="name">
            {{item.name}}
          </view> -->
          </view>
        </block>
      </scroll-view>
    </view>
  </view>
</wrapper>