parent
9f468ffd0f
commit
fab6e0aa3d
23 changed files with 589 additions and 263 deletions
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 50 KiB |
@ -0,0 +1,110 @@ |
||||
<template> |
||||
<view class="wrap"> |
||||
<view class="title">{{ form.title }}</view> |
||||
|
||||
<view class="text">{{ form.applicableMajor }}</view> |
||||
<view class="text">{{ form.schemeIntroduction }}</view> |
||||
<view class="text">{{ form.product }}</view> |
||||
<template v-if="form.fileName"> |
||||
<view class="file">{{ form.fileName }}</view> |
||||
<view class="detail" @click.stop="download">下载</view> |
||||
</template> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { schemeFindById } from '@/apis/modules/article.js' |
||||
export default { |
||||
data() { |
||||
return { |
||||
id: '', |
||||
form: { |
||||
totalBrowsing: '' |
||||
} |
||||
} |
||||
}, |
||||
onShow() { |
||||
const pages = getCurrentPages() |
||||
const { options } = pages[pages.length - 1] |
||||
this.id = options.id |
||||
this.getInfo() |
||||
}, |
||||
methods: { |
||||
// 获取详情 |
||||
getInfo() { |
||||
uni.showLoading({ |
||||
title: '加载中' |
||||
}) |
||||
schemeFindById(this.id).then(({ data }) => { |
||||
this.form = data |
||||
uni.hideLoading() |
||||
}).catch(e => { |
||||
uni.hideLoading() |
||||
}) |
||||
}, |
||||
// 下载方案文件 |
||||
download() { |
||||
this.$util.to(`../send/send?url=${this.form.schemeFile}`) |
||||
// uni.showLoading({ |
||||
// title: '加载中', |
||||
// mask: true |
||||
// }) |
||||
// const url = this.form.schemeFile |
||||
// const that = this |
||||
// // 下载文件资源到本地 |
||||
// uni.downloadFile({ |
||||
// url, |
||||
// success: function(res) { |
||||
// console.log(444, res) |
||||
// uni.saveFile({ |
||||
// tempFilePath: res.tempFilePath, |
||||
// success: function(res) { |
||||
// console.log(555, res) |
||||
// // 新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。 |
||||
// that.$util.isDoc(url.substring(url.lastIndexOf('.') +1)) && uni.openDocument({ |
||||
// filePath: res.savedFilePath, |
||||
// showMenu: true, // 允许出现分享功能 |
||||
// success: res => { |
||||
// uni.hideLoading() |
||||
// }, |
||||
// fail: openError => { |
||||
// uni.hideLoading() |
||||
// } |
||||
// }) |
||||
// } |
||||
// }) |
||||
// }, |
||||
// fail: function(err) { |
||||
// uni.hideLoading() |
||||
// } |
||||
// }) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.wrap { |
||||
padding: 30rpx; |
||||
background-color: #fff; |
||||
} |
||||
.title { |
||||
font-size: 34rpx; |
||||
font-weight: 600; |
||||
color: #333; |
||||
} |
||||
.text { |
||||
margin: 20rpx 0; |
||||
font-size: 28rpx; |
||||
line-height: 1.6; |
||||
} |
||||
.file { |
||||
margin: 20rpx 0; |
||||
font-size: 26rpx; |
||||
word-break: break-all; |
||||
} |
||||
.detail { |
||||
font-size: 30rpx; |
||||
color: #1f83ff; |
||||
} |
||||
</style> |
Loading…
Reference in new issue