<import-sjs
  name="utils"
  from="./index.sjs"
/>
<import-sjs
  from="../utils-component/index.sjs"
  name="numberUtils"
/>
<wrapper>
  <view
    class="footer-button-container"
    style="{{`position: ${position}`}}"
  >
    <view class="bottom-container">
      <view
        class="tap-block"
        onTap="openCarPop"
      >
        <!--   icon -->
        <view
          class="car-icon"
          a:if="{{showIcon}}"
        >
          <view id="carBottomEnd">
            <block a:if="{{showColorBtn}}">
              <image
                a:if="{{!selectNum}}"
                class="car-icon-img"
                src="{{carIconAddress}}"
              />
              <badge
                a:else
                text="{{selectNum}}"
                overflowCount="{{99}}"
              >
                <image
                  slot="inner"
                  class="car-icon-img"
                  src="{{carIconAddress}}"
                />
              </badge>
            </block>
            <block a:else>
              <image
                class="car-icon-img"
                src="{{inActiveCarIcon}}"
              />
            </block>
          </view>
        </view>
        <!--  金额 -->
        <view class="car-money-container">
          <view
            class="car-money"
            a:if="{{showColorBtn}}"
          >
            <view class="total">
              合计
            </view>
            <view class="price">
              <view class="price-icon">¥</view>
              {{numberUtils.calcNumberThird(disCountTotalPrice,packingFee,item.deliveryCost)}}
            </view>
            <view
              class="pre-price"
              a:if="{{discountShow && disCountTotalPrice!==totalPrice}}"
            >¥{{numberUtils.calcNumberThird(totalPrice,packingFee,item.deliveryCost)}}</view>
          </view>
          <view class="btn-modal-container">
            <view
              a:if="{{item.deliveryCost || packingFee}}"
              class="btn-modal-text"
            >(含</view>
            <modal-group
              btnConfig="{{btnConfig}}"
              item="{{item}}"
            />
            <view
              a:if="{{item.deliveryCost || packingFee}}"
              class="btn-modal-text"
            >)</view>
          </view>
        </view>
      </view>
      <!-- 按钮 -->
      <block a:if="{{showColorBtn && showColorCar}}">
        <!-- <view
          class="{{utils.canGotoConfirm(globalCar) || isConfirm ? 'car-button' : 'car-button-inactive'}}"
          onTap="onHandelClick"
        >{{buttonText}}</view> -->
        <form
          onSubmit="onHandleClick"
          report-submit={{true}}
        >
          <button
            class="{{utils.canGotoConfirm(globalCar) || isConfirm ? 'car-button' : 'car-button-inactive'}}"
            form-type="submit"
            style="display: inline;"
          >{{buttonText}}</button>
        </form>
      </block>
      <form a:else>
        <button
          class="car-button-inactive"
          style="display: inline;"
        >{{buttonText}}
          <am-icon
            a:if="{{(numberUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0)  < startDeliveryAmount) && showTip}}"
            type="QuestionCircleOutline"
            color="#fff"
            size="6"
            onTap="showModal"
          />
        </button>
      </form>
    </view>
  </view>
</wrapper>