Commit 8639e866 by sunchao

文章分享优化

parent 91b0c8eb
......@@ -7,8 +7,8 @@
{{articleInfo?.title}}
</h2>
<div id="meta_content" class="rich_media_meta_list">
<span class="rich_media_meta rich_media_meta_nickname" id="profileBt">
<a href="javascript:void(0);" id="js_name">银盾保险在线</a>
<span class="rich_media_meta rich_media_meta_nickname" id="profileBt" (click)="jumpTo()">
<a href="javascript:void(0);" id="js_name">{{articleInfo?.author}}</a>
</span>
<em id="publish_time"
class="rich_media_meta rich_media_meta_text">{{(articleInfo?.updatedAt).substr(0,10)}}</em>
......@@ -31,6 +31,7 @@
class="img-thumbnail">
</div>
</div>
<!-- <div class="rich_media_content " id="js_content" style="visibility: visible;" [ngStyle]="{'min-height':shareCode && !state ? '550px':'inherit'}"> -->
<div class="rich_media_content " id="js_content" style="visibility: visible;">
<div [innerHTML]="articleInfo?.fileContent | safeHtml">
</div>
......@@ -60,7 +61,7 @@
</div>
</div>
<div class="shareCus" (click)="share()" *ngIf="this.lifeCommonService.checkDeviceType() == 3">
<span>分享</span>
<span style="font-size: 20px;">分享</span>
</div>
<!--分享引导页-->
<div class="shareGuidePage" *ngIf="shareAbled" (click)="shareAbled=false">
......
......@@ -91,7 +91,7 @@
line-height: 48px;
bottom: 0;
left: 0;
background: #0d4d7a;
background: #ff9700;
text-align: center;
letter-spacing: 1px;
color: #fff;
......
......@@ -26,6 +26,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
articleShareCodeSaveInfo: any;
sharePractitionerInfo: any;
deviceType:string;
state:string;
constructor(private myService: MyService, public lifeCommonService: LifeCommonService, public router: Router, public activatedRoute: ActivatedRoute) {
// this.subscription = lifeCommonService.shareStatus$.subscribe(status => {
// this.shareAbled = !(status == '0');
......@@ -35,6 +36,14 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
ngOnInit() {
this.articleId = this.activatedRoute.snapshot.params['id'];
this.shareCode = this.activatedRoute.snapshot.queryParams['shareCode'];
this.state = this.lifeCommonService.getQueryString('state')
// if (this.activatedRoute.snapshot.queryParams['shareCode'] && this.state) {
// this.practitionerFileSharingList(null, this.shareCode);
// } else if(this.activatedRoute.snapshot.queryParams['shareCode']){
// this.articleTrackSave();
// }else{this.practitionerFileSharingList(this.articleId, null);
// }
if (this.activatedRoute.snapshot.queryParams['shareCode']) {
this.practitionerFileSharingList(null, this.shareCode);
this.articleTrackSave();
......@@ -55,9 +64,6 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
this.customerId = null;
}
this.deviceType = this.lifeCommonService.checkDeviceType();
// if (this.lifeCommonService.checkDeviceType() == '3' && !this.customerId) {
// this.getWxUserInfo();
// }
}
ngOnDestroy() {
......@@ -119,7 +125,7 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
channel: 1,
url: window.location.href
};
this.lifeCommonService.wxShare(this.articleInfo.title, `来自银盾经纪人${this.lifeCustomerInfo ? this.lifeCustomerInfo.practitionerBasicInfo.name : this.sharePractitionerInfo.name}的分享`, `${window.location.origin}${window.location.pathname}?shareCode=${this.articleShareCodeSaveInfo.shareCode}`, this.articleInfo.coverUrl);
this.lifeCommonService.wxShare(this.articleInfo.title, this.lifeCommonService.getTwenty(this.articleInfo.digest,38), `${window.location.origin}${window.location.pathname}?shareCode=${this.articleShareCodeSaveInfo.shareCode}`, this.articleInfo.coverUrl);
this.myService.articleShareCodeSave(this.articleShareCodeSaveInfo).subscribe(res => {
// console.log(res);
});
......@@ -172,4 +178,8 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
document.getElementById('submit').click();
}
}
jumpTo(){
window.location.href = 'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzU4MDYxMDA3NA==#wechat_redirect'
}
}
......@@ -13,6 +13,6 @@
</li>
<li>{{lifeCommonService.isEmpty(readerItem.nickName)}}</li>
<li>{{getGender(readerItem.gender)}}</li>
<li>{{readerItem.trackInTime.substr(0,16)}}</li>
<li>{{readerItem.trackInTime.substr(5,11)}}</li>
</ul>
</div>
\ No newline at end of file
......@@ -10,6 +10,7 @@
color: #333333;
width: 28%;
text-align: center;
overflow: hidden;
.headimg{
width: 45px;
height: 45px;
......@@ -25,11 +26,12 @@
li:nth-child(1){
width: 18%;
}
li:nth-child(2){
text-align: left;
width: 30%;
}
li:nth-child(3){
width: 10%;
}
li:nth-child(4){
width: 35%;
}
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@
</li>
</ul>
<div class="article_wrapper">
<ul>
<ul *ngIf="articleList?.length>0">
<li *ngFor="let articleItem of articleList" >
<div class="left" (click)="articleDetail(articleItem)">
<div class="title">{{articleItem.title}}</div>
......@@ -32,4 +32,7 @@
</div>
</ul>
</div>
<div *ngIf="!articleList?.length" style="text-align: center;margin-top: 50px;">
暂无文章
</div>
</div>
......@@ -7,7 +7,7 @@
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="viewport" content="width=device-width" />
<meta name="keywords" content="银盾保险在线,健康保险,出国旅行保险,户外运动保险,意外保险,国内旅行保险,留学游学保险,邮轮保险">
<meta name="description" content="银盾保险在线,提供全球多家知名保险公司产品网上投保,甄选并推荐最适合您的保险产品。" />
<title>银盾保险经纪</title>
......@@ -91,6 +91,16 @@
}
var token = getToken();
function getQueryString(name) {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = decodeURIComponent(window.location.search).substr(1).match(reg);
if (r != null) {
return r[2];
}
return null;
}
var shareCode = getQueryString('shareCode');
const initialize = function () {
let loading = document.getElementById("adv");
loading.style.display = 'block';
......@@ -106,7 +116,13 @@
//页面刷新的时候不出现
if (window.name == "") {
window.name = "isReload"; // 在首次进入页面时我们可以给window.name设置一个固定值
initialize();
if(shareCode){
let loading = document.getElementById("adv");
loading.style.display = 'none';
}else{
initialize();
}
} else if (window.name == "isReload") {
let loading = document.getElementById("adv");
loading.style.display = 'none';
......
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