fix;问答页面处理
This commit is contained in:
@@ -1,13 +1,35 @@
|
||||
<template>
|
||||
<view class="answer-content" v-if="props.isLoading">
|
||||
<view class="talking-cont">
|
||||
<CommonLoading color="#06f"/>
|
||||
<CommonLoading color="#06f" />
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="answer-content" v-else>
|
||||
<view class="talking-link">
|
||||
<view :class="['link-cont', activeNames.indexOf(1) >= 0 ? 'is-active' : '']" @click="changeActive(1)">
|
||||
<view class="link-info">
|
||||
<view class="info-text">
|
||||
引用知识库{{3}}篇相关资料
|
||||
</view>
|
||||
</view>
|
||||
<view class="link-items">
|
||||
<view class="link-item" v-for="(item, index) in 3">{{index+1}}. {{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :class="['link-cont', activeNames.indexOf(2) >= 0 ? 'is-active' : '']">
|
||||
<view class="link-info" @click="changeActive(2)">
|
||||
<view class="info-text">
|
||||
发现{{3}}个关联课程
|
||||
</view>
|
||||
</view>
|
||||
<view class="link-items">
|
||||
<view class="link-item" v-for="(item, index) in 5">{{index+1}}. {{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="talking-cont">
|
||||
<MarkdownPreview :mdString="mdText"/>
|
||||
<MarkdownPreview :mdString="mdText" />
|
||||
</view>
|
||||
<view class="btns-cont" v-if="!props.isAnswering">
|
||||
<view class="replay-btn" @click="reAnswer">
|
||||
@@ -17,70 +39,73 @@
|
||||
<image class="icon" src="@/static/images/dialog/answer-stop1.png" style="width: 100%;height: 100%;"></image>
|
||||
</view> -->
|
||||
<view class="replay-btn" @click="zanAnswer">
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/images/dialog/answer-zan1.png"
|
||||
style="width: 100%;height: 100%;"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/images/dialog/answer-yizan1.png"
|
||||
style="width: 100%;height: 100%;"
|
||||
></image>
|
||||
<image class="icon" src="@/static/images/dialog/answer-zan1.png" style="width: 100%;height: 100%;"></image>
|
||||
<image class="icon" src="@/static/images/dialog/answer-yizan1.png" style="width: 100%;height: 100%;"></image>
|
||||
</view>
|
||||
<view class="play-btn">
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/images/dialog/answer-fankui1.png"
|
||||
style="width: 100%;height: 100%;"
|
||||
></image>
|
||||
<image
|
||||
class="icon"
|
||||
src="@/static/images/dialog/answer-yifankui1.png"
|
||||
style="width: 100%;height: 100%;"
|
||||
></image>
|
||||
<image class="icon" src="@/static/images/dialog/answer-fankui1.png" style="width: 100%;height: 100%;"></image>
|
||||
<image class="icon" src="@/static/images/dialog/answer-yifankui1.png" style="width: 100%;height: 100%;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, computed, ref, watch } from 'vue'
|
||||
import {
|
||||
onMounted,
|
||||
computed,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue'
|
||||
import MarkdownPreview from '@/components/markdown-preview/markdown-preview.vue';
|
||||
|
||||
|
||||
const emit = defineEmits(['handleEvents'])
|
||||
const props = defineProps({
|
||||
const props = defineProps({
|
||||
dataInfo: {
|
||||
default: () => ({}),
|
||||
type: Object
|
||||
},
|
||||
isLoading:{
|
||||
isLoading: {
|
||||
default: false,
|
||||
type:Boolean
|
||||
type: Boolean
|
||||
},
|
||||
isAnswering: {
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => props.dataInfo, () => {},{deep: true,immediate: true})
|
||||
watch(() => props.isLoading, () => {},{deep: true,immediate: true})
|
||||
|
||||
watch(() => props.dataInfo, () => {}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
watch(() => props.isLoading, () => {}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
const mdText = computed(() => props.dataInfo?.talkingText)
|
||||
|
||||
const activeNames = ref([1, 2])
|
||||
|
||||
const changeActive = (val) => {
|
||||
if (activeNames.value.indexOf(val) >= 0) {
|
||||
activeNames.value = activeNames.value.filter(t => t !== val)
|
||||
} else {
|
||||
activeNames.value.push(val)
|
||||
}
|
||||
}
|
||||
const reAnswer = () => {
|
||||
emit('handleEvents', 'reAnswer')
|
||||
}
|
||||
const stopAnswer = () => {
|
||||
emit('handleEvents', 'stop')
|
||||
}
|
||||
const zanAnswer = () => {
|
||||
const zanAnswer = () => {
|
||||
emit('handleEvents', 'great')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.answer-content{
|
||||
.answer-content {
|
||||
background-color: #f5f5f5;
|
||||
padding: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
@@ -90,14 +115,17 @@
|
||||
float: left;
|
||||
width: 100%;
|
||||
min-height: 80rpx;
|
||||
.talking-cont{
|
||||
|
||||
.talking-cont {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.btns-cont{
|
||||
|
||||
.btns-cont {
|
||||
overflow: hidden;
|
||||
border-top: 3rpx solid #eee;
|
||||
padding-bottom: 10rpx;
|
||||
.replay-btn{
|
||||
|
||||
.replay-btn {
|
||||
float: left;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
@@ -105,7 +133,8 @@
|
||||
margin-right: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.play-btn{
|
||||
|
||||
.play-btn {
|
||||
float: left;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
@@ -113,7 +142,8 @@
|
||||
margin-right: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.next-learn-btn{
|
||||
|
||||
.next-learn-btn {
|
||||
float: left;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
@@ -125,14 +155,17 @@
|
||||
margin-top: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
position: relative;
|
||||
&.replay-study-btn{
|
||||
|
||||
&.replay-study-btn {
|
||||
float: right;
|
||||
}
|
||||
&.restart{
|
||||
|
||||
&.restart {
|
||||
background-color: #eaf2ff;
|
||||
color: #06f;
|
||||
}
|
||||
.icon-iamge{
|
||||
|
||||
.icon-iamge {
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
@@ -141,7 +174,8 @@
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
.replay-learn-btn{
|
||||
|
||||
.replay-learn-btn {
|
||||
float: left;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
@@ -153,7 +187,8 @@
|
||||
margin-top: 16rpx;
|
||||
margin-right: 16rpx;
|
||||
position: relative;
|
||||
.icon-iamge{
|
||||
|
||||
.icon-iamge {
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
@@ -162,7 +197,8 @@
|
||||
margin-top: -12rpx;
|
||||
}
|
||||
}
|
||||
.next-btn{
|
||||
|
||||
.next-btn {
|
||||
float: right;
|
||||
padding: 0 60rpx 0 20rpx;
|
||||
height: 62rpx;
|
||||
@@ -173,7 +209,8 @@
|
||||
border-radius: 8rpx;
|
||||
margin-top: 16rpx;
|
||||
position: relative;
|
||||
.icon-iamge{
|
||||
|
||||
.icon-iamge {
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
position: absolute;
|
||||
@@ -183,6 +220,59 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.link-cont {
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.link-info {
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
overflow: hidden;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.info-text {
|
||||
float: left;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
&::after {
|
||||
transition: all 0.3s ease-in-out;
|
||||
content: '';
|
||||
display: block;
|
||||
float: left;
|
||||
position: relative;
|
||||
top: 12rpx;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
border-right: 4rpx solid #333;
|
||||
border-bottom: 4rpx solid #333;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
.link-info {
|
||||
&::after {
|
||||
top: 18rpx;
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
}
|
||||
|
||||
.link-items {
|
||||
max-height: 500rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.link-items {
|
||||
max-height: 0rpx;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease-in-out;
|
||||
|
||||
.link-item {
|
||||
line-height: 48rpx;
|
||||
color: #06f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -10,7 +10,7 @@
|
||||
<!-- <uv-icon class="arrow-icon" name="arrow-left" @click="common.navigateBack()"/> -->
|
||||
AI问答
|
||||
<view class="seek-setting">
|
||||
<image src="@/static/images/dialog/new-dialog.png" alt="" class="image-icon-new"></image>
|
||||
<image src="@/static/images/dialog/new-dialog.png" alt="" class="image-icon-new" @click="createNewDialog"></image>
|
||||
<image src="@/static/images/dialog/history.png" alt="" class="image-icon"></image>
|
||||
</view>
|
||||
</view>
|
||||
@@ -177,6 +177,11 @@
|
||||
const answerIsOver = ref(true)
|
||||
const talkingList = ref([])
|
||||
|
||||
|
||||
const createNewDialog = () => {
|
||||
common.redirectTo(`/pages/index/dialog`)
|
||||
// talkingList.value = []
|
||||
}
|
||||
const showModelComfirm = ref(false)
|
||||
const reconcatNum = ref(1)
|
||||
const initsocketTask = () => {
|
||||
|
||||
Reference in New Issue
Block a user