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
571a94f1
Commit
571a94f1
authored
Dec 31, 2019
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加重要公告和个人名片分享
parent
d0ddf23b
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
126 additions
and
33 deletions
+126
-33
src/app/common/guide-page/guide-page.component.ts
+3
-1
src/app/common/life-common.module.ts
+4
-2
src/app/common/life-common.service.ts
+18
-0
src/app/common/safe-html.pipe.spec.ts
+8
-0
src/app/common/safe-html.pipe.ts
+16
-0
src/app/my/important-announcement/important-announcement.component.html
+5
-1
src/app/my/important-announcement/important-announcement.component.scss
+17
-0
src/app/my/important-announcement/important-announcement.component.ts
+8
-0
src/app/my/my-center-home/my-center-home.component.html
+14
-8
src/app/my/my-center-home/my-center-home.component.scss
+30
-21
src/app/my/my-center-home/my-center-home.component.ts
+2
-0
src/index.html
+1
-0
No files found.
src/app/common/guide-page/guide-page.component.ts
View file @
571a94f1
...
...
@@ -12,7 +12,9 @@ export class GuidePageComponent implements OnInit {
}
ngOnInit
()
{
setTimeout
(()
=>
{
this
.
closeGuidePage
();
},
6000
);
}
closeGuidePage
()
{
...
...
src/app/common/life-common.module.ts
View file @
571a94f1
...
...
@@ -3,9 +3,10 @@ import {CommonModule} from '@angular/common';
import
{
AlertComponent
}
from
'./alert/alert.component'
;
import
{
FormsModule
}
from
"@angular/forms"
;
import
{
GuidePageComponent
}
from
'./guide-page/guide-page.component'
;
import
{
SafeHtmlPipe
}
from
'./safe-html.pipe'
;
@
NgModule
({
declarations
:
[
AlertComponent
,
GuidePageComponent
],
declarations
:
[
AlertComponent
,
GuidePageComponent
,
SafeHtmlPipe
],
imports
:
[
CommonModule
,
FormsModule
...
...
@@ -13,7 +14,8 @@ import { GuidePageComponent } from './guide-page/guide-page.component';
exports
:
[
FormsModule
,
AlertComponent
,
GuidePageComponent
GuidePageComponent
,
SafeHtmlPipe
]
})
export
class
LifeCommonModule
{
...
...
src/app/common/life-common.service.ts
View file @
571a94f1
...
...
@@ -55,6 +55,24 @@ export class LifeCommonService {
}
/**
* 检测设备信息
* deviceType:PC为1,移动端为2,微信为3
*/
checkDeviceType
()
{
let
deviceType
=
null
;
if
(
/Android|webOS|iPhone|iPod|BlackBerry/i
.
test
(
navigator
.
userAgent
))
{
if
(
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
'micromessenger'
)
!==
-
1
)
{
deviceType
=
'3'
;
}
else
{
deviceType
=
'2'
;
}
}
else
{
deviceType
=
'1'
;
}
return
deviceType
;
}
/**
* shareCode生成器
*/
generateShareCode
(
jsonParams
?:
any
)
{
...
...
src/app/common/safe-html.pipe.spec.ts
0 → 100644
View file @
571a94f1
import
{
SafeHtmlPipe
}
from
'./safe-html.pipe'
;
describe
(
'SafeHtmlPipe'
,
()
=>
{
it
(
'create an instance'
,
()
=>
{
const
pipe
=
new
SafeHtmlPipe
();
expect
(
pipe
).
toBeTruthy
();
});
});
src/app/common/safe-html.pipe.ts
0 → 100644
View file @
571a94f1
import
{
Pipe
,
PipeTransform
}
from
'@angular/core'
;
import
{
DomSanitizer
}
from
"@angular/platform-browser"
;
@
Pipe
({
name
:
'safeHtml'
})
export
class
SafeHtmlPipe
implements
PipeTransform
{
constructor
(
private
sanitized
:
DomSanitizer
)
{
}
transform
(
value
:
any
,
args
?:
any
):
any
{
return
this
.
sanitized
.
bypassSecurityTrustHtml
(
value
);
}
}
src/app/my/important-announcement/important-announcement.component.html
View file @
571a94f1
<div>
重要公告
<div
class=
"announcementItem"
*
ngFor=
"let announcementItem of announcementLists"
>
<div
class=
"announcement_title"
><span
class=
"announcement_type"
>
【{{announcementItem.announcement_type}}】
</span><span
[
innerHtml
]="
announcementItem
.
title
"
></span></div>
<div
[
innerHtml
]="
announcementItem
.
content
"
class=
"announcement_content"
></div>
<div
class=
"announcement_at"
>
{{announcementItem.announcement_at}}
</div>
</div>
</div>
src/app/my/important-announcement/important-announcement.component.scss
View file @
571a94f1
.announcementItem
{
padding
:
10px
8px
;
border-bottom
:
1px
solid
#dcdcdc
;
.announcement_type
{
color
:
#ff3500
;
}
.announcement_at
{
font-size
:
12px
;
padding-left
:
17px
;
}
.announcement_title
{
margin-left
:
17px
;
}
.announcement_content
{
padding-left
:
17px
;
}
}
src/app/my/important-announcement/important-announcement.component.ts
View file @
571a94f1
...
...
@@ -6,11 +6,19 @@ import {Component, OnInit} from '@angular/core';
styleUrls
:
[
'./important-announcement.component.scss'
]
})
export
class
ImportantAnnouncementComponent
implements
OnInit
{
announcementLists
:
Array
<
any
>
;
constructor
()
{
}
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
},
];
}
}
src/app/my/my-center-home/my-center-home.component.html
View file @
571a94f1
...
...
@@ -4,15 +4,21 @@
<img
src=
"assets/images/icons/meng.png"
alt=
"头像"
>
</div>
<div
class=
"brokerInfo"
>
<p
class=
"brokerName"
>
{{lifeCustomerInfo?.practitionerBasicInfo?.name}}
</p>
<p
class=
"brokerTag"
>
<span>
机构名
</span>
<span>
级别
</span>
</p>
</div>
<div
class=
"shareSelfInfoBtn"
>
<span
(
click
)="
shareIdCard
()"
>
分享名片
</span>
<div
class=
"brokerName"
>
<div
style=
"letter-spacing: 2px"
><span>
{{lifeCustomerInfo?.practitionerBasicInfo?.name}}
</span></div>
<div
class=
"shareSelfInfoBtn"
(
click
)="
shareIdCard
()"
><span>
分享名片
</span></div>
</div>
<div
class=
"brokerTag"
>
<div>
<p>
银盾保险 上海营业部
</p>
</div>
<div><span
class=
"ydTitle"
>
业务总监
</span></div>
</div>
</div>
<!--<div class="shareSelfInfoBtn">-->
<!--<span (click)="shareIdCard()">分享名片</span>-->
<!--</div>-->
</div>
<div
class=
"weui-panel__bd"
>
<div
class=
"weui-media-box weui-media-box_small-appmsg"
>
...
...
src/app/my/my-center-home/my-center-home.component.scss
View file @
571a94f1
...
...
@@ -21,16 +21,14 @@
width
:
100%
;
color
:
#fff
;
background
:
linear-gradient
(
90deg
,
#494949
,
#393939
);
box-sizing
:
border-box
;
img
{
max-width
:
100%
;
height
:
100%
;
display
:
block
;
}
>
div
{
margin-right
:
30px
;
}
>
div
:last-child
{
margin-right
:
0
;
margin-right
:
15px
;
}
.avatar
{
width
:
60px
;
...
...
@@ -39,37 +37,48 @@
overflow
:
hidden
;
}
.brokerInfo
{
flex
:
1
;
.brokerName
{
background
:
linear-gradient
(
#fbe9ab
,
#e3c385
);
-webkit-background-clip
:
text
;
color
:
transparent
;
margin-bottom
:
10px
;
display
:
flex
;
justify-content
:
space-between
;
color
:
#e3c385
;
font-size
:
16px
;
>
div
:first-child
{
display
:
flex
;
align-items
:
flex-end
;
font-size
:
17px
;
}
}
.ydTitle
,
.brokerTag
{
color
:
#fff
;
border-radius
:
6px
;
}
.brokerTag
{
>
span
{
display
:
inline-block
;
padding
:
0
10px
;
border
:
1px
solid
#e3c385
;
border-radius
:
20px
;
margin-right
:
15px
;
}
>
span
:last-child
{
margin-right
:
0
;
margin-top
:
10px
;
display
:
flex
;
font-weight
:
normal
;
font-size
:
14px
;
>
div
{
display
:
flex
;
align-items
:
center
;
border
:
1px
solid
#fff
;
border-radius
:
6px
;
padding
:
0
8px
;
margin-right
:
10px
;
}
}
}
.shareSelfInfoBtn
{
padding
:
5px
15px
;
padding
:
0
15px
;
color
:
#fff
;
background-color
:
#ff4100
;
border-radius
:
20px
;
font-size
:
15px
;
}
}
@media
(
min-width
:
768px
)
{
.weui-panel__hd
{
height
:
300px
;
}
}
src/app/my/my-center-home/my-center-home.component.ts
View file @
571a94f1
...
...
@@ -12,11 +12,13 @@ export class MyCenterHomeComponent implements OnInit {
isNeedAlert
:
boolean
;
dialogInfo
:
any
;
lifeCustomerInfo
:
any
;
deviceType
:
number
;
constructor
(
private
router
:
Router
,
private
lifeCommonService
:
LifeCommonService
)
{
}
ngOnInit
()
{
this
.
deviceType
=
this
.
lifeCommonService
.
checkDeviceType
();
this
.
lifeCustomerInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))
?
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))
:
null
;
// fileUpload
this
.
menuLists
=
[
...
...
src/index.html
View file @
571a94f1
...
...
@@ -18,6 +18,7 @@
<app-root></app-root>
<script
src=
"assets/js/jquery.min.js"
></script>
<script
src=
"assets/js/qrcode.min.js"
></script>
<!--<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>-->
<script
src=
"https://res2.wx.qq.com/open/js/jweixin-1.4.0.js"
></script>
</body>
</html>
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