From 08d1b720e82951c03ee43c12de0e780d42b6548d Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 23 Dec 2020 10:01:28 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E8=80=83=E7=94=9F?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examination-details.component.html | 14 +++++- .../examination-details.component.scss | 43 +++++++++++++++++++ .../examination-details.component.ts | 15 ++++++- .../student-index/student-index.component.ts | 8 +++- 4 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/app/student/examination-details/examination-details.component.html b/src/app/student/examination-details/examination-details.component.html index 5431c31..aa1ab18 100644 --- a/src/app/student/examination-details/examination-details.component.html +++ b/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> diff --git a/src/app/student/examination-details/examination-details.component.scss b/src/app/student/examination-details/examination-details.component.scss index e69de29..a23667a 100644 --- a/src/app/student/examination-details/examination-details.component.scss +++ b/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; +} \ No newline at end of file diff --git a/src/app/student/examination-details/examination-details.component.ts b/src/app/student/examination-details/examination-details.component.ts index 4597353..5effe16 100644 --- a/src/app/student/examination-details/examination-details.component.ts +++ b/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) + }) } } diff --git a/src/app/student/student-index/student-index.component.ts b/src/app/student/student-index/student-index.component.ts index 2292bc2..9d3ef14 100644 --- a/src/app/student/student-index/student-index.component.ts +++ b/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}`) + }) } }