Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydLife
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
ydLife
Commits
555ceb54
Commit
555ceb54
authored
Jan 08, 2020
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重要公告对接
parent
4c973cbb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
11 deletions
+27
-11
package.json
+1
-1
src/app/my/important-announcement/important-announcement.component.html
+2
-2
src/app/my/important-announcement/important-announcement.component.ts
+11
-8
src/app/my/my.service.ts
+7
-0
src/styles.scss
+6
-0
No files found.
package.json
View file @
555ceb54
...
...
@@ -4,7 +4,7 @@
"scripts"
:
{
"ng"
:
"ng"
,
"start"
:
"ng serve"
,
"build"
:
"ng build"
,
"build"
:
"ng build
-c=dev --prod
"
,
"test"
:
"ng test"
,
"lint"
:
"ng lint"
,
"e2e"
:
"ng e2e"
...
...
src/app/my/important-announcement/important-announcement.component.html
View file @
555ceb54
<div>
<div
class=
"announcementItem"
*
ngFor=
"let announcementItem of announcementLists"
>
<div
class=
"announcement_title"
><span
class=
"announcement_type"
>
【{{announcementItem.announcement
_typ
e}}】
</span><span
[
innerHtml
]="
announcementItem
.
title
"
></span></div>
<div
class=
"announcement_title"
><span
class=
"announcement_type"
>
【{{announcementItem.announcement
TypeNam
e}}】
</span><span
[
innerHtml
]="
announcementItem
.
title
"
></span></div>
<div
[
innerHtml
]="
announcementItem
.
content
"
class=
"announcement_content"
></div>
<div
class=
"announcement_at"
>
{{announcementItem.announcement
_a
t}}
</div>
<div
class=
"announcement_at"
>
{{announcementItem.announcement
A
t}}
</div>
</div>
</div>
src/app/my/important-announcement/important-announcement.component.ts
View file @
555ceb54
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
MyService
}
from
"../my.service"
;
@
Component
({
selector
:
'ydlife-important-announcement'
,
...
...
@@ -8,17 +9,19 @@ import {Component, OnInit} from '@angular/core';
export
class
ImportantAnnouncementComponent
implements
OnInit
{
announcementLists
:
Array
<
any
>
;
constructor
()
{
constructor
(
private
myService
:
MyService
)
{
}
ngOnInit
()
{
this
.
announcementLists
=
[
{
id
:
1
,
title
:
'运营公告eeeee'
,
content
:
'11111'
,
announcement_type
:
'运营公告'
,
announcement_at
:
'2019-12-30'
,
is_active
:
1
},
{
id
:
2
,
title
:
'市场喜讯55555'
,
content
:
'22222'
,
announcement_type
:
'市场喜讯'
,
announcement_at
:
'2019-12-30'
,
is_active
:
1
},
{
id
:
3
,
title
:
'重要通知33333'
,
content
:
'33333'
,
announcement_type
:
'重要通知'
,
announcement_at
:
'2019-12-30'
,
is_active
:
1
},
{
id
:
4
,
title
:
'新品上架6777776'
,
content
:
'4444'
,
announcement_type
:
'新品上架'
,
announcement_at
:
'2019-12-30'
,
is_active
:
1
},
{
id
:
5
,
title
:
'竞赛奖励78978978'
,
content
:
'555'
,
announcement_type
:
'竞赛奖励'
,
announcement_at
:
'2019-12-30'
,
is_active
:
1
},
];
this
.
announcementQuery
();
}
announcementQuery
()
{
this
.
myService
.
announcementQuery
(
null
,
null
).
subscribe
(
res
=>
{
if
(
res
[
'success'
])
{
this
.
announcementLists
=
res
[
'data'
][
'announcementInfoList'
];
}
});
}
}
src/app/my/my.service.ts
View file @
555ceb54
...
...
@@ -23,4 +23,11 @@ export class MyService {
return
this
.
http
.
post
(
url
,
JSON
.
stringify
({
itemType
:
itemType
,
itemId
:
itemId
,
fileCategory
:
fileCategory
}));
}
// 重要公告
announcementQuery
(
id
,
announcementTypeId
)
{
const
url
=
this
.
API
+
'/announcementQuery'
;
return
this
.
http
.
post
(
url
,
JSON
.
stringify
({
id
:
id
,
announcementTypeId
:
announcementTypeId
}));
}
}
src/styles.scss
View file @
555ceb54
...
...
@@ -24,3 +24,9 @@ html, body {
input
:
:
placeholder
{
font-size
:
14px
;
}
.announcementItem
{
a
{
color
:
#000
!
important
;
}
}
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