Commit 22b46b32 by Sweet Zhang

调整名片实现方式

parent d327a4f8
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"core-js": "^2.5.4", "core-js": "^2.5.4",
"dayjs": "1.10.4", "dayjs": "1.10.4",
"echarts": "^4.9.0", "echarts": "^4.9.0",
"html2canvas": "^1.0.0-rc.7", "html2canvas": "^1.4.1",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"jspdf": "^2.3.0", "jspdf": "^2.3.0",
"ng-zorro-antd-mobile": "^0.12.5", "ng-zorro-antd-mobile": "^0.12.5",
......
<div class="businessCardContainer"> <div class="businessCardContainer">
<div style="text-align: right;padding-top: 15px;"> <div style="text-align: right;padding-top: 15px;">
<button class="applyEmailBtn" (click)="applyEmail()" *ngIf="practitionerInfo?.emailIsActive==0">申请公司邮箱</button> <button class="applyEmailBtn" (click)="applyEmail()" *ngIf="practitionerInfo?.emailIsActive==0">申请公司邮箱</button>
<a class="applyEmailBtn" href="assets/pdfjs/web/viewer.html?file={{practitionerInfo?.businessCardPdfUrl}}&isNeedCover=false&isNeedDownload=true" target="_blank" rel="noopener noreferrer">保存名片PDF档</a> <!-- <button class="applyEmailBtn" (click)="savePicture(practitionerInfo.businessCardProsImg)" *ngIf="practitionerInfo?.businessCardProsImg">保存名片正面</button>
<button class="applyEmailBtn" (click)="savePicture(practitionerInfo.businessCardConsImg)" *ngIf="practitionerInfo?.businessCardConsImg">保存名片反面</button> -->
<!-- <a class="applyEmailBtn" href="assets/pdfjs/web/viewer.html?file={{practitionerInfo?.businessCardPdfUrl}}&isNeedCover=false&isNeedDownload=true" target="_blank" rel="noopener noreferrer">保存名片PDF档</a> -->
<!-- <a class="applyEmailBtn" href="{{practitionerInfo?.businessCardProsImg}}" download="名片正面" target="_blank" rel="noopener noreferrer">保存名片正面</a> -->
<!-- <a class="applyEmailBtn" href="{{practitionerInfo?.businessCardConsImg}}" download="名片反面" target="_blank" rel="noopener noreferrer">保存名片反面</a> -->
</div> </div>
<div class="brokerCardPositive"> <div *ngIf="practitionerInfo?.businessCardProsImg" style="text-align: center;color: red;">长按可保存名片到相册</div>
<div id="saveImgContainer">
<div>
<img src="{{practitionerInfo?.businessCardProsImg}}" alt="" class="img-responsive">
</div>
<div>
<img src="{{practitionerInfo?.businessCardConsImg}}" alt="" class="img-responsive">
</div>
<!-- <div class="brokerCardPositive">
<div class="qrcodeBox"> <div class="qrcodeBox">
<div> <div>
<div style="margin-bottom: 20%;"><img src="assets/images/ydShield.png" alt="银盾保险经纪" class="img-responsive"> <div style="margin-bottom: 20%;"><img src="assets/images/ydShield.png" alt="银盾保险经纪" class="img-responsive">
...@@ -46,6 +58,7 @@ ...@@ -46,6 +58,7 @@
</div> </div>
<div class="brokerCardOpposite"> <div class="brokerCardOpposite">
<img src="assets/images/card_opposite.jpg" alt="" class="img-responsive"> <img src="assets/images/card_opposite.jpg" alt="" class="img-responsive">
</div> </div> -->
</div>
</div> </div>
<ydlife-alert *ngIf="isNeedAlert" [dialogInfo]="dialogInfo" (popInfo)="getPopInfo()"></ydlife-alert> <ydlife-alert *ngIf="isNeedAlert" [dialogInfo]="dialogInfo" (popInfo)="getPopInfo()"></ydlife-alert>
\ No newline at end of file
...@@ -18,6 +18,19 @@ export class BusinessCardComponent implements OnInit { ...@@ -18,6 +18,19 @@ export class BusinessCardComponent implements OnInit {
this.lifeCustomerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo')); this.lifeCustomerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo'));
this.businessCard(); this.businessCard();
} }
savePicture(Url) {
var blob = new Blob([''], { type: 'application/octet-stream' });
var url = URL.createObjectURL(blob);
var a = document.createElement('a');
a.href = Url;
a.download = Url.replace(/(.*\/)*([^.]+.*)/ig, "$2").split("?")[0];
var e = document.createEvent('MouseEvents');
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
a.dispatchEvent(e);
URL.revokeObjectURL(url);
}
// 申请企业邮箱 // 申请企业邮箱
applyEmail(){ applyEmail(){
this.myService.applyEmail({practitionerId:this.practitionerInfo.practitionerId,email:this.practitionerInfo.email}).subscribe(res=>{ this.myService.applyEmail({practitionerId:this.practitionerInfo.practitionerId,email:this.practitionerInfo.email}).subscribe(res=>{
...@@ -44,7 +57,7 @@ export class BusinessCardComponent implements OnInit { ...@@ -44,7 +57,7 @@ export class BusinessCardComponent implements OnInit {
this.isNeedAlert = false; this.isNeedAlert = false;
} }
businessCard(){ businessCard(){
this.myService.businessCard({practitionerId:this.lifeCustomerInfo.practitionerId}).subscribe(res=>{ this.myService.businessCard({practitionerId:this.lifeCustomerInfo.practitionerId,businessCardType:2}).subscribe(res=>{
if(res['success']){ if(res['success']){
this.practitionerInfo = res['data']; this.practitionerInfo = res['data'];
this.practitionerInfo.certificateList = this.practitionerInfo.certificateList.splice(0,3) this.practitionerInfo.certificateList = this.practitionerInfo.certificateList.splice(0,3)
......
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