Commit 9df82257 by 李伟康

commit 提交

1 parent c357829e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="wn-canvas"> <view class="wn-canvas">
<zoom-pan <zoom-pan
:class="['canvas-box',{fill:custom}]" :class="['canvas-box',{fill:custom}]"
:disabled="drawStatus" :disabled="drawStatus || !scaleSwitch"
:scale-max="5" :scale-max="5"
:scale-min="1" :scale-min="1"
@scale="scale" @scale="scale"
...@@ -169,6 +169,10 @@ export default { ...@@ -169,6 +169,10 @@ export default {
default: 'drawCanvas' default: 'drawCanvas'
}, },
custom: Boolean, //自定义 custom: Boolean, //自定义
scaleSwitch:{
type: Boolean,
default: true
}
}, },
computed: { computed: {
watchStatus () { watchStatus () {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
:drawStatus="penSwitch" :drawStatus="penSwitch"
custom custom
@scale="$emit('scale',$event)" @scale="$emit('scale',$event)"
:scaleSwitch="false"
> >
<template slot="customContent"> <template slot="customContent">
<view class="title"> <view class="title">
......
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
color: #292d33; color: #292d33;
line-height: 48rpx; line-height: 48rpx;
overflow-y: auto; overflow-y: auto;
word-break: break-all;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
e.checked = true e.checked = true
e.main = e.itemName == '交强险' ? '交强险' : '商业险' e.main = e.itemName == '交强险' ? '交强险' : '商业险'
e.show = false e.show = false
e.itemDesc = this.processHtmlString(e.itemDesc) e.itemDesc = e.itemDesc ? this.processHtmlString(e.itemDesc) : ''
}) })
if (!storageInsuranceList) { if (!storageInsuranceList) {
uni.showLoading({ uni.showLoading({
...@@ -246,11 +246,17 @@ export default { ...@@ -246,11 +246,17 @@ export default {
this.flag = true this.flag = true
}, },
processHtmlString (htmlString) { processHtmlString (htmlString) {
const regexStyle = /style="[^"]*"/g // 移除 `<br>` 及其变体,并用 `<div></div>` 替换
const regexBr = /<\/br>|<br>|<br\/>|\n/g let processedString = htmlString.replace(/<\/?br\s*\/?>|\n/g, '<div></div>')
let processedString = htmlString.replace(regexBr, '<div></div>') // 移除 `style` 属性
let newHtmlString = processedString.replace(regexStyle, '') processedString = processedString.replace(/style="[^"]*"/g, '');
return newHtmlString // 移除 `<strong>`, `</strong>`, `<em>`, `</em>` 和孤立的 `<` 标签
processedString = processedString.replace(/<strong>|<\/strong>|<em>|<\/em>|<>/g, '');
// 替换非 `div` 和非 `span` 的 HTML 标签
processedString = processedString.replace(/<(?!div|span)[^>]*>/g, '<div>');
processedString = processedString.replace(/<\/(?!div|span)>/g, '</div>');
return processedString
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!