<wxs src="../../utils/filter.wxs" module="filters" />
<navigationBar bind:reload='reload' showNav="{{false}}"></navigationBar>
<view class="matchBox">
    <swiper class="bannerList" autoplay circular indicator-dots="{{bannerList.length>1}}" indicator-active-color="#fff"
        indicator-color='#ecececa1'>
        <swiper-item wx:for="{{bannerList}}" wx:key="id">
            <image src="{{item.icon}}" class="headerImg" data-iconDetail="{{item.iconDetail}}" bindtap="jumpIntro" />
        </swiper-item>
    </swiper>
    <view class="modelText">
        <view class="header">
            <image src="/static/modelBg.png" class="bg" />
            <view class="text">选择下面范文进行朗读</view>
        </view>
        <swiper class="swiper" autoplay circular indicator-dots previous-margin='40px' next-margin='20px'
            indicator-active-color="#7ACAFF" indicator-color='#BABABA'>
            <swiper-item wx:for="{{modelList}}" wx:key="id">
                <image src="{{item.coverImg}}" class="swiper-item" bindtap='bannelEvent' data-id='{{item.exampleId}}' />
            </swiper-item>
        </swiper>
    </view>
    <view class="rankList">
        <view class="switchBtns" bindtap="selectType">
            <view class="switchBtn {{currentType?'currentBtn currentBtn-l':''}}" data-type='true'>人气榜TOP100</view>
            <view class="switchBtn {{!currentType?'currentBtn currentBtn-r':''}}" data-type='false'>我的参赛作品</view>
        </view>
        <view class="table" wx:if="{{currentType}}">
            <view class="titleLine">
                <view class="colTitle">排名</view>
                <view class="colTitle">人气值</view>
            </view>
            <block wx:if="{{activityUserList.length>0}}">
                <view class="contentBox" wx:for="{{activityUserList}}" wx:key="id">
                    <view class="firstCol">
                        <image src="/static/{{index+1}}-1.png" class="rankingImg" wx:if="{{index<3}}" />
                        <text wx:else>{{index+1}}</text>
                    </view>
                    <view class="secondCol" bindtap="jumpUserInfo" data-uid='{{item.user.uid}}'>
                        <image lazy-load src="{{item.user.avatar}}" class="avatar" />
                        <view class="userInfo">
                            <view class="nickName">{{item.user.nickName||item.user.eid}}</view>
                            <view class="date">
                                <view>
                                    <image src="/static/f.png" class="icon" />
                                    <view class="num">{{filters.numFilter(item.activityJoinUser.shareAmount)}}</view>
                                </view>
                                <view>
                                    <image src="/static/p.png" class="icon" />
                                    <view class="num">{{filters.numFilter(item.activityJoinUser.commentAmount)}}</view>
                                </view>
                                <view>
                                    <image src="/static/d.png" class="icon" />
                                    <view class="num">{{filters.numFilter(item.activityJoinUser.likeAmount)}}</view>
                                </view>
                            </view>
                        </view>
                    </view>
                    <view class="threeCol">
                        <image src="/static/hot.png" class="icon" />
                        <view class="num">{{filters.numFilter(item.activityJoinUser.hotAmount)}}</view>
                    </view>
                </view>
            </block>
            <image src="/static/rankNull.png" class="rankNull" wx:else />
            <view class="contentBox selfRank" wx:if="{{myActivityUser.activityJoinUser}}">
                <view class="firstCol">
                    <text>{{myActivityUser.activityJoinUser.order}}</text>
                </view>
                <view class="secondCol">
                    <image src="{{myActivityUser.user.avatar}}" class="avatar" />
                    <view class="userInfo">
                        <view class="nickName">{{myActivityUser.user.nickName||myActivityUser.user.eid}}</view>
                        <view class="date">
                            <view>
                                <image src="/static/f.png" class="icon" />
                                <view class="num">{{filters.numFilter(myActivityUser.activityJoinUser.shareAmount)}}
                                </view>
                            </view>
                            <view>
                                <image src="/static/p.png" class="icon" />
                                <view class="num">{{filters.numFilter(myActivityUser.activityJoinUser.commentAmount)}}
                                </view>
                            </view>
                            <view>
                                <image src="/static/d.png" class="icon" />
                                <view class="num">{{filters.numFilter(myActivityUser.activityJoinUser.likeAmount)}}
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="threeCol">
                    <image src="/static/hot.png" class="icon" />
                    <view class="num">{{filters.numFilter(myActivityUser.activityJoinUser.hotAmount)}}</view>
                </view>
            </view>
        </view>
        <block wx:else>
            <worksList class="worksList" videoType='my' worksList="{{list}}" wx:if="{{list.length>0}}" />
            <image src="/static/rankNull.png" class="rankNull" wx:else />
        </block>
    </view>
    <canvas id='share' type="2d"> </canvas>
</view>