<import-sjs
  name="utils"
  from="./index.sjs"
/>
<wrapper>
  <!-- 页面主体 -->
  <block a:if="{{hasLocation}}">
    <view
      class="shop-deliver-info"
      a:if="{{showFlag}}"
    >
      <!-- <default-img
        height="28rpx"
        width="28rpx"
        src="https://gw.alipayobjects.com/mdn/rms_933648/afts/img/A*TAAISJymbPgAAAAAAAAAAAAAARQnAQ"
      /> -->
      <view class="shop-deliver-tag-left">
        门店支持配送
      </view>
      <view class="shop-deliver-tag-right">
        起送金额：¥{{startDeliveryAmount}}
      </view>
    </view>
    <view class="mall-index-container">
      <view
        class="mall-index"
        a:if="{{globalTabs.length}}"
        style="{{`height: calc(100vh - ${tabBarHight+(+headB2bHight)+headerHight+extraTotalHight}px)`}}"
      >
        <!-- style="{{scrollArriveTop ? `height: calc(100vh - ${tabBarHight+(+headerHight)}px);over-flow: hidden` : 'height: auto;'}}" -->
        <vtabs
          className="vtab-class"
          tabs="{{globalTabs}}"
          a:if="{{ globalTabs.length }}"
          swipeable="{{true}}"
          animated="{{false}}"
          onChange="onChange"
          activeTab="{{activeTab}}"
          sameFontSize="{{true}}"
          tabBarlineShow="{{true}}"
          ref="saveRef"
        >
          <view class="right-list">
            <block
              a:for="{{globalGoodsList}}"
              a:for-item="listItem"
            >
              <vtab-content
                anchor="{{listItem.anchor}}"
                key="{{'key'+listItem.anchor}}"
              >
                <view class="group-text">{{utils.getCategoryName(globalTabs,index)}}</view>
                <view class="anchor-list">
                  <view a:if="{{!listItem.list.length}}">
                    <empty-goods-list />
                  </view>
                  <block
                    a:else
                    a:for="{{listItem.list}}"
                  >
                    <goods-item
                      activeId="{{jumpId}}"
                      targetId="#carFixedEnd"
                      goodsItem="{{item}}"
                      componentData="{{componentData}}"
                      key="{{'goodsItem'+item.skuId}}"
                      defaultNum="{{item.quantity}}"
                      onItemChange="handelItemChange"
                      showStock="{{item.stockStatus === 'Y'}}"
                      isGoToDetail="{{true}}"
                      showBooking="{{true}}"
                      showAuto="{{true}}"
                    ></goods-item>
                  </block>
                </view>
              </vtab-content>
            </block>
          </view>
        </vtabs>
      </view>
    </view>

    <!-- 底部 fix -->
    <mall-car-popup
      a:if="{{globalTabs.length}}"
      tabBarHight="{{tabBarHight}}"
      componentData="{{componentData}}"
      ref="saveCarRef"
      showFlag="{{showFlag}}"
      startDeliveryAmount="{{startDeliveryAmount}}"
    >
      <shop-car-button
        onConfirmClick="handleConfirm"
        onCarClick="handleCarClick"
        tabBarHight="{{tabBarHight}}"
        showFlag="{{showFlag}}"
        startDeliveryAmount="{{startDeliveryAmount}}"
      />
    </mall-car-popup>
  </block>
  <!-- <empty
    a:else
    emptyImage="{{emptyImage}}"
    title="什么都没有"
    message="开启定位试试吧"
  >
    <view
      class="location-btn"
      onTap="refreshPage"
    >
      回到首页
    </view>
  </empty> -->
</wrapper>