<!--subpages/myMattress/myMattress.wxml-->
<view>
    <view wx:if="{{mList.length <= 0}}" class='container' style="min-height: 100vh;justify-content: center;">
        <image src="/subpages/icons/ic_no_mattress.svg" style="width: 216rpx;height: 216rpx;">
        </image>
        <text style="color: #606972;font-size: 28rpx;margin-bottom:300rpx;margin-top: 10rpx;">暂未添加床垫</text>
    </view>
    <view wx:else class="mattress-list">
        <view wx:for="{{mList}}" wx:key="index" class="mattress-item">
            <image class="item-cover" src="/subpages/images/ic-cd.png"></image>
            <view class="right-content">
                <text class="item-title">{{item.location}}</text>
                <text wx:if="{{item.online == 'yes'}}" class="item-online">已连接</text>
                <text wx:else class="item-offline">未连接</text>
                <text class="item-sn">SN：{{item.sn}}</text>
                <text class="item-user">使用人：{{item.person}}</text>
            </view>
            <view class="menu-btn" data-item="{{item}}" bindtap="showMenu"><van-icon name="ellipsis" /></view>
        </view>

    </view>
    <view class="bottom-view">
        <navigator url="/subpages/addMattresses/addMattresses" class="bottom-btn">
            <van-icon name="plus" color="#ffffff" />
            <text style="margin-left: 20rpx;">增加床垫</text>
        </navigator>
    </view>

</view>