|
@@ -1,34 +1,36 @@
|
1
|
1
|
<template>
|
2
|
|
- <a-layout>
|
3
|
|
- <view class="v-flex container">
|
4
|
|
- <banner-box class="flex-0">
|
5
|
|
- <view class="rank-tab flex">
|
6
|
|
- <view class="flex-1" :class="{ active: current === 0 }" @tap="current = 0">
|
7
|
|
- 分享排名
|
8
|
|
- </view>
|
9
|
|
- <view class="flex-1" :class="{ active: current === 1 }" @tap="current = 1">
|
10
|
|
- 区域排名
|
11
|
|
- </view>
|
|
2
|
+ <view class="page rank-page">
|
|
3
|
+ <view class="rank-head">
|
|
4
|
+ <view class="rank-tab flex">
|
|
5
|
+ <view class="flex-1" :class="{ active: current === 0 }" @tap="current = 0">
|
|
6
|
+ 分享排名
|
12
|
7
|
</view>
|
13
|
|
- </banner-box>
|
14
|
|
- <view class="flex-1">
|
15
|
|
- <rank-list v-if="current === 0" st-type="person"></rank-list>
|
16
|
|
- <rank-list v-else st-type="area"></rank-list>
|
|
8
|
+ <view class="flex-1" :class="{ active: current === 1 }" @tap="current = 1">
|
|
9
|
+ 区域排名
|
|
10
|
+ </view>
|
|
11
|
+ </view>
|
|
12
|
+ <view class="rank-mine">
|
|
13
|
+ {{rankDesc}}
|
17
|
14
|
</view>
|
18
|
15
|
</view>
|
19
|
|
- </a-layout>
|
|
16
|
+ <view class="rank-body">
|
|
17
|
+ <rank-list v-if="current === 0" st-type="person"></rank-list>
|
|
18
|
+ <rank-list v-else st-type="area"></rank-list>
|
|
19
|
+ </view>
|
|
20
|
+ </view>
|
20
|
21
|
</template>
|
21
|
22
|
|
22
|
23
|
<script>
|
23
|
|
-import { ref } from 'vue';
|
|
24
|
+import { computed, ref, watch } from 'vue';
|
24
|
25
|
import Taro, { useReady } from '@tarojs/taro';
|
25
|
26
|
import { useModel } from '@zjxpcyc/vue-tiny-store';
|
26
|
27
|
import BannerBox from '@/components/banner/index.vue'
|
|
28
|
+import { getMyRank } from '@/service/rank';
|
27
|
29
|
import ListVue from './components/list.vue';
|
28
|
30
|
|
29
|
31
|
export default {
|
30
|
32
|
components: {
|
31
|
|
- 'banner-box': BannerBox,
|
|
33
|
+ // 'banner-box': BannerBox,
|
32
|
34
|
'rank-list': ListVue,
|
33
|
35
|
},
|
34
|
36
|
onShareAppMessage() {
|
|
@@ -41,9 +43,19 @@ export default {
|
41
|
43
|
setup () {
|
42
|
44
|
const { user } = useModel('user');
|
43
|
45
|
const current = ref(0);
|
|
46
|
+ const myRank = ref(0);
|
|
47
|
+
|
|
48
|
+ const rankDesc = computed(() => myRank.value > 0 ? `我的全国排名:第 ${myRank.value} 名` : '我的全国排名:暂未上榜')
|
|
49
|
+
|
|
50
|
+ watch(user, (person) => {
|
|
51
|
+ if (person.personId) {
|
|
52
|
+ getMyRank(person.personId).then(res => myRank.value = res);
|
|
53
|
+ }
|
|
54
|
+ }, { immediate: true });
|
44
|
55
|
|
45
|
56
|
return {
|
46
|
57
|
user,
|
|
58
|
+ rankDesc,
|
47
|
59
|
current,
|
48
|
60
|
}
|
49
|
61
|
},
|
|
@@ -51,15 +63,42 @@ export default {
|
51
|
63
|
</script>
|
52
|
64
|
|
53
|
65
|
<style lang="less">
|
|
66
|
+.rank-page {
|
|
67
|
+ background: linear-gradient(#EE1C25, #FFFD00);
|
|
68
|
+
|
|
69
|
+ @rankHeadHeight: 280rpx;
|
|
70
|
+
|
|
71
|
+ .rank-head {
|
|
72
|
+ height: @rankHeadHeight;
|
|
73
|
+ }
|
|
74
|
+
|
|
75
|
+ .rank-body {
|
|
76
|
+ height: calc(100% - @rankHeadHeight);
|
|
77
|
+ }
|
|
78
|
+}
|
|
79
|
+
|
|
80
|
+.rank-mine {
|
|
81
|
+ position: absolute;
|
|
82
|
+ width: calc(100vw - 2em);
|
|
83
|
+ top: 180rpx;
|
|
84
|
+ left: 1em;
|
|
85
|
+ background: rgba(250, 244, 230, .9);
|
|
86
|
+ color: #333;
|
|
87
|
+ border-radius: 48rpx;
|
|
88
|
+ line-height: 78rpx;
|
|
89
|
+ box-sizing: border-box;
|
|
90
|
+ padding: 0 2em;
|
|
91
|
+}
|
|
92
|
+
|
54
|
93
|
.rank-tab {
|
55
|
94
|
position: absolute;
|
56
|
95
|
width: 60vw;
|
57
|
|
- top: 100rpx;
|
|
96
|
+ top: 60rpx;
|
58
|
97
|
left: 20vw;
|
59
|
98
|
|
60
|
|
- background: rgba(251, 254, 154, 0.1);
|
61
|
|
- color: #333;
|
62
|
|
- border: 8px solid #A02923;
|
|
99
|
+ background: transparent;
|
|
100
|
+ color: rgba(250, 244, 230, 1);
|
|
101
|
+ border: 4rpx solid rgba(250, 244, 230, 1);
|
63
|
102
|
border-radius: 48rpx;
|
64
|
103
|
box-sizing: border-box;
|
65
|
104
|
text-align: center;
|
|
@@ -67,8 +106,8 @@ export default {
|
67
|
106
|
overflow: hidden;
|
68
|
107
|
|
69
|
108
|
.active {
|
70
|
|
- background: rgba(160, 41, 35, 1);
|
71
|
|
- color: #fff;
|
|
109
|
+ background: rgba(250, 244, 230, .9);
|
|
110
|
+ color: #333;
|
72
|
111
|
}
|
73
|
112
|
}
|
74
|
113
|
</style>
|