Commit e748a0cd by Sweet Zhang

文件下载对接接口

parent ca277f93
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
"@angular/platform-browser": "~7.2.0", "@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0", "@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0", "@angular/router": "~7.2.0",
"buffer": "^5.4.3",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"html2canvas": "^1.0.0-rc.5",
"rxjs": "~6.3.3", "rxjs": "~6.3.3",
"tslib": "^1.9.0", "tslib": "^1.9.0",
"uuid": "^3.3.3", "uuid": "^3.3.3",
...@@ -30,9 +32,9 @@ ...@@ -30,9 +32,9 @@
"@angular/cli": "~7.3.5", "@angular/cli": "~7.3.5",
"@angular/compiler-cli": "~7.2.0", "@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0", "@angular/language-service": "~7.2.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8", "@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0", "codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1", "jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "~4.2.1",
......
...@@ -9,14 +9,15 @@ ...@@ -9,14 +9,15 @@
<div class="weui-cell"> <div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">手机号</label></div> <div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
<div class="weui-cell__bd"> <div class="weui-cell__bd">
<input class="weui-input" type="tel" maxlength="11" pattern="[0-9]*" placeholder="您的手机号" name="mobileNo" <input autofocus="" class="weui-input" type="tel" maxlength="11" pattern="[0-9]*" placeholder="您的手机号"
name="mobileNo"
[(ngModel)]="userInfo.mobileNo"> [(ngModel)]="userInfo.mobileNo">
</div> </div>
</div> </div>
<div class="weui-cell weui-cell_vcode"> <div class="weui-cell weui-cell_vcode">
<div class="weui-cell__hd"><label class="weui-label">验证码</label></div> <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>
<div class="weui-cell__bd"> <div class="weui-cell__bd">
<input autofocus="" class="weui-input" type="tel" pattern="[0-9]*" id="js_input" placeholder="手机验证码" <input class="weui-input" type="tel" pattern="[0-9]*" id="js_input" placeholder="手机验证码"
maxlength="4" name="verificationCode" [(ngModel)]="userInfo.verificationCode"> maxlength="4" name="verificationCode" [(ngModel)]="userInfo.verificationCode">
</div> </div>
<div class="weui-cell__ft"> <div class="weui-cell__ft">
...@@ -28,7 +29,8 @@ ...@@ -28,7 +29,8 @@
</div> </div>
</div> </div>
<div class="weui-form__opr-area"> <div class="weui-form__opr-area">
<a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" (click)="login()">确定</a> <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" style="width:80%"
(click)="login()">确定</a>
</div> </div>
</div> </div>
</div> </div>
......
<div class="fileUploadLists"> <div class="fileUploadLists">
<ul> <ul>
<li *ngFor="let fileUploadItem of fileUploadLists"> <li *ngFor="let fileUploadItem of fileUploadItemList">
<a href="{{fileUploadItem.filePath}}" download="{{fileUploadItem.fileName}}" target="_blank"> <a href="{{fileUploadItem.filePath}}" download="{{fileUploadItem.itemName}}" target="_blank">
<div><i class="iconfont icon-pdf"></i></div> <div><i class="iconfont icon-pdf"></i></div>
<div title="{{fileUploadItem.fileTitle}}">{{fileUploadItem.fileName}}</div> <div title="{{fileUploadItem.itemName}}">{{fileUploadItem.itemName}}</div>
</a> </a>
<div><i class="iconfont icon-xiazai"></i></div> <div><i class="iconfont icon-xiazai"></i></div>
</li> </li>
......
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {LifeCommonService} from "../../common/life-common.service"; import {LifeCommonService} from "../../common/life-common.service";
import {MyService} from "../my.service";
@Component({ @Component({
selector: 'ydlife-file-upload', selector: 'ydlife-file-upload',
...@@ -7,37 +8,22 @@ import {LifeCommonService} from "../../common/life-common.service"; ...@@ -7,37 +8,22 @@ import {LifeCommonService} from "../../common/life-common.service";
styleUrls: ['./file-upload.component.scss'] styleUrls: ['./file-upload.component.scss']
}) })
export class FileUploadComponent implements OnInit { export class FileUploadComponent implements OnInit {
fileUploadLists: Array<any>; fileUploadItemList: Array<any>;
constructor(private lfeCommonService: LifeCommonService) { constructor(private myService: MyService) {
} }
ngOnInit() { ngOnInit() {
this.fileUploadLists = [ this.fileUpload(3, 0, 19);
{
fileTitle: '上海银盾保险经纪有限公司反欺诈管理制度',
fileName: '上海银盾保险经纪有限公司反欺诈管理制度',
filePath: 'https://www.ydinsurance.cn/wp-content/uploads/2019/12/%E4%B8%8A%E6%B5%B7%E9%93%B6%E7%9B%BE%E4%BF%9D%E9%99%A9%E7%BB%8F%E7%BA%AA%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8%E5%8F%8D%E6%AC%BA%E8%AF%88%E7%AE%A1%E7%90%86%E5%88%B6%E5%BA%A6.pdf',
fileType: 'pdf'
},
{
fileTitle: '员工生活关爱手册',
fileName: '员工生活关爱手册',
filePath: 'https://www.ydinsurance.cn/wp-content/uploads/2019/12/%E5%91%98%E5%B7%A5%E7%94%9F%E6%B4%BB%E5%85%B3%E7%88%B1%E6%89%8B%E5%86%8C.pdf',
fileType: 'pdf'
},
{
fileTitle: '公告佣金表',
fileName: '公告佣金表',
filePath: 'https://www.ydinsurance.cn/wp-content/uploads/2019/12/20191220%E5%85%AC%E5%91%8A%E4%BD%A3%E9%87%91%E8%A1%A8.pdf',
fileType: 'pdf'
}
];
} }
// 文件下载 // 文件下载
fileUpload(fileUploadItem) { fileUpload(itemType, itemId, fileCategory) {
this.myService.filePath(itemType, itemId, fileCategory).subscribe(res => {
if (res['success']) {
this.fileUploadItemList = res['data']['fileUploadItemList'];
}
});
} }
} }
...@@ -3,6 +3,7 @@ import {ActivatedRoute} from '@angular/router'; ...@@ -3,6 +3,7 @@ import {ActivatedRoute} from '@angular/router';
import {environment} from '../../../environments/environment'; import {environment} from '../../../environments/environment';
import {LifeCommonService} from '../../common/life-common.service'; import {LifeCommonService} from '../../common/life-common.service';
import {MyService} from '../my.service'; import {MyService} from '../my.service';
import {Buffer} from 'buffer';
declare var QRCode: any; declare var QRCode: any;
import * as uuid from 'uuid'; import * as uuid from 'uuid';
@Component({ @Component({
...@@ -56,7 +57,6 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -56,7 +57,6 @@ export class MkMaterialDetailComponent implements OnInit {
canvas.height = H * ratio; canvas.height = H * ratio;
canvas.style.width = W + 'px'; canvas.style.width = W + 'px';
canvas.style.height = H + 'px'; canvas.style.height = H + 'px';
// const qr = document.querySelector('#qrcode');
const img = new Image(); const img = new Image();
// 画圆形头像 // 画圆形头像
const avatarurlWidth = 50 * ratio; // 绘制的头像宽度 const avatarurlWidth = 50 * ratio; // 绘制的头像宽度
...@@ -64,7 +64,11 @@ export class MkMaterialDetailComponent implements OnInit { ...@@ -64,7 +64,11 @@ export class MkMaterialDetailComponent implements OnInit {
const avatarurlX = 10 * ratio; // 绘制的头像在画布上的位置 const avatarurlX = 10 * ratio; // 绘制的头像在画布上的位置
const avatarurlY = this.canvas.nativeElement.height - (this.contentHeight + 50) / 2 * ratio; // 绘制的头像在画布上的位置 const avatarurlY = this.canvas.nativeElement.height - (this.contentHeight + 50) / 2 * ratio; // 绘制的头像在画布上的位置
const avatarImg = new Image(); const avatarImg = new Image();
avatarImg.src = `${environment.ORIGINNAME}/assets/img/meng.png`; if (this.lifeCustomerInfo.practitionerBasicInfo.headImagePath) {
avatarImg.src = this.lifeCustomerInfo.practitionerBasicInfo.headImagePath;
} else {
avatarImg.src = `${environment.ORIGINNAME}/assets/img/meng.png`;
}
// // 这里的第一张图片就是可以是你们的海报 这里注意绘制的顺序 我们要手动控制 // // 这里的第一张图片就是可以是你们的海报 这里注意绘制的顺序 我们要手动控制
img.src = `${environment.ORIGINNAME}/ydLife/assets/images/mk-material/${this.materialItemId}.jpg`; img.src = `${environment.ORIGINNAME}/ydLife/assets/images/mk-material/${this.materialItemId}.jpg`;
img.onload = () => { img.onload = () => {
......
<div class="weui-panel"> <div class="weui-panel">
<div class="weui-panel__hd"> <div class="weui-panel__hd">
<div class="avatar"> <div class="avatar">
<img src="assets/images/icons/meng.png" alt="头像"> <img
src="{{lifeCustomerInfo?.practitionerBasicInfo?.headImagePath ? lifeCustomerInfo?.practitionerBasicInfo?.headImagePath : 'assets/images/icons/meng.png'}}"
alt="头像">
</div> </div>
<div class="brokerInfo"> <div class="brokerInfo">
<div class="brokerName"> <div class="brokerName">
<div style="letter-spacing: 2px"><span>{{lifeCustomerInfo?.practitionerBasicInfo?.name}}</span></div> <div style="letter-spacing: 2px"><span>{{lifeCustomerInfo?.practitionerBasicInfo?.name}}</span></div>
<div class="shareSelfInfoBtn" (click)="shareIdCard()"><span>分享名片</span></div> <div class="shareSelfInfoBtn" *ngIf="this.deviceType===3" (click)="shareIdCard()"><span>分享名片</span></div>
</div> </div>
<div class="brokerTag"> <div class="brokerTag">
<div> <div>
<p>银盾保险 上海营业部</p> <p>{{lifeCustomerInfo?.practitionerBasicInfo?.insurerBranchName ? lifeCustomerInfo?.practitionerBasicInfo?.insurerBranchName : '银盾保险'}}</p>
</div> </div>
<div><span class="ydTitle">业务总监</span></div> <div><span class="ydTitle">{{lifeCustomerInfo?.practitionerBasicInfo?.levelName}}</span></div>
</div> </div>
</div> </div>
<!--<div class="shareSelfInfoBtn">--> <!--<div class="shareSelfInfoBtn">-->
......
...@@ -8,10 +8,10 @@ import {FileUploadComponent} from './file-upload/file-upload.component'; ...@@ -8,10 +8,10 @@ import {FileUploadComponent} from './file-upload/file-upload.component';
import {ImportantAnnouncementComponent} from "./important-announcement/important-announcement.component"; import {ImportantAnnouncementComponent} from "./important-announcement/important-announcement.component";
const myRoutes: Routes = [ const myRoutes: Routes = [
{path: '', component: MyCenterHomeComponent, canActivate: [AuthGuard]}, {path: '', component: MyCenterHomeComponent, canActivate: [AuthGuard]},
{path: 'material', component: MkMaterialComponent}, {path: 'material', component: MkMaterialComponent, canActivate: [AuthGuard]},
{path: 'material/:itemId', component: MkMaterialDetailComponent}, {path: 'material/:itemId', component: MkMaterialDetailComponent, canActivate: [AuthGuard]},
{path: 'fileUpload', component: FileUploadComponent}, {path: 'fileUpload', component: FileUploadComponent, canActivate: [AuthGuard]},
{path: 'importantAnnouncement', component: ImportantAnnouncementComponent}, {path: 'importantAnnouncement', component: ImportantAnnouncementComponent, canActivate: [AuthGuard]},
]; ];
@NgModule({ @NgModule({
......
...@@ -16,4 +16,11 @@ export class MyService { ...@@ -16,4 +16,11 @@ export class MyService {
return this.http return this.http
.post(url, JSON.stringify(shareInfo)); .post(url, JSON.stringify(shareInfo));
} }
// 文件下载
filePath(itemType, itemId, fileCategory) {
const url = this.API + '/filePathQuery';
return this.http
.post(url, JSON.stringify({itemType: itemType, itemId: itemId, fileCategory: fileCategory}));
}
} }

18.1 KB | W: | H:

64.1 KB | W: | H:

src/assets/images/mk-material/117thumb.jpg
src/assets/images/mk-material/117thumb.jpg
src/assets/images/mk-material/117thumb.jpg
src/assets/images/mk-material/117thumb.jpg
  • 2-up
  • Swipe
  • Onion skin

24.3 KB | W: | H:

75.8 KB | W: | H:

src/assets/images/mk-material/118thumb.jpg
src/assets/images/mk-material/118thumb.jpg
src/assets/images/mk-material/118thumb.jpg
src/assets/images/mk-material/118thumb.jpg
  • 2-up
  • Swipe
  • Onion skin

21.9 KB | W: | H:

72.2 KB | W: | H:

src/assets/images/mk-material/131thumb.jpg
src/assets/images/mk-material/131thumb.jpg
src/assets/images/mk-material/131thumb.jpg
src/assets/images/mk-material/131thumb.jpg
  • 2-up
  • Swipe
  • Onion skin

22.9 KB | W: | H:

86.4 KB | W: | H:

src/assets/images/mk-material/133thumb.jpg
src/assets/images/mk-material/133thumb.jpg
src/assets/images/mk-material/133thumb.jpg
src/assets/images/mk-material/133thumb.jpg
  • 2-up
  • Swipe
  • Onion skin

24.6 KB | W: | H:

71.2 KB | W: | H:

src/assets/images/mk-material/136thumb.jpg
src/assets/images/mk-material/136thumb.jpg
src/assets/images/mk-material/136thumb.jpg
src/assets/images/mk-material/136thumb.jpg
  • 2-up
  • Swipe
  • Onion skin

23.4 KB | W: | H:

109 KB | W: | H:

src/assets/images/mk-material/137thumb.jpg
src/assets/images/mk-material/137thumb.jpg
src/assets/images/mk-material/137thumb.jpg
src/assets/images/mk-material/137thumb.jpg
  • 2-up
  • Swipe
  • Onion skin

26.2 KB | W: | H:

106 KB | W: | H:

src/assets/images/mk-material/138thumb.jpg
src/assets/images/mk-material/138thumb.jpg
src/assets/images/mk-material/138thumb.jpg
src/assets/images/mk-material/138thumb.jpg
  • 2-up
  • Swipe
  • Onion skin

27 KB | W: | H:

84.6 KB | W: | H:

src/assets/images/mk-material/139thumb.jpg
src/assets/images/mk-material/139thumb.jpg
src/assets/images/mk-material/139thumb.jpg
src/assets/images/mk-material/139thumb.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -833,6 +833,10 @@ base64-arraybuffer@0.1.5: ...@@ -833,6 +833,10 @@ base64-arraybuffer@0.1.5:
version "0.1.5" version "0.1.5"
resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8"
base64-arraybuffer@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz#4b944fac0191aa5907afe2d8c999ccc57ce80f45"
base64-js@^1.0.2: base64-js@^1.0.2:
version "1.3.1" version "1.3.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
...@@ -1055,6 +1059,13 @@ buffer@^4.3.0: ...@@ -1055,6 +1059,13 @@ buffer@^4.3.0:
ieee754 "^1.1.4" ieee754 "^1.1.4"
isarray "^1.0.0" isarray "^1.0.0"
buffer@^5.4.3:
version "5.4.3"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115"
dependencies:
base64-js "^1.0.2"
ieee754 "^1.1.4"
builtin-modules@^1.1.1: builtin-modules@^1.1.1:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
...@@ -1607,6 +1618,12 @@ crypto-browserify@^3.11.0: ...@@ -1607,6 +1618,12 @@ crypto-browserify@^3.11.0:
randombytes "^2.0.0" randombytes "^2.0.0"
randomfill "^1.0.3" randomfill "^1.0.3"
css-line-break@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/css-line-break/-/css-line-break-1.1.1.tgz#d5e9bdd297840099eb0503c7310fd34927a026ef"
dependencies:
base64-arraybuffer "^0.2.0"
css-parse@1.7.x: css-parse@1.7.x:
version "1.7.0" version "1.7.0"
resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b" resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b"
...@@ -2706,6 +2723,12 @@ html-entities@^1.2.0: ...@@ -2706,6 +2723,12 @@ html-entities@^1.2.0:
version "1.2.1" version "1.2.1"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f"
html2canvas@^1.0.0-rc.5:
version "1.0.0-rc.5"
resolved "https://registry.yarnpkg.com/html2canvas/-/html2canvas-1.0.0-rc.5.tgz#4ee3cac9f6e20a0fa0c2f35a6f99c960ae7ec4c1"
dependencies:
css-line-break "1.1.1"
http-cache-semantics@^3.8.1: http-cache-semantics@^3.8.1:
version "3.8.1" version "3.8.1"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2"
......
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