Commit af1feb31 authored by wangqinghua's avatar wangqinghua

倒计时时间的bug;

批阅试卷
parent b55dd698
......@@ -42,7 +42,7 @@
<p>参与人员:<span class="color-666">{{test?.testObject}}</span></p>
<p>时间限制:<span class="color-666">{{test?.timeLimit | formatTime}}</span></p>
<div class="basic-question">
<div class="question-left">题数与分值</div>
<div class="question-left">题数与分值:</div>
<div class="question-right color-666">
<ng-container *ngFor="let item of test?.configs">
<p>
......
......@@ -34,7 +34,9 @@ export class LearnDetailPage {
//批阅试卷
gotoRead() {
if(this.test.markNumber > 0){
this.navCtrl.push('ReadLearnPage')
this.navCtrl.push('ReadLearnPage',{
testId:this.testId
})
}else{
this.commonSer.toast("当前试卷无问答题");
}
......
......@@ -14,7 +14,18 @@ export class LearnManageService{
return this.http.post(AppGlobal.domain+'/wisdomgroup//modules/testManage/getLearnTestList',this.commonSer.toFormData(data))
}
//试卷列表
getDetail(data): Observable<any>{
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-navbar>
<ion-title>排行榜</ion-title>
</ion-navbar>
</ion-header>
......@@ -16,7 +14,6 @@
refreshingSpinner="bubbles">
</ion-refresher-content>
</ion-refresher>
<ion-list>
<div class="main-container">
<div class="learn-item">
......@@ -46,8 +43,10 @@
<!--<p class="tips">备注:分数相同的情况下,先交卷者排名在前</p>-->
<!--上滑加载数据-->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
<ion-infinite-scroll threshold="100px" (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content
loadingSpinner="bubbles"
loadingText="加载更多...">
</ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
page-rank-list {
.top-container{
background: linear-gradient(to bottom,#89a2cd 0%,#ccd4e3 25%,#e6e8ed 100%);
text-align: center;
padding: 1.5rem;
}
......@@ -28,13 +30,13 @@ page-rank-list {
}
.span-rank{
display: inline-block;
width: 1.5rem;
height: 1.5rem;
width: 2rem;
height: 2rem;
background-color: #bfcbe0;
border-radius: 2px;
color: #fff;
font-size: 1.2rem;
vertical-align: middle;
line-height: 1.5rem;
line-height: 2rem;
}
}
......@@ -3,12 +3,6 @@ import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {DatePipe} from "@angular/common";
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()
@Component({
......@@ -98,7 +92,26 @@ export class RankListPage {
selectType: '1', //全部状态
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 @@
</div>
<div class="footer-subject">
<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>
<div class="footer-submit">
......
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 {LearnManageService} from "../learnManage.service";
import {message} from "../../../../app/main";
import {CommonService} from "../../../../provide/common.service";
@IonicPage()
@Component({
selector: 'page-read-learn',
templateUrl: 'read-learn.html',
selector: 'page-read-learn',
templateUrl: 'read-learn.html',
})
export class ReadLearnPage {
@ViewChild(Navbar) navbar:Navbar
list = [
{name:'杨阳洋1', test:[
{title:"看云识天气的解释1",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释2",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释3",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释4",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
]},
{name:'杨阳洋1', test:[
{title:"看云识天气的解释1",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释2",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释3",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释4",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
]},
{name:'杨阳洋1', test:[
{title:"看云识天气的解释1",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释2",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释3",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释4",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
{title:"看云识天气的解释5",content:"蚂蚁上树蚂蚁上树蚂蚁上树" },
]},
]
constructor(public navCtrl: NavController, public navParams: NavParams,public appService:AppService) {
}
ionViewDidLoad() {
this.navbar.backButtonClick = ()=>{
this.appService.alert("是否退出批阅?"),()=>{
this.navCtrl.pop()
@ViewChild(Navbar) navbar: Navbar;
@ViewChild(Slides) slides:Slides;
testId;
pageNumber = 1;
pageSize = 100;
index = 0;
list = [
{
name: '杨阳洋1', test: [
{title: "看云识天气的解释1", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释2", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释3", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释4", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
]
},
{
name: '杨阳洋1', test: [
{title: "看云识天气的解释1", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释2", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释3", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释4", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释5", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
]
},
{
name: '杨阳洋1', test: [
{title: "看云识天气的解释1", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释2", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{title: "看云识天气的解释3", content: "蚂蚁上树蚂蚁上树蚂蚁上树"},
{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;
console.log(this.list)
//
select(test, boolean) {
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{
getTop5(data): Observable<any>{
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 {
this.clock = window.setInterval(() => {
totalTime--;
this.useTime++;
let hourse = (Math.floor(totalTime / 3600)).toString();
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);
let seconds = Math.floor(totalTime % 60).toString();
seconds = (seconds.length > 1 ? seconds : '0' + seconds);
this.timeText = hourse + ":" + minutes + ":" + seconds;
if (totalTime < 0) {
this.useTime = this.totalTime;
window.clearInterval(this.clock)
......
......@@ -176,8 +176,8 @@
</ng-container>
</ng-container>
<!--上滑加载数据-->
<!--<ion-infinite-scroll (ionInfinite)="doInfinite($event)">-->
<!--<ion-infinite-scroll-content></ion-infinite-scroll-content>-->
<!--</ion-infinite-scroll>-->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
......@@ -17,7 +17,6 @@ export class FormatTimePipe implements PipeTransform {
let seconds = Math.floor(value % 60).toString();
seconds = (seconds.length > 1 ? seconds : '0' + seconds);
const timeText = hourse + ":" + minutes + ":" + seconds;
console.log(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