postdischarge-applet/pages/Medicalknowledge/Medicalknowledge.vue
zhuangyuanke daf9159fca 1
2024-11-01 13:36:21 +08:00

110 lines
2.0 KiB
Vue

<template>
<view class="app">
<view class="title">
{{infoTitle}}
</view>
<u-parse :html="item.infoContent"></u-parse>
</view>
</template>
<script>
import {
getInfoById
} from '@/api/Medicalknowledge/Medicalknowledge.js'
export default {
data() {
return {
item: '',
infoContent:'',
infoTitle:'',
};
},
onLoad(options) { //获取传值
this.item = JSON.parse(decodeURIComponent(options.item))
getInfoById(this.item.id).then(res=>{
this.infoContent = res.data.infoContent.replace(/\<img/gi,
"<br/> <img class='richPic'")
this.infoContent = res.data.infoContent.replace(/\<p/gi,
"<p class='ptext'")
console.log(this.infoContent)
this.infoTitle=res.data.infoTitle
})
},
onReady() {}, //更改导航栏文字
//1.分享给朋友
onShareAppMessage(res) {
let pages = getCurrentPages();
let url = pages[pages.length - 1].$page.fullPath
return {
title: '泉医到家',
path: url,
}
},
//2.分享到朋友圈
onShareTimeline(res) {
let pages = getCurrentPages();
let url = pages[pages.length - 1].$page.fullPath
return {
title: '泉医到家',
path: url,
}
},
}
</script>
<style lang="scss">
/deep/ .ptext {
margin-top: 20rpx;
}
/deep/ .interlayer{
text{
display: block;
margin-top: 20rpx;
text-indent: 2em;
font-size: 36rpx;
margin-bottom: 20rpx;
}
}
/deep/ .ptext:nth-child(1) {
text-indent: 2em;
display: block;
}
/deep/ .ql-size-small {
font-size: 20rpx;
}
/deep/ .ql-size-large {
font-size: 36rpx;
}
/deep/ .ql-size-huge {
font-size: 46rpx;
}
.title {
padding: 0 3%;
font-size: 38rpx;
font-weight: bold;
white-space: normal;
word-break: break-all;
margin-bottom: 20rpx;
margin-top: 20rpx;
text-align: justify;
}
.text {
width: 96%;
margin: 0 auto;
background-color: #fff;
padding: 20rpx;
border-radius: 10rpx;
}
/deep/ .richPic {
width: 100% !important;
height: 100% !important;
}
</style>