File tree Expand file tree Collapse file tree 7 files changed +396
-346
lines changed
Expand file tree Collapse file tree 7 files changed +396
-346
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module.exports = {
44 host : '127.0.0.1' , //mysql连接ip地址
55 user : 'root' ,
66 password : '648363' , //mySql用户名密码
7- database : 'user_system ' , //mySql数据库名
7+ database : 'team ' , //mySql数据库名
88 port : '3306' , //mysql连接端口
99 }
1010}
Original file line number Diff line number Diff line change 55 class =" mainContainer"
66 v-for =" (item, index) in rankers"
77 :key =" item.nickname"
8- v-loading =" isLoading.single "
8+ v-loading =" isLoading"
99 >
10- <Card class =" card" :author =" item" />
11- <span class =" time" >{{
12- new Date(item.timeStamp).toLocaleString()
13- }}</span >
1410 <span class =" th"
15- >{{ index + 1 }}& nbsp ; <sup >{{ thString(index + 1) }}</sup ></span
11+ >{{ index + 1 }}<sup >{{ thString(index + 1) }}</sup ></span
1612 >
13+ <el-icon class =" icon avatar" v-if =" !item.avatar" ><User /></el-icon >
14+ <Avatar
15+ class =" avatar"
16+ :image =" item.avatar"
17+ :is-dot =" false"
18+ v-else
19+ />
20+ <span class =" info" >
21+ <span class =" nickname" >{{ item.nickname }}</span >
22+ </span >
1723 </div >
1824 </div >
1925</template >
2026
2127<script >
22- import Card from " @/components/UserAssets/Card /index.vue"
28+ import Avatar from " @/components/UserAssets/Avatar /index.vue"
2329
2430export default {
2531 name: " Rank" ,
26- components: { Card },
32+ components: { Avatar },
2733 data () {
2834 return {
2935 isLoading: true ,
@@ -114,29 +120,31 @@ export default {
114120 font-family : "HanSerif" ;
115121}
116122.mainContainer {
117- @apply relative py-4 my-2 max-w-xs ;
123+ @apply relative inline-flex justify-center items-center py-4 w-full ;
118124}
119125
120- .card {
121- @apply flex-col px-4 ;
126+ .avatar {
127+ @apply inline-block w-24 ml-2 ;
122128}
123- .time {
124- @apply text-xs font-bold opacity-60;
129+ .icon {
130+ @apply text-4xl inline-block h-full px-2;
131+ }
132+ .info {
133+ @apply relative inline-flex flex-col justify-center w-full ml-2;
134+ }
135+
136+ .info .nickname {
137+ @apply block text-base truncate font-semibold;
138+ max-width : 12 ch ;
125139}
126140
127141.th {
128- @apply inline-block absolute top-0 right-8 font-semibold text-lg ;
142+ @apply inline-block text-xl w-6 ;
129143}
130144
131145@media (prefers-color-scheme : dark) {
132- .title {
133- @apply bg-gray-800;
134- }
135146}
136147
137148@media (prefers-color-scheme : light) {
138- .title {
139- @apply bg-gray-100;
140- }
141149}
142150 </style >
Original file line number Diff line number Diff line change 11<template >
22 <div class =" navigation" >
33 <UserAvatar
4- class =" avatar"
4+ class =" avatar comp "
55 @click =" handleOpenUserArea"
66 v-show =" isLogined"
77 :image =" avatarUrl"
88 :isDot =" false"
9+ :isMe =" true"
10+ v-if =" avatarUrl"
911 />
12+ <span class =" avatar icon" @click =" handleOpenUserArea" v-else >
13+ <el-icon ><User /></el-icon
14+ ></span >
1015 <div class =" shiftOperations" >
1116 <span class =" color-mode" @click =" switchColorMode" >
1217 <el-icon v-if =" isMatchColorMode('light')" ><Sunny /></el-icon >
@@ -65,8 +70,9 @@ export default {
6570 }
6671 },
6772 beforeCreate () {
68- this .$public .on (" update-main-user-info-upto-app" , () => {
73+ this .$public .on (" update-main-user-info-upto-app" , ({ detail } ) => {
6974 this .isLogined = true
75+ this .avatarUrl = detail .avatar ?? localStorage .getItem (" avatar" )
7076 })
7177 this .$public .on (" clear-user-sign-status" , () => {
7278 this .isLogined = false
@@ -167,7 +173,15 @@ export default {
167173}
168174
169175.avatar {
170- @apply w-11 h-11 absolute left-2;
176+ @apply inline- flex justify- center items- center w- 11 h- 11 absolute left- 2
177+ hover: bg- gray- 200 dark: hover: bg- gray- 600 rounded- full cursor- pointer transition- all;
178+ }
179+
180+ .avatar : not (.comp ) {
181+ @apply inline- flex justify- center items- center w- 11 h- 11 p- 2.5 absolute left- 2
182+ hover: bg- gray- 200 dark: hover: bg- gray- 600 rounded- full
183+ border- 2 border- gray- 300 dark: border- gray- 600
184+ cursor- pointer transition- all;
171185}
172186
173187.shiftOperations {
You can’t perform that action at this time.
0 commit comments