Browse Source

[完善] 考生页面完善

master
陈鹏飞 4 years ago
parent
commit
08d1b720e8
  1. 14
      src/app/student/examination-details/examination-details.component.html
  2. 43
      src/app/student/examination-details/examination-details.component.scss
  3. 15
      src/app/student/examination-details/examination-details.component.ts
  4. 8
      src/app/student/student-index/student-index.component.ts

14
src/app/student/examination-details/examination-details.component.html

@ -1 +1,13 @@
<p>11111123</p>
<div class="content">
<div><app-tabbar></app-tabbar></div>
<div class="cneter">
<div class="left">
<div class="headerLeft"><div>单位列表</div><div style="text-align: right;">总分: <label style="color: #07CDCF;">120</label></div></div>
<div class="centerLeft" style="background: #F5FDFE;"><div>单位名称</div><div>总分</div></div>
<div class="centerLeft"><div>单位名称</div><div>总分</div></div>
</div>
<div class="right"></div>
</div>
</div>

43
src/app/student/examination-details/examination-details.component.scss

@ -0,0 +1,43 @@
.content{
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
box-sizing: border-box;
.cneter {
flex: 1;
overflow: hidden;
background-color: #F2F5F6;
display: flex;
box-sizing: border-box;
padding: 25px;
>div { background-color: #fff; border-radius: 10px; }
.left {
flex: 20%;
margin-right: 25px;
}
.right {
flex: 80%;
}
}
}
//左侧
.headerLeft{
display: flex;
align-items: center;
>div {flex: 1;}
height: 36px;
padding: 0 25px;
}
.centerLeft {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
>div {flex: 1; overflow: hidden; text-align: center;}
height: 36px;
padding: 0 25px;
margin: 0 30px;
}

15
src/app/student/examination-details/examination-details.component.ts

@ -1,4 +1,8 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-examination-details',
@ -7,9 +11,18 @@ import { Component, OnInit } from '@angular/core';
})
export class ExaminationDetailsComponent implements OnInit {
constructor() { }
constructor(public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute) { }
ngOnInit(): void {
this.getTestInfo()
}
//获取考卷
getTestInfo () {
let id = this.route.snapshot.queryParams.paperId
this.http.get(`/api/Papers/${id}`).subscribe((data:any)=>{
console.log(data)
})
}
}

8
src/app/student/student-index/student-index.component.ts

@ -92,6 +92,12 @@ export class StudentIndexComponent implements OnInit {
//参加考试
takeTest (e) {
window.open(`/examinationDetails?testId=${e.id}`)
let body = {
name: e.title,
paperId: e.id,
}
this.http.post('/api/Examinations',body).subscribe((data:any)=>{
window.open(`/examinationDetails?paperId=${e.id}&examId=${data.id}`)
})
}
}

Loading…
Cancel
Save