@@ -23,34 +23,34 @@
-
+
个人总收益率
-
117.91%
+
{{memberInfo.currentRatio}}
个人综合排名
-
1
+
{{memberInfo.personalRank}}
-
+
团队综合排名
-
1
+
{{memberInfo.teamRank}}
个人总资产
-
217.58万
+
{{memberInfo.totalFounds}}万
@@ -64,7 +64,7 @@
- 吴和静的总成绩
+ {{userInfo.name}}的总成绩
@@ -80,7 +80,7 @@
个人收益率趋势
- 创建日期2021-10-10
+ 创建日期{{createTime}}
@@ -92,7 +92,7 @@
团队收益率趋势
-
创建日期2021-10-10
+
创建日期{{createTime}}
@@ -109,7 +109,7 @@
个人综合排名走势
- 创建日期2021-10-10
+ 创建日期{{createTime}}
@@ -122,7 +122,7 @@
团队综合排名走势
- 创建日期2021-10-10
+ 创建日期{{createTime}}
@@ -202,6 +202,7 @@
import * as echarts from 'echarts'
import * as competitionApi from '@/api/competition'
import { getInfo } from '@/utils/auth'
+import * as memberApi from '@/api/member'
export default {
data(){
return {
@@ -210,10 +211,18 @@ export default {
personalRankingCharts: null,
teamRankingCharts: null,
compId: 0,
- competition: {},
stageId: 0,
+ currentStage: null,
positionList:[],
- userInfo:null
+ userInfo:null,
+ memberInfo: null,
+ createTime: new Date().Format('yyyy-MM-dd')
+ }
+ },
+ props:{
+ competition:{
+ type: Object,
+ default: null
}
},
created(){
@@ -221,15 +230,19 @@ export default {
this.compId = this.$route.query.id
}
this.userInfo = getInfo()
- competitionApi.get({compId: this.compId}).then(res=> {
- if(res.code == 200 ){
- this.competition = res.data
- this.stageId = this.competition.stageList[0].id
- this.listPosition()
- }
- })
+
+ },
+ watch:{
+ competition:function(nv){
+ this.stageId = this.competition.stageList[0].id
+ this.loadData()
+ }
},
mounted(){
+ if(this.competition){
+ this.stageId = this.competition.stageList[0].id
+ this.loadData()
+ }
this.draw("personalRatio")
this.draw("teamRatio")
this.drawRanking("personalRanking")
@@ -244,9 +257,21 @@ export default {
}
})
},
+ getMemberInfo(){
+ memberApi.getMemberInfo(this.compId,this.stageId).then(res=>{
+ if(res.code == 200){
+ this.memberInfo = res.data
+ }
+ })
+ },
+ loadData(){
+ this.listPosition()
+ this.getMemberInfo()
+ },
changeStage(id){
this.stageId = id
- this.listPosition()
+ this.getCurrentStage(id)
+ this.loadData()
},
numberFixed(num){
if(typeof num == 'number'){
@@ -255,6 +280,14 @@ export default {
return 0;
}
},
+ getCurrentStage(id){
+ let stage = this.competition.stageList.filter(st =>{
+ return st.id == id
+ })
+ if(stage){
+ this.currentStage = stage
+ }
+ },
draw(id){
let base = +new Date(1968, 9, 3);
let oneDay = 24 * 3600 * 1000;
diff --git a/front/src/views/login/index.vue b/front/src/views/login/index.vue
index 9420c63..256e251 100644
--- a/front/src/views/login/index.vue
+++ b/front/src/views/login/index.vue
@@ -19,7 +19,7 @@ export default {
return {
user: {
username:'2020096911',
- password:'tz2022'
+ password:'abc123ddd'
},
msg: ''
}
diff --git a/front/src/views/member/index.vue b/front/src/views/member/index.vue
index 4d2d660..ea391e4 100644
--- a/front/src/views/member/index.vue
+++ b/front/src/views/member/index.vue
@@ -14,7 +14,7 @@
个人中心
-
- 上次登录1天前
+ 上次登录{{formatLastTime()}}前
- 上次登陆IP: 110.12.68.64
- IP登陆地: 广东省深圳市宝安区
+ 上次登陆IP: {{userInfo.ip}}
+ IP登陆地: {{userInfo.location}}
编辑
- 保存
+ 保存
@@ -67,7 +67,7 @@
- 姓名:伍金林
+ 姓名:{{ userInfo.name}}
班级:天择1班
@@ -75,10 +75,10 @@
- 学号:20171031
+ 学号:{{userInfo.username}}
- 学校:天择大学
+ 学校:{{ userInfo.school }}
@@ -86,15 +86,15 @@
学历:本科
- 电话:
+ 电话:
@@ -106,13 +106,25 @@
@@ -557,9 +607,7 @@ export default {
color: white;
margin-left: 25rem;
}
-.tz-bold{
- font-weight: bold;
-}
+
.tz-flex div{
min-height: 80px;
align-items: center;
@@ -657,6 +705,7 @@ export default {
border-radius: 3px;
border: 2px solid white;
margin-right: 1rem;
+ width: 18rem;
}
.comp-type{
display: inline-block;
@@ -672,8 +721,6 @@ export default {
min-height: 387px;
max-width: 86rem;
background: white;
- display: block;
- width: 100%;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
diff --git a/front/src/views/system/portrait.vue b/front/src/views/system/portrait.vue
index 3d7a919..4bebb32 100644
--- a/front/src/views/system/portrait.vue
+++ b/front/src/views/system/portrait.vue
@@ -6,7 +6,7 @@
欢迎
- {{userInfo.name}}
+ {{ userInfo? userInfo.name: ''}}