|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="order-sum">
|
|
|
+ <view v-if="data" class="order-sum">
|
|
|
<view class="data-bar">
|
|
|
<view @click="chooseTime(0)"><text>{{ this.date[0] ? this.date[0] : '开始时间' }}</text> <text v-if="!this.date[0]" class="cuIcon-triangledownfill"></text></view>
|
|
|
<view @click="chooseTime(1)"><text>{{ this.date[1] ? this.date[1] : '结束时间' }}</text> <text v-if="!this.date[1]" class="cuIcon-triangledownfill"></text></view>
|
|
@@ -89,13 +89,15 @@
|
|
|
<view>简约版</view>
|
|
|
<view>老人版 </view>
|
|
|
</view>
|
|
|
- <view class="rankItem" v-for="(item, index) in data.list" :key="index">
|
|
|
- <view>{{ item.name }}</view>
|
|
|
- <view>{{ item.phone.replace(/(?<=\d{3})\d{4}(?=\d{4})/, '...') }}</view>
|
|
|
+ <view class="rankItem" v-for="(item, index) in rank" :key="index">
|
|
|
+ <view>{{ item.username }}</view>
|
|
|
+ <!-- <view>{{ item.mobile.replace(/(?<=\d{3})\d{4}(?=\d{4})/, '...') }}</view> -->
|
|
|
+ <view>{{ item.mobile }}</view>
|
|
|
<view>{{ item.hard }}</view>
|
|
|
<view>{{ item.simple }}</view>
|
|
|
<view>{{ item.old }} </view>
|
|
|
</view>
|
|
|
+ <view v-if="!rank.length" class="rankItem">暂无排名</view>
|
|
|
</view>
|
|
|
<uni-calendar ref="calendar" :insert="false" :lunar="true" @confirm="confirm" />
|
|
|
<w-picker ref="Selector" mode="selector" themeColor="#F76454" :selectList="activeList" @confirm="confirmActice" />
|
|
@@ -103,7 +105,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { _API_OrderSum } from '@/apis/fortune.js'
|
|
|
+ import { _API_OrderSum, _API_OrderRank } from '@/apis/fortune.js'
|
|
|
import WPicker from '@/components/w-picker/w-picker.vue'
|
|
|
import chartProgress from '@/components/charts/chart-progress.vue'
|
|
|
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue'
|
|
@@ -116,32 +118,11 @@
|
|
|
0: '',
|
|
|
1: ''
|
|
|
},
|
|
|
- data: {
|
|
|
- money: 123456,
|
|
|
- pay_money: 45215,
|
|
|
- no_pay_money: 521,
|
|
|
- hard: 123,
|
|
|
- simple: 46,
|
|
|
- old: 852,
|
|
|
- hard_all: 861,
|
|
|
- simple_all: 8541,
|
|
|
- old_all: 5422,
|
|
|
- hard_money: 86100,
|
|
|
- simple_money: 854001,
|
|
|
- old_money: 542002,
|
|
|
- list: [
|
|
|
- { name: '张三', phone: '18333333333', hard: 10, old: 20, simple: 50 },
|
|
|
- { name: '张三', phone: '18333333333', hard: 10, old: 20, simple: 50 },
|
|
|
- { name: '张三', phone: '18333333333', hard: 10, old: 20, simple: 50 },
|
|
|
- { name: '张三', phone: '18333333333', hard: 10, old: 20, simple: 50 },
|
|
|
- { name: '张三', phone: '18333333333', hard: 10, old: 20, simple: 50 },
|
|
|
- ]
|
|
|
- },
|
|
|
+ data: null,
|
|
|
+ rank: [],
|
|
|
choosedActie: -1,
|
|
|
activeList: [
|
|
|
- { label: '五月活动', value: '1', start: '2020-05-12', end: '2020-06-11' },
|
|
|
- { label: '六月活动', value: '2', start: '2020-05-12', end: '2020-06-11' },
|
|
|
- { label: '七月活动', value: '3', start: '2020-05-12', end: '2020-06-11' },
|
|
|
+ { label: '五月重启 强力回归', value: '1', start: '2020-05-12', end: '2020-05-14' }
|
|
|
]
|
|
|
};
|
|
|
},
|
|
@@ -196,16 +177,30 @@
|
|
|
}
|
|
|
this.request()
|
|
|
},
|
|
|
+ onPullDownRefresh() {
|
|
|
+ this.request()
|
|
|
+ this.type = 0
|
|
|
+ },
|
|
|
methods: {
|
|
|
request() {
|
|
|
uni.loading()
|
|
|
if (this.date[0] && this.date[1]) {
|
|
|
_API_OrderSum({ satrt: this.date[0], end: this.date[1] }).then(({ data }) => {
|
|
|
this.data = data
|
|
|
+ uni.loading()
|
|
|
+ _API_OrderRank({ satrt: this.date[0], end: this.date[1] }).then(({ data: { list } }) => {
|
|
|
+ list.sort((a, b) => b.all - a.all)
|
|
|
+ this.rank = list
|
|
|
+ })
|
|
|
})
|
|
|
} else {
|
|
|
- _API_OrderSum().then(res => {
|
|
|
+ _API_OrderSum().then(({ data }) => {
|
|
|
this.data = data
|
|
|
+ uni.loading()
|
|
|
+ _API_OrderRank().then(({ data: { list } }) => {
|
|
|
+ list.sort((a, b) => b.all - a.all)
|
|
|
+ this.rank = list
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -262,9 +257,10 @@
|
|
|
.activity {
|
|
|
position: absolute;
|
|
|
top: 28rpx;
|
|
|
- right: -28.5rpx;
|
|
|
- width: 217.5rpx;
|
|
|
+ right: -20rpx;
|
|
|
+ min-width: 217.5rpx;
|
|
|
height: 57rpx;
|
|
|
+ padding: 0 24rpx;
|
|
|
@include flex();
|
|
|
color: #EEEBEB;
|
|
|
font-size: 28rpx;
|
|
@@ -317,10 +313,12 @@
|
|
|
&.active::after {
|
|
|
content: "";
|
|
|
bottom: 0;
|
|
|
+ left: 50%;
|
|
|
height: 4rpx;
|
|
|
width: 190rpx;
|
|
|
position: absolute;
|
|
|
border-radius: 2rpx;
|
|
|
+ transform: translateX(-50%);
|
|
|
background: $app-base-color;
|
|
|
}
|
|
|
}
|