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
+2 -1
View File
@@ -4,7 +4,8 @@ ENV = 'development.yh'
# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.91:9786'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.32.154:9604'
# VITE_APP_BASE_H5_API_Url_TRAPRACTICE = 'http://25.64.32.156:9603'
+3 -2
View File
@@ -6,7 +6,7 @@
"dev:h5": "uni",
"dev:rd": "uni -p h5 --mode development.rd",
"dev:yh": "uni -p h5 --mode development.yh",
"dev:ty": "uni -p h5 --mode development.ty",
"dev:ty": "uni -p h5 --mode development.ty",
"dev:h5:sit": "uni -p h5 --mode sit",
"dev:h5:uat": "uni -p h5 --mode uat",
"dev:h5:production": "uni -p h5 --mode production",
@@ -15,7 +15,7 @@
"build:app-plus:sit": "uni build -p app-plus --mode sit",
"build:app-plus:uat": "uni build -p app-plus --mode uat",
"build:app-plus:prod": "uni build -p app-plus",
"build:h5:dev": "uni build -p h5 --mode development_h5",
"build:h5:dev": "uni build -p h5 --mode development_h5",
"build:h5": "uni build"
},
"dependencies": {
@@ -36,6 +36,7 @@
"@dcloudio/uni-mp-xhs": "3.0.0-4060620250520001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4060620250520001",
"crypto-js": "^3.1.9-1",
"dompurify": "^3.3.0",
"markdown-it": "^14.1.0",
"pinia": "^2.3.1",
"terser": "^5.42.0",
@@ -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,