Commit a5f573a7 by Chao Sun

登录缓存和ydLife区分开

parent 6e99e8f6
......@@ -31,8 +31,8 @@ export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
}
checkLogin(url: string): boolean {
const lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
if (this.authService.isLoggedIn || (lifeCustomerInfo && lifeCustomerInfo['customerId'] && lifeCustomerInfo['practitionerId'])) {
const ydgiCustomerInfo = localStorage.getItem('ydgiCustomerInfo') ? JSON.parse(localStorage.getItem('ydgiCustomerInfo')) : null;
if (this.authService.isLoggedIn || (ydgiCustomerInfo && ydgiCustomerInfo['customerId'] && ydgiCustomerInfo['practitionerId'])) {
return true;
}
// Store the attempted URL for redirecting
......
......@@ -48,9 +48,10 @@ export class LoginComponent implements OnInit, OnDestroy {
this.authService.login({ mobileNo: this.userInfo.mobileNo }).subscribe((response) => {
if (response['success']) {
this.authService.isLoggedIn = true;
const lifeCustomerInfo = { ...response.data, mobileNo: this.userInfo.mobileNo, commonResult: null };
if (lifeCustomerInfo['customerId'] && lifeCustomerInfo['practitionerId']) {
localStorage.setItem('lifeCustomerInfo', JSON.stringify(lifeCustomerInfo));
const ydgiCustomerInfo = { ...response.data, mobileNo: this.userInfo.mobileNo, commonResult: null };
if (ydgiCustomerInfo['customerId'] && ydgiCustomerInfo['practitionerId']) {
if (response['data']['practitionerTypeId'] == 27) {
localStorage.setItem('ydgiCustomerInfo', JSON.stringify(ydgiCustomerInfo));
//如果有openId跳页由后端判断,没有的话根据登录次数前端判断跳页
if (response['data']['getOpenIdUrl']) {
const deviceType = this.lifeCommonService.checkDeviceType()
......@@ -74,23 +75,10 @@ export class LoginComponent implements OnInit, OnDestroy {
this.router.navigateByUrl(this.redirect);
}
}
// if (response['data']['loginTimes'] > 0) {
// this.redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/my';
// this.router.navigateByUrl(this.redirect);
// // if (response['data']['getOpenIdUrl']) {
// // window.location.href = response['data']['getOpenIdUrl'];
// // } else {
// // this.redirect = this.authService.redirectUrl ? this.router.parseUrl(this.authService.redirectUrl) : '/my';
// // this.router.navigateByUrl(this.redirect);
// // }
// } else {
// this.router.navigateByUrl('/thanks')
// // if (response['data']['getOpenIdUrl']) {
// // window.location.href = response['data']['getOpenIdUrl'];
// // } else {
// // this.router.navigateByUrl('/thanks')
// // }
// }
} else {
this.openPopInfo('仅供产险经纪人登录!');
return;
}
} else {
this.openPopInfo('暂无查询资格');
}
......
......@@ -15,11 +15,11 @@
<div class="brokerInfo">
<div class="brokerBasicInfo">
<div class="brokerName">
<div>{{lifeCustomerInfo.practitionerBasicInfo.name}}</div>
<div>{{ydgiCustomerInfo.practitionerBasicInfo.name}}</div>
<div>Neo Zheng</div>
</div>
<div class="brokerTitle">
<div>{{lifeCustomerInfo.practitionerBasicInfo.levelName}}</div>
<div>{{ydgiCustomerInfo.practitionerBasicInfo.levelName}}</div>
<div>Sales Director</div>
</div>
</div>
......@@ -31,7 +31,7 @@
<div class="brokerContactInfo">
<div>
<i class="iconfont icon-dianhua"></i>
<span>M: {{lifeCustomerInfo.mobileNo}}</span>
<span>M: {{ydgiCustomerInfo.mobileNo}}</span>
</div>
<div>
<i class="iconfont icon-youxiang"></i>
......
import {Component, OnInit} from '@angular/core';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'ydlife-business-card',
......@@ -6,13 +6,13 @@ import {Component, OnInit} from '@angular/core';
styleUrls: ['./business-card.component.scss']
})
export class BusinessCardComponent implements OnInit {
lifeCustomerInfo: any;
ydgiCustomerInfo: any;
constructor() {
}
ngOnInit() {
this.lifeCustomerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo'));
this.ydgiCustomerInfo = JSON.parse(localStorage.getItem('ydgiCustomerInfo'));
}
}
......@@ -20,7 +20,7 @@ export class MkMaterialDetailComponent implements OnInit {
materialItemType: string;
// 海报图
productPosterPath: string;
lifeCustomerInfo: any;
ydgiCustomerInfo: any;
shareInfo: any;
// 自定义内容部分高度
contentHeight: number = 90;
......@@ -42,7 +42,7 @@ export class MkMaterialDetailComponent implements OnInit {
ngOnInit() {
this.materialItemId = this.activateRoute.snapshot.paramMap.get('itemId');
this.materialItemType = this.activateRoute.snapshot.queryParams['itemType'];
this.lifeCustomerInfo = localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
this.ydgiCustomerInfo = localStorage.getItem('ydgiCustomerInfo') ? JSON.parse(localStorage.getItem('ydgiCustomerInfo')) : null;
this.posterType = this.activateRoute.snapshot.queryParams['posterType'];
this.posterQuery(this.posterType, this.materialItemType);
}
......@@ -68,8 +68,8 @@ export class MkMaterialDetailComponent implements OnInit {
const avatarurlY = this.canvas.nativeElement.height - (this.contentHeight + 50) / 2 * ratio; // 绘制的头像在画布上的位置
const avatarImg = new Image();
avatarImg.setAttribute('crossOrigin', 'anonymous');
if (this.lifeCustomerInfo.practitionerBasicInfo.headImagePath) {
avatarImg.src = this.lifeCustomerInfo.practitionerBasicInfo.headImagePath + '?v=' + new Date().getTime();
if (this.ydgiCustomerInfo.practitionerBasicInfo.headImagePath) {
avatarImg.src = this.ydgiCustomerInfo.practitionerBasicInfo.headImagePath + '?v=' + new Date().getTime();
} else {
avatarImg.src = `${environment.DOMAINNAME}/assets/img/meng.png?v=${new Date().getTime()}`;
}
......@@ -118,11 +118,11 @@ export class MkMaterialDetailComponent implements OnInit {
ctx.font = `${12 * ratio}px 微软雅黑`;
if (this.isNameShow == 1) {
ctx.fillText(`${this.lifeCustomerInfo.practitionerBasicInfo.name}`, 75 * ratio, avatarurlY + 15 * ratio); // Y指的是文字底部的位置
ctx.fillText(`${this.ydgiCustomerInfo.practitionerBasicInfo.name}`, 75 * ratio, avatarurlY + 15 * ratio); // Y指的是文字底部的位置
}
ctx.fillText(`银盾保险经纪`, 75 * ratio, avatarurlY + 30 * ratio); // Y指的是文字底部的位置
if (this.isMobileShow == 1) {
ctx.fillText(`${this.lifeCustomerInfo.mobileNo}`, 75 * ratio, avatarurlY + 45 * ratio);
ctx.fillText(`${this.ydgiCustomerInfo.mobileNo}`, 75 * ratio, avatarurlY + 45 * ratio);
}
ctx.scale(ratio, ratio);
};
......@@ -208,7 +208,7 @@ export class MkMaterialDetailComponent implements OnInit {
posterQuery(itemId, itemType) {
this.myService.posterQuery({
id: this.posterType,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
paginationInfo: {
noLimitFlag: 'CONFIRM'
}
......@@ -224,7 +224,7 @@ export class MkMaterialDetailComponent implements OnInit {
this.shareInfo = {
...this.lifeCommonService.generateShareCode(),
shareCode: shareCodeUuid,
customerId: this.lifeCustomerInfo.customerId,
customerId: this.ydgiCustomerInfo.customerId,
productId: this.materialItemId,
url: `${environment.DOMAINNAME}/life/${this.materialItemId}?shareCode=${shareCodeUuid}`
};
......
......@@ -22,7 +22,7 @@ export class MkMaterialComponent implements OnInit {
posterQuery() {
const param = {
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
mdDropOptionId: this.selectedCategoryId,
paginationInfo: { noLimitFlag: 'CONFIRM' }
}
......
......@@ -62,9 +62,9 @@ export class MyBusinessDetailComponent implements OnInit {
status: any;
isNeedAlert: boolean;
dialogInfo: any;
practitionerId:any;
practitionerId: any;
constructor(private activateRoute: ActivatedRoute, private myService: MyService,
public lifeCommonService: LifeCommonService, private router: Router, ) {
public lifeCommonService: LifeCommonService, private router: Router,) {
this.titleList = [
{ id: 1, name: '基本信息' },
{ id: 3, name: '商机跟进' },
......@@ -80,7 +80,7 @@ export class MyBusinessDetailComponent implements OnInit {
//商机id
this.leadsAssignedId = this.activateRoute.snapshot.queryParams['leadsAssignedId'];
this.opportunityRecordId = null;
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
this.practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId']
this.tagQuery();
//商机状态
this.dropOptionsQuery('bizchance_promotion_action');
......@@ -549,8 +549,8 @@ export class MyBusinessDetailComponent implements OnInit {
}
openPopInfo(message) {
this.myService.applyForExpertSupport({leadsAssignedId:this.leadsAssignedId,practitionerId:this.practitionerId,opportunityId:this.opportunityId}).subscribe((res)=>{
if(res['success']){
this.myService.applyForExpertSupport({ leadsAssignedId: this.leadsAssignedId, practitionerId: this.practitionerId, opportunityId: this.opportunityId }).subscribe((res) => {
if (res['success']) {
this.ownOpportunityDetailQuery();
this.isNeedAlert = true;
this.dialogInfo = {
......@@ -558,7 +558,7 @@ export class MyBusinessDetailComponent implements OnInit {
content: { value: message, align: 'center' },
footer: [{ value: '确认离开', routerLink: '', className: 'weui-dialog__btn_primary' }],
};
}else{
} else {
this.toastDialog = true;
this.toastInfo = {
status: 1,
......
......@@ -16,8 +16,8 @@ export class MyBusinessComponent implements OnInit {
}
ownOpportunityQuery() {
const brokerCustomerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['customerId'];
const brokerPractitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const brokerCustomerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['customerId'];
const brokerPractitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.myService.ownOpportunityQuery({ customerId: brokerCustomerId, practitionerId: brokerPractitionerId }).subscribe((res) => {
if (res['data']['ownOpportunityInfos']) {
this.businessList = res['data']['ownOpportunityInfos'];
......
......@@ -3,24 +3,24 @@
<!--头部经纪人信息START-->
<div class="avatar" routerLink="setting">
<img
src="{{lifeCustomerInfo?.practitionerBasicInfo?.headImagePath ? lifeCustomerInfo?.practitionerBasicInfo?.headImagePath : './assets/images/icons/meng.png'}}"
src="{{ydgiCustomerInfo?.practitionerBasicInfo?.headImagePath ? ydgiCustomerInfo?.practitionerBasicInfo?.headImagePath : './assets/images/icons/meng.png'}}"
alt="头像">
</div>
<div class="brokerInfo">
<div class="brokerName">
<div style="letter-spacing: 2px"><span>{{lifeCustomerInfo?.practitionerBasicInfo?.name}}</span></div>
<div style="letter-spacing: 2px"><span>{{ydgiCustomerInfo?.practitionerBasicInfo?.name}}</span></div>
<span i class="iconfont icon-ar-r" style="font-size:18px;" routerLink="setting"></span>
</div>
<div class="brokerTag">
<div>
<p>{{lifeCustomerInfo?.practitionerBasicInfo?.insurerBranchName ?
lifeCustomerInfo?.practitionerBasicInfo?.insurerBranchName : '银盾保险'}}</p>
<p>{{ydgiCustomerInfo?.practitionerBasicInfo?.insurerBranchName ?
ydgiCustomerInfo?.practitionerBasicInfo?.insurerBranchName : '银盾保险'}}</p>
</div>
<div>·</div>
<div>{{lifeCustomerInfo?.practitionerBasicInfo?.subordinateName}}</div>
<div>{{ydgiCustomerInfo?.practitionerBasicInfo?.subordinateName}}</div>
<div>·</div>
<div><span class="ydTitle">{{lifeCustomerInfo?.practitionerBasicInfo?.levelName}}</span></div>
<div><span class="ydTitle">{{ydgiCustomerInfo?.practitionerBasicInfo?.levelName}}</span></div>
</div>
</div>
<!--头部经纪人信息END-->
......
......@@ -18,7 +18,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
menuLists: Array<any>;
isNeedAlert: boolean;
dialogInfo: any;
lifeCustomerInfo: any;
ydgiCustomerInfo: any;
deviceType: number;
announcementLists: Array<any>;
firstAnnouncement: string;
......@@ -48,7 +48,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
const title = this.activatedRoute.snapshot.data[0]['title'];
this.lifeCommonService.setTitle(title);
this.deviceType = this.lifeCommonService.checkDeviceType();
this.lifeCustomerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo')) ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
this.ydgiCustomerInfo = JSON.parse(localStorage.getItem('ydgiCustomerInfo')) ? JSON.parse(localStorage.getItem('ydgiCustomerInfo')) : null;
this.announcementQuery();
this.performanceList = [
{ name: '本月', time: 1 },
......@@ -71,11 +71,11 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
{
title: '营销工具',
content: [
{ no: 2, subtitle: 'AI保险医生', icon: 'icon-AI', path: `https://${window.location.host}/questionnaire/#/index?campaign=AIRobot&task=AItask1&customerId=${this.lifeCustomerInfo.customerId}`, routerLink: '' },
{ no: 2, subtitle: 'AI保险医生', icon: 'icon-AI', path: `https://${window.location.host}/questionnaire/#/index?campaign=AIRobot&task=AItask1&customerId=${this.ydgiCustomerInfo.customerId}`, routerLink: '' },
{ no: 1, subtitle: '獴哥保险诊所', icon: 'icon-zhensuozhongxin', path: `https://${window.location.host}/consulting`, routerLink: '' },
{ no: 4, subtitle: '线上投保', icon: 'icon-yidonghulianwang2', path: `https://${window.location.host}/index?source=dyd`, routerLink: '' },
{ no: 13, subtitle: '我的商机', icon: 'icon-xiansuo1', path: '', routerLink: 'business' },
{ no: 9, subtitle: '我的名片', icon: 'icon-zhiyezhenghao', path: `https://${window.location.host}/brokerQry/#/brokerDetail/${this.lifeCustomerInfo.practitionerId}?source=0`, routerLink: '' },
{ no: 9, subtitle: '我的名片', icon: 'icon-zhiyezhenghao', path: `https://${window.location.host}/brokerQry/#/brokerDetail/${this.ydgiCustomerInfo.practitionerId}?source=0`, routerLink: '' },
{ no: 10, subtitle: '职业类别', icon: 'icon-zhiye', path: 'https://www.ydinsurance.cn/occupationQry/', routerLink: '' },
{ no: 7, subtitle: '文章分享', icon: 'icon-fenxiangwenzhang', path: `https://${window.location.host}/discovery`, routerLink: '' },
{ no: 3, subtitle: '产品海报', icon: 'icon-haibao-1', path: '/salesDetail', routerLink: 'material' },
......@@ -153,12 +153,12 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
// 分享名片
shareIdCard() {
const imgUrl = this.lifeCustomerInfo.practitionerBasicInfo.headImagePath ? this.lifeCustomerInfo.practitionerBasicInfo.headImagePath : `${environment.ORIGINNAME}/ydLife/assets/images/icons/meng.png`;
const imgUrl = this.ydgiCustomerInfo.practitionerBasicInfo.headImagePath ? this.ydgiCustomerInfo.practitionerBasicInfo.headImagePath : `${environment.ORIGINNAME}/ydLife/assets/images/icons/meng.png`;
this.lifeCommonService.shareStatusPublish(1);
this.lifeCommonService.wxShare(
`银盾保险经纪 ${this.lifeCustomerInfo.practitionerBasicInfo.name}`,
`银盾保险经纪 ${this.ydgiCustomerInfo.practitionerBasicInfo.name}`,
'您的家庭保险专家、财务策划师。规划成就人生。',
`https://${window.location.host}/brokerQry/#/brokerDetail/${this.lifeCustomerInfo.practitionerId}`,
`https://${window.location.host}/brokerQry/#/brokerDetail/${this.ydgiCustomerInfo.practitionerId}`,
imgUrl);
}
......@@ -172,7 +172,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
}
getOut() {
localStorage.removeItem('lifeCustomerInfo');
localStorage.removeItem('ydgiCustomerInfo');
this.router.navigate(['/login']);
}
......@@ -184,7 +184,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
rank(time, platform, type) {
this.performanceSelectedFlag = time;
const param = {
mobileNo: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['mobileNo'],
mobileNo: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['mobileNo'],
time: time,
platform: platform,
type: type
......@@ -280,7 +280,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
//查询是否团队长
subordinateSystemMemberQuery() {
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.myService.subordinateSystemMemberQuery({ practitionerId: practitionerId, time: 1 }).subscribe((res) => {
if (res['success']) {
this.isShow = true;
......@@ -297,7 +297,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
//经纪人商机分数统计
opportunityStatistics() {
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.myService.opportunityStatistics({ practitionerId: practitionerId }).subscribe((res) => {
if (res['success']) {
this.activities_grade = res['data'];
......
......@@ -38,7 +38,7 @@ export class MySettingDetailComponent implements OnInit {
//查询详情
mySettingQuery() {
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.myService.mySettingQuery({ practitionerId: practitionerId }).subscribe((res) => {
if (res['success']) {
this.settingInfo = res['data'];
......@@ -133,7 +133,7 @@ export class MySettingDetailComponent implements OnInit {
myImgDelete(picId, index?: any, deletePic?: any) {
if (picId) {
const param = {
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
fileId: Number(picId)
}
return new Promise((resolve, reject) => {
......@@ -170,14 +170,14 @@ export class MySettingDetailComponent implements OnInit {
param = {
settingSave: 'img',
headImgUrl: this.settingInfo.headImgUrl,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
lifeImgUrls: []
}
} else {
param = {
settingSave: 'img',
headImgUrl: undefined,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
lifeImgUrls: []
}
}
......@@ -187,14 +187,14 @@ export class MySettingDetailComponent implements OnInit {
param = {
settingSave: 'img',
wxQRImgUrl: this.settingInfo.wxQRImgUrl,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
lifeImgUrls: []
}
} else {
param = {
settingSave: 'img',
wxQRImgUrl: undefined,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
lifeImgUrls: []
}
}
......@@ -215,13 +215,13 @@ export class MySettingDetailComponent implements OnInit {
param = {
settingSave: 'img',
lifeImgUrls: lifeImgUrlsParam,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
}
}
if (this.uploadType == 'introduction') {
param = {
settingSave: 'intro',
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
bioIntro: this.settingInfo.bioIntro
}
}
......@@ -230,7 +230,7 @@ export class MySettingDetailComponent implements OnInit {
settingSave: 'isShow',
isNameShow: this.settingInfo.isNameShow,
isMobileShow: this.settingInfo.isMobileShow,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
}
}
// alert(JSON.stringify(param))
......@@ -240,9 +240,9 @@ export class MySettingDetailComponent implements OnInit {
this.mySettingQuery();
setTimeout(() => {
if (this.uploadType == 'headUrl') {
const lifeCustomerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo')) ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
lifeCustomerInfo.practitionerBasicInfo.headImagePath = this.settingInfo.headImgUrl;
localStorage.setItem('lifeCustomerInfo', JSON.stringify(lifeCustomerInfo))
const ydgiCustomerInfo = JSON.parse(localStorage.getItem('ydgiCustomerInfo')) ? JSON.parse(localStorage.getItem('ydgiCustomerInfo')) : null;
ydgiCustomerInfo.practitionerBasicInfo.headImagePath = this.settingInfo.headImgUrl;
localStorage.setItem('ydgiCustomerInfo', JSON.stringify(ydgiCustomerInfo))
}
}, 300)
} else {
......
......@@ -20,7 +20,7 @@ export class MySettingComponent implements OnInit {
}
mySettingQuery() {
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.myService.mySettingQuery({ practitionerId: practitionerId }).subscribe((res) => {
if (res['success']) {
this.settingInfo = res['data'];
......@@ -29,7 +29,7 @@ export class MySettingComponent implements OnInit {
}
getOut() {
localStorage.removeItem('lifeCustomerInfo');
localStorage.removeItem('ydgiCustomerInfo');
this.router.navigate(['/login']);
}
......
......@@ -45,7 +45,7 @@ export class MyTargetComponent implements OnInit {
ngOnInit() {
this.searchType = 1;
this.isTeamleader = sessionStorage.getItem('isTeamleader');
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
this.practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
//初始化查个人销售目标
this.salesTargetQuery(1);
}
......@@ -144,7 +144,7 @@ export class MyTargetComponent implements OnInit {
}
//修改平均值获取新的年度目标
changePremium(idx,type) {
changePremium(idx, type) {
let premium = 0;
let commission = 0;
for (let i = 0; i < this.salesTargetMonths.length; i++) {
......@@ -156,10 +156,10 @@ export class MyTargetComponent implements OnInit {
if (this.premium && this.pieceAveragePremium) {
this.pieces = Math.ceil(this.premium / this.pieceAveragePremium);
}
if(type=='FYP' || type=='FYC'){
if (type == 'FYP' || type == 'FYC') {
let totalPiece = 0;
for(let j=0;j<this.salesTargetMonths.length;j++){
this.salesTargetMonths[idx]['pieces'] = Math.ceil(Number(this.salesTargetMonths[idx]['premium'])/Number(this.salesTargetMonths[idx]['pieceAveragePremium']));
for (let j = 0; j < this.salesTargetMonths.length; j++) {
this.salesTargetMonths[idx]['pieces'] = Math.ceil(Number(this.salesTargetMonths[idx]['premium']) / Number(this.salesTargetMonths[idx]['pieceAveragePremium']));
totalPiece += Number(this.salesTargetMonths[j]['pieces']);
}
this.pieces = totalPiece;
......@@ -178,7 +178,7 @@ export class MyTargetComponent implements OnInit {
if (type === 'pieceAveragePremium') {
item.pieceAveragePremium = this.pieceAveragePremium;
}
if(type!='commission'){
if (type != 'commission') {
if (item.premium && Number(item.pieceAveragePremium)) {
item.pieces = Math.ceil((this.premium / this.pieceAveragePremium) / 12);
} else {
......@@ -186,7 +186,7 @@ export class MyTargetComponent implements OnInit {
}
}
});
if(type!='commission'){
if (type != 'commission') {
if (this.premium && Number(this.pieceAveragePremium)) {
this.pieces = Math.ceil(this.premium / this.pieceAveragePremium);
} else {
......
......@@ -113,7 +113,7 @@ export class RecruitingDetailComponent implements OnInit {
recruitTrackQuery() {
const param = {
potentialId: this.potentialId ? this.potentialId : null,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId']
}
this.myService.recruitTrackQuery(param).subscribe((res) => {
if (res['success']) {
......@@ -159,7 +159,7 @@ export class RecruitingDetailComponent implements OnInit {
saveInfo() {
this.editRecruiting = {
...this.editRecruiting,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
potentialId: this.potentialId ? this.potentialId : null
}
if (!this.editRecruiting.name) {
......@@ -321,7 +321,7 @@ export class RecruitingDetailComponent implements OnInit {
}
param = {
potentialId: this.potentialId,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'],
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'],
notice: this.notice,
trackStatusId: this.trackStatusId,
trackTime: this.trackTime
......@@ -329,7 +329,7 @@ export class RecruitingDetailComponent implements OnInit {
} else {
param = recruitTrackInfoItem;
param.potentialId = this.potentialId;
param.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
param.practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
}
this.myService.addRecruitTrack(param).subscribe((res) => {
if (res['success']) {
......@@ -358,7 +358,7 @@ export class RecruitingDetailComponent implements OnInit {
recruitListQuery() {
const listParam = {
status: null,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo')).practitionerId
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo')).practitionerId
}
this.myService.recruitListQuery(listParam).subscribe((res) => {
if (res['success']) {
......
......@@ -34,7 +34,7 @@ export class RecruitingComponent implements OnInit {
recruitListQuery(type) {
const listParam = {
status: type,
practitionerId: JSON.parse(localStorage.getItem('lifeCustomerInfo')).practitionerId
practitionerId: JSON.parse(localStorage.getItem('ydgiCustomerInfo')).practitionerId
}
this.myService.recruitListQuery(listParam).subscribe((res) => {
if (res['success']) {
......
......@@ -17,8 +17,8 @@ export class SalaryComponent implements OnInit {
constructor(private myService: MyService, public lifeCommonService: LifeCommonService) { }
ngOnInit() {
this.practitionerIdEG = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerIdEG'];
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']
this.practitionerIdEG = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerIdEG'];
this.practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId']
this.payScaleListQuery();
}
......
......@@ -30,7 +30,7 @@ export class SalesDetailComponent implements OnInit {
//查询保单
practitionerPolicyListQuery(platform?: any) {
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.myService.policyListQuery({ practitionerId: practitionerId, time: this.searchType }).subscribe((res) => {
if (res['success']) {
this.salesDetailList = res['data']['policyInfoList'];
......@@ -58,7 +58,7 @@ export class SalesDetailComponent implements OnInit {
jumpToOrderdetail(orderNo, platform, fortuneId) {
if (platform === 1) {
const customerId = JSON.parse(localStorage.getItem('lifeCustomerInfo')).customerId;
const customerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo')).customerId;
window.location.href = `https://${window.location.host}/mine/orderdetail/${orderNo}?customerId=${customerId}&isReferral=true&paid=true&fortuneId=${fortuneId}`;
} else {
this.router.navigate(['/orderDetail'], { queryParams: { orderNo: orderNo } });
......
......@@ -35,7 +35,7 @@ export class SalesRankComponent implements OnInit {
}
ngOnInit() {
this.practitionerBasicInfo = JSON.parse(localStorage.getItem("lifeCustomerInfo"))['practitionerBasicInfo'];
this.practitionerBasicInfo = JSON.parse(localStorage.getItem("ydgiCustomerInfo"))['practitionerBasicInfo'];
this.time = this.activatedRoute.snapshot.queryParams.time ? Number(this.activatedRoute.snapshot.queryParams.time) : null;
//初始化查线上保费
this.rank(this.time, 1, 1)
......@@ -51,7 +51,7 @@ export class SalesRankComponent implements OnInit {
this.isOnlineType = platform;
this.searchType = type;
const param = {
mobileNo: JSON.parse(localStorage.getItem('lifeCustomerInfo'))['mobileNo'],
mobileNo: JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['mobileNo'],
time: time,
platform: platform,
type: type
......
......@@ -17,7 +17,7 @@ export class ScoreDetailsComponent implements OnInit {
//销售活动量详情D-天 W-周 M-月
salesScoreDetailQuery(time) {
this.selectedTime = time;
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.myService.salesScoreDetailQuery({ practitionerId: practitionerId, time: this.selectedTime }).subscribe((res) => {
if (res['success']) {
this.salesScoreDetails = res['data']['salesScoreDetails'];
......
......@@ -26,7 +26,7 @@ export class TeamPanelComponent implements OnInit {
statisticInfo: any;
constructor(private myService: MyService, public lifeCommonService: LifeCommonService) { }
ngOnInit() {
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
this.practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.subordinateSystemName = sessionStorage.getItem('subordinateSystemName');
this.teamActionsAverageQuery();
this.potentialActivityQuery();
......
......@@ -35,7 +35,7 @@ export class TeamRankComponent implements OnInit {
subordinateSystemMemberQuery(time, online?: any) {
this.time = time;
this.lineType = online;
const practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
const practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
//如果是寿险不显示
if (online == 'underLine') {
this.allPerformanceInfo = null
......
......@@ -19,7 +19,7 @@ export class TeamSalesScoreComponent implements OnInit {
private myService: MyService, public lifeCommonService: LifeCommonService) { }
ngOnInit() {
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
this.practitionerId = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerId'];
this.subordinateSystemName = sessionStorage.getItem('subordinateSystemName');
//判断显示销售得分还是销售预测
this.showType = this.activateRoute.snapshot.paramMap.get('type');
......
......@@ -20,7 +20,7 @@ export class ThanksComponent implements OnInit, AfterViewInit {
brokerInfo: any;
constructor(private router: Router) { }
ngOnInit() {
this.brokerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerBasicInfo']
this.brokerInfo = JSON.parse(localStorage.getItem('ydgiCustomerInfo'))['practitionerBasicInfo']
}
ngAfterViewInit() {
......
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