部分逻辑修正
This commit is contained in:
+3
-2
@@ -51,7 +51,8 @@ export default function request({
|
||||
suppressErrors,
|
||||
toastErrors,
|
||||
header = {},
|
||||
timeout = 6000
|
||||
timeout = 6000,
|
||||
baseUrl = ''
|
||||
}) {
|
||||
const base_url = get_base_url(url);
|
||||
|
||||
@@ -67,7 +68,7 @@ export default function request({
|
||||
let that = this
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `${base_url}${url}`,
|
||||
url: `${baseUrl || base_url}${url}`,
|
||||
data: data,
|
||||
method: method,
|
||||
header: headers_base,
|
||||
|
||||
@@ -94,3 +94,52 @@ export const waitMakeEvaluateApi = (data) => {
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
// /trastudy/intgask/askAbout
|
||||
// 流式获取文本
|
||||
export const getAskAboutRawApi = (data) => {
|
||||
// return request({
|
||||
// baseUrl:'http://25.18.122.76:3030',
|
||||
// url: '/api/v1/prediction/a402cf58-9f64-479b-a9f8-c527300a7905',
|
||||
// isStream: true,
|
||||
// header: {
|
||||
// 'Accept':'text/event-stream',
|
||||
// 'content-type': 'application/json; charset=UTF-8',
|
||||
// 'Authorization': 'Bearer PjadGPFSHDg6F8ZRekROe-QxS2fPXlWRsmvP5Mp0vxA'
|
||||
// },
|
||||
// method: 'post',
|
||||
// toastErrors: false,
|
||||
// data
|
||||
// });
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: base_url + '/intgask/askAbout',
|
||||
header: {
|
||||
'Accept':'text/event-stream',
|
||||
'content-type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
method: 'get',
|
||||
isStream: true,
|
||||
timeout: 30000,
|
||||
toastErrors: false,
|
||||
data
|
||||
}).then(res=>{
|
||||
console.log(res.data)
|
||||
let _str = `[${ res.data.split('}{').join('},{')}]`
|
||||
console.log(JSON.parse(_str))
|
||||
|
||||
})
|
||||
});
|
||||
// return request({
|
||||
// url: base_url + '/intgask/askAbout',
|
||||
// header: {
|
||||
// 'Accept':'text/event-stream',
|
||||
// 'content-type': 'application/json; charset=UTF-8',
|
||||
// },
|
||||
// method: 'get',
|
||||
// isStream: true,
|
||||
// timeout: 30000,
|
||||
// toastErrors: false,
|
||||
// data
|
||||
// });
|
||||
};
|
||||
@@ -131,11 +131,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { watch, unref, ref, toRefs, computed, nextTick } from 'vue'
|
||||
import { watch, unref, ref, toRefs, computed, nextTick,onMounted } from 'vue'
|
||||
import ImagePreview from '@/components/image-preview/image-preview.vue'
|
||||
import VideoPreview from '@/components/image-preview/video-preview.vue'
|
||||
import { downloadVoiceFile, uploadVoiceFile, } from "@/api/common.js"
|
||||
import { studyParagraphOverApi } from "@/api/study.js"
|
||||
import { studyParagraphOverApi, getAskAboutRawApi } from "@/api/study.js"
|
||||
import ChartFour from "./chartFour.vue"
|
||||
import ChartThree from "./chartThree.vue"
|
||||
import common from '@/common/common';
|
||||
@@ -169,7 +169,11 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
voiceRate: {
|
||||
default: '1.0',
|
||||
type:[Number,String],
|
||||
}
|
||||
},
|
||||
isTransform:{
|
||||
default: false,
|
||||
type: Boolean
|
||||
},
|
||||
})
|
||||
const { type, dataInfo, activeVoiceId, isPlaying, isLast} = toRefs(props)
|
||||
const emit = defineEmits(['changePlay', 'nextQuestion', 'withdraw', 'finishQuestion'])
|
||||
@@ -194,6 +198,23 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
immediate: true
|
||||
})
|
||||
|
||||
const transformContent = ref('')
|
||||
const showContent = computed(() => {
|
||||
return props.isTransform
|
||||
? transformContent.value
|
||||
: unref(dataInfo)?.pgrphContent || unref(dataInfo)?.qnsContent || unref(dataInfo)?.talkingContent || ''
|
||||
})
|
||||
|
||||
onMounted(()=>{
|
||||
// getAskAboutRawApi({
|
||||
// question: unref(dataInfo)?.pgrphContent,
|
||||
// streaming: true
|
||||
// }).then(res=>{
|
||||
// console.log(res)
|
||||
// })
|
||||
if(props.isTransform){}
|
||||
})
|
||||
|
||||
talkVoiceObj.value.onEnded(()=>{
|
||||
emit('changePlay', '')
|
||||
talkVoiceObj.value.src = ''
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<view class="course-study-body" v-show="step === 1">
|
||||
<view class="seek-setting" @click="showSeekModel = true">
|
||||
{{chooseRate}}倍
|
||||
<img src="@/static/images/course/setting.png" alt="">
|
||||
<image src="@/static/images/course/setting.png" alt=""/>
|
||||
</view>
|
||||
<view class="body-title">
|
||||
<uv-icon class="arrow-icon" name="arrow-left" @click="common.navigateBack()"/>
|
||||
|
||||
Reference in New Issue
Block a user