This commit is contained in:
yanghang
2025-07-11 11:08:51 +08:00
parent bd43a7d209
commit 10f2f2adff
5 changed files with 35 additions and 16 deletions
@@ -5,11 +5,18 @@
</template>
<script>
// import {Marked} from 'marked';
import MarkdownIt from 'markdown-it';
export default {
name:"markdown-preview",
props: {
mdString: {
default:`在客服交流中使用标准术语是提高专业形象和服务质量的重要手段。以下是一些常见的客服标准用语及其适用场景:
default:`## 我是二级标题
### 我是三级标题
| 我是表头 | 表头 2 |
| :----------- | :----------- |
|1|2|
在客服交流中使用标准术语是提高专业形象和服务质量的重要手段。以下是一些常见的客服标准用语及其适用场景:
1. **问候与介绍:**
- “您好,欢迎来到[公司名称],我是您的客服代表[姓名],很高兴为您服务。”
@@ -41,20 +48,34 @@
},
data() {
return {
contentHtml:''
contentHtml:'',
mdObj:null
};
},
watch:{
mdString: {
handler(val){
this.contentHtml = this.parseContent(val)
},
deep: true,
immediate: true
}
},
methods:{
parseContent(text){
if(this.mdObj){
return this.mdObj.render(text)
}else{
setTimeout(()=>{
return this.parseContent(text)
},500)
}
}
},
mounted(){
this.mdObj = new MarkdownIt()
this.contentHtml = this.parseContent(this.mdString)
console.log(this.contentHtml)
}
}
</script>
+1 -1
View File
@@ -335,7 +335,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
}
// readType 阅读内容类型pgrh段落/qns问题
emit('changePlay', unref(dataInfo)?.id)
if(talkVoiceObj.value.src === itemVoice.value) {
if(talkVoiceObj.value.src && talkVoiceObj.value.src === itemVoice.value) {
talkVoiceObj.value.play()
return
}
+3 -8
View File
@@ -167,16 +167,11 @@ import { onMounted, ref, computed } from 'vue'
}
// 点击生产线分类
const changePrdLine = (item)=>{
activePrdlineType.value = item.value
activePrdlineType.value = item.value === activePrdlineType.value ? '' : item.value
}
// 点击课程分类
const changeCourseType = (item)=>{
activeCourseType.value = item.value
setTimeout(()=>{
console.log(courseListTreeShow.value)
})
activeCourseType.value = item.value === activeCourseType.value ? '' : item.value
}
const showTypeName = computed(()=>{
return (activeTab.value === '全部' && activeCourseType.value === '') || (activeTab.value === '生产线' && activePrdlineType.value === '')
@@ -241,7 +236,7 @@ import { onMounted, ref, computed } from 'vue'
const changeTab = (item) => {
if(!item) return
activeTab.value = item.name
activeTag.value = ''
// activeTag.value = ''
activeCourseType.value = ''
activePrdlineType.value = ''
switch (item.name){
+5 -2
View File
@@ -1,8 +1,11 @@
<template>
<view>AI问答</view>
<view>
<MarkdownPreview/>
</view>
</template>
<script>
<script setup>
import MarkdownPreview from '@/components/markdown-preview/markdown-preview.vue';
</script>
<style>
+1 -1
View File
@@ -84,7 +84,7 @@
<image class="icon" src="@/static/images/index/navigation_course.png"></image>
<view class="title">课程中心</view>
</view>
<view class="item">
<view class="item" @click="common.navigateTo('/pages/index/dialog')">
<image class="icon" src="@/static/images/index/navigation_question_answering.png"></image>
<view class="title">AI问答</view>
</view>