用户推荐帮
This commit is contained in:
@@ -12,13 +12,18 @@
|
||||
<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 :class="['rank_type_item',type === '3'?'rank_type_item_active':'']" @click="changeType('3')">会员推荐榜</view>
|
||||
</view>
|
||||
<scroll-view class="rank_type" scroll-x="true">
|
||||
<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 :class="['rank_type_item',type === '3'?'rank_type_item_active':'']" @click="changeType('3')">会员推荐榜
|
||||
</view>
|
||||
<view :class="['rank_type_item',type === '4'?'rank_type_item_active':'']" @click="changeType('4')">用户推荐榜
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="rank_update_time" v-if="lists.length > 0 && type !== '3'">
|
||||
<view class="rank_update_time" v-if="lists.length > 0 && type !== '3'&& type !== '4'">
|
||||
<view class="title"> 加成{{type === '1'?'结束':'生效'}}倒计时 : </view>
|
||||
<u-count-down :time="end_timestamp" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
|
||||
<view class="time">
|
||||
@@ -43,7 +48,12 @@
|
||||
<view class="list">
|
||||
<block v-if="lists.length>0">
|
||||
<view class="list_item" v-for="(item,index) in lists" :keys='index'>
|
||||
<view class="no">
|
||||
<view class="no" v-if="type === '3' || type === '4'">
|
||||
<image v-if="index < 1" class="image" :src="'/static/rank/rank-'+(index+1)+'.png'"
|
||||
mode="widthFix" />
|
||||
<view v-else class="txt"> {{index + 1}} </view>
|
||||
</view>
|
||||
<view class="no" v-if="type !== '3' && type !== '4'">
|
||||
<image v-if="index < 3" class="image" :src="'/static/rank/rank-'+(index+1)+'.png'"
|
||||
mode="widthFix" />
|
||||
<view v-else class="txt"> {{index + 1}} </view>
|
||||
@@ -56,7 +66,7 @@
|
||||
</view>
|
||||
<view class="tuijian">
|
||||
<view class="num"> {{item.number}}</view>
|
||||
<view class="title">推荐会员</view>
|
||||
<view class="title">{{type === '4'?'推荐用户':'推荐会员'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -76,8 +86,9 @@
|
||||
<script>
|
||||
import {
|
||||
week,
|
||||
week_mul,
|
||||
total
|
||||
week_mul,
|
||||
total,
|
||||
totaluser
|
||||
} from '@/apis/interfaces/rank.js'
|
||||
export default {
|
||||
data() {
|
||||
@@ -98,9 +109,9 @@
|
||||
this.timeData = e
|
||||
},
|
||||
changeType(type) {
|
||||
if (this.type !== type) {
|
||||
if (this.type !== type) {
|
||||
this.lists = [];
|
||||
this.type = type;
|
||||
this.type = type;
|
||||
uni.showLoading({})
|
||||
this.getList();
|
||||
}
|
||||
@@ -117,13 +128,15 @@
|
||||
urlRequest = week_mul
|
||||
} else if (this.type === '2') {
|
||||
urlRequest = week
|
||||
}else{
|
||||
urlRequest = total
|
||||
} else if (this.type === '4') {
|
||||
urlRequest = totaluser
|
||||
} else {
|
||||
urlRequest = total
|
||||
}
|
||||
urlRequest().then(res => {
|
||||
urlRequest().then(res => {
|
||||
this.lists = res.rand;
|
||||
this.page_id = res.page_id;
|
||||
this.end_timestamp = res.end_timestamp * 1000;
|
||||
this.end_timestamp = res.end_timestamp * 1000;
|
||||
uni.hideLoading()
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
@@ -184,16 +197,16 @@
|
||||
}
|
||||
|
||||
.rank_type {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
background-color: #26b398;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
|
||||
|
||||
.rank_type_item {
|
||||
flex: 1;
|
||||
display: inline-block;
|
||||
width: 18%;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
font-size: 32rpx;
|
||||
@@ -332,7 +345,7 @@
|
||||
.nickname {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
max-width: 200rpx;
|
||||
max-width: 200rpx;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
Reference in New Issue
Block a user