Commit e30b0df5 by Sweet Zhang

分享

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