Commit e30b0df5 by Sweet Zhang

分享

parent 4dd0cf5b
...@@ -119,7 +119,6 @@ export class LifeCommonService { ...@@ -119,7 +119,6 @@ export class LifeCommonService {
link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: imgUrl, // 分享图标 imgUrl: imgUrl, // 分享图标
success: () => { success: () => {
alert(111)
_this.shareStatusPublish(0); _this.shareStatusPublish(0);
} }
}; };
......
<button (click)="getWxUserInfo()">getWxUserInfo</button>
<div id="js_article" class="rich_media"> <div id="js_article" class="rich_media">
<div class="rich_media_inner"> <div class="rich_media_inner">
<div id="page-content" class="rich_media_area_primary"> <div id="page-content" class="rich_media_area_primary">
<div class="rich_media_area_primary_inner"> <div class="rich_media_area_primary_inner">
<div id="img-content" class="rich_media_wrp"> <div id="img-content" class="rich_media_wrp">
<button (click)="getWxUserInfo()">getWxUserInfo</button>
<h2 class="rich_media_title" id="activity-name"> <h2 class="rich_media_title" id="activity-name">
{{articleInfo?.title}} {{articleInfo?.title}}
</h2> </h2>
......
...@@ -34,27 +34,26 @@ export class ArticleDetailComponent implements OnInit, OnDestroy { ...@@ -34,27 +34,26 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.articleId = this.activatedRoute.snapshot.params['id']; this.articleId = this.activatedRoute.snapshot.params['id'];
this.shareCode = this.activatedRoute.snapshot.queryParams['shareCode'] ? this.activatedRoute.snapshot.queryParams['shareCode'] : uuid.v4(); this.shareCode = this.activatedRoute.snapshot.queryParams['shareCode'];
if (this.activatedRoute.snapshot.queryParams['shareCode']) { if (this.activatedRoute.snapshot.queryParams['shareCode']) {
this.practitionerFileSharingList(null, this.shareCode); this.practitionerFileSharingList(null, this.shareCode);
this.articleTrackSave(); this.articleTrackSave();
} else { } else {
this.practitionerFileSharingList(this.articleId, null); this.practitionerFileSharingList(this.articleId, null);
} }
this.lifeCustomerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo')) ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null; this.lifeCustomerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo')) ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
if (this.lifeCustomerInfo) { if (this.lifeCustomerInfo) {
this.customerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['customerId'] this.customerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['customerId'];
this.agentInfo = {
headImagePath: this.lifeCustomerInfo.practitionerBasicInfo.headImagePath,
agentName: this.lifeCustomerInfo.practitionerBasicInfo.name,
insurerBranchName: this.lifeCustomerInfo.practitionerBasicInfo.insurerBranchName,
qrCodePath: this.lifeCustomerInfo.practitionerBasicInfo.qrCodePath,
mobileNo: this.lifeCustomerInfo.mobileNo
};
} else { } else {
this.customerId = null; this.customerId = null;
} }
this.agentInfo = {
headImagePath: this.lifeCustomerInfo.practitionerBasicInfo.headImagePath,
agentName: this.lifeCustomerInfo.practitionerBasicInfo.name,
insurerBranchName: this.lifeCustomerInfo.practitionerBasicInfo.insurerBranchName,
qrCodePath: this.lifeCustomerInfo.practitionerBasicInfo.qrCodePath,
mobileNo: this.lifeCustomerInfo.mobileNo
};
if (this.lifeCommonService.checkDeviceType() == '3' && !this.customerId) { if (this.lifeCommonService.checkDeviceType() == '3' && !this.customerId) {
this.getWxUserInfo(); this.getWxUserInfo();
} }
...@@ -74,6 +73,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy { ...@@ -74,6 +73,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
}) })
} }
// 点击分享 // 点击分享
share() { share() {
this.shareAbled = !this.shareAbled; this.shareAbled = !this.shareAbled;
...@@ -93,14 +93,18 @@ export class ArticleDetailComponent implements OnInit, OnDestroy { ...@@ -93,14 +93,18 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
}).subscribe(res => { }).subscribe(res => {
this.articleInfo = res['data'].practitionerFileShares.list['0']; this.articleInfo = res['data'].practitionerFileShares.list['0'];
this.sharePractitionerInfo = res['data'].sharePractitionerInfo; this.sharePractitionerInfo = res['data'].sharePractitionerInfo;
this.agentInfo = { if (this.sharePractitionerInfo) {
headImagePath: this.sharePractitionerInfo.headImagePath, this.agentInfo = {
agentName: this.sharePractitionerInfo.name, headImagePath: this.sharePractitionerInfo.headImagePath,
insurerBranchName: this.sharePractitionerInfo.insurerBranchName, agentName: this.sharePractitionerInfo.name,
qrCodePath: this.sharePractitionerInfo.qrCodePath, insurerBranchName: this.sharePractitionerInfo.insurerBranchName,
mobileNo: this.sharePractitionerInfo.mobileNo qrCodePath: this.sharePractitionerInfo.qrCodePath,
}; mobileNo: this.sharePractitionerInfo.mobileNo
this.lifeCommonService.wxShare(this.articleInfo.title, `来自银盾经纪人${this.agentInfo.agentName}的分享`, `${window.location.href}`, this.articleInfo.coverUrl); };
this.lifeCommonService.wxShare(this.articleInfo.title, `来自银盾经纪人${this.agentInfo.agentName}的分享`, `${window.location.href}`, this.articleInfo.coverUrl);
}
}); });
} }
...@@ -108,7 +112,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy { ...@@ -108,7 +112,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
articleShareCodeSave() { articleShareCodeSave() {
this.articleShareCodeSaveInfo = { this.articleShareCodeSaveInfo = {
itemId: this.articleId, itemId: this.articleId,
shareCode: this.shareCode, shareCode: uuid.v4(),
practitionerId: this.lifeCustomerInfo.practitionerId ? this.lifeCustomerInfo.practitionerId : this.sharePractitionerInfo.practitionerId, practitionerId: this.lifeCustomerInfo.practitionerId ? this.lifeCustomerInfo.practitionerId : this.sharePractitionerInfo.practitionerId,
customerId: this.lifeCustomerInfo.customerId ? this.lifeCustomerInfo.customerId : this.sharePractitionerInfo.customerId, customerId: this.lifeCustomerInfo.customerId ? this.lifeCustomerInfo.customerId : this.sharePractitionerInfo.customerId,
os: this.lifeCommonService.checkOs(), os: this.lifeCommonService.checkOs(),
......
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