|
|
|
@ -23,17 +23,36 @@ |
|
|
|
<a style="cursor: pointer;color: blue;" @click="previewFile(arrayInfo.url)">素材文件</a> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="con_style" v-html="arrayInfo.content"></view> |
|
|
|
<!-- <view class="con_style" v-html="arrayInfo.content"></view> --> |
|
|
|
<jyf-parser class="con_style" :html="arrayInfo.content" :tag-style="tagStyle"></jyf-parser> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import apiRoute from '@/api/apiRoute.js'; |
|
|
|
import jyfParser from '@/components/jyf-parser/jyf-parser.vue'; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
jyfParser |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
articleId: undefined, |
|
|
|
arrayInfo: [], |
|
|
|
tagStyle: { |
|
|
|
// 设置富文本样式 |
|
|
|
p: 'margin:0;padding:0;color:#333333;', |
|
|
|
span: 'color:#333333;', |
|
|
|
h1: 'color:#333333;', |
|
|
|
h2: 'color:#333333;', |
|
|
|
h3: 'color:#333333;', |
|
|
|
h4: 'color:#333333;', |
|
|
|
h5: 'color:#333333;', |
|
|
|
h6: 'color:#333333;', |
|
|
|
li: 'color:#333333;', |
|
|
|
div: 'color:#333333;' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
@ -70,10 +89,10 @@ |
|
|
|
const { |
|
|
|
tempFilePath |
|
|
|
} = await this.downloadFile(url); |
|
|
|
|
|
|
|
console.log($util.img(tempFilePath)) |
|
|
|
// 2. 打开文件 |
|
|
|
await uni.openDocument({ |
|
|
|
filePath: tempFilePath, |
|
|
|
filePath: $util.img(tempFilePath), |
|
|
|
showMenu: true, |
|
|
|
success: () => { |
|
|
|
console.log('打开文档成功'); |
|
|
|
|