Commit 5bf0dc95 by Sweet Zhang

文章分享

parent e30b0df5
......@@ -42,8 +42,8 @@
</div>
</div>
</div>
<div class="shareCus" (click)="share()">
<span>分享获客</span>
<div class="shareCus" (click)="share()" *ngIf="this.lifeCommonService.checkDeviceType() == 3">
<span>分享</span>
</div>
<!--分享引导页-->
<div class="shareGuidePage" *ngIf="shareAbled" (click)="share()">
......
......@@ -27,9 +27,9 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
sharePractitionerInfo: any;
constructor(private myService: MyService, public lifeCommonService: LifeCommonService, public router: Router, public activatedRoute: ActivatedRoute) {
this.subscription = lifeCommonService.shareStatus$.subscribe(status => {
this.shareAbled = !(status == '0');
});
// this.subscription = lifeCommonService.shareStatus$.subscribe(status => {
// this.shareAbled = !(status == '0');
// });
}
ngOnInit() {
......@@ -60,7 +60,8 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
}
ngOnDestroy() {
this.subscription.unsubscribe();
this.articleTrackSave();
sessionStorage.removeItem('articleTrackId');
}
// 从后台获取到获取微信code的URL
......@@ -76,8 +77,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
// 点击分享
share() {
this.shareAbled = !this.shareAbled;
this.lifeCommonService.wxShare(this.articleInfo.title, `来自银盾经纪人${this.agentInfo.agentName}的分享`, `${window.location.href}?shareCode=${this.shareCode}`, this.articleInfo.coverUrl);
this.shareAbled = true;
this.articleShareCodeSave();
setTimeout(() => {
this.shareAbled = false;
......@@ -101,7 +101,6 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
qrCodePath: this.sharePractitionerInfo.qrCodePath,
mobileNo: this.sharePractitionerInfo.mobileNo
};
this.lifeCommonService.wxShare(this.articleInfo.title, `来自银盾经纪人${this.agentInfo.agentName}的分享`, `${window.location.href}`, this.articleInfo.coverUrl);
}
......@@ -119,6 +118,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
channel: 1,
url: window.location.href
};
this.lifeCommonService.wxShare(this.articleInfo.title, `来自银盾经纪人${this.lifeCustomerInfo.practitionerBasicInfo.name ? this.lifeCustomerInfo.practitionerBasicInfo.name : this.sharePractitionerInfo.name}的分享`, `${window.location.origin}${window.location.pathname}?shareCode=${this.articleShareCodeSaveInfo.shareCode}`, this.articleInfo.coverUrl);
this.myService.articleShareCodeSave(this.articleShareCodeSaveInfo).subscribe(res => {
// console.log(res);
});
......@@ -128,7 +128,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
// 有id就是出 没id就是进
articleTrackSave() {
const param = {
id: null,
id: sessionStorage.getItem('articleTrackId') ? sessionStorage.getItem('articleTrackId') : null,
shareCode: this.shareCode,
nickname: null,
gender: null,
......@@ -136,7 +136,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
deviceType: this.lifeCommonService.checkDeviceType()
};
this.myService.articleTrackSave(param).subscribe(res => {
console.log(res);
sessionStorage.setItem('articleTrackId', res['data']['id']);
})
}
......
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