Commit 6a2e8f1f by sweet

增加疾无忧产品海报

parent c4201a53
...@@ -4,8 +4,10 @@ import {environment} from '../../../environments/environment'; ...@@ -4,8 +4,10 @@ import {environment} from '../../../environments/environment';
import {LifeCommonService} from '../../common/life-common.service'; import {LifeCommonService} from '../../common/life-common.service';
import {MyService} from '../my.service'; import {MyService} from '../my.service';
import {Buffer} from 'buffer'; import {Buffer} from 'buffer';
declare var QRCode: any; declare var QRCode: any;
import * as uuid from 'uuid'; import * as uuid from 'uuid';
@Component({ @Component({
selector: 'ydlife-mk-material-detail', selector: 'ydlife-mk-material-detail',
templateUrl: './mk-material-detail.component.html', templateUrl: './mk-material-detail.component.html',
...@@ -13,6 +15,8 @@ import * as uuid from 'uuid'; ...@@ -13,6 +15,8 @@ import * as uuid from 'uuid';
}) })
export class MkMaterialDetailComponent implements OnInit { export class MkMaterialDetailComponent implements OnInit {
@ViewChild('canvas') canvas: ElementRef<any>; @ViewChild('canvas') canvas: ElementRef<any>;
// 区分险种 1.产险-健康险
productType: number;
materialItemId: string; materialItemId: string;
lifeCustomerInfo: any; lifeCustomerInfo: any;
shareInfo: any; shareInfo: any;
...@@ -32,6 +36,9 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -32,6 +36,9 @@ export class MkMaterialDetailComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.materialItemId = this.activateRoute.snapshot.paramMap.get('itemId'); this.materialItemId = this.activateRoute.snapshot.paramMap.get('itemId');
if (this.materialItemId.substr(0, 2) === 'ph') {
this.productType = 1;
}
this.lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null; this.lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
// 分享信息 // 分享信息
const shareCodeUuid = uuid.v4(); const shareCodeUuid = uuid.v4();
...@@ -42,6 +49,11 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -42,6 +49,11 @@ export class MkMaterialDetailComponent implements OnInit {
productId: this.materialItemId, productId: this.materialItemId,
url: `${environment.ORIGINNAME}/life/${this.materialItemId}?shareCode=${shareCodeUuid}` url: `${environment.ORIGINNAME}/life/${this.materialItemId}?shareCode=${shareCodeUuid}`
}; };
if (this.productType === 1) {
this.shareInfo.productId = null;
this.shareInfo.planId = this.materialItemId .substr(2);
this.shareInfo.url = `${environment.ORIGINNAME}/hProductDetail/${this.materialItemId .substr(2)}?shareCode=${shareCodeUuid}&type=9`;
}
// 发送请求保存分享码 // 发送请求保存分享码
this.shareCallBack(); this.shareCallBack();
} }
......
...@@ -21,6 +21,7 @@ export class MkMaterialComponent implements OnInit { ...@@ -21,6 +21,7 @@ export class MkMaterialComponent implements OnInit {
{id: 6, itemId: '137', title: '中信保诚祯爱优选定期寿险'}, {id: 6, itemId: '137', title: '中信保诚祯爱优选定期寿险'},
{id: 7, itemId: '138', title: '中信保诚祯爱减额定期寿险'}, {id: 7, itemId: '138', title: '中信保诚祯爱减额定期寿险'},
{id: 8, itemId: '139', title: '中信保诚祯爱增额定期寿险'}, {id: 8, itemId: '139', title: '中信保诚祯爱增额定期寿险'},
{id: 9, itemId: 'ph465', title: 'E生平安·疾无忧'}
]; ];
} }
......
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