提交 2b45c311 authored 作者: matian's avatar matian

文件下载修改

上级 c1925303
...@@ -2,9 +2,16 @@ ...@@ -2,9 +2,16 @@
<app-frame :data="frameParams" :class="isMobile ? 'is-h5' : 'is-pc'"> <app-frame :data="frameParams" :class="isMobile ? 'is-h5' : 'is-pc'">
<img class="img" src="https://webapp-pub.ezijing.com/project/marywood/data_banner.png" /> <img class="img" src="https://webapp-pub.ezijing.com/project/marywood/data_banner.png" />
<div class="dataList"> <div class="dataList">
<div class="item" v-for="(item, index) in fileList" :key="index" @click="download(item)"> <div class="item" @click="downIntroduce">
<img :src="item.icon" /> <img src="https://webapp-pub.ezijing.com/project/marywood/pdf.png" />
<p class="doc">{{ item.name }}</p> <p class="doc">招生简章.pdf</p>
<p class="p1">最新更新</p>
<p class="p2">下载</p>
</div>
<div class="item" @click="downQuestion">
<img src="https://webapp-pub.ezijing.com/project/marywood/pdf.png" />
<p class="doc">常见问题.pdf</p>
<p class="p1">最新更新</p> <p class="p1">最新更新</p>
<p class="p2">下载</p> <p class="p2">下载</p>
</div> </div>
...@@ -12,7 +19,7 @@ ...@@ -12,7 +19,7 @@
</app-frame> </app-frame>
</template> </template>
<script> <script>
// import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
import appFrame from '@/components/appFrame' import appFrame from '@/components/appFrame'
export default { export default {
...@@ -27,31 +34,7 @@ export default { ...@@ -27,31 +34,7 @@ export default {
path: '/dataDownload/dataDownload' path: '/dataDownload/dataDownload'
} }
] ]
}, }
fileList: [
{
name: '招生简章.pdf',
url: 'https://webapp-pub.ezijing.com/project/marywood/%E6%8B%9B%E7%94%9F%E7%AE%80%E7%AB%A0.pdf?v=2',
icon: 'https://webapp-pub.ezijing.com/project/marywood/pdf.png'
},
{
name: '常见问题.pdf',
url: 'https://webapp-pub.ezijing.com/project/marywood/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.pdf?v=3',
icon: 'https://webapp-pub.ezijing.com/project/marywood/pdf.png'
}
// {
// name: '申请材料清单.docx',
// url:
// 'https://webapp-pub.ezijing.com/project/marywood/%E7%94%B3%E8%AF%B7%E6%9D%90%E6%96%99%E6%B8%85%E5%8D%95.docx',
// icon: 'https://webapp-pub.ezijing.com/project/marywood/doc.png'
// },
// {
// name: '英文简历模板.doc',
// url:
// 'https://webapp-pub.ezijing.com/project/marywood/%E8%8B%B1%E6%96%87%E7%AE%80%E5%8E%86%E6%A8%A1%E6%9D%BF.doc',
// icon: 'https://webapp-pub.ezijing.com/project/marywood/doc.png'
// }
]
} }
}, },
computed: { computed: {
...@@ -60,11 +43,17 @@ export default { ...@@ -60,11 +43,17 @@ export default {
} }
}, },
methods: { methods: {
download(item) { downIntroduce() {
var FileSaver = require('file-saver') saveAs(
console.log(FileSaver.saveAs) 'https://webapp-pub.ezijing.com/project/marywood/%E6%8B%9B%E7%94%9F%E7%AE%80%E7%AB%A0.pdf?v=2',
var file = new File([item.url], item.name, { type: 'application/pdf;charset=utf-8' }) '招生简章.pdf'
FileSaver.saveAs(file) )
},
downQuestion() {
saveAs(
'https://webapp-pub.ezijing.com/project/marywood/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.pdf?v=3',
'常见问题.pdf'
)
} }
} }
} }
...@@ -92,7 +81,6 @@ export default { ...@@ -92,7 +81,6 @@ export default {
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
background: #f9f8f8; background: #f9f8f8;
cursor: pointer;
.doc { .doc {
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论