ranking.vue 2.6 KB
Newer Older
1 2
<template>
	<view>
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
		<view class="top">
			<image class="back" src="/static/login/returnBack.png" @click="goBack()"></image>
			<view class="title">累计排名</view>
			<span class="empty"></span>
		</view>
		<view class="userList" v-for="(item,index) in userList" :key="index">
			<view class="rank">{{item.rank}}</view>
			<image class="icon" :src="item.icon"></image>
			<view class="username">{{item.username}}</view>
			<view class="distance">{{item.distance}}km</view>
		</view>
		<view class="my">
			<view class="rank">{{rank}}</view>
			<image class="icon" :src="icon"></image>
			<!-- <view class="info"> -->
				<view class="username">{{username}}</view>
				<view class="distance">{{distance}}km</view>
			<!-- </view> -->
		</view>
22 23 24 25 26 27
	</view>
</template>

<script>
	export default {
		data() {
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
			return {
				rank: 1,
				icon: '/static/sport/icon.jpg',
				username: "不会取名字",
				distance: 99.99,
				userList: [{
					rank: 1,
					icon: '/static/sport/icon.jpg',
					username: "不会取名字",
					distance: 99.99
				},{
					rank: 2,
					icon: '/static/sport/icon.jpg',
					username: "不会取名字",
					distance: 12.12
				}]
			}
45 46 47
		},
		methods: {
			goBack() {
48 49 50 51
				uni.reLaunch({
					url: '/pages/sport/main',
					animationType: 'pop-in',
					animationDuration: 300
52 53 54 55 56 57 58 59 60 61 62 63 64 65
				});
			}
		}
	}
</script>

<style>
	.returnBack {
		height: 55rpx;
		width: 55rpx;
		margin-top: 60rpx;
		margin-left: 20rpx;
		margin-right: auto;
	}
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151

	.top {
		width: 100%;
		height: 50px;
		background-color: #EDEEF0;
		text-align: center;
	}

	.back {
		width: 40px;
		height: 30px;
		margin-top: 10px;
		margin-bottom: 10px;
		float: left;
		margin-left: 10px;
	}

	.empty {
		width: 40px;
		height: 30px;
		margin-top: 10px;
		margin-bottom: 10px;
		float: right;
		margin-right: 10px;
	}

	.title {
		font-size: 20px;
		margin-top: 10px;
		font-weight: bold;
		color: #f1992d;
		display: inline-block;
	}
	
	.userList{
		margin-top: 10px;
	}
	
	.my{
		position: absolute;
		bottom: 0px;
		background-color: #EDEEF0;
		width: 100%;
		height: 55px;
		padding: 5px 0;
	}
	.rank{
		position: relative;
		bottom: 15px;
		left: 20px;
		display: inline;
		font-size: 20px;
		font-weight: bold;
	}
	.icon{
		position: relative;
		top:2px;
		left: 38px;
		width: 50px;
		height: 50px;
		border-radius: 50%;
	}
	/* .info{
		position: relative;
		float: left;
	}
	.username{
		float: ;
	} */
	.username{
		display: inline; 
		position: relative;
		font-size: 17px;
		font-weight: bold;
		bottom: 25px;
		left: 48px;
		color: #7F7F7F;
	}
	.distance{
		display: inline;
		position: relative;
		font-size: 14px;
		font-weight: bold;
		bottom: 5px;
		left: -36px;
	}
152
</style>