瀏覽代碼

app-自测练习

xiaoqiao 4 月之前
父節點
當前提交
164fb806d5

+ 3 - 3
parth5/parth5/src/app/views/pages/examonline/examonline.component.html

@@ -13,7 +13,7 @@
         <ion-label text-wrap>
           <ion-row>
             <ion-col>
-             <h2> {{ item.testName }}</h2>
+              <h2> {{ item.testName }}</h2>
             </ion-col>
           </ion-row>
           <ion-row>
@@ -33,9 +33,9 @@
           </ion-row>
           <ion-row>
             <ion-col size="8">
-              100
+              {{ item.score == null ? '--' : item.score }}分/及格{{ item.passingscore }}
             </ion-col>
-            <ion-col>
+            <ion-col  [ngStyle]="{'color':getColor(item.manStatus)}">
               {{ item.manStatusName }}
             </ion-col>
           </ion-row>

+ 16 - 0
parth5/parth5/src/app/views/pages/examonline/examonline.component.ts

@@ -56,6 +56,22 @@ export class ExamonlineComponent implements OnInit {
       }
     });
   }
+  getColor(manStatus){
+    switch (manStatus){
+      case  1:
+        return '#ff4900';
+      case 2:
+        return '#0000ff';
+      case 3:
+        return '#3880ff';
+      case 4:
+        return '#8b8b83';
+      case 5:
+        return '#19e218';
+      default:
+          return 'red';
+    }
+  }
   async presentAlert(msg: string) {
     const alert = await this.alertController.create({
       header: '提示',