Commit 680b51fc authored by wangqinghua's avatar wangqinghua

结果页面

parent f5bd5bb1
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.smart19.starter.test" version="4.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="io.ionic.smart19.starter.test" version="4.0.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>党建云平台(测试)</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
......
page-read-learn {
.main-container{
height: calc(100% - 8rem);
background-image: url(../../../../assets/imgs/learn/learning_background.png);
background-repeat: no-repeat;
background-color: #e6e8ed;
background: #e6e8ed url(../../../../assets/imgs/learn/learning_background.png) no-repeat;
padding: 1.5rem;
}
.swiper-slide,.slide-zoom{
......
......@@ -10,7 +10,7 @@
<ion-content>
<div class="main-container">
<ion-slides>
<ion-slides (ionSlideDidChange)="slideChanged()">
<ion-slide *ngFor="let item of list;let i = index;">
<div class="learn-item">
<div class="learn-title">{{title}}</div>
......@@ -18,7 +18,7 @@
<div class="item-title">
<!--判断题目类型-->
<p>
<span class="color-red" *ngIf="item.isAns == 1">*</span>{{index}}、
<span class="color-red" *ngIf="item.isAns == 1">*</span>{{i +1}}、
<span *ngIf="item.questionType == 1">(单选)</span>
<span *ngIf="item.questionType == 2">(多选)</span>
<span *ngIf="item.questionType == 3">(填空)</span>
......@@ -87,7 +87,7 @@
</div>
<div class="footer-subject">
<div (click)="prev()" class="prev">上一题</div>
<div class="index">{{index}} / {{list.length}}</div>
<div class="index">{{index +1}} / {{list.length}}</div>
<div (click)="next()" class="next">下一题</div>
</div>
<div class="footer-submit">
......
page-learning-do {
.main-container{
height: calc(100% - 8rem);
background-image: url(../../../../assets/imgs/learn/learning_background.png);
background-repeat: no-repeat;
background-color: #e6e8ed;
background:#e6e8ed url(../../../../assets/imgs/learn/learning_background.png) no-repeat;
padding: 1.5rem;
}
.swiper-slide,.slide-zoom{
......@@ -27,7 +25,7 @@ page-learning-do {
}
.item-container{
background-color: #fff;
height: calc(100% - 7rem);
height: calc(100% - 8rem);
border-bottom-left-radius: .8rem;
border-bottom-right-radius: .8rem;
}
......@@ -49,11 +47,12 @@ page-learning-do {
padding: 0 1rem;
position: absolute;
left: 0;
bottom: 3rem;
bottom: 4rem;
height: 5rem;
width: 100%;
background-color: #e6e8ed;
display: flex;
font-size: 1.8rem;
div {
line-height: 5rem;
}
......@@ -65,7 +64,7 @@ page-learning-do {
text-align: right;
}
.index {
flex: 1;
flex: 3;
text-align: center;
}
}
......@@ -73,12 +72,12 @@ page-learning-do {
position: absolute;
left: 0;
bottom: 0;
height: 3rem;
height: 4rem;
width: 100%;
border-top: .1rem solid #34b4fc;
display: flex;
div {
line-height: 3rem;
line-height: 4rem;
}
.time {
text-align: center;
......
......@@ -25,7 +25,7 @@ export class LearningDoPage {
list = [];
timeText = '00:00:00';
totalTime;
index = 1; //当前题目的序号
index = 0; //当前题目的序号
useTime = 0; //用时
constructor(public navCtrl: NavController, public navParams: NavParams, private learnSer: LearnService, public commonSer: CommonService,
public toastCtrl: ToastController, public appService: AppService, public datePipe: DatePipe) {
......@@ -37,6 +37,7 @@ export class LearningDoPage {
this.submit();
}
};
this.navCtrl.swipeBackEnabled = false;
}
ionViewDidEnter() {
......@@ -88,28 +89,33 @@ export class LearningDoPage {
//上一题
prev() {
if (this.index == 1) {
if (this.index == 0) {
const toast = this.toastCtrl.create(message);
toast.setMessage('已经是第一题哦');
toast.present();
} else {
this.index -= 1;
this.slides.slideTo(this.index - 1)
this.slides.slideTo(this.index)
}
}
//下一题
next() {
if (this.index == this.list.length) {
if (this.index == this.list.length -1) {
const toast = this.toastCtrl.create(message);
toast.setMessage('已经是最后一题了哦');
toast.present();
} else {
this.index += 1;
this.slides.slideTo(this.index - 1)
this.slides.slideTo(this.index)
}
}
//左划右划
slideChanged(){
this.index = this.slides.getActiveIndex();
}
//多选
mutiSelect(i, option) {
if (this.list[i].answer.includes(option)) {
......@@ -150,6 +156,7 @@ export class LearningDoPage {
listMap: this.list.map(e => {
if (e.answer.length > 1) {
e.answer = e.answer.substr(0, e.answer.length - 1);
e.answer = e.answer.split(";").sort();
}
const d = {
questionId: e.questionId,
......
......@@ -26,11 +26,15 @@ export class LearningListPage {
constructor(public navCtrl: NavController, public navParams: NavParams,
public learnSer: LearnService, public datePipe: DatePipe) {
}
ionViewDidEnter() {
ionViewDidLoad(){
let itemWidth = window.screen.width / 3;
this.tips.nativeElement.style.left = itemWidth / 2 - this.tips.nativeElement.offsetWidth / 2 + 'px';
}
ionViewDidEnter() {
this.getList();
}
......
......@@ -4,9 +4,7 @@ page-learning-result {
}
.main-container {
height: 100%;
background-image: url(../../../../assets/imgs/learn/learning_background.png);
background-repeat: no-repeat;
background-color: #e6e8ed;
background: #e6e8ed url(../../../../assets/imgs/learn/learning_background.png) no-repeat;
padding: 1.5rem;
}
.swiper-slide, .slide-zoom {
......
......@@ -8,7 +8,7 @@
<ion-content>
<div class="main-container">
<ion-slides (ionSlideDidChange)="slideChanged(e)">
<ion-slides (ionSlideDidChange)="slideChanged()">
<ion-slide *ngFor="let item of list;let i = index">
<div class="learn-item">
<div class="learn-title">{{title}}</div>
......
page-review-learn {
.main-container {
height: calc(100% - 8rem);
background-image: url(../../../../assets/imgs/learn/learning_background.png);
background-repeat: no-repeat;
background-color: #e6e8ed;
background: #e6e8ed url(../../../../assets/imgs/learn/learning_background.png) no-repeat;
padding: 1.5rem;
}
.swiper-slide, .slide-zoom {
......@@ -27,7 +25,7 @@ page-review-learn {
}
.item-container {
background-color: #fff;
height: calc(100% - 7rem);
height: calc(100% - 8rem);
border-bottom-left-radius: .8rem;
border-bottom-right-radius: .8rem;
}
......@@ -45,11 +43,12 @@ page-review-learn {
padding: 0 1rem;
position: absolute;
left: 0;
bottom: 3rem;
bottom: 4rem;
height: 5rem;
width: 100%;
background-color: #e6e8ed;
display: flex;
font-size: 1.8rem;
div {
line-height: 5rem;
}
......@@ -61,7 +60,7 @@ page-review-learn {
text-align: right;
}
.index {
flex: 1;
flex: 3;
text-align: center;
}
}
......@@ -69,12 +68,12 @@ page-review-learn {
position: absolute;
left: 0;
bottom: 0;
height: 3rem;
height: 4rem;
width: 100%;
border-top: .1rem solid #34b4fc;
display: flex;
div {
line-height: 3rem;
line-height: 4rem;
}
.time {
text-align: center;
......
......@@ -4,9 +4,7 @@ page-review-result {
}
.main-container {
height: 100%;
background-image: url(../../../../assets/imgs/learn/learning_background.png);
background-repeat: no-repeat;
background-color: #e6e8ed;
background: #e6e8ed url(../../../../assets/imgs/learn/learning_background.png) no-repeat;
padding: 1.5rem;
}
.swiper-slide, .slide-zoom {
......
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