<wxs src="../../utils/filter.wxs" module="filters" />
<view class="personalBox">
  <view class="userBox">
    <view class="identity">
      <image class='avatar' src='{{ userInfo.user.avatar}}'></image>
      <view class="identityText">{{userInfo.user.profession}}</view>
    </view>
    <view class="userRight">
      <view class="topBox">
        <view class="row">
          <view class="nickName textOver">{{userInfo.user.nickName||userInfo.user.eid }}</view>
          <view class="gradeText textOver" catchtap="clipboar">学号：{{userInfo.user.eid}}
            <image src="/static/copy.png" class="copy" />
          </view>
        </view>
        <view class="row" wx:if="{{type=='user'}}">
          <view class="count">
            粉丝<text class="countNum textOver">{{filters.numFilter(userInfo.fansAmount)|| '0'}}</text>
          </view>
          <view class="count">
            作品<text class="countNum textOver">{{filters.numFilter(userInfo.readAmount)|| 0}}</text>
          </view>
          <view class="count countEnd">
            播放<text class="countNum textOver">{{filters.numFilter(userInfo.playAmount) || 0}}</text>
          </view>
        </view>
        <view class="row" wx:if="{{type=='pk'}}">
          <view class="count">
            总场<text class="countNum textOver">{{filters.numFilter(userInfo.totalCount)|| 0}}</text>
          </view>
          <view class="count">
            胜<text class="countNum textOver">{{filters.numFilter(userInfo.winCount)|| 0}}</text>
          </view>
          <view class="count">
            平<text class="countNum textOver">{{filters.numFilter(userInfo.flatCount)|| '0'}}</text>
          </view>
          <view class="count">
            负<text class="countNum textOver">{{filters.numFilter(userInfo.failCount) || 0}}</text>
          </view>
        </view>
      </view>
      <view class="btmBox">
        <view class="follow {{userInfo.like?'isFans':''}}" bindtap="setFans">
          <image src="/static/follow_2.png" wx:if="{{userInfo.like}}" class="character" />
          <text>{{userInfo.like?'已关注':'关注'}}</text>
        </view>
        <view class="follow isFans" catchtap="sendMsg">
          <image src="/static/sx.png" class="character" />
          <text>发私信</text>
        </view>
      </view>
    </view>
  </view>
  <view class="divider">
    <view class="title">ta的作品</view>
  </view>
  <view style="flex: 1;overflow: hidden;">
    <scroll-view class="worksList" scroll-y="true" enhanced show-scrollbar="{{false}}" scroll-top="{{scrollTop}}"
      bindscrolltolower='loadMore'>
      <view class="worksBox" wx:for="{{list}}" wx:key="index" bindtap="toPkPage" data-id="{{item.userRead.id}}">
        <view class="left">
          <image src="{{item.userRead.coverImg}}" class="cover"
            wx:if="{{!item.userReadExtend||item.userReadExtend.resourcesType==0}}" />
          <view class="audioCover" style="background-image: url({{item.userReadExtend.backgroundVirtualImg}});" wx:else>
            <image src="/static/audioBg.png" class="audioPlayBg" />
            <image src="/static/zhen.png" class="audioPlayZhen" />
            <image src="{{item.userRead.coverImg}}" class="cover" />
          </view>
          <view class="work">
            <view class="title textOver">{{item.userRead.title}}</view>
            <view class="statistics">
              <view class="statistic">
                <image src="/static/play2.png" class="playImg" />
                <view class="num">{{filters.numFilter(item.userRead.playAmount||0)}}</view>
              </view>
              <view class="statistic">
                <image src="/static/p.png" class="playImg" />
                <view class="num">{{filters.numFilter(item.userRead.commentAmount||0)}}</view>
              </view>
              <view class="statistic">
                <image src="/static/d.png" class="playImg" />
                <view class="num">{{filters.numFilter(item.userRead.likeAmount||0)}}</view>
              </view>
            </view>
          </view>
        </view>
        <view class="goRead">
          {{userInfo.user.profession=='官方'||userInfo.user.uid==localUid?'去朗读':'挑战PK'}}
        </view>
      </view>
    </scroll-view>
  </view>
</view>
<canvas id='share' type="2d"> </canvas>