<view class="page">
    <view class="page-bd">
        <view class="module" wx:if="{{goodsList.length > 0}}">
            <view class="module-hd">
                <text class="tit">玥子轩母婴产品</text>
                <view class="text-right" bindtap="changeEditStatus">{{isEditing ? '完成' : '编辑'}}</view>
            </view>
            <view class="module-bd">
                <view class="goods-item" wx:for="{{goodsList}}" bindtap="changeSelect" data-index="{{index}}">
                    <view class="left">
                        <image class="icon-check" src="/img/icon-circle-check{{item.checked ? 'ed' : ''}}.png"></image>
                        <image class="goods-img" src="{{item.photo}}"></image>
                        <view class="goods-info">
                            <view class="num-counter" wx:if="{{isEditing}}">
                                <view class="minus" catchtap="minusAmount" data-index="{{index}}">-</view>
                                <text class="input-num">{{item.product_amount}}</text>
                                <view class="plus" catchtap="addAmount" data-index="{{index}}">+</view>
                            </view>
                            <view class="goods-name" wx:else>{{item.name}}</view>
                            <view class="goods-price">
                                <text class="unit">￥</text>{{item.price}}</view>
                        </view>
                    </view>
                    <view class="right">
                        <view class="btn-delete" wx:if="{{isEditing}}" catchtap="deleteGoods" data-index="{{index}}"
                            data-id="{{item.id}}">
                            <text>删除</text>
                        </view>
                        <view class="amount" wx:else>×{{item.product_amount}}</view>
                    </view>
                </view>
            </view>
            <view class="module-ft">
                <view class="booking">
                    <view class="input-item">
                        <view class="label">姓名</view>
                        <view class="input-content">
                            <input type="text" class="input-text" bindinput="_handleInput" data-name="name" placeholder="您的称呼" />
                        </view>
                    </view>
                    <view class="input-item">
                        <view class="label">电话</view>
                        <view class="input-content">
                            <input type="number" class="input-text" bindinput="_handleInput" data-name="phone" placeholder="您的手机号码" />
                        </view>
                    </view>
                    <view class="input-item ">
                        <view class="label ">地址</view>
                        <view class="input-content">
                            <input type="text" class="input-text" bindinput="_handleInput" data-name="address" placeholder="寄送地址" />
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <view class="empty-content" wx:else>
            <view class="empty-content-text">购物车空空如也</view>
        </view>
    </view>
    <view class="page-ft">
        <view class="total">
            <view class="left">
                <view class="select-all" catchtap="changeSelectAll">
                    <image class="icon-check" src="/img/icon-circle-check{{(selectedAmount > 0 && selectedAmount === goodsList.length) ? 'ed' : ''}}.png"></image>全选
                </view>
            </view>
            <view class="right">
                <block wx:if="{{isEditing}}">
                    <view class="btn-delete" bindtap="deleteSelected">删除</view>
                </block>
                <block wx:else>
                    <view class="total-price">合计：
                        <text class="price">￥{{totalPrice}}</text>
                    </view>
                    <view class="btn-settle" bindtap="toSettle">去结算({{selectedAmount}})</view>
                </block>
            </view>
        </view>
    </view>
</view>