| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <template>
- <view style="position: relative;height: 100%;">
- <view style="width: 100%;">
- <image src="/static/rank_bg.png" style="width: 100%;position: relative;top: -80rpx;"></image>
- </view>
- <view class="box">
- <view style="margin-top: 15rpx;">
- <u-row gutter="16" justify="center">
- <u-col span="2" text-align="center">
- <view class="r_t1" >
- 我的<br>
- 成绩
- </view>
- </u-col>
- <u-col span="6">
- <view style="vertical-align: middle;display: flex;">
- <image :src="userInfo!=null?$method.splitImgHost(userInfo.avatar):''" style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image>
- <view class="r_t2">{{userInfo.nickname}}</view>
- </view>
- </u-col>
- <u-col span="4" v-if="current==0">
- <view style="color: #0183FE;font-size: 28rpx;" >
- <view style="line-height: 80rpx;" v-if="info.rank>0">
- <text>第{{info.rank}}名</text>
- <text style="margin-left: 30rpx;">{{info.hourse}}h</text>
- </view>
- <view style="line-height: 80rpx;" v-else>
- <text>暂未上榜</text>
-
- </view>
- </view>
- </u-col>
- <u-col span="5" v-if="current==1">
- <view style="color: #0183FE;font-size: 28rpx;">
- <view style="line-height: 80rpx;">
- <text>第{{info2.rank}}名</text>
- <text style="margin-left: 30rpx;">{{info2.hourse}}h</text>
- </view>
- </view>
- </u-col>
- </u-row>
- </view>
- <view >
- <view>
- <u-tabs :list="list" font-size="24" :current="current" @change="change" active-color="#32467B"></u-tabs>
- </view>
- <view >
- <u-row >
- <u-col span="2" text-align="center">
- <view class="rank_t3">排名</view>
- </u-col>
- <u-col span="8" >
- <view class="rank_t3">姓名</view>
- </u-col>
- <u-col span="2" >
- <view class="rank_t3">时长</view>
- </u-col>
- </u-row>
- </view>
- <scroll-view class='main-scroll' scroll-y >
- <view v-for="(item,index) in list2" :key="index" class="rank_item" v-if="current==0">
- <u-row >
- <u-col span="2" text-align="center">
- <view class="rank_t3">
- <image src="/static/sort_1.png" class="rank_img" v-if="index==0"></image>
- <image src="/static/sort_2.png" class="rank_img" v-if="index==1"></image>
- <image src="/static/sort_3.png" class="rank_img" v-if="index==2"></image>
- <view v-if="index>2" class="rank_t5">{{index+1}}</view>
- </view>
- </u-col>
- <u-col span="8" >
- <view style="vertical-align: middle;display: flex;">
- <image :src="$method.splitImgHost(item.avatar)" style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image>
- <view class="rank_t4" style="padding-left: 30rpx;">{{item.nickname}}</view>
- </view>
- </u-col>
- <u-col span="2" text-align="left">
- <view class="rank_t4">{{item.hourse}}h</view>
- </u-col>
- </u-row>
- </view>
- <view v-for="(item,index) in list3" :key="index" class="rank_item" v-if="current==1">
- <u-row >
- <u-col span="2" text-align="center">
- <view class="rank_t3">
- <image src="/static/sort_1.png" class="rank_img" v-if="index==0"></image>
- <image src="/static/sort_2.png" class="rank_img" v-if="index==1"></image>
- <image src="/static/sort_3.png" class="rank_img" v-if="index==2"></image>
- <view v-if="index>2" class="rank_t5">{{index+1}}</view>
- </view>
- </u-col>
- <u-col span="8" >
- <view style="vertical-align: middle;display: flex;">
- <image :src="$method.splitImgHost(item.avatar)" style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image>
- <view class="rank_t4" style="padding-left: 30rpx;">{{item.nickname}}</view>
- </view>
- </u-col>
- <u-col span="2" text-align="left">
- <view class="rank_t4">{{item.hourse}}h</view>
- </u-col>
- </u-row>
- </view>
- </scroll-view>
-
- </view>
- </view>
- </view>
- </template>
- <script>
- import {mapGetters} from 'vuex';
- export default {
- data() {
- return {
- list: [{
- name: '日榜'
- }, {
- name: '总榜'
- }],
- current: 0,
- list2:[],
- list3:[],
- info:{
- hourse:0,
- rank:0
- },
- info2:{
- hourse:0,
- rank:0
- },
- }
- },
- onLoad(option) {
- this.rankList()
- this.rankList2()
- },
- onShow(){
- },
- methods: {
- change(index) {
- this.current = index;
- },
- rankList(){
- let self = this
- this.$api.rankList({status:0}).then(res => {
- self.info = res.data.data
- self.list2 = res.data.data.ranKingUsers
- });
- },
- rankList2(){
- let self = this
- this.$api.rankList({status:1}).then(res => {
- self.info2 = res.data.data
- self.list3 = res.data.data.ranKingUsers
- console.log(self.info2,333)
- });
- },
-
- },
- computed: {...mapGetters(['userInfo'])}
- }
- </script>
- <style scope>
- .main-scroll{
- position: absolute;
- left: 0;
- right: 0;
- top: 300rpx;
- bottom: 0;
- }
- .rank_t5{
- color: #AAB1B9;
- text-align: center;
- }
- .rank_t3{
- line-height: 80rpx;
- }
- .rank_t4{
- line-height: 80rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #32467B;
- }
- .rank_item{
- height: 100rpx;
- vertical-align: middle;
- padding: 0 25rpx;
- }
- .rank_img{
- width: 54rpx;
- height: 54rpx;
- }
- .rank_list{
- width: 100%;
- height: 100%;
- position: relative;
- }
- .rank_t3{
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #959EA8;
- }
- .r_t2{
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #32467B;
- line-height: 80rpx;
- margin-left: 30rpx;
- }
- .r_t1{
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #0183FE;
- }
-
- page {
- background: #FFFFFF;
- height: 100%;
-
- }
- .box{
- height: 75%;
- width: 100%;
- border-top-right-radius: 32rpx;
- border-top-left-radius: 32rpx;
- z-index: 999;
- background-color: #FFFFFF;
- position: fixed;
- bottom: 0;
- padding: 25rpx;
- }
- </style>
|