Fix:5778 【商城小程序】【商户入驻-入驻申请须知】香道滇小程序展示的“入驻申请须知”段落格式,与香道滇后台管理系统中配置的内容格式不一致

This commit is contained in:
linxi
2026-08-17 16:18:47 +08:00
parent f20e73e859
commit f4539ccf4a
7 changed files with 79 additions and 10 deletions
+9
View File
@@ -9,6 +9,15 @@ import stringify from "@/utils/querystring";
import {VUE_APP_API_URL} from "@/config";
import {auth} from '@/libs/wechat'
// 富文本内容预处理:
// 纯文本内容(不含HTML标签)中的换行符\n在rich-text中会被折叠为空格,需转为<br/>以保留换行格式
export function formatRichText(content) {
if (!content) return ''
// 含HTML标签的富文本内容不做处理,避免破坏原有结构
if (/<[a-zA-Z][^>]*>/.test(content)) return content
return content.replace(/\r\n/g, '\n').replace(/\n/g, '<br/>')
}
export function dataFormat(time, option) {
time = +time * 1000;
const d = new Date(time);