<!--index.wxml-->
<view class="container">
  <!-- 标题 -->
  <tarbar id="tarbar"/>
  <!-- 内容 -->
  <view class="content">
      <scroll-view scroll-y="true" bindscroll="lower" scroll-with-animation="true" scroll-with-animation="true" enable-back-to-top="true">
          <!-- 我的 -->
          <view class="my {{navBtnSelectIdx == 0 ? '' : 'none'}}">
            <!-- 个人信息 -->
            <view class='message'>
              <view class='user'>
                <view class='head'>
                  <image class="userinfo-avatar" src="{{data.users.headImgUrl}}" background-size="cover"></image>
                  <view class='left'>
                    <view class="student">
                      学号:<text>{{data.users.eid}}</text>
                    </view>
                    <view class="name">
                      {{data.users.wechatName}}
                      <text class='LV'>LV {{data.level}}</text>
                    </view>
                  </view>
                </view>
                <view>
                  <view class='grade' bindtap="setgrade">
                    {{grade}}
                  </view>
                  <view class='set-name'>
                    <navigator style='font-size:28rpx;' url="../set_name/set_name" >更改昵称</navigator>
                  </view>
                </view>
              </view>
              <view class='personal'>
                <view class="particulars">
                    <text>登录天数</text>
                    <text>{{data.users.loginDay}}</text>
                </view>
                <view class="particulars">
                  <text>TV</text>
                  <text>{{time}}</text>
                </view>
                <view class="particulars">
                  <text>当前排名</text>
                  <text>{{data.scoreRank}}</text>
                </view>
                <view class="particulars">
                  <text>超过用户</text>
                  <text>{{data.proportion}}%</text>
                </view>
              </view>  
            </view>
            <!-- 答题 -->
            <view class="ranking">
              <view class="dashed"></view>
              <view class="ranking-con">
                <view class="rank">
                  <text>勋章数量:{{rankData.metalsRank.number}}枚</text>
                  <text>第{{rankData.metalsRank.rank}}名</text>
                </view>
                <view class="rank">
                  <text>等级:LV{{rankData.expRank.number}}</text>
                  <text>第{{rankData.expRank.rank}}名</text>
                </view>
                <view class="rank">
                  <text>答题量:{{rankData.userQuestionRank.number}}题</text>
                  <text>第{{rankData.userQuestionRank.rank}}名</text>
                </view>
                <view class="rank">
                  <text>答题准确率:{{rankData.userQuestionCorrectRank.numberCorrect}}%</text>
                  <text>第{{rankData.userQuestionCorrectRank.rank}}名</text>
                </view>
              </view>
              <view class="particular">
                <navigator url="../medal_rank/medal_rank" >查看详细排行</navigator>
              </view>
            </view>
            <!-- 勋章 -->
            <view class="medal">
              <view class="title">
                <text>我的勋章</text>
                <text class="{{data.metalsList.length > 0 ? 'none' : ''}}">本周还没获得</text>
              </view>

              <scroll-view scroll-x="true" >
                <view class="img">
                  <view wx:if="{{!data.isHave}}">
                    <image src="../image/no_gain.png" class="no-gain"></image>
                    <image src="{{data.currentMetals.unsoldImg}}"></image>
                    <text>本周勋章</text>
                  </view>
                  <view wx:for="{{data.metalsList}}" wx:key="{{item.id}}" >    
                    <image src="{{item.img}}"></image>
                    <text>{{item.name}}</text>
                  </view>
                </view>
              </scroll-view>
              
            </view>
            <!-- 课模板 -->
            <view>
              <curriculum 
              studyLog="{{ studyLog }}"
              height="{{height}}"/>
            </view>
            <!-- 上传作品 -->
            <chat id="upload"
              id="chat"
              productionData="{{productionData}}" 
              title="我的作品"
              query="上传作品"
              type="2"
              columnType="6"
              bind:getHeight="onGetHeight"
              bind:myevent="onMyEvent"
              more="{{productionMore}}"/>
            <!-- 更改年级 -->
            <setGrade 
             id="set-grade"
             grade="{{grade}}"/>
          </view>
          <view class="canvas-box">
            <canvas canvas-id="myCanvas" style="width:100%; height: {{canvasHeight}}px;"></canvas>
          </view>
      </scroll-view>
  </view>
  <view hidden="{{flag}}">
    <dialog bindmyevent="jurisdiction"/>
  </view>
</view>