NurseStationPersonAppletUl/pages/Healthitem/Healthitem.vue
2023-05-05 16:20:55 +08:00

94 lines
1.9 KiB
Vue

<template>
<view class="app">
<view class="title">
{{item.informationTitle}}
</view>
<u-parse :html="item.informationContent"></u-parse>
<!-- <view class="text" v-html="item.informationContent">
</view>-->
</view>
</template>
<script>
export default {
data() {
return {
item: '',
};
},
onLoad(options) { //获取传值
this.item = JSON.parse(decodeURIComponent(options.item))
this.item.informationContent = this.item.informationContent.replace(/\<img/gi,
"<br/> <img class='richPic'")
this.item.informationContent = this.item.informationContent.replace(/\<p/gi,
"<p class='ptext'")
// this.item.informationContent = this.item.informationContent.replace(/\<span/,
// "<span class='ql-size-small'")
// atch = match.replace(/class="ql-size-large"/gi, 'max-width:100%;')
},
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/ .ptext:nth-child(1) {
text-indent: 2em;
}
/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;
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>