Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
party-build-cloud
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
party-build-cloud
Commits
8b643750
Commit
8b643750
authored
May 30, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回答答案
parent
9299d0ad
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
363 additions
and
26 deletions
+363
-26
issue.ts
src/pages/discover-pages/issue/issue.ts
+4
-3
response.html
src/pages/discover-pages/response/response.html
+72
-0
response.module.ts
src/pages/discover-pages/response/response.module.ts
+13
-0
response.scss
src/pages/discover-pages/response/response.scss
+189
-0
response.ts
src/pages/discover-pages/response/response.ts
+45
-0
discover.html
src/pages/tabs/discover/discover.html
+19
-1
discover.ts
src/pages/tabs/discover/discover.ts
+6
-5
home.html
src/pages/tabs/home/home.html
+7
-7
home.scss
src/pages/tabs/home/home.scss
+3
-3
home.ts
src/pages/tabs/home/home.ts
+0
-7
tabs.service.ts
src/pages/tabs/tabs.service.ts
+5
-0
No files found.
src/pages/discover-pages/issue/issue.ts
View file @
8b643750
...
...
@@ -99,10 +99,11 @@ export class IssuePage {
this
.
tabSer
.
saveMineQuestion
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errcode
==
'1000'
){
let
index
=
this
.
navCtrl
.
length
()
-
2
;
this
.
navCtrl
.
remove
(
2
,
index
)
}
else
{
let
index
=
this
.
navCtrl
.
length
()
-
1
;
this
.
navCtrl
.
remove
(
1
,
index
);
this
.
commonSer
.
toast
(
'提问成功'
);
}
else
{
this
.
commonSer
.
toast
(
res
.
errMsg
);
}
}
)
...
...
src/pages/discover-pages/response/response.html
0 → 100644
View file @
8b643750
<ion-header>
<ion-navbar>
<ion-title>
你问我答
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<div
class=
"learn-item"
>
<div
class=
"item-container"
>
<div
class=
"item-title"
>
<p>
<span
*
ngIf=
"item?.type == 1"
>
(判断)
</span>
<span
*
ngIf=
"item?.type == 2"
>
(单选)
</span>
<span
*
ngIf=
"item?.type == 3"
>
(多选)
</span>
{{item?.stem}}
</p>
</div>
<div
class=
"item-content"
>
<div
class=
"padding-20-20"
>
<!--判断题-->
<ng-container
*
ngIf=
"item?.type == 1"
>
<p>
<label>
<input
[(
ngModel
)]="
answer
"
[
name
]="
item
?.
id
"
value=
"A"
type=
"radio"
>
<span
class=
" selectIndex"
>
A
</span>
是
</label>
</p>
<p>
<label>
<input
[(
ngModel
)]="
answer
"
[
name
]="
item
?.
id
"
value=
"B"
type=
"radio"
>
<span
class=
" selectIndex"
>
B
</span>
否
</label>
</p>
</ng-container>
<!--单选题-->
<ng-container
*
ngIf=
"item?.type == 2"
>
<ng-container
*
ngFor=
" let option1 of item?.options;"
>
<p>
<label>
<input
[(
ngModel
)]="
answer
"
type=
"radio"
[
value
]="
option1
.
option
"
[
name
]="
item
?.
id
"
>
<span
class=
"selectIndex"
>
{{option1.option}}
</span>
{{option1.comment}}
</label>
</p>
</ng-container>
</ng-container>
<!--多选题-->
<ng-container
*
ngIf=
"item?.type == 3"
>
<ng-container
*
ngFor=
" let option2 of item.options;let i2 = index;"
>
<p>
<label>
<input
type=
"checkbox"
(
change
)="
mutiSelect
(
i2
,
option2
.
option
)"
[
value
]="
option2
.
option
"
[
name
]="
item
?.
id
"
>
<span
class=
"input-duox selectIndex"
>
{{option2.option}}
</span>
{{option2.comment}}
</label>
</p>
</ng-container>
</ng-container>
</div>
</div>
</div>
</div>
<button
class=
"submit-btn submit"
(
click
)="
submit
()"
>
确认
</button>
</ion-content>
src/pages/discover-pages/response/response.module.ts
0 → 100644
View file @
8b643750
import
{
NgModule
}
from
'@angular/core'
;
import
{
IonicPageModule
}
from
'ionic-angular'
;
import
{
ResponsePage
}
from
'./response'
;
@
NgModule
({
declarations
:
[
ResponsePage
,
],
imports
:
[
IonicPageModule
.
forChild
(
ResponsePage
),
],
})
export
class
ResponsePageModule
{}
src/pages/discover-pages/response/response.scss
0 → 100644
View file @
8b643750
page-response
{
.main-container
{
height
:
calc
(
100%
-
8rem
);
background-color
:
#e6e8ed
;
padding
:
1
.8rem
;
}
.bgc
{
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
0
;
}
.learn-item
{
width
:
100%
;
padding-bottom
:
1rem
;
}
ion-slides
{
height
:
calc
(
100%
-
4rem
);
}
.swiper-slide
,
.slide-zoom
{
text-align
:
left
;
}
.swiper-slide
{
justify-content
:
normal
;
align-items
:
normal
;
}
.learn-title
{
background-color
:
rgba
(
18
,
28
,
52
,
0
.34
);
font-size
:
1
.8rem
;
color
:
#ffffff
;
text-align
:
center
;
padding
:
1rem
;
border-top-left-radius
:
.8rem
;
border-top-right-radius
:
.8rem
;
}
.item-container
{
background-color
:
#fff
;
border-bottom-left-radius
:
.8rem
;
border-bottom-right-radius
:
.8rem
;
overflow-y
:
scroll
;
}
.item-title
{
padding
:
1rem
;
font-size
:
1
.5rem
;
}
.item-content
{
padding
:
1rem
;
font-size
:
1
.6rem
;
div
{
p
{
margin-bottom
:
1rem
;
margin-left
:
1rem
;
line-height
:
1
.5rem
;
}
}
}
.footer-subject
{
padding
:
0
1rem
;
position
:
absolute
;
left
:
0
;
bottom
:
4rem
;
height
:
5rem
;
width
:
100%
;
background-color
:
#e6e8ed
;
display
:
flex
;
font-size
:
1
.8rem
;
div
{
line-height
:
5rem
;
}
.prev
{
flex
:
3
;
}
.next
{
flex
:
3
;
text-align
:
right
;
}
.index
{
flex
:
3
;
text-align
:
center
;
}
}
.footer-submit
{
position
:
absolute
;
left
:
0
;
bottom
:
0
;
height
:
4rem
;
width
:
100%
;
border-top
:
.1rem
solid
#34b4fc
;
display
:
flex
;
div
{
line-height
:
4rem
;
}
.time
{
text-align
:
center
;
flex
:
4
;
}
.submit
{
background-color
:
#34b4fc
;
color
:
#ffffff
;
text-align
:
center
;
flex
:
1
;
}
}
.item-ios
p
{
margin
:
15px
0
;
white-space
:
normal
;
}
label
{
position
:
relative
;
display
:
inline-block
;
height
:
2rem
;
line-height
:
2rem
;
input
{
display
:
none
;
}
}
.content-textarea
{
padding
:
10px
;
min-height
:
100px
;
width
:
100%
;
border
:
1px
solid
#ddd
;
}
.selectIndex
{
display
:
inline-block
;
vertical-align
:
middle
;
width
:
2rem
;
text-align
:
center
;
height
:
2rem
;
line-height
:
1
.9rem
;
border
:
1px
solid
#ddd
;
border-radius
:
50%
;
margin-right
:
5px
;
color
:
#666
;
font-size
:
1
.5rem
;
position
:
relative
;
}
input
:checked
+
.selectIndex
{
background-color
:
#ec1826
;
color
:
#ffffff
;
border
:
1px
solid
#ec1826
;
}
.submit-error
{
height
:
3rem
;
width
:
40%
;
background-color
:
#5579bb
;
color
:
#fff
;
line-height
:
3rem
;
}
.button-error
{
line-height
:
4rem
;
height
:
4rem
;
text-align
:
center
;
margin-top
:
.5rem
;
}
.error-text
{
position
:
absolute
;
top
:
0
;
left
:
0
;
height
:
100%
;
width
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,.
2
);
z-index
:
9
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
.error-flex
{
text-align
:
center
;
width
:
80%
;
background-color
:
#fff
;
.error-title
{
background-color
:
#5579bb
;
color
:
#ffffff
;
padding
:
1rem
0
;
}
.error-footer
{
height
:
4rem
;
.sure
,
.cancel
{
color
:
#ffffff
;
background-color
:
#5579bb
;
width
:
69%
;
margin-right
:
10px
;
height
:
3rem
;
}
}
}
}
}
src/pages/discover-pages/response/response.ts
0 → 100644
View file @
8b643750
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
TabsService
}
from
"../../tabs/tabs.service"
;
@
IonicPage
()
@
Component
({
selector
:
'page-response'
,
templateUrl
:
'response.html'
,
})
export
class
ResponsePage
{
item
;
answer
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
tabSer
:
TabsService
)
{
}
ionViewDidLoad
()
{
this
.
item
=
this
.
navParams
.
get
(
'item'
);
}
//多选
mutiSelect
(
i
,
option
)
{
if
(
this
.
answer
.
includes
(
option
))
{
this
.
answer
=
this
.
answer
.
replace
(
option
,
''
);
}
else
{
this
.
answer
+=
option
+
";"
;
}
}
//提交答案
submit
(){
const
data
=
{
questionId
:
this
.
item
.
id
,
answer
:
this
.
answer
};
this
.
tabSer
.
answerMineQuestion
(
data
).
subscribe
(
(
res
)
=>
{
}
)
}
}
src/pages/tabs/discover/discover.html
View file @
8b643750
...
...
@@ -63,7 +63,7 @@
</ion-refresher>
<div
class=
"search-content"
>
<ng-container
*
ngFor=
"let item of new"
>
<div
class=
"search-item"
(
click
)="
goToDetail
(
item
)"
>
<div
*
ngIf=
"indexChildren != '45'"
class=
"search-item"
(
click
)="
goToDetail
(
item
)"
>
<p
class=
"item-info"
>
<span
class=
"item-source"
>
{{item.source}}
</span>
<span>
{{item.publishTime | date:'yyyy-MM-dd'}}
</span>
...
...
@@ -112,6 +112,24 @@
</ion-row>
</div>
</div>
<div
*
ngIf=
"indexChildren =='45' "
class=
"search-item"
(
click
)="
goToResponse
(
item
)"
>
<p
style=
"margin: 0;"
class=
"item-info"
>
<span>
{{item.dateTime | date:'yyyy-MM-dd'}}
</span>
</p>
<div
class=
"item-news"
>
<ion-row
class=
"news-item"
>
<ion-col
col-8
class=
"news-left"
>
<p
style=
"margin: 0;"
class=
"news-title"
>
<span
*
ngIf=
"item.type == 1"
>
(判断)
</span>
<span
*
ngIf=
"item.type == 2"
>
(单选)
</span>
<span
*
ngIf=
"item.type == 3"
>
(多选)
</span>
{{item.stem}}
</p>
</ion-col>
<ion-col
col-4
class=
"news-right"
>
</ion-col>
</ion-row>
</div>
</div>
</ng-container>
</div>
<ion-infinite-scroll
(
ionInfinite
)="
doInfinite
($
event
)"
*
ngIf=
"indexParent == i "
>
...
...
src/pages/tabs/discover/discover.ts
View file @
8b643750
...
...
@@ -215,7 +215,6 @@ export class DiscoverPage {
//父级选择
changeParent
(
item
)
{
this
.
newsContent
.
nativeElement
.
scrollLeft
=
0
;
//二级菜单滑动重置
// this.infiniteScrollContent.inf.enable(true);
this
.
loadMore
=
true
;
const
index
=
item
.
indexParent
;
...
...
@@ -256,7 +255,6 @@ export class DiscoverPage {
//子级选择
changeChildren
(
item
)
{
this
.
indexChildren
=
item
.
indexChildren
;
// this.infiniteScrollContent.inf.enable(true);
if
(
this
.
indexChildren
==
45
)
{
this
.
getQuestion
();
return
false
;
...
...
@@ -279,7 +277,7 @@ export class DiscoverPage {
if
(
e
.
attachments
.
length
>
0
)
{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
}
})
})
;
this
.
slideList
[
this
.
indexParent
]
=
this
.
newList
;
}
)
...
...
@@ -348,7 +346,6 @@ export class DiscoverPage {
'resourceType'
:
1
}
};
// this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement.children[0], 'minHeight', '60px');
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
(
res
)
=>
{
let
arr
=
res
.
data
.
list
;
...
...
@@ -362,7 +359,6 @@ export class DiscoverPage {
}
setTimeout
(()
=>
{
infiniteScroll
.
complete
();
// this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement.children[0], 'minHeight', '0px');
},
1000
)
}
)
...
...
@@ -387,6 +383,11 @@ export class DiscoverPage {
this
.
isPublish
=
false
;
}
//回答题目
goToResponse
(
item
){
this
.
navCtrl
.
push
(
'ResponsePage'
,{
item
:
item
})
}
//消息提醒页面
goToNotice
()
{
this
.
navCtrl
.
push
(
NoticePage
);
...
...
src/pages/tabs/home/home.html
View file @
8b643750
...
...
@@ -100,8 +100,8 @@
<div
id=
"swiper-article"
class=
"swiper-container"
>
<div
class=
"swiper-wrapper"
>
<ng-container
*
ngIf=
"slidersItems.length > 0"
>
<div
[
style
.
top
]="
isScroll =
=
true
?'
50px
'
:
''"
class=
"swiper-slide"
*
ngFor=
"let item of slideList;let i = index;"
>
<div
[
style
.
top
]="
isScroll =
=
true
?'
50px
'
:
''"
class=
"swiper-slide"
*
ngFor=
"let item of slideList;let i = index;"
>
<ion-content
>
<div
class=
"main-news"
>
<ng-container
*
ngFor=
"let new of item;"
>
<ng-container
*
ngIf=
"new.imgUrl"
>
...
...
@@ -138,16 +138,16 @@
</ng-container>
<p
class=
"noData"
*
ngIf=
"!loadMore"
>
你已经看到我的底线了
</p>
</div>
</div>
</ng-container>
</div>
</div>
<ion-infinite-scroll
#
infiniteScrollContentEle
(
ionInfinite
)="
doInfinite
($
event
)"
>
<ion-infinite-scroll-content
loadingSpinner=
"bubbles"
loadingText=
"加载中"
></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
</div>
</ng-container>
</div>
</div>
</ion-content>
<!--政治生日-->
...
...
src/pages/tabs/home/home.scss
View file @
8b643750
...
...
@@ -347,13 +347,13 @@ page-home {
}
#swiper-article
.swiper-container
{
height
:
fit-content
;
height
:
100%
;
.swiper-wrapper
{
height
:
fit-content
;
height
:
100%
;
.swiper-slide
{
height
:
fit-content
;
height
:
100%
;
}
}
}
...
...
src/pages/tabs/home/home.ts
View file @
8b643750
...
...
@@ -196,7 +196,6 @@ export class HomePage {
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
this
.
itemWidth
*
(
this
.
index
)
+
(
this
.
itemWidth
-
this
.
spanWidth
)
/
2
+
'px'
;
this
.
tips1
.
nativeElement
.
style
.
left
=
this
.
itemWidth
*
(
this
.
index
)
+
(
this
.
itemWidth
-
this
.
spanWidth
)
/
2
+
'px'
;
this
.
InfiniteScrollContent
.
inf
.
enable
(
true
);
if
(
item
.
type
==
0
)
{
this
.
isRecent
=
1
;
}
else
{
...
...
@@ -236,10 +235,6 @@ export class HomePage {
this
.
initSlide
=
1
;
return
false
;
}
// let index = this.slides.toArray()[1].getActiveIndex();
// if (index == this.tabsList.length) index = 0;
// if (index == this.tabsList.length + 1) index = 1;
// this.change(this.tabsList[index])
}
...
...
@@ -388,7 +383,6 @@ export class HomePage {
'resourceType'
:
1
}
};
// this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement, 'height', '60px');
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
(
res
)
=>
{
let
arr
=
res
.
data
.
list
;
...
...
@@ -402,7 +396,6 @@ export class HomePage {
}
setTimeout
(()
=>
{
e
.
complete
();
// this.renderer.setStyle(this.infiniteScrollContentEle.nativeElement, 'height', '0px');
},
1000
)
}
)
...
...
src/pages/tabs/tabs.service.ts
View file @
8b643750
...
...
@@ -168,4 +168,9 @@ export class TabsService {
saveMineQuestion
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/personquestion/save'
,
data
);
}
//我要出题列表
answerMineQuestion
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
AppGlobal
.
domain
+
'/wisdomgroup/modules/personanswer/answer'
,
data
);
}
}
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