Commit af1feb31 authored by wangqinghua's avatar wangqinghua

倒计时时间的bug;

批阅试卷
parent b55dd698
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<p>参与人员:<span class="color-666">{{test?.testObject}}</span></p> <p>参与人员:<span class="color-666">{{test?.testObject}}</span></p>
<p>时间限制:<span class="color-666">{{test?.timeLimit | formatTime}}</span></p> <p>时间限制:<span class="color-666">{{test?.timeLimit | formatTime}}</span></p>
<div class="basic-question"> <div class="basic-question">
<div class="question-left">题数与分值</div> <div class="question-left">题数与分值:</div>
<div class="question-right color-666"> <div class="question-right color-666">
<ng-container *ngFor="let item of test?.configs"> <ng-container *ngFor="let item of test?.configs">
<p> <p>
......
...@@ -34,7 +34,9 @@ export class LearnDetailPage { ...@@ -34,7 +34,9 @@ export class LearnDetailPage {
//批阅试卷 //批阅试卷
gotoRead() { gotoRead() {
if(this.test.markNumber > 0){ if(this.test.markNumber > 0){
this.navCtrl.push('ReadLearnPage') this.navCtrl.push('ReadLearnPage',{
testId:this.testId
})
}else{ }else{
this.commonSer.toast("当前试卷无问答题"); this.commonSer.toast("当前试卷无问答题");
} }
......
...@@ -14,7 +14,18 @@ export class LearnManageService{ ...@@ -14,7 +14,18 @@ export class LearnManageService{
return this.http.post(AppGlobal.domain+'/wisdomgroup//modules/testManage/getLearnTestList',this.commonSer.toFormData(data)) return this.http.post(AppGlobal.domain+'/wisdomgroup//modules/testManage/getLearnTestList',this.commonSer.toFormData(data))
} }
//试卷列表
getDetail(data): Observable<any>{ getDetail(data): Observable<any>{
return this.http.post(AppGlobal.domain+'/wisdomgroup//modules/testManage/getDetail',this.commonSer.toFormData(data)) return this.http.post(AppGlobal.domain+'/wisdomgroup//modules/testManage/getDetail',this.commonSer.toFormData(data))
} }
//待批阅列表
getMarkList(data): Observable<any>{
return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/testManage/getMarkList' , this.commonSer.toFormData(data) );
}
//提交批阅结果
submitMarkResult(data): Observable<any>{
return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/testManage/submitMarkResult' , data);
}
} }
\ No newline at end of file
<!--排行榜--> <!--排行榜-->
<ion-header> <ion-header>
<ion-navbar> <ion-navbar>
<ion-title>排行榜</ion-title> <ion-title>排行榜</ion-title>
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
...@@ -16,7 +14,6 @@ ...@@ -16,7 +14,6 @@
refreshingSpinner="bubbles"> refreshingSpinner="bubbles">
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
<ion-list> <ion-list>
<div class="main-container"> <div class="main-container">
<div class="learn-item"> <div class="learn-item">
...@@ -46,8 +43,10 @@ ...@@ -46,8 +43,10 @@
<!--<p class="tips">备注:分数相同的情况下,先交卷者排名在前</p>--> <!--<p class="tips">备注:分数相同的情况下,先交卷者排名在前</p>-->
<!--上滑加载数据--> <!--上滑加载数据-->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <ion-infinite-scroll threshold="100px" (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content
loadingSpinner="bubbles"
loadingText="加载更多...">
</ion-infinite-scroll-content>
</ion-infinite-scroll> </ion-infinite-scroll>
</ion-content> </ion-content>
page-rank-list { page-rank-list {
.top-container{ .top-container{
background: linear-gradient(to bottom,#89a2cd 0%,#ccd4e3 25%,#e6e8ed 100%);
text-align: center; text-align: center;
padding: 1.5rem; padding: 1.5rem;
} }
...@@ -28,13 +30,13 @@ page-rank-list { ...@@ -28,13 +30,13 @@ page-rank-list {
} }
.span-rank{ .span-rank{
display: inline-block; display: inline-block;
width: 1.5rem; width: 2rem;
height: 1.5rem; height: 2rem;
background-color: #bfcbe0; background-color: #bfcbe0;
border-radius: 2px; border-radius: 2px;
color: #fff; color: #fff;
font-size: 1.2rem; font-size: 1.2rem;
vertical-align: middle; vertical-align: middle;
line-height: 1.5rem; line-height: 2rem;
} }
} }
...@@ -3,12 +3,6 @@ import {IonicPage, NavController, NavParams} from 'ionic-angular'; ...@@ -3,12 +3,6 @@ import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {DatePipe} from "@angular/common"; import {DatePipe} from "@angular/common";
import {CommonService} from "../../../../provide/common.service"; import {CommonService} from "../../../../provide/common.service";
/**
* Generated class for the RankListPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -98,7 +92,26 @@ export class RankListPage { ...@@ -98,7 +92,26 @@ export class RankListPage {
selectType: '1', //全部状态 selectType: '1', //全部状态
queryTime: nowDate, queryTime: nowDate,
}; };
infiniteScroll.complete(); setTimeout( ()=>{
this.list.push(
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
{username: '7', score: '100'},
)
if(this.list.length > 100){
infiniteScroll.enable(false);
}else{
infiniteScroll.complete();
}
},1000 )
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
<div class="footer-subject"> <div class="footer-subject">
<div (click)="prev()" class="prev">上一题</div> <div (click)="prev()" class="prev">上一题</div>
<div class="index">1 / 10</div> <div class="index">{{index +1}} / {{list.length}}</div>
<div (click)="next()" class="next">下一题</div> <div (click)="next()" class="next">下一题</div>
</div> </div>
<div class="footer-submit"> <div class="footer-submit">
......
import {Component, ViewChild} from '@angular/core'; import {Component, ViewChild} from '@angular/core';
import {IonicPage, Navbar, NavController, NavParams} from 'ionic-angular'; import {IonicPage, Navbar, NavController, NavParams, Slides} from 'ionic-angular';
import {AppService} from "../../../../service/http.service"; import {AppService} from "../../../../service/http.service";
import {LearnManageService} from "../learnManage.service";
import {message} from "../../../../app/main";
import {CommonService} from "../../../../provide/common.service";
@IonicPage() @IonicPage()
@Component({ @Component({
selector: 'page-read-learn', selector: 'page-read-learn',
templateUrl: 'read-learn.html', templateUrl: 'read-learn.html',
}) })
export class ReadLearnPage { export class ReadLearnPage {
@ViewChild(Navbar) navbar:Navbar @ViewChild(Navbar) navbar: Navbar;
@ViewChild(Slides) slides:Slides;
list = [
{name:'杨阳洋1', test:[ testId;
{title:"看云识天气的解释1",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, pageNumber = 1;
{title:"看云识天气的解释2",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, pageSize = 100;
{title:"看云识天气的解释3",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, index = 0;
{title:"看云识天气的解释4",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, list = [
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, name: '杨阳洋1', test: [
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释1", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释2", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释3", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释4", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
]}, {title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{name:'杨阳洋1', test:[ {title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释1",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释2",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释3",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释4",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, ]
]}, },
{name:'杨阳洋1', test:[ {
{title:"看云识天气的解释1",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, name: '杨阳洋1', test: [
{title:"看云识天气的解释2",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释1", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释3",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释2", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释4",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释3", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" }, {title: "看云识天气的解释4", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
]}, {title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
] ]
constructor(public navCtrl: NavController, public navParams: NavParams,public appService:AppService) { },
} {
name: '杨阳洋1', test: [
ionViewDidLoad() { {title: "看云识天气的解释1", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
this.navbar.backButtonClick = ()=>{ {title: "看云识天气的解释2", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
this.appService.alert("是否退出批阅?"),()=>{ {title: "看云识天气的解释3", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
this.navCtrl.pop() {title: "看云识天气的解释4", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
]
},
]
constructor(public navCtrl: NavController, public navParams: NavParams, public appService: AppService,
public learnManSer: LearnManageService,public commonSer:CommonService) {
}
ionViewDidLoad() {
this.testId = this.navParams.get("testId");
const data = {
testId: this.testId,
pageNumber: this.pageNumber,
pageSize: this.pageSize
};
this.learnManSer.getMarkList(data).subscribe(
(res)=>{
}
)
this.navbar.backButtonClick = () => {
this.appService.alert("是否退出批阅,当前批阅不会保存?"), () => {
this.navCtrl.pop()
}
}
}
slideChanged(){
this.index = this.slides.realIndex;
}
//上一题
prev() {
if (this.index == 0) {
this.commonSer.toast('已经是第一份试卷了!')
} else {
this.index -= 1;
this.slides.slideTo(this.index)
}
}
//下一题
next() {
if (this.index == this.list.length - 1) {
this.commonSer.toast('已经是最后一份试卷了!')
} else {
this.index += 1;
this.slides.slideTo(this.index)
} }
} }
}
//
select(test,boolean){ //
test.checked = boolean; select(test, boolean) {
console.log(this.list) test.checked = boolean;
console.log(this.list)
} }
//提交批阅结果
submit(){
const data = {
};
this.learnManSer.submitMarkResult(data).subscribe(
(res)=>{
this.commonSer.toast("批阅完成!")
this.navCtrl.pop();
}
)
}
} }
...@@ -43,14 +43,4 @@ export class LearnService{ ...@@ -43,14 +43,4 @@ export class LearnService{
getTop5(data): Observable<any>{ getTop5(data): Observable<any>{
return this.http.get(AppGlobal.domain+'/wisdomgroup/modules/learnPcTest/top/' + data); return this.http.get(AppGlobal.domain+'/wisdomgroup/modules/learnPcTest/top/' + data);
} }
//待批阅列表
getMarkList(data): Observable<any>{
return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/testManage/getMarkList' , data);
}
//提交批阅结果
submitMarkResult(data): Observable<any>{
return this.http.post(AppGlobal.domain+'/wisdomgroup/modules/testManage/submitMarkResult' , data);
}
} }
\ No newline at end of file
...@@ -78,13 +78,16 @@ export class LearningDoPage { ...@@ -78,13 +78,16 @@ export class LearningDoPage {
this.clock = window.setInterval(() => { this.clock = window.setInterval(() => {
totalTime--; totalTime--;
this.useTime++; this.useTime++;
let hourse = (Math.floor(totalTime / 3600)).toString(); let hourse = (Math.floor(totalTime / 3600)).toString();
hourse = (hourse.length > 1 ? hourse : '0' + hourse); hourse = (hourse.length > 1 ? hourse : '0' + hourse);
let minutes = Math.floor(totalTime / 60).toString(); let minutes =<any> Math.floor(totalTime / 60).toString();
minutes = minutes % 60 === 0 ? 0:minutes;
minutes = (minutes.length > 1 ? minutes : '0' + minutes); minutes = (minutes.length > 1 ? minutes : '0' + minutes);
let seconds = Math.floor(totalTime % 60).toString(); let seconds = Math.floor(totalTime % 60).toString();
seconds = (seconds.length > 1 ? seconds : '0' + seconds); seconds = (seconds.length > 1 ? seconds : '0' + seconds);
this.timeText = hourse + ":" + minutes + ":" + seconds; this.timeText = hourse + ":" + minutes + ":" + seconds;
if (totalTime < 0) { if (totalTime < 0) {
this.useTime = this.totalTime; this.useTime = this.totalTime;
window.clearInterval(this.clock) window.clearInterval(this.clock)
......
...@@ -176,8 +176,8 @@ ...@@ -176,8 +176,8 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<!--上滑加载数据--> <!--上滑加载数据-->
<!--<ion-infinite-scroll (ionInfinite)="doInfinite($event)">--> <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<!--<ion-infinite-scroll-content></ion-infinite-scroll-content>--> <ion-infinite-scroll-content></ion-infinite-scroll-content>
<!--</ion-infinite-scroll>--> </ion-infinite-scroll>
</ion-content> </ion-content>
...@@ -17,7 +17,6 @@ export class FormatTimePipe implements PipeTransform { ...@@ -17,7 +17,6 @@ export class FormatTimePipe implements PipeTransform {
let seconds = Math.floor(value % 60).toString(); let seconds = Math.floor(value % 60).toString();
seconds = (seconds.length > 1 ? seconds : '0' + seconds); seconds = (seconds.length > 1 ? seconds : '0' + seconds);
const timeText = hourse + ":" + minutes + ":" + seconds; const timeText = hourse + ":" + minutes + ":" + seconds;
console.log(timeText)
return timeText; return timeText;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment