排行榜新增

This commit is contained in:
2022-06-30 14:14:13 +08:00
parent e384e0cd4c
commit 17735fd505
11 changed files with 1791 additions and 314 deletions

31
apis/interfaces/rank.js Normal file
View File

@@ -0,0 +1,31 @@
/**
* Web-zdx
* moduleName:排行榜
*/
import {
request
} from '../index'
// 上周加成榜
const week_mul = () => {
return request({
url: 'user/rank/week_mul'
})
}
// 本周推荐榜
const week = () => {
return request({
url: 'user/rank/week'
})
}
export {
week_mul,
week,
}

27
node_modules/.package-lock.json generated vendored
View File

@@ -1,27 +0,0 @@
{
"name": "dtx_store",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"node_modules/uni-read-pages": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/uni-read-pages/-/uni-read-pages-1.0.5.tgz",
"integrity": "sha512-GkrrZ0LX0vn9R5k6RKEi0Ez3Q3e2vUpjXQ8Z6/K/d28KudI9ajqgt8WEjQFlG5EPm1K6uTArN8LlqmZTEixDUA==",
"hasInstallScript": true
},
"node_modules/uni-simple-router": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/uni-simple-router/-/uni-simple-router-2.0.7.tgz",
"integrity": "sha512-8FKv5dw7Eoonm0gkO8udprrxzin0fNUI0+AvIphFkFRH5ZmP5ZWJ2pvnWzb2NiiqQSECTSU5VSB7HhvOSwD5eA=="
},
"node_modules/uview-ui": {
"version": "2.0.31",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.31.tgz",
"integrity": "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw==",
"engines": {
"HBuilderX": "^3.1.0"
}
}
}
}

View File

@@ -443,7 +443,18 @@
"navigationBarTitleText" : "发布"
}
}
],
,{
"path" : "pages/rank/index",
"style" :
{
"navigationBarTitleText": "会员推荐",
"enablePullDownRefresh": false,
"navigationBarTextStyle":"white",
"navigationBarBackgroundColor":"#34CE98"
}
}
],
"tabBar": {
"borderStyle": "white",
"selectedColor": "#34CE98",
@@ -458,12 +469,12 @@
"pagePath": "pages/store/index",
"text": "DT商城"
},
{
"iconPath": "static/tabBar/tabBar_02.png",
"selectedIconPath": "static/tabBar/tabBar_show_02.png",
"pagePath": "pages/chat/index",
"text": "DT圈子"
},
// {
// "iconPath": "static/tabBar/tabBar_02.png",
// "selectedIconPath": "static/tabBar/tabBar_show_02.png",
// "pagePath": "pages/chat/index",
// "text": "DT圈子"
// },
{
"iconPath": "static/tabBar/tabBar_03.png",
"selectedIconPath": "static/tabBar/tabBar_show_03.png",

View File

@@ -48,13 +48,21 @@
<image src="../../static/img/house_back.jpg" mode="aspectFill"></image>
</view>
<view class="life-flex-item both">
<view class="both-item team" @click="onToast('共力文娱暂未开放尽情期待')">
<!-- <view class="both-item team" @click="onToast('共力文娱暂未开放尽情期待')">
<view class="team-content">
<view class="team-title">共力文娱</view>
<view class="team-subtitle">文娱短视频近期开放</view>
</view>
<image src="../../static/img/text_back.jpg" mode="aspectFill"></image>
</view> -->
<view class="both-item team" @click="goRank">
<view class="team-content">
<view class="team-title">共力排行</view>
<view class="team-subtitle">推动全体成员共同富裕</view>
</view>
<image src="../../static/img/text_back.jpg" mode="aspectFill"></image>
</view>
<view class="both-item team" @click="onNav({name: 'Team'}, '')">
<view class="team-content">
<view class="team-title">共力团队</view>
@@ -251,7 +259,12 @@
title,
icon : 'none'
})
}
},
goRank(){
uni.navigateTo({
url:'pages/rank/index',
})
}
},
onHide() {
try{

378
pages/rank/index.vue Normal file
View File

@@ -0,0 +1,378 @@
<template>
<view class="rank">
<view class="rank_top">
<view class="rank_top_left">
<image class="rank_title" src="../../static/rank/rank_txt.png" mode="widthFix" />
<view class="rank_sub_title" @click="toHelp">
共力家族 周会员推荐
<image src="/static/rank/help.png" mode="widthFix" />
</view>
</view>
<image class="rank_top_right" src="../../static/rank/rank.png" mode="widthFix" />
</view>
<view class="rank_type">
<view :class="['rank_type_item',type === '1'?'rank_type_item_active':'']" @click="changeType('1')">周加成榜
</view>
<view :class="['rank_type_item',type === '2'?'rank_type_item_active':'']" @click="changeType('2')">周推荐榜
</view>
</view>
<view class="rank_update_time" v-if="lists.length > 0">
<view class="title"> 加成{{type === '1'?'有效':'生效'}}倒计时 : </view>
<u-count-down :time="end_timestamp" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
<view class="time">
<view class="time__item">
<view class="time__item_no">{{ timeData.days }} </view>
</view>
<view class="time__item">
<view class="time__item_no">{{ timeData.hours>9?timeData.hours:'0'+timeData.hours}}</view>
</view>
<view class="time__item">
<view class="time__item_no">{{ timeData.minutes>9?timeData.minutes:'0'+timeData.minutes}}</view>
</view>
<view class="time__item">
<view class="time__item_no">{{ timeData.seconds>9?timeData.seconds:'0'+timeData.seconds}}</view>
</view>
</view>
</u-count-down>
</view>
<view class="list">
<block v-if="lists.length>0">
<view class="list_item" v-for="(item,index) in lists" :keys='index'>
<view class="no">
<image v-if="index < 3" class="image" :src="'/static/rank/rank-'+(index+1)+'.png'"
mode="widthFix" />
<view v-else class="txt"> {{index + 1}} </view>
</view>
<view class="user_info">
<view class="user">
<image class="avatar" :src="item.avatar" mode="aspectFill" />
<view class="nickname"> {{item.nickname}} </view>
<view class="wight" v-if="type === '1'">+{{item.rate}}%</view>
</view>
<view class="tuijian">
<view class="num"> {{item.number}}</view>
<view class="title">推荐会员</view>
</view>
</view>
</view>
</block>
<block v-else>
<view class="vertical pages-empty">
<u-empty icon="http://cdn.uviewui.com/uview/empty/list.png" textColor="#999"
:text="type === '1'?'上周无加成数据':'当前暂无推荐数据'">
</u-empty>
</view>
</block>
</view>
</view>
</template>
<script>
import {
week,
week_mul
} from '@/apis/interfaces/rank.js'
export default {
data() {
return {
end_timestamp: 0,
lists: [],
timeData: {},
type: "1", // 1 加成榜 2推荐榜
page_id:'',
}
},
onLoad() {
this.getList();
},
methods: {
onChange(e) {
this.timeData = e
},
changeType(type) {
if (this.type !== type) {
this.type = type;
this.getList();
}
},
toHelp() {
uni.navigateTo({
url: 'pages/vip/agreement?id=' + this.page_id
})
},
getList() {
uni.showLoading({})
let urlRequest = ''
if (this.type === '1') {
urlRequest = week_mul
} else {
urlRequest = week
}
urlRequest().then(res => {
console.log(res)
this.lists = [];
this.lists = res.rand;
this.page_id = res.page_id;
this.end_timestamp = res.end_timestamp * 1000;
uni.hideLoading();
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true
})
})
}
}
}
</script>
<style lang="scss">
.rank {
.rank_top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
background-color: #34CE98;
padding: 50rpx 30rpx 40rpx 30rpx;
.rank_top_left {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
.rank_title {
width: 360rpx;
}
.rank_sub_title {
font-size: 28rpx;
font-weight: 500;
color: white;
padding-left: 20rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
margin-top: 10rpx;
image {
width: 32rpx;
margin-left: 6rpx;
}
}
}
.rank_top_right {
width: 280rpx;
}
}
.rank_type {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #26b398;
.rank_type_item {
flex: 1;
text-align: center;
padding: 40rpx;
font-size: 32rpx;
font-weight: 400;
color: rgba($color: #fff, $alpha: 0.6);
}
.rank_type_item_active {
position: relative;
color: white;
&::after {
content: '';
border-bottom: 20rpx solid white;
border-right: 16rpx solid transparent;
border-left: 16rpx solid transparent;
position: absolute;
bottom: 0;
left: 50%;
margin-left: -20rpx;
}
}
}
.rank_update_time {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 50rpx 30rpx;
width: 100%;
.title {
font-size: 28rpx;
font-weight: normal;
color: #34CE98;
}
.time {
padding-left: 20rpx;
flex: 1;
font-size: 28rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #333;
.time__item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.time__item_no {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #34CE98;
color: white;
min-width: 50rpx;
min-height: 50rpx;
border-radius: 4rpx;
margin: 0 16rpx;
font-size: 36rpx;
font-weight: bold;
padding: 2rpx 10rpx;
}
}
}
}
.list {
border-top: 30rpx solid #f9f9f9;
padding: 30rpx;
.list_item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.no {
width: 80rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.image {
width: 54rpx;
}
.txt {
font-weight: 600;
font-size: 34rpx;
color: #333;
}
}
.user_info {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
border-bottom: solid 1rpx #bdc6d7;
padding: 30rpx 20rpx 30rpx 0;
margin-left: 30rpx;
.user {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.avatar {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
margin-right: 30rpx;
}
.nickname {
font-size: 30rpx;
color: #333;
max-width: 200rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
}
.wight {
font-size: 26rpx;
font-weight: normal;
margin-left: 20rpx;
background-color: #bdc6d7;
color: #fff;
border-radius: 30rpx;
padding: 0 10rpx;
}
}
}
.tuijian {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.num {
color: #999;
font-size: 30rpx;
}
.title {
font-size: 22rpx;
color: #999;
}
}
}
}
}
</style>

BIN
static/rank/help.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/rank/rank_txt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long