<template>
<gracePage headerBG="#FFFFFF" :customHeader="false">
<view slot="gBody" class="ranking-list-wrap">
<!-- 头部个人信息 -->
<view class="header-msg grace-space-between">
<view class="header-msg-item grace-rows grace-flex-center grace-flex-vcenter">
<text class="header-msg-text">19000</text>
<text class="header-msg-text-small">步</text>
</view>
<view class="header-msg-item grace-rows grace-flex-center">
<image class="header-msg-face" src="https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png" mode="widthFix"></image>
</view>
<view class="header-msg-item grace-rows grace-flex-center grace-flex-vcenter">
<text class="header-msg-text">18</text>
<text class="header-msg-text-small">名</text>
</view>
</view>
<!-- 排行榜 -->
<view class="ranking-lists">
<view class="ranking-lists-item grace-nowrap grace-flex-vcenter" v-for="(item,index) in rankingList" :key="index">
<view class="ranking-lists-num" :style="{color:item.color?item.color:''}">{{index+1}}</view>
<image class="ranking-lists-image" :src="item.face" mode="widthFix"></image>
<view class="ranking-lists-content">
<text class="ranking-lists-content-name">{{item.name}}</text>
<text class="ranking-lists-content-desc">{{item.num}} 步</text>
</view>
<view class="ranking-lists-zan">
<text :class="['grace-icons icon-shoucang ranking-lists-zan-icon', item.iszan ? 'zan-active':'']"></text>
<text class="ranking-lists-zan-num">{{item.zan}}</text>
</view>
</view>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/components/gracePage.vue";
export default {
data() {
return {
rankingList : [
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'小花儿', num:'30000', zan:999, iszan:true, color:'#FF0036'},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'武哥哥', num:'28000', zan:952, iszan:false, color:'#FF9B00'},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'李喜梅', num:'26000', zan:900, iszan:false, color:'#FFCC00'},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'南宫喵', num:'25000', zan:822, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'吴小莉', num:'23000', zan:605, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'静默茶', num:'20000', zan:582, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'小甜甜', num:'18000', zan:521, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'九国公', num:'16000', zan:500, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'冷风孙', num:'15000', zan:388, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'布谷鸟', num:'10000', zan:219, iszan:false}
]
};
},
methods:{},
components:{gracePage}
}
</script>
<style>
page{background:url(https://staticimgs.oss-cn-beijing.aliyuncs.com/ydbg.png) no-repeat #E5E5E5; background-size:100% auto;}
.ranking-list-wrap{background-color:#FFFFFF; margin:25rpx; margin-top:466rpx; border-radius:16rpx;}
.header-msg{margin:0 30rpx; border-bottom:8rpx solid #F6F6F6; margin-top:30rpx; padding-bottom:20rpx;}
.header-msg-item{width:200rpx;}
.header-msg-text{font-size:32rpx; font-weight:bold; color:#666666;}
.header-msg-text-small{font-size:22rpx; margin:10rpx; color:#666666;}
.header-msg-face{width:140rpx; height:140rpx; margin:5rpx; border-radius:120rpx; border:6rpx solid #E5E5E5;}
.ranking-lists{padding:25rpx;}
.ranking-lists-item{padding:20rpx;}
.ranking-lists-num{width:60rpx; line-height:80rpx; font-size:50rpx; color:#666666; font-weight:bold; font-style:italic; flex-shrink:0;}
.ranking-lists-image{width:100rpx; height:100rpx; border-radius:100rpx; margin:0 20rpx; flex-shrink:0; border:6rpx solid #E5E5E5;}
.ranking-lists-content{width:600rpx; margin:0 10rpx;}
.ranking-lists-content-name{font-size:30rpx; line-height:56rpx; color:#333333; width:100%; display:block; line-height:50rpx;}
.ranking-lists-content-desc{color:#999999; font-size:24rpx; line-height:36rpx; width:100%; display:block;}
.ranking-lists-zan{width:80rpx; flex-shrink:0;}
.ranking-lists-zan-icon{font-size:50rpx; width:100%; color:#999999; display:block; text-align:center;}
.ranking-lists-zan-num{font-size:22rpx; color:#999999; width:100%; display:block; text-align:center;}
.zan-active{color:#FF0036 !important;}
.bgF5{background:#F8F8F8 !important;}
</style>
<template>
<gracePage headerBG="#FFFFFF" :customHeader="false">
<view slot="gBody">
<!-- 背景图 -->
<image src="https://staticimgs.oss-cn-beijing.aliyuncs.com/ydbg.png" class="bgimg" mode="widthFix"></image>
<!-- 撑开页面 150 根据列表高度 自己调整即可-->
<view :style="{width:'750rpx', height:(150*rankingList.length)+'rpx'}"></view>
<!-- 排行主体使用定位 -->
<view class="ranking-list-wrap">
<!-- 头部个人信息 -->
<view class="header-msg grace-space-between">
<view class="header-msg-item grace-rows grace-flex-center grace-flex-vcenter">
<text class="header-msg-text">19000</text>
<text class="header-msg-text-small">步</text>
</view>
<view class="header-msg-item grace-rows grace-flex-center">
<image class="header-msg-face" src="https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png" mode="widthFix"></image>
</view>
<view class="header-msg-item grace-rows grace-flex-center grace-flex-vcenter">
<text class="header-msg-text">18</text>
<text class="header-msg-text-small">名</text>
</view>
</view>
<!-- 排行榜 -->
<view class="ranking-lists">
<view class="ranking-lists-item grace-nowrap grace-flex-vcenter" v-for="(item,index) in rankingList" :key="index">
<view class="ranking-lists-num" :style="{color:item.color?item.color:''}">{{index+1}}</view>
<image class="ranking-lists-image" :src="item.face" mode="widthFix"></image>
<view class="ranking-lists-content">
<text class="ranking-lists-content-name">{{item.name}}</text>
<text class="ranking-lists-content-desc">{{item.num}} 步</text>
</view>
<view class="ranking-lists-zan">
<text :class="['grace-icons icon-shoucang ranking-lists-zan-icon', item.iszan ? 'zan-active':'']"></text>
<text class="ranking-lists-zan-num">{{item.zan}}</text>
</view>
</view>
</view>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/weexComponents/gracePage.nvue";
export default {
data() {
return {
rankingList : [
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'小花儿', num:'30000', zan:999, iszan:true, color:'#FF0036'},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'武哥哥', num:'28000', zan:952, iszan:false, color:'#FF9B00'},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'李喜梅', num:'26000', zan:900, iszan:false, color:'#FFCC00'},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'南宫喵', num:'25000', zan:822, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'吴小莉', num:'23000', zan:605, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'静默茶', num:'20000', zan:582, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'小甜甜', num:'18000', zan:521, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'九国公', num:'16000', zan:500, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name:'冷风孙', num:'15000', zan:388, iszan:false},
{face:'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name:'布谷鸟', num:'10000', zan:219, iszan:false}
]
};
},
methods:{},
components:{gracePage}
}
</script>
<style>
.bgimg{width:750rpx; height:700rpx;}
.ranking-list-wrap{background-color:#FFFFFF; border-radius:16rpx; width:700rpx; position:absolute; left:25rpx; top:466rpx;}
.header-msg{margin:0 30rpx; border-bottom-width:8rpx; border-bottom-style:solid; border-bottom-color:#F6F6F6; margin-top:30rpx; padding-bottom:20rpx;}
.header-msg-item{width:200rpx;}
.header-msg-text{font-size:32rpx; font-weight:bold; color:#666666;}
.header-msg-text-small{font-size:22rpx; margin:10rpx; color:#666666;}
.header-msg-face{width:140rpx; height:140rpx; margin:5rpx; border-radius:120rpx; border-width:6rpx; border-style:solid; border-color:#E5E5E5;}
.ranking-lists{padding:25rpx;}
.ranking-lists-item{padding:20rpx;}
.ranking-lists-num{width:60rpx; line-height:80rpx; font-size:50rpx; color:#666666; font-weight:bold; font-style:italic;}
.ranking-lists-image{width:100rpx; height:100rpx; border-radius:100rpx; margin:0 20rpx; border-width:6rpx; border-style:solid; border-color:#E5E5E5;}
.ranking-lists-content{width:600rpx; margin:0 10rpx; flex:1;}
.ranking-lists-content-name{font-size:30rpx; line-height:56rpx; color:#333333; line-height:50rpx;}
.ranking-lists-content-desc{color:#999999; font-size:24rpx; line-height:36rpx}
.ranking-lists-zan{width:80rpx;}
.ranking-lists-zan-icon{font-size:50rpx; color:#999999; text-align:center;}
.ranking-lists-zan-num{font-size:22rpx; color:#999999; text-align:center;}
.zan-active{color:#FF0036;}
.bgF5{background-color:#F8F8F8;}
</style>
.wxml
<gracePage customHeader="{{false}}">
<view slot="gBody" class="ranking-list-wrap">
<!-- 头部个人信息 -->
<view class="header-msg grace-space-between">
<view class="header-msg-item grace-rows grace-flex-center grace-flex-vcenter">
<text class="header-msg-text">19000</text>
<text class="header-msg-text-small">步</text>
</view>
<view class="header-msg-item grace-rows grace-flex-center">
<image class="header-msg-face" src="https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png" mode="widthFix"></image>
</view>
<view class="header-msg-item grace-rows grace-flex-center grace-flex-vcenter">
<text class="header-msg-text">18</text>
<text class="header-msg-text-small">名</text>
</view>
</view>
<!-- 排行榜 -->
<view class="ranking-lists">
<view class="ranking-lists-item grace-nowrap grace-flex-vcenter" wx:for="{{rankingList}}">
<view class="ranking-lists-num" style="color:{{item.color ? item.color : ''}}">{{index+1}}</view>
<image class="ranking-lists-image" src="{{item.face}}" mode="widthFix"></image>
<view class="ranking-lists-content">
<text class="ranking-lists-content-name">{{item.name}}</text>
<text class="ranking-lists-content-desc">{{item.num}} 步</text>
</view>
<view class="ranking-lists-zan">
<text class="grace-icons icon-shoucang ranking-lists-zan-icon {{item.iszan ? 'zan-active':''}}"></text>
<text class="ranking-lists-zan-num">{{item.zan}}</text>
</view>
</view>
</view>
</view>
</gracePage>.wxss
page{background:url(https://staticimgs.oss-cn-beijing.aliyuncs.com/ydbg.png) no-repeat #E5E5E5; background-size:100% auto;}
.ranking-list-wrap{background-color:#FFFFFF; margin:25rpx; margin-top:466rpx; border-radius:16rpx;}
.header-msg{margin:0 30rpx; border-bottom:8rpx solid #F6F6F6; margin-top:30rpx; padding-bottom:20rpx;}
.header-msg-item{width:200rpx;}
.header-msg-text{font-size:32rpx; font-weight:bold; color:#666666;}
.header-msg-text-small{font-size:22rpx; margin:10rpx; color:#666666;}
.header-msg-face{width:140rpx; height:140rpx; margin:5rpx; border-radius:120rpx; border:6rpx solid #E5E5E5;}
.ranking-lists{padding:25rpx;}
.ranking-lists-item{padding:20rpx;}
.ranking-lists-num{width:60rpx; line-height:80rpx; font-size:50rpx; color:#666666; font-weight:bold; font-style:italic; flex-shrink:0;}
.ranking-lists-image{width:100rpx; height:100rpx; border-radius:100rpx; margin:0 20rpx; flex-shrink:0; border:6rpx solid #E5E5E5;}
.ranking-lists-content{width:600rpx; margin:0 10rpx;}
.ranking-lists-content-name{font-size:30rpx; line-height:56rpx; color:#333333; width:100%; display:block; line-height:50rpx;}
.ranking-lists-content-desc{color:#999999; font-size:24rpx; line-height:36rpx; width:100%; display:block;}
.ranking-lists-zan{width:80rpx; flex-shrink:0;}
.ranking-lists-zan-icon{font-size:50rpx; width:100%; color:#999999; display:block; text-align:center;}
.ranking-lists-zan-num{font-size:22rpx; color:#999999; width:100%; display:block; text-align:center;}
.zan-active{color:#FF0036 !important;}
.bgF5{background:#F8F8F8 !important;}.json
{
"usingComponents": {
"gracePage": "../../graceUI/components/gracePage"
}
}.js
Page({
data: {
rankingList: [
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name: '小花儿', num: '30000', zan: 999, iszan: true, color: '#FF0036' },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name: '武哥哥', num: '28000', zan: 952, iszan: false, color: '#FF9B00' },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name: '李喜梅', num: '26000', zan: 900, iszan: false, color: '#FFCC00' },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name: '南宫喵', num: '25000', zan: 822, iszan: false },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name: '吴小莉', num: '23000', zan: 605, iszan: false },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name: '静默茶', num: '20000', zan: 582, iszan: false },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name: '小甜甜', num: '18000', zan: 521, iszan: false },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name: '九国公', num: '16000', zan: 500, iszan: false },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/2.png', name: '冷风孙', num: '15000', zan: 388, iszan: false },
{ face: 'https://graceui.oss-cn-beijing.aliyuncs.com/faces/1.png', name: '布谷鸟', num: '10000', zan: 219, iszan: false }
]
}
})