Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-ces
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
wisdom-ces
Commits
9cb0a8b3
Commit
9cb0a8b3
authored
Apr 07, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上拉 下拉
parent
f18605d3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
44 deletions
+97
-44
learning-do.html
src/pages/home/learning/learning-do/learning-do.html
+6
-6
learning-do.ts
src/pages/home/learning/learning-do/learning-do.ts
+14
-9
learning-list.html
src/pages/home/learning/learning-list/learning-list.html
+21
-12
learning-list.scss
src/pages/home/learning/learning-list/learning-list.scss
+2
-1
learning-list.ts
src/pages/home/learning/learning-list/learning-list.ts
+52
-16
learning-result.ts
src/pages/home/learning/learning-result/learning-result.ts
+2
-0
No files found.
src/pages/home/learning/learning-do/learning-do.html
View file @
9cb0a8b3
...
...
@@ -11,7 +11,7 @@
<ion-content>
<div
class=
"main-container"
>
<ion-slides>
<ion-slide
*
ngFor=
"let item of list;"
>
<ion-slide
*
ngFor=
"let item of list;
let i = index;
"
>
<div
class=
"learn-item"
>
<div
class=
"learn-title"
>
学习测试标题学习测试标题学习测试标题
</div>
<div
class=
"item-container"
>
...
...
@@ -19,10 +19,10 @@
<!--判断题目类型-->
<p>
<span
class=
"color-red"
*
ngIf=
"item.isAns == 1"
>
*
</span>
{{index}}、
<span
*
ngIf=
"item.questionType == 1"
>
(
判断
)
</span>
<span
*
ngIf=
"item.questionType == 2"
>
(
单
选)
</span>
<span
*
ngIf=
"item.questionType == 3"
>
(
多选
)
</span>
<span
*
ngIf=
"item.questionType == 4"
>
(
填空
)
</span>
<span
*
ngIf=
"item.questionType == 1"
>
(
单选
)
</span>
<span
*
ngIf=
"item.questionType == 2"
>
(
多
选)
</span>
<span
*
ngIf=
"item.questionType == 3"
>
(
填空
)
</span>
<span
*
ngIf=
"item.questionType == 4"
>
(
判断
)
</span>
<span
*
ngIf=
"item.questionType == 5"
>
(问答)
</span>
{{item.questionContent}}
</p>
...
...
@@ -46,7 +46,7 @@
<ng-container
*
ngFor=
" let option2 of item.options;let quesIndex = index;"
>
<p>
<label>
<input
type=
"checkbox"
(
change
)="
mutiSelect
(
i
,
quesIndex
)"
value=
"{{quesIndex}}"
name=
"{{item.questionId}}"
>
<input
type=
"checkbox"
(
change
)="
mutiSelect
(
i
,
option2
.
option
)"
value=
"{{quesIndex}}"
name=
"{{item.questionId}}"
>
<span
class=
"input-duox selectIndex"
>
{{quesIndex +1 | charCode}}
</span>
{{option2.comment}}
</label>
...
...
src/pages/home/learning/learning-do/learning-do.ts
View file @
9cb0a8b3
...
...
@@ -15,7 +15,7 @@ export class LearningDoPage {
@
ViewChild
(
Slides
)
slides
:
Slides
;
@
ViewChild
(
Navbar
)
navbar
:
Navbar
clock
;
//
clock
;
//
倒计时的定时器
list
=
[];
timeText
=
'00:00:00'
;
totalTime
;
...
...
@@ -24,7 +24,7 @@ export class LearningDoPage {
public
toastCtrl
:
ToastController
,
public
appService
:
AppService
,
public
datePipe
:
DatePipe
)
{
}
ionViewDid
Load
()
{
ionViewDid
Enter
()
{
const
testId
=
this
.
navParams
.
get
(
'testId'
);
const
data
=
{
testId
:
testId
...
...
@@ -32,6 +32,7 @@ export class LearningDoPage {
this
.
learnSer
.
startTest
(
data
).
subscribe
(
(
res
)
=>
{
this
.
list
=
res
.
data
.
detailVos
;
this
.
list
.
forEach
(
e
=>
e
.
answerdesc
=
''
);
this
.
totalTime
=
res
.
data
.
timeLimit
;
this
.
countTime
();
}
...
...
@@ -43,6 +44,13 @@ export class LearningDoPage {
}
}
//清楚定时器
ionViewDidLeave
(){
this
.
index
=
1
;
this
.
slides
.
slideTo
(
0
);
window
.
clearInterval
(
this
.
clock
);
}
//倒计时
countTime
()
{
let
totalTime
=
this
.
totalTime
;
...
...
@@ -63,11 +71,6 @@ export class LearningDoPage {
},
1000
)
}
//清楚定时器
ionViewDidLeave
(){
window
.
clearInterval
(
this
.
clock
);
}
//上一题
prev
()
{
if
(
this
.
index
==
1
)
{
...
...
@@ -93,8 +96,9 @@ export class LearningDoPage {
}
//多选
mutiSelect
(
i
,
quesIndex
)
{
mutiSelect
(
i
,
option
)
{
this
.
list
[
i
].
answerdesc
+=
option
;
console
.
log
(
this
.
list
);
}
//强制交卷
...
...
@@ -106,6 +110,7 @@ export class LearningDoPage {
//交卷
submit
()
{
console
.
log
(
this
.
list
);
this
.
appService
.
alert
(
"确定提交问卷"
,
()
=>
{
this
.
navCtrl
.
push
(
"LearningResultPage"
)
})
...
...
src/pages/home/learning/learning-list/learning-list.html
View file @
9cb0a8b3
...
...
@@ -2,17 +2,22 @@
<ion-navbar>
<ion-title>
测试列表
</ion-title>
</ion-navbar>
</ion-header>
<ion-content
class=
"bgc-e7e8ed"
>
<div
class=
"tabs-parent"
>
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
i
)"
class=
"tabs-children"
>
{{item.name}}
</div>
<span
#
tips
id=
"tips"
></span>
</div>
<ion-slides
(
ionSlideDidChange
)="
slideChanged
()"
>
</ion-header>
<ion-content
class=
"bgc-e7e8ed"
>
<ion-refresher
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content
pullingText=
"下拉刷新"
pullingIcon=
"arrow-dropdown"
refreshingSpinner=
"bubbles"
>
</ion-refresher-content>
</ion-refresher>
<ng-container
*
ngIf=
"link"
>
<ion-slide
>
<ng-container
*
ngIf=
"index == 0"
>
<ion-list>
<ng-container
*
ngFor=
"let item of list"
>
<ion-item
class=
"item-list margin-bottom-10"
>
...
...
@@ -44,8 +49,8 @@
</ion-list>
</ng-container>
</ion-list>
</ion-slide
>
<ion-slide
>
</ng-container
>
<ng-container
*
ngIf=
"index == 1"
>
<ion-list>
<ng-container
*
ngIf=
"noList.length > 0"
>
<ng-container
*
ngFor=
"let item of noList"
>
...
...
@@ -76,8 +81,8 @@
</ion-list>
</ng-container>
</ion-list>
</ion-slide
>
<ion-slide
>
</ng-container
>
<ng-container
*
ngIf=
"index == 2"
>
<ion-list>
<ng-container
*
ngIf=
"doList.length > 0"
>
<ng-container
*
ngFor=
"let item of doList"
>
...
...
@@ -108,7 +113,11 @@
</ion-list>
</ng-container>
</ion-list>
</ion-slide>
</ng-container>
</ion-slides>
</ng-container>
<!--下滑的时候,加载数据-->
<ion-infinite-scroll
(
ionInfinite
)="
doInfinite
($
event
)"
>
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
src/pages/home/learning/learning-list/learning-list.scss
View file @
9cb0a8b3
page-learning-list
{
.swiper-container
{
overflow
:
auto
;
overflow-x
:
hidden
;
overflow-y
:
scroll
;
}
.swiper-slide
{
align-items
:
normal
;
...
...
src/pages/home/learning/learning-list/learning-list.ts
View file @
9cb0a8b3
...
...
@@ -14,12 +14,14 @@ export class LearningListPage {
@
ViewChild
(
Slides
)
slides
:
Slides
;
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
index
;
index
=
0
;
tabsList
=
[{
name
:
"全部"
,},
{
name
:
"未完成"
,},
{
name
:
"已完成"
,}];
noList
=
[];
doList
=
[];
list
=
[];
//全部测试
link
=
false
;
//是否请求完成
pageNumber
=
1
;
//页码
pageSize
=
25
;
//每页显示条数
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
learnSer
:
LearnService
,
public
datePipe
:
DatePipe
)
{
...
...
@@ -34,9 +36,9 @@ export class LearningListPage {
getList
()
{
const
nowDate
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy/MM/dd HH:hh:ss'
)
const
data
=
{
pageNumber
:
'1'
,
pageSize
:
'15'
,
selectType
:
'1'
,
pageNumber
:
this
.
pageNumber
,
pageSize
:
this
.
pageSize
,
selectType
:
'1'
,
//全部状态
queryTime
:
nowDate
,
};
this
.
learnSer
.
getLearnTestList
(
data
).
subscribe
(
...
...
@@ -51,23 +53,57 @@ export class LearningListPage {
)
}
change
(
index
)
{
// 下拉
doRefresh
(
refresher
){
this
.
pageNumber
=
1
;
const
nowDate
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy/MM/dd HH:hh:ss'
)
const
data
=
{
pageNumber
:
this
.
pageNumber
,
pageSize
:
this
.
pageSize
,
selectType
:
'1'
,
//全部状态
queryTime
:
nowDate
,
};
this
.
learnSer
.
getLearnTestList
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
data
){
this
.
list
=
res
.
data
.
list
;
this
.
noList
=
res
.
data
.
list
.
filter
((
e
)
=>
e
.
testResult
==
0
);
this
.
doList
=
res
.
data
.
list
.
filter
((
e
)
=>
e
.
testResult
==
2
);
}
refresher
.
complete
()
this
.
link
=
true
;
}
)
}
let
itemWidth
=
window
.
screen
.
width
/
3
;
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
index
+
itemWidth
/
2
-
this
.
tips
.
nativeElement
.
offsetWidth
/
2
+
'px'
;
this
.
slides
.
slideTo
(
index
)
this
.
index
=
index
;
//上拉
doInfinite
(
infiniteScroll
){
this
.
pageNumber
++
;
const
nowDate
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy/MM/dd HH:hh:ss'
)
const
data
=
{
pageNumber
:
this
.
pageNumber
,
pageSize
:
this
.
pageSize
,
selectType
:
'1'
,
//全部状态
queryTime
:
nowDate
,
};
this
.
learnSer
.
getLearnTestList
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
data
){
this
.
list
=
this
.
list
.
concat
(
res
.
data
.
list
);
this
.
noList
=
res
.
data
.
list
.
filter
((
e
)
=>
e
.
testResult
==
0
);
this
.
doList
=
res
.
data
.
list
.
filter
((
e
)
=>
e
.
testResult
==
2
);
}
infiniteScroll
.
complete
();
this
.
link
=
true
;
}
)
}
//
slideChanged
()
{
this
.
index
=
this
.
slides
.
getActiveIndex
();
if
(
this
.
index
<
3
)
{
change
(
index
)
{
let
itemWidth
=
window
.
screen
.
width
/
3
;
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
this
.
index
+
itemWidth
/
2
-
this
.
tips
.
nativeElement
.
offsetWidth
/
2
+
'px'
;
}
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
index
+
itemWidth
/
2
-
this
.
tips
.
nativeElement
.
offsetWidth
/
2
+
'px'
;
this
.
index
=
index
;
}
goToResult
(
item
)
{
...
...
src/pages/home/learning/learning-result/learning-result.ts
View file @
9cb0a8b3
...
...
@@ -9,6 +9,7 @@ import {ReviewLearnPage} from "../review-learn/review-learn";
})
export
class
LearningResultPage
{
@
ViewChild
(
Navbar
)
navbar
:
Navbar
;
testId
;
starList
=
[
{
class
:
'star-yellow'
},
...
...
@@ -20,6 +21,7 @@ export class LearningResultPage {
}
ionViewDidLoad
()
{
this
.
testId
=
this
.
navParams
.
get
(
'testId'
);
this
.
navbar
.
backButtonClick
=
(
event
)
=>
{
let
index
=
this
.
navCtrl
.
length
()
-
2
;
this
.
navCtrl
.
remove
(
2
,
index
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment