This commit is contained in:
杨航
2025-12-02 11:13:14 +08:00
parent 04711aa242
commit da5d4435c2
5 changed files with 37 additions and 5 deletions
@@ -1,11 +1,12 @@
<template>
<view>
<rich-text :nodes="contentHtml"></rich-text>
<rich-text :nodes="mdText"></rich-text>
</view>
</template>
<script>
import MarkdownIt from 'markdown-it';
import DOMPurify from 'dompurify'
export default {
name:"markdown-preview",
props: {
@@ -29,6 +30,12 @@
immediate: true
}
},
computed:{
mdText(){
let _endtext = DOMPurify.sanitize(this.contentHtml)
return _endtext
}
},
methods:{
parseContent(text){
if(this.mdObj){
+4 -1
View File
@@ -7,6 +7,7 @@
<view class="answer-content" v-else>
<view class="talking-cont">
<MarkdownPreview :mdString="mdText" />
<!-- <text v-text="props.dataInfo?.talkingText|| ''"></text> -->
</view>
<view class="talking-link">
<view :class="['link-cont', activeNames.indexOf(1) >= 0 ? 'is-active' : '']" v-if="fileList.length > 0">
@@ -50,6 +51,7 @@
import { onMounted, computed, ref, watch } from 'vue'
import MarkdownPreview from '@/components/markdown-preview/markdown-preview.vue'
import common from '@/common/common'
import DOMPurify from 'dompurify'
const emit = defineEmits(['handleEvents'])
const props = defineProps({
@@ -89,7 +91,8 @@ watch(
)
const mdText = computed(() => {
let _text = (props.dataInfo?.talkingText|| '').replace(/\\n/g, `\n`);
return _text
let _endtext = _text // DOMPurify.sanitize(_text)
return _endtext
})
const fileList = computed(() => props.dataInfo?.talkingFiles || [])
const crsList = computed(() => props.dataInfo?.talkingCrsList || [])
+20
View File
@@ -180,6 +180,9 @@
appSearchCrsApi
} from '@/api/search.js'
import SparringItem from '@/pages/sparring/components/sparring-item.vue'
import {
checkTraPartnerInfoById
} from '@/api/sparring.js'
const fromType = ref('')
onLoad(params => {
@@ -351,6 +354,23 @@
common.navigateTo(item.path, item.params || {})
}
}
// 跳转 陪练详情
const toSparringDetail = item => {
if (item.traId) {
checkTraPartnerInfoById({
traId: item.traId
}).then(res => {
if (res.body.inRange) {
common.navigateTo('/pages/sparring/detail?traId=' + item.traId)
} else {
common.show('提示', res.body.message, false)
}
})
}
}
const pageInfo = ref({
page: 1,
limit: 3,