
<view class="content">
    <block wx:if="{{isUser}}">
        <!-- 工具栏 -->
        <view class="bag-header">
            <view class="bag-header-add-select">
                <view class="checkbox allCheckbox">
                    <checkbox checked="{{allCheckbox}}" bindtap="allCheckbox"></checkbox>
                </view>
                全选
            </view>
        </view>

        <!-- 购物袋 -->
        <view class="bag-content" wx:if="{{bags.length > 0}}">
            <view class="bag-content-mall" wx:for="{{bags}}" wx:key="bagList" wx:for-item="bagList" wx:for-index="sellerIndex">
                <view class="bag-content-mall-name nowrap">
                    <view class="checkbox sellerCheckbox">
                        <checkbox checked="{{bagList.shop.mallState}}" data-seller="{{sellerIndex}}" bindtap="sellerCheckbox"></checkbox>
                    </view>
                    {{ bagList.shop.name }}
                </view>
                <view class="bag-content-mall-goods" wx:for="{{bagList.items}}" wx:key="mallGood" wx:for-index="goodsIndex">
                    <view class="checkbox">
                        <checkbox checked="{{item.state}}" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="checkbox"></checkbox>
                    </view>
                    <image class="mall-good-cover" src="{{item.cover}}" mode="aspectFill"></image>
                    <view class="mall-good-content">
                        <view class="mall-good-title nowrap">{{item.name}}</view>
                        <view class="mall-good-value nowrap">{{item.sku_name}}</view>
                        <view class="mall-good-price nowrap">
                            ￥{{item.price}}
                            <view class="mall-good-number">
                                <view class="mall-good-number-btn" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="goodsNumber" data-type="remove">-</view>
                                <input class="mall-good-number-input" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" value="{{item.qty}}" type="number" bindblur="goodsNumberInput"></input>
                                <view class="mall-good-number-btn" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}" bindtap="goodsNumber" data-type="plus">+</view>
                            </view>
                        </view>
                    </view>
                    <view class="mall-good-more" bindtap="actionSheet" data-seller="{{sellerIndex}}" data-goods="{{goodsIndex}}">
                        <image src="/static/icons/bag_more_icon.png" mode="widthFix"></image>
                    </view>
                </view>
            </view>
        </view>

        <!-- 购物袋为空 -->
        <view class="pack-center pages-hint" wx:else>
            <image src="/static/icons/carnull_icon.png"></image>
            <view>购物袋中暂无任何商品</view>
        </view>

        <!-- 结算 -->
        <view class="bag-footer">
            <view class="bag-footer-price">合计<text>￥{{allPrice}}</text></view>
            <view class="bag-footer-rests">共计{{bagNumber}}件</view>
            <button class="bag-footer-btn" size="mini" bindtap="bagOrder" disabled="{{bagOrderLoading}}" loading="{{bagOrderLoading}}">结算</button>
        </view>
    </block>

    <block wx:else>
        <!-- 用户未登录 -->
        <view class="pack-center pages-loding auth-login">
            <image src="/static/icons/carnull_icon.png"></image>
            <view>您还未登录，无法查看您的购物车信息</view>
            <navigator class="auth-btn" url="/pages/login/index">登录</navigator>
        </view>
    </block>
</view>
