Commit 571a94f1 by Sweet Zhang

增加重要公告和个人名片分享

parent d0ddf23b
......@@ -12,7 +12,9 @@ export class GuidePageComponent implements OnInit {
}
ngOnInit() {
setTimeout(() => {
this.closeGuidePage();
}, 6000);
}
closeGuidePage() {
......
......@@ -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 {
......
......@@ -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) {
......
import { SafeHtmlPipe } from './safe-html.pipe';
describe('SafeHtmlPipe', () => {
it('create an instance', () => {
const pipe = new SafeHtmlPipe();
expect(pipe).toBeTruthy();
});
});
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);
}
}
<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>
.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;
}
}
......@@ -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},
];
}
}
......@@ -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">
......
......@@ -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;
}
}
......@@ -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 = [
......
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment