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
80daba30
Commit
80daba30
authored
Apr 07, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上拉 下拉
parent
9cb0a8b3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
49 deletions
+73
-49
learn-manage.html
src/pages/home/learn-manage/learn-manage/learn-manage.html
+28
-19
learn-manage.ts
src/pages/home/learn-manage/learn-manage/learn-manage.ts
+9
-10
learning-do.html
src/pages/home/learning/learning-do/learning-do.html
+4
-4
learning-do.ts
src/pages/home/learning/learning-do/learning-do.ts
+19
-4
learning-list.html
src/pages/home/learning/learning-list/learning-list.html
+11
-10
learning-list.ts
src/pages/home/learning/learning-list/learning-list.ts
+2
-2
No files found.
src/pages/home/learn-manage/learn-manage/learn-manage.html
View file @
80daba30
...
...
@@ -3,17 +3,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-slide>
</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"
>
<ng-container
*
ngIf=
"index == 0"
>
<ion-list>
<ng-container
*
ngIf=
"list.length > 0"
>
<ng-container
*
ngFor=
"let item of list"
>
...
...
@@ -48,24 +53,24 @@
</ion-list>
</ng-container>
</ion-list>
</
ion-slide
>
<
ion-slide
>
</
ng-container
>
<
ng-container
*
ngIf=
"index == 1"
>
<ion-list>
<ng-container
*
ngIf=
"
l
ist.length > 0"
>
<ng-container
*
ngFor=
"let item of noList"
>
<ng-container
*
ngIf=
"
noL
ist.length > 0"
>
<ng-container
*
ngFor=
"let item of doList"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<div
class=
"item"
(
click
)="
goToResult
(
item
)"
>
<div
class=
"item-header padding-15-0"
>
<div
class=
"item-header-style"
>
<span
class=
"item-title"
>
{{item.title}}
</span>
<span
float-right
class=
"gr
ay"
>
未作答
</span>
<span
float-right
class=
"gr
een"
>
已完成
</span>
</div>
</div>
<div
class=
"content-button padding-15-0"
>
<span>
参与人员:
</span>
<span
*
ngIf=
"item.groupName"
>
{{item.groupName}}
</span>
<span
*
ngIf=
"!item.groupName"
>
全体人员
</span>
<span
float-right
class=
"
join"
>
测试
</span>
<span
float-right
class=
"
look"
>
查看
</span>
</div>
</div>
</ion-item>
...
...
@@ -80,8 +85,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"
>
...
...
@@ -112,8 +117,8 @@
</ion-list>
</ng-container>
</ion-list>
</
ion-slide
>
<
ion-slide
>
</
ng-container
>
<
ng-container
*
ngIf=
"index == 3"
>
<ion-list>
<ng-container
*
ngIf=
"edList.length > 0"
>
<ng-container
*
ngFor=
"let item of edList"
>
...
...
@@ -144,6 +149,10 @@
</ion-list>
</ng-container>
</ion-list>
</ion-slide>
</ion-slides>
</ng-container>
</ng-container>
<!--上滑加载数据-->
<ion-infinite-scroll
(
ionInfinite
)="
doInfinite
($
event
)"
>
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
src/pages/home/learn-manage/learn-manage/learn-manage.ts
View file @
80daba30
...
...
@@ -12,14 +12,14 @@ export class LearnManagePage {
@
ViewChild
(
Slides
)
slides
:
Slides
;
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
index
;
index
=
0
;
link
=
true
;
tabsList
=
[
{
name
:
"全部"
,},
{
name
:
"待发布"
,},
{
name
:
"已发布"
,},
{
name
:
"已过期"
,}
];
allList
=
[];
//全部
noList
=
[];
//待发布
doList
=
[];
//已发布
edList
=
[];
//已过期
...
...
@@ -56,18 +56,17 @@ export class LearnManagePage {
let
itemWidth
=
window
.
screen
.
width
/
4
;
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
index
+
itemWidth
/
2
-
this
.
tips
.
nativeElement
.
offsetWidth
/
2
+
'px'
;
this
.
slides
.
slideTo
(
index
)
this
.
index
=
index
;
}
//
slideChanged
(){
this
.
index
=
this
.
slides
.
getActiveIndex
();
if
(
this
.
index
<
3
){
let
itemWidth
=
window
.
screen
.
width
/
4
;
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
this
.
index
+
itemWidth
/
2
-
this
.
tips
.
nativeElement
.
offsetWidth
/
2
+
'px'
;
//下拉刷新
doRefresh
(
refresher
){
refresher
.
complete
();
}
//上滑
doInfinite
(
infiniteScroll
){
infiniteScroll
.
complete
()
}
goToResult
(
item
){
...
...
src/pages/home/learning/learning-do/learning-do.html
View file @
80daba30
...
...
@@ -34,7 +34,7 @@
<ng-container
*
ngFor=
" let option1 of item.options;let optIndex = index;"
>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
type=
"radio"
value=
"{{optIndex}}"
name=
"{{item.questionId}}
"
>
<input
[(
ngModel
)]="
item
.
answerdesc
"
type=
"radio"
[
value
]="
option1
.
option
"
[
name
]="
item
.
questionId
"
>
<span
class=
" selectIndex"
>
{{optIndex +1 | charCode}}
</span>
{{option1.comment}}
</label>
...
...
@@ -46,7 +46,7 @@
<ng-container
*
ngFor=
" let option2 of item.options;let quesIndex = index;"
>
<p>
<label>
<input
type=
"checkbox"
(
change
)="
mutiSelect
(
i
,
option2
.
option
)"
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>
...
...
@@ -61,14 +61,14 @@
<ng-container
*
ngIf=
"item.questionType == 4"
>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
name=
"{{item.questionQueId}}"
value=
"0"
type=
"radio"
>
<input
[(
ngModel
)]="
item
.
answerdesc
"
[
name
]="
item
.
questionQueId
"
value=
"A
type="
radio
"
>
<span
class=
" selectIndex"
>
A
</span>
是
</label>
</p>
<p>
<label>
<input
[(
ngModel
)]="
item
.
answerdesc
"
name=
"{{item.questionQueId}}"
value=
"1
"
type=
"radio"
>
<input
[(
ngModel
)]="
item
.
answerdesc
"
[
name
]="
item
.
questionQueId
"
value=
"B
"
type=
"radio"
>
<span
class=
" selectIndex"
>
B
</span>
否
</label>
...
...
src/pages/home/learning/learning-do/learning-do.ts
View file @
80daba30
...
...
@@ -57,11 +57,11 @@ export class LearningDoPage {
this
.
clock
=
window
.
setInterval
(()
=>
{
totalTime
--
;
let
hourse
=
(
Math
.
floor
(
totalTime
/
3600
)).
toString
();
hourse
=
(
hourse
.
length
>
1
?
hourse
:
hourse
+
'0'
);
hourse
=
(
hourse
.
length
>
1
?
hourse
:
'0'
+
hourse
);
let
minutes
=
Math
.
floor
(
totalTime
/
60
).
toString
();
minutes
=
(
minutes
.
length
>
1
?
minutes
:
minutes
+
'0'
);
minutes
=
(
minutes
.
length
>
1
?
minutes
:
'0'
+
minutes
);
let
seconds
=
Math
.
floor
(
totalTime
%
60
).
toString
();
seconds
=
(
seconds
.
length
>
1
?
seconds
:
seconds
+
'0'
);
seconds
=
(
seconds
.
length
>
1
?
seconds
:
'0'
+
seconds
);
this
.
timeText
=
hourse
+
":"
+
minutes
+
":"
+
seconds
;
if
(
totalTime
<
0
)
{
window
.
clearInterval
(
this
.
clock
)
...
...
@@ -97,7 +97,11 @@ export class LearningDoPage {
//多选
mutiSelect
(
i
,
option
)
{
if
(
this
.
list
[
i
].
answerdesc
.
includes
(
option
)){
this
.
list
[
i
].
answerdesc
=
this
.
list
[
i
].
answerdesc
.
replace
(
option
,
''
);
}
else
{
this
.
list
[
i
].
answerdesc
+=
option
;
}
console
.
log
(
this
.
list
);
}
...
...
@@ -110,8 +114,19 @@ export class LearningDoPage {
//交卷
submit
()
{
let
message
=
"确定交卷吗"
;
//提示信息
let
number
=
0
;
//有number题未答
this
.
list
.
forEach
(
e
=>
{
if
(
e
.
answerdesc
.
length
==
0
){
number
++
;
}
});
if
(
number
>
0
){
message
=
"您有"
+
number
+
"题未作答,确定交卷吗"
;
}
console
.
log
(
this
.
list
);
this
.
appService
.
alert
(
"确定提交问卷"
,
()
=>
{
this
.
appService
.
alert
(
message
,
()
=>
{
this
.
navCtrl
.
push
(
"LearningResultPage"
)
})
}
...
...
src/pages/home/learning/learning-list/learning-list.html
View file @
80daba30
...
...
@@ -3,13 +3,14 @@
<ion-title>
测试列表
</ion-title>
</ion-navbar>
<div
class=
"tabs-parent"
>
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
i
)"
class=
"tabs-children"
>
{{item.name}}
</div>
<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-header>
<ion-content
class=
"bgc-e7e8ed"
>
<!--下拉刷新-->
<ion-refresher
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content
pullingText=
"下拉刷新"
pullingIcon=
"arrow-dropdown"
...
...
@@ -19,8 +20,8 @@
<ng-container
*
ngIf=
"link"
>
<ng-container
*
ngIf=
"index == 0"
>
<ion-list>
<ng-container
*
ngFor=
"let item of list"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<ng-container
*
ngFor=
"let item of list"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<div
class=
"item"
(
click
)="
goToResult
(
item
)"
>
<div
class=
"item-header padding-15-0"
>
<div
class=
"item-header-style"
>
...
...
@@ -41,7 +42,7 @@
</ion-item>
</ng-container>
<ng-container
*
ngIf=
"list.length == 0"
>
<ion-list
text-center
style=
"margin-top: 10rem"
>
<ion-list
text-center
style=
"margin-top: 10rem"
>
<img
style=
"width: 20%;"
src=
"./assets/imgs/no-info.png"
alt=
""
>
<p
text-center
>
暂无测试
...
...
@@ -53,8 +54,8 @@
<ng-container
*
ngIf=
"index == 1"
>
<ion-list>
<ng-container
*
ngIf=
"noList.length > 0"
>
<ng-container
*
ngFor=
"let item of noList"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<ng-container
*
ngFor=
"let item of noList"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<div
class=
"item"
(
click
)="
goToResult
(
item
)"
>
<div
class=
"item-header padding-15-0"
>
<div
class=
"item-header-style"
>
...
...
@@ -73,7 +74,7 @@
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"noList.length == 0"
>
<ion-list
text-center
style=
"margin-top: 10rem"
>
<ion-list
text-center
style=
"margin-top: 10rem"
>
<img
style=
"width: 20%;"
src=
"./assets/imgs/no-info.png"
alt=
""
>
<p
text-center
>
暂无测试
...
...
@@ -86,7 +87,7 @@
<ion-list>
<ng-container
*
ngIf=
"doList.length > 0"
>
<ng-container
*
ngFor=
"let item of doList"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<ion-item
class=
"item-list margin-bottom-10"
>
<div
class=
"item"
(
click
)="
goToResult
(
item
)"
>
<div
class=
"item-header padding-15-0"
>
<div
class=
"item-header-style"
>
...
...
@@ -105,7 +106,7 @@
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"doList.length == 0"
>
<ion-list
text-center
style=
"margin-top: 10rem"
>
<ion-list
text-center
style=
"margin-top: 10rem"
>
<img
style=
"width: 20%;"
src=
"./assets/imgs/no-info.png"
alt=
""
>
<p
text-center
>
暂无测试
...
...
@@ -115,7 +116,7 @@
</ion-list>
</ng-container>
</ng-container>
<!--
下滑的时候,
加载数据-->
<!--
上滑
加载数据-->
<ion-infinite-scroll
(
ionInfinite
)="
doInfinite
($
event
)"
>
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
...
...
src/pages/home/learning/learning-list/learning-list.ts
View file @
80daba30
...
...
@@ -90,8 +90,8 @@ export class LearningListPage {
(
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
);
this
.
noList
=
this
.
list
.
filter
((
e
)
=>
e
.
testResult
==
0
);
this
.
doList
=
this
.
list
.
filter
((
e
)
=>
e
.
testResult
==
2
);
}
infiniteScroll
.
complete
();
this
.
link
=
true
;
...
...
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