<!--pages/mine/mine.wxml-->
<view class="container">
    <view class="top-box" bindtap="showDialog">
        <image class="top-bg" src="../../static/bg/index_bg.png" mode="widthFix"></image>
        <view class="user-bg">

        </view>
        <view class="userInfo-box">
            <view class="user-h-view" style="align-items: center;">
                <image class="avatar" src="{{avatarUrl}}" mode="aspectFill"></image>
                <view class="user-v-view" style="flex: 1;height: fit-content;margin:64rpx 30rpx 0 30rpx;">
                    <text class="username">{{nickName}}</text>
                    <view class="user-h-view" style="align-items: center;">
                        <text class="phoneNumber">{{phoneNumber}}</text>
                        <text wx:if="{{hasAuth}}" class="edit-btn">编辑资料</text>
                    </view>
                </view>
            </view>
        </view>
    </view>
    <image class="ad-banner" src="../../static/bg/mine-ad.png" mode="widthFix"></image>


    <view class="card-menu">
        <view class="card-menu-item" wx:for="{{ menuCardList }}" wx:key="index" bindtap="onMenuCardClick"
            data-index="{{ index }}" style="background-color: {{item.bgColor}};">
            <image class="bg-card-menu" src="{{item.bgIcon}}" mode="widthFix"></image>
            <text class="card-menu-title" style="color: {{item.color}};">{{item.title}}</text>
            <image class="ic-card-menu" src="{{item.icon}}" mode="widthFix"></image>
        </view>

    </view>
    <view class="menu-card">
        <view class="menu-item" wx:for="{{ menuList }}" wx:key="index" bindtap="onMenuClick" data-index="{{ index }}">
            <image class="ic-menu" src="{{item.icon}}" mode="widthFix"></image>
            <text class="menu-title">{{item.title}}</text>
            <button wx:if="{{item.type == 'contact'}}" open-type="contact"></button>
        </view>
    </view>
    <authorized-login-dialog showDialog="{{showAuthorizedDialog}}"
        bind:authorizationSuccessful="authorizationSuccessful"></authorized-login-dialog>



    <van-popup show="{{ showTipsA }}" bind:close="onCloseTipsDialog" custom-style="background-color: transparent;">
        <view class="tips-box">
            <view class="tips-content">
                <image class="ic-tips" src="/static/index/icon/ic_zwqx1.png" mode="widthFix"></image>
                <text class="tips-title">暂无权限</text>
                <text
                    class="tips-desc">{{'暂无权限的原因如下：\n1、您不是酒店住客或者爱眠客床垫用户，没有权限查看睡眠报告。\n2、您是酒店住客，但是没有获取到您的信息，请联系前台。\n3、您是爱眠客床垫用户，请联系客服。'}}</text>
            </view>
            <view class="tips-close-btn" bindtap="onCloseTipsDialog">
                <van-icon name="close" color="#FFFFFF" size="56rpx" />
            </view>
        </view>
    </van-popup>

    <van-popup show="{{ showTipsB }}" bind:close="onCloseTipsDialog" custom-style="background-color: transparent;">
        <view class="tips-box">
            <view class="tips-contentB">
                <image class="ic-tips" src="/static/index/icon/ic_zwqx2.png" mode="widthFix"></image>
                <text class="tips-title">暂无权限</text>
                <text class="tips-desc">{{'暂无权限的原因如下：\n1、您不是酒店住客，没有权限控制房间智能设备。\n2、您是酒店住客，但是没有获取到您的信息，请联系前台。'}}</text>
            </view>
            <view class="tips-close-btn" bindtap="onCloseTipsDialog">
                <van-icon name="close" color="#FFFFFF" size="56rpx" />
            </view>
        </view>
    </van-popup>


</view>