Commit 91698862 by Chao Sun

分享按钮微信显示&icon更换

parent 04ff2aaa
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
</footer> </footer>
</div> </div>
<div class="returnIndexBox" (click)="shareIdCard()"> <div class="returnIndexBox" *ngIf="deviceType==3" (click)="shareIdCard()">
<div><i class="iconfont icon-shouye"></i></div> <div style="text-align: center;"><img style="max-width: 45%;" src="assets/images/shareBtn.png" alt=""></div>
<div>分享</div> <div>分享</div>
</div> </div>
</div> </div>
......
...@@ -15,6 +15,7 @@ export class BrokerDetailComponent implements OnInit { ...@@ -15,6 +15,7 @@ export class BrokerDetailComponent implements OnInit {
imgShowFlag: boolean; imgShowFlag: boolean;
scaleImgPath: any; scaleImgPath: any;
reloadurl: any; reloadurl: any;
deviceType: number;
constructor(private eventBusService: EventBusService, private activatedRoute: ActivatedRoute) { constructor(private eventBusService: EventBusService, private activatedRoute: ActivatedRoute) {
} }
...@@ -25,6 +26,8 @@ export class BrokerDetailComponent implements OnInit { ...@@ -25,6 +26,8 @@ export class BrokerDetailComponent implements OnInit {
if (this.getQuery('reload') !== 'true') { if (this.getQuery('reload') !== 'true') {
window.location.href = this.reloadurl; window.location.href = this.reloadurl;
} }
this.deviceType = this.checkDeviceType();
} }
userPractitionerDetailQuery() { userPractitionerDetailQuery() {
const practitionerId = { const practitionerId = {
...@@ -63,4 +66,23 @@ export class BrokerDetailComponent implements OnInit { ...@@ -63,4 +66,23 @@ export class BrokerDetailComponent implements OnInit {
`${window.location.href}`, `${window.location.href}`,
imgUrl); imgUrl);
} }
/**
* 检测设备信息
* deviceType:PC为1,移动端为2,微信为3
*/
checkDeviceType() {
let deviceType = null;
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
deviceType = 3;
} else {
deviceType = 2;
}
} else {
deviceType = 1;
}
return deviceType;
}
} }
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