9f5f5094 by joe

產品頁下載電子檔信息通過cms管理

1 parent db98d45f
......@@ -63,6 +63,8 @@ module.exports = {
policyReceipt: "/pingan_hklife_webapi/policy/policyReceipt",
// 获取电子保单下载code
getDownloadPath: "/pingan_hklife_webapi/policy/getDownloadPath",
// 获取OBS文件下載code
getObsDownloadPath: "/pingan_hklife_webapi/policy/getObsDownloadPath",
// 下载电子保单
downloadPolicy: "/pingan_hklife_webapi/policy/d",
// 上传电子文档
......
......@@ -6,7 +6,8 @@
import api from '@/api/api'
import {
httpGet,
httpPost
httpPost,
requestDomain
} from '@/api/fetch-api.js'
import {
mapGetters,
......@@ -184,6 +185,24 @@ export default {
this.bottomBtnLink = targetData.bottomUrlLink;
}
},
downloadFile(key) {
let sourceData = this.sourceData;
if (sourceData.exts && sourceData.exts.iobsKey && sourceData.exts.iobsKey[key]) {
let iobsKey = sourceData.exts.iobsKey[key];
httpPost({
url: api.getObsDownloadPath,
data: { key: iobsKey }
}).then(res => {
if (res) {
let url = requestDomain() + api.downloadPolicy + "/" + res;
window.open(url);
} else {
this.showDownloadError = true;
}
});
}
},
initActivity() {
let d = localStorage.getItem("voluntaryInfo");
if (d) {
......
......@@ -190,7 +190,7 @@
<!-- 下载 -->
<div class="download">
<div class="border2 download-item">
<div class="cont">
<div class="cont" @click="downloadFile('k1')">
<div class="icon-wrap">
<img class="icon" src="@/assets/images/vhis/vhis-download.png" />
</div>
......@@ -198,7 +198,7 @@
</div>
</div>
<div class="border2 download-item">
<div class="cont">
<div class="cont" @click="downloadFile('k2')">
<div class="icon-wrap">
<img class="icon" src="@/assets/images/vhis/vhis-download.png" />
</div>
......
......@@ -6,7 +6,8 @@
import api from '@/api/api'
import {
httpGet,
httpPost
httpPost,
requestDomain
} from '@/api/fetch-api.js'
import {
mapGetters,
......@@ -184,6 +185,24 @@ export default {
this.bottomBtnLink = targetData.bottomUrlLink;
}
},
downloadFile(key) {
let sourceData = this.sourceData;
if (sourceData.exts && sourceData.exts.iobsKey && sourceData.exts.iobsKey[key]) {
let iobsKey = sourceData.exts.iobsKey[key];
httpPost({
url: api.getObsDownloadPath,
data: { key: iobsKey }
}).then(res => {
if (res) {
let url = requestDomain() + api.downloadPolicy + "/" + res;
window.open(url);
} else {
this.showDownloadError = true;
}
});
}
},
initActivity() {
let d = localStorage.getItem("voluntaryInfo");
if (d) {
......
......@@ -363,17 +363,17 @@
<!-- 下载 -->
<div class="download">
<div class="border2 download-item">
<div class="cont">
<div class="cont" @click="downloadFile('k1')">
<div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t1')}}
</div>
</div>
<div class="border2 download-item">
<div class="cont">
<div class="cont" @click="downloadFile('k2')">
<div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t2')}}
</div>
</div>
<div class="border2 download-item">
<div class="cont">
<div class="cont" @click="downloadFile('k3')">
<div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t3')}}
</div>
</div>
......