<!-- 会员中心 -->
<!--pages/memberCenter/memberCenter.wxml-->
<view class="member-index">
  <!-- 会员信息 -->
  <view class="member-msg">
    <view class="member-container">
      <image src="../../images/icon/memberLevelBg.png" class="m-bg {{isSmallScreen?'small-screen':''}}" />
      <view class="member-info">
        <view class="member-info-top">
          <view class="user-info">
            <image class="user-avatar" src="{{userInfo.pic?userInfo.pic:'../../../images/icon/head04.png'}}"></image>
            <view class="user-nickname">
              <view class="nickname">{{memberInfo.nickName}}</view>
              <!-- <view class="user-score" bindtap="routeTo" data-path="scoreDet">
                <image class="score-img" src="../../images/icon/integral.png"></image>
                <text> 积分: {{memberInfo.score}} </text>
                <image class="right-arr" src="../../images/icon/white-arr.png"></image>
              </view> -->
            </view>
          </view>
          <view class="user-level">
            <text>{{memberInfo.userLevel.levelName}}</text>
            <!-- <image wx:if="{{(memberInfo.userLevel.level>1 && memberInfo.levelType ==0) || memberInfo.levelType !=0}}" class="level-img" src='../../images/icon/vip{{memberInfo.userLevel.level}}.png'></image> -->
          </view>
        </view>

        <view class="member-info-bottom">
          <view class="vip-level-progress">
            <view class="level-tips">
              <text wx:if="{{memberInfo.nextGrowth -memberInfo.growth < 0}}">当前成长值已满</text>
              <text wx:else>升级还需 {{memberInfo.nextGrowth -memberInfo.growth}}成长值</text>
              <progress class="level-progress" percent="{{percent}}" backgroundColor="#feeee0" activeColor="#9e642e" active="{{true}}" border-radius="8" stroke-width="4"></progress>
              <view class="level-span">
                <text>{{memberInfo.userLevel.levelName}}</text>
                <text>{{memberInfo.nextLevelName}}</text>
              </view>
            </view>
            <view class="level-text" wx:if="{{memberInfo.nextGrowth}}">成长值 {{memberInfo.growth}} / {{memberInfo.nextGrowth}}</view>
            <view class="level-text" wx:else>成长值 {{memberInfo.growth}}</view>
          </view>
        </view>
      </view>

    </view>
  </view>
  <!-- /会员信息 -->

  <!-- 会员成长说明 -->
  <view class="member-growth" wx:if="{{memberInfo.levelType!=1}}">
    <view class="member-tit">
      <view class="text">会员成长说明</view>
    </view>
    <!-- 成长值 -->
    <view class="growth-value">
      <view class="value-table">
        <view class="tr">
          <view class="td-left th">等级</view>
          <view class="td-right th">对应成长值</view>
        </view>
        <view class="tr" wx:for="{{userLevels}}" wx:key="id">
          <view class="td-left">{{item.levelName}}</view>
          <view class="td-right">{{item.needGrowth}}</view>
        </view>
      </view>

    </view>
    <!-- 成长值 -->

  </view>
  <!-- /会员成长说明 -->


  <!-- vip专属权益 -->
  <view class="member-growth member-rights">
    <view class="member-tit">
      <view class="text">会员专属权益</view>
      <text class="more-rights" bindtap="toogleShowRights">更多权益></text>
    </view>
    <view class="rights-container">
      <block wx:for="{{memberInfo.userLevel.userRights}}" wx:for-item="right" wx:key="rightsId">
        <view class="right-item">
          <view class="right-lf">
            <image mode="widthFix" src="{{right.icon}}"></image>
          </view>
          <view class="right-rt">
            <view class="right-tit">
              {{right.rightsName}}
            </view>
            <view class="right-desc">
              {{right.description}}
            </view>
          </view>
        </view>
      </block>
    </view>
  </view>
  <!-- /vip专属权益 -->


  <!-- 弹窗Swiper -->
  <view class="swiperPop" wx:if="{{showRights}}">
    <view class="mask" wx:if="{{showRights}}" bindtap="toogleShowRights">
      <view class="close">
        <image src="../../../images/icon/close-white.png"></image>
      </view>
    </view>
    <swiper indicator-dots indicator-active-color="#fff" indicator-color="rgba(255,255,255,.2)" duration="{{duration}}" next-margin='20rpx' previous-margin='50rpx'>
      <block wx:for="{{userLevels}}" wx:for-item="levelItem" wx:key="id">
        <swiper-item class="member-item">
          <view class="swiper-box">
            <view class="top-bg">
              <image class="member-bg" src="{{levelItem.img}}"></image>
              <view class="top-con">
                <view class="member-title">{{levelItem.levelName}}</view>
                <text class="member-desc">{{levelItem.userRights.length}}项 会员权益 </text>
              </view>
            </view>
            <view class="rights-item-con">
              <block wx:for="{{levelItem.userRights}}" wx:for-item="right" wx:key="rightsId">
                <view class="rights-item">
                  <view class="rights-img">
                    <image mode="heightFix" src="{{right.icon}}"></image>
                  </view>
                  <view class="rights-tit">{{right.rightsName}}</view>
                  <view class="rights-desc">{{right.description}}</view>
                </view>
              </block>
            </view>
          </view>
        </swiper-item>
      </block>
    </swiper>
  </view>
  <!-- /弹窗Swiper -->

</view>

<wxs module="wxs" src="../../../wxs/number.wxs" />