9f5f5094 by joe

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

1 parent db98d45f
...@@ -63,6 +63,8 @@ module.exports = { ...@@ -63,6 +63,8 @@ module.exports = {
63 policyReceipt: "/pingan_hklife_webapi/policy/policyReceipt", 63 policyReceipt: "/pingan_hklife_webapi/policy/policyReceipt",
64 // 获取电子保单下载code 64 // 获取电子保单下载code
65 getDownloadPath: "/pingan_hklife_webapi/policy/getDownloadPath", 65 getDownloadPath: "/pingan_hklife_webapi/policy/getDownloadPath",
66 // 获取OBS文件下載code
67 getObsDownloadPath: "/pingan_hklife_webapi/policy/getObsDownloadPath",
66 // 下载电子保单 68 // 下载电子保单
67 downloadPolicy: "/pingan_hklife_webapi/policy/d", 69 downloadPolicy: "/pingan_hklife_webapi/policy/d",
68 // 上传电子文档 70 // 上传电子文档
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
6 import api from '@/api/api' 6 import api from '@/api/api'
7 import { 7 import {
8 httpGet, 8 httpGet,
9 httpPost 9 httpPost,
10 requestDomain
10 } from '@/api/fetch-api.js' 11 } from '@/api/fetch-api.js'
11 import { 12 import {
12 mapGetters, 13 mapGetters,
...@@ -184,6 +185,24 @@ export default { ...@@ -184,6 +185,24 @@ export default {
184 this.bottomBtnLink = targetData.bottomUrlLink; 185 this.bottomBtnLink = targetData.bottomUrlLink;
185 } 186 }
186 }, 187 },
188 downloadFile(key) {
189 let sourceData = this.sourceData;
190
191 if (sourceData.exts && sourceData.exts.iobsKey && sourceData.exts.iobsKey[key]) {
192 let iobsKey = sourceData.exts.iobsKey[key];
193 httpPost({
194 url: api.getObsDownloadPath,
195 data: { key: iobsKey }
196 }).then(res => {
197 if (res) {
198 let url = requestDomain() + api.downloadPolicy + "/" + res;
199 window.open(url);
200 } else {
201 this.showDownloadError = true;
202 }
203 });
204 }
205 },
187 initActivity() { 206 initActivity() {
188 let d = localStorage.getItem("voluntaryInfo"); 207 let d = localStorage.getItem("voluntaryInfo");
189 if (d) { 208 if (d) {
......
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
190 <!-- 下载 --> 190 <!-- 下载 -->
191 <div class="download"> 191 <div class="download">
192 <div class="border2 download-item"> 192 <div class="border2 download-item">
193 <div class="cont"> 193 <div class="cont" @click="downloadFile('k1')">
194 <div class="icon-wrap"> 194 <div class="icon-wrap">
195 <img class="icon" src="@/assets/images/vhis/vhis-download.png" /> 195 <img class="icon" src="@/assets/images/vhis/vhis-download.png" />
196 </div> 196 </div>
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
198 </div> 198 </div>
199 </div> 199 </div>
200 <div class="border2 download-item"> 200 <div class="border2 download-item">
201 <div class="cont"> 201 <div class="cont" @click="downloadFile('k2')">
202 <div class="icon-wrap"> 202 <div class="icon-wrap">
203 <img class="icon" src="@/assets/images/vhis/vhis-download.png" /> 203 <img class="icon" src="@/assets/images/vhis/vhis-download.png" />
204 </div> 204 </div>
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
6 import api from '@/api/api' 6 import api from '@/api/api'
7 import { 7 import {
8 httpGet, 8 httpGet,
9 httpPost 9 httpPost,
10 requestDomain
10 } from '@/api/fetch-api.js' 11 } from '@/api/fetch-api.js'
11 import { 12 import {
12 mapGetters, 13 mapGetters,
...@@ -184,6 +185,24 @@ export default { ...@@ -184,6 +185,24 @@ export default {
184 this.bottomBtnLink = targetData.bottomUrlLink; 185 this.bottomBtnLink = targetData.bottomUrlLink;
185 } 186 }
186 }, 187 },
188 downloadFile(key) {
189 let sourceData = this.sourceData;
190
191 if (sourceData.exts && sourceData.exts.iobsKey && sourceData.exts.iobsKey[key]) {
192 let iobsKey = sourceData.exts.iobsKey[key];
193 httpPost({
194 url: api.getObsDownloadPath,
195 data: { key: iobsKey }
196 }).then(res => {
197 if (res) {
198 let url = requestDomain() + api.downloadPolicy + "/" + res;
199 window.open(url);
200 } else {
201 this.showDownloadError = true;
202 }
203 });
204 }
205 },
187 initActivity() { 206 initActivity() {
188 let d = localStorage.getItem("voluntaryInfo"); 207 let d = localStorage.getItem("voluntaryInfo");
189 if (d) { 208 if (d) {
......
...@@ -363,17 +363,17 @@ ...@@ -363,17 +363,17 @@
363 <!-- 下载 --> 363 <!-- 下载 -->
364 <div class="download"> 364 <div class="download">
365 <div class="border2 download-item"> 365 <div class="border2 download-item">
366 <div class="cont"> 366 <div class="cont" @click="downloadFile('k1')">
367 <div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t1')}} 367 <div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t1')}}
368 </div> 368 </div>
369 </div> 369 </div>
370 <div class="border2 download-item"> 370 <div class="border2 download-item">
371 <div class="cont"> 371 <div class="cont" @click="downloadFile('k2')">
372 <div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t2')}} 372 <div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t2')}}
373 </div> 373 </div>
374 </div> 374 </div>
375 <div class="border2 download-item"> 375 <div class="border2 download-item">
376 <div class="cont"> 376 <div class="cont" @click="downloadFile('k3')">
377 <div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t3')}} 377 <div class="icon-wrap"><img class="icon" src="@/assets/images/vhis/vhis-download.png"></div> {{$t('vhisDetail.download.t3')}}
378 </div> 378 </div>
379 </div> 379 </div>
......