样式调整

This commit is contained in:
yanghang
2025-07-07 14:49:53 +08:00
parent 3aa5e7ef55
commit 6d1965c231
4 changed files with 24 additions and 125 deletions
-12
View File
@@ -145,18 +145,6 @@ export const getAskAboutRawApi = (data) => {
toastErrors: false,
data
})
// 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
// });
};
+10 -86
View File
@@ -96,10 +96,12 @@
<CommonLoading color="#fff" v-show="voiceLoading || dataInfo.isLoading"/>
</view>
<view class="talking-cont" v-show="!dataInfo.isLoading">
<text :class="['talking-text', translateLoading?'loading':'']">
<CommonLoading color="#fff" v-show="translateLoading"/>
<text :class="['talking-text translate-text loading']" v-show="!translateLoading">
{{ showContent }}
</text>
<view class="talking-text translate-text" v-if="translateLoading">
<CommonLoading color="#fff"/>
</view>
</view>
<view class="btns-cont" v-show="!dataInfo.isLoading">
<!-- <view class="replay-btn">
@@ -239,69 +241,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
// question: unref(dataInfo)?.pgrphContent,
// streaming: true
// })
// getAskAboutRawApi({
// question: unref(dataInfo)?.pgrphContent,
// streaming: true
// }).then(async res=>{
// console.log(res)
// const reader = res.body.getReader();
// const textDecoder = new TextDecoder();
// let result = true;
// let output = "";
// while (result) {
// const { done, value } = await reader.read();
// console.log(done, value);
// let _resStr = textDecoder.decode(value);
// console.log(_resStr, 1111);
// if (_resStr.indexOf("[DONE]") < 0) {
// let _resItem = JSON.parse(_resStr);
// output += _resItem.data;
// if (_resItem.event === "end") {
// result = false;
// break;
// }
// } else {
// break;
// }
// }
// })
// let _params = new URLSearchParams({
// question: "Hey, how are you?",
// streaming: true,
// });
// fetch("/trastudy/intgask/askAbout?" + _params, {
// method: "GET",
// headers: {
// // Accept: "text/event-stream",
// "Content-Type": "text/event-stream",
// summary:
// "3D072C9D242C96EA3F0FD647CB14A6F495E1C5D01D88EB84369DC9A26309FE4F1058926C9BE6466D06AB10DAAC7D849D",
// },
// }).then(async (res) => {
// const reader = res.body.getReader();
// const textDecoder = new TextDecoder();
// let result = true;
// let output = "";
// while (result) {
// const { done, value } = await reader.read();
// console.log(done, value);
// let _resStr = textDecoder.decode(value);
// console.log(_resStr, 1111);
// if (_resStr.indexOf("[DONE]") < 0) {
// let _resItem = JSON.parse(_resStr);
// output += _resItem.data;
// if (_resItem.event === "end") {
// result = false;
// break;
// }
// } else {
// break;
// }
// }
// console.log(output);
// });
if(props.isTransform){}
// if(props.isTransform){}
})
talkVoiceObj.value.onEnded(()=>{
@@ -383,23 +323,6 @@ const audioCacheObj = computed(() => storageStore.audioObj)
})
}
})
// let _cache = audioCacheObj.value[_url]
// if(_cache){
// voiceLoading.value = false
// itemVoice.value = _cache
// talkVoiceObj.value.src = _cache
// talkVoiceObj.value.play()
// return
// }
// downloadVoiceFile(_url).then(res=>{
// voiceLoading.value = false
// itemVoice.value = res.tempFilePath
// talkVoiceObj.value.src = res.tempFilePath
// talkVoiceObj.value.play()
// storageStore.setStorage('audio', _url, itemVoice.value)
// }).catch((err)=>{
// voiceLoading.value = false
// })
}
}
const playQnsVoice = (readType = 'qns', item) =>{
@@ -440,7 +363,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
// }).then(res=>{
// showNextBtn.value = false
// })
emit('nextQuestion', unref(dataInfo), 'overGraph')
emit('nextQuestion', unref(dataInfo), 'overGraph')
}
}
@@ -524,7 +447,7 @@ const audioCacheObj = computed(() => storageStore.audioObj)
word-break: break-all;
white-space: pre-line;
&.loading{
min-height: 68rpx;
// min-height: 36px;
}
}
.cont-img-box{
@@ -696,8 +619,9 @@ const audioCacheObj = computed(() => storageStore.audioObj)
margin-bottom: 20rpx;
word-break: break-all;
white-space: pre-line;
&.loading{
min-height: 68rpx;
overflow: hidden;
&.translate-text{
min-height: 48rpx;
}
}
}
+8 -7
View File
@@ -351,7 +351,7 @@ import { onMounted, ref, computed } from 'vue'
.list-view{
flex:1;
overflow: hidden;
margin-bottom: 80rpx;
margin-bottom: 15rpx;
background: #ffffff;
border-radius: 23rpx;
display: flex;
@@ -469,15 +469,16 @@ import { onMounted, ref, computed } from 'vue'
border-right: 2rpx solid #eee;
overflow-y: auto;
.type-item{
height: 90rpx;
line-height: 90rpx;
font-size: 23rpx;
min-height: 90rpx;
line-height: 40rpx;
font-size: 22rpx;
box-sizing: border-box;
padding: 0 18rpx;
// overflow: hidden;
padding: 25rpx 18rpx;
overflow: hidden;
// text-overflow: ellipsis;
word-break: break-all;
text-align: center;
white-space: nowrap;
white-space: pre-wrap;
&.is-active{
background-color: rgba(44,142,242,.1);
color: #06f;
+6 -20
View File
@@ -179,7 +179,6 @@ const getData = async () => {
})
step.value = 2
}else{
// 重新开始
// 重新学习
afreshStudyCourseApi({
crsId: crsId.value,
@@ -204,9 +203,6 @@ const getData = async () => {
}catch{
}
// downloadFile('S3F0250640161332025061618052000000267276').then(res=>{
// videoUrlShow.value = res.tempFilePath
// })
};
const showChangeSeekModelNow = () => {
@@ -225,7 +221,7 @@ const changePlayItemId = (id = '') => {
const choiceTeacherInfo = computed(()=>{
return teacherList.value.find(t=> t.teacherNo === choiceTeacher.value)
})
// 选择教师语音对象
const activeVoiceTeachNo = ref('')
const teacherVoiceObj = uni.createInnerAudioContext()
@@ -375,7 +371,6 @@ const nextQuestionSuccess = (info, type='next') => {
getQuestionInfoUnStudy(info.pgrphId)
})
}else if( type === 'reStart'){
console.log( 'qstLogId',info.qstLogId)
// 重新回答
textChartApi({
processType: 'NEW-ANSER',
@@ -451,14 +446,6 @@ const reconnect = ()=> {
const sendMessage = (data) => {
unref(SocketObj).send(data)
}
const closeWebSocket = () => {
isManualClose.value = true
if(socketTask){
// socketTask.close()
socketTask = null
uni.closeSocket({})
}
}
// ws 结束
onLoad((params) => {
@@ -467,8 +454,6 @@ onLoad((params) => {
});
const showTalkingModel = ref(false)
// 录音
const audioPath = ref('')
const audioObj = uni.createInnerAudioContext()
onMounted(()=>{
getData();
})
@@ -485,6 +470,7 @@ const uploadRecordNow = (voicePath) => {
stdyBatch: stdyBatch.value,// 学习批次 必输项:true 类型:String
ansterContent: '',// 回答文本内容 必输项:false 类型:String
}
console.log(_data)
let _id = new Date().getTime() + 'id'
//#ifndef APP-PLUS
// h5 假数据
@@ -493,7 +479,7 @@ const uploadRecordNow = (voicePath) => {
pgrphId: unref(lastTalkingInfo).pgrphId,
qnsId: unref(lastTalkingInfo).qnsId,
talkingContent: '',
talkingVoice: audioPath.value,
talkingVoice: voicePath,
type: 1,
userInfo: {...choiceTeacherInfo.value},
id: _id
@@ -506,7 +492,7 @@ const uploadRecordNow = (voicePath) => {
pgrphId: unref(lastTalkingInfo).pgrphId,
qnsId: unref(lastTalkingInfo).qnsId,
talkingContent: '',
talkingVoice: audioPath.value,
talkingVoice: voicePath,
intrctId: '',
isLoading: true,
type: 1,
@@ -514,7 +500,7 @@ const uploadRecordNow = (voicePath) => {
id: _id
})
scrollToBottomNow()
commonUploadVoiceFile(audioPath.value, '/trastudy/traStdyInfo/studyAnswerVoiceUp', _data).then(res=>{
commonUploadVoiceFile(voicePath, '/trastudy/traStdyInfo/studyAnswerVoiceUp', _data).then(res=>{
let _res = JSON.parse(res.data)
if(_res.rtnCode === '0000'){
talkingList.value = talkingList.value.map(t=>{
@@ -525,7 +511,7 @@ const uploadRecordNow = (voicePath) => {
qstLogId: _data.qstLogId,
qnsId: _data.qnsId,
talkingContent: '',
talkingVoice: audioPath.value,
talkingVoice: voicePath,
intrctId: res.body||'',
type: 1,
userInfo: {...choiceTeacherInfo.value},