Merge branch 'sit' into 'uat'

Sit

See merge request K17_AITS/tra-app!70
This commit is contained in:
田岩
2025-07-24 16:55:49 +08:00
13 changed files with 125 additions and 81 deletions
+3 -1
View File
@@ -18,4 +18,6 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
# h5专用地址
VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7002'
VITE_APP_BASE_H5_API_Url = 'http://aitstest.jlbank.com.cn:7001'
+58 -46
View File
@@ -1,5 +1,6 @@
// #ifdef APP-PLUS
import showDialog from '@/common/dialogMessage'
// #endif
function msg(title, duration = 1000) {
uni.showToast({
title: title,
@@ -10,40 +11,49 @@ function msg(title, duration = 1000) {
}
function show(title, msg, showCancel = true, cancelText = '取消', confirmText = '确定') {
return new Promise((resolve, reject) => {
// 创建通用参数对象
const dialogOptions = {
title,
content: msg,
showCancel,
cancelText,
confirmText,
success: (res) => {
// 统一处理成功回调,解析为布尔值
console.log('res.confirm', res.confirm);
resolve(!!res.confirm);
}
};
if (getPhoneEnvBool('AND')) {
// 安卓环境使用showDialog,补充cancel回调
showDialog({
...dialogOptions,
cancel: () => {
console.log('用户点击取消');
resolve(false); // 取消时也返回Promise结果
}
});
} else {
// 其他环境使用uni.showModal,补充fail回调
uni.showModal({
...dialogOptions,
fail: (res) => {
reject(res);
}
});
}
});
return new Promise((resolve, reject) => {
// 创建通用参数对象
const dialogOptions = {
title,
content: msg,
showCancel,
cancelText,
confirmText,
success: (res) => {
// 统一处理成功回调,解析为布尔值
console.log('res.confirm', res.confirm);
resolve(!!res.confirm);
}
};
// #ifdef APP-PLUS
if (getPhoneEnvBool('AND')) {
// 安卓环境使用showDialog,补充cancel回调
showDialog({
...dialogOptions,
cancel: () => {
console.log('用户点击取消');
resolve(false); // 取消时也返回Promise结果
}
});
} else {
// 其他环境使用uni.showModal,补充fail回调
uni.showModal({
...dialogOptions,
fail: (res) => {
reject(res);
}
});
}
// #endif
// #ifdef H5
uni.showModal({
...dialogOptions,
fail: (res) => {
reject(res);
}
});
// #endif
});
}
const loading = (title = '加载中', mask = true) => uni.showLoading({
@@ -140,18 +150,20 @@ export const getUserInfo = (key = '') => {
* @returns {boolean} 如果当前平台匹配指定标识返回true,否则返回false
*/
export const getPhoneEnvBool = (flag) => {
// 获取当前设备的平台信息
const { platform } = uni.getSystemInfoSync();
// 平台与标识的映射关系
const platformMap = {
ios: 'IOS',
android: 'AND',
};
// 获取当前设备的平台信息
// 根据当前平台返回匹配结果
return platformMap[platform] === flag;
const {
platform
} = uni.getSystemInfoSync();
// 平台与标识的映射关系
const platformMap = {
ios: 'IOS',
android: 'AND',
};
// 根据当前平台返回匹配结果
return platformMap[platform] === flag;
};
+4 -2
View File
@@ -1,4 +1,5 @@
export default function showDialog(options) {
const view = new plus.nativeObj.View('customModal', {
top: '0',
left: '0',
@@ -7,7 +8,7 @@ export default function showDialog(options) {
backgroundColor: 'rgba(0,0,0,0.1)',
position: 'fixed'
});
const screenWidth = plus.screen.resolutionWidth;
const screenHeight = plus.screen.resolutionHeight;
const borderRadius = 10;
@@ -212,7 +213,7 @@ export default function showDialog(options) {
}
}
}, false);
view.show();
return {
@@ -220,4 +221,5 @@ export default function showDialog(options) {
view.close();
}
};
}
@@ -64,5 +64,7 @@
padding: 2px 4px;
border-radius: 3px;
}
p,span,div{
word-break: break-all;
}
</style>
+2 -2
View File
@@ -436,13 +436,13 @@ const audioCacheObj = computed(() => storageStore.audioObj)
if(talkVoiceObj.value.duration){
voiceTime.value = ( Math.ceil(talkVoiceObj.value.duration) || 0 ) + 's'
}else{
if(sum === 5) {
if(sum === 10) {
voiceTime.value = 0 + 's'
return
}
setTimeout(()=>{
setVoiceTime(sum)
},100)
},200)
}
}
const playQnsVoice = (readType = 'qns', item) =>{
+5 -1
View File
@@ -9,7 +9,7 @@
>按住说话
</view>
<view class="touch-btn" v-if="keyboardIsShow">
<uv-input class="input-box" ref="inputRef" v-model="answerValue" maxlength="500"
<uv-input class="input-box" ref="inputRef" v-model="answerValue" :maxlength="props.textValueLength"
placeholderStyle='color:#999999;font-size:26rpx' placeholder="请输入文字">
</uv-input>
</view>
@@ -72,6 +72,10 @@ const props = defineProps({
default: '当前状态不能发送内容!',
type: String
},
textValueLength:{
type: Number,
default: 500
}
})
const { isDisabled, onlyVoice } = toRefs(props)
const isLoadingState = computed(() => props.isLoading)
+12 -4
View File
@@ -167,10 +167,18 @@
}
}
const getData = () => {
if (status.value !== 'loadmore' && status.value !== '') return
status.value = 'loading'
page.value++
const getData = (from = '') => {
if (from == 'submit') {
status.value = ''
total.value = -1
page.value = 1
message_list.length = 0
} else {
if (status.value !== 'loadmore' && status.value !== '') return
status.value = 'loading'
page.value++
}
queryTraCrsBbsInfoByCrsId({
crsId: props.crsId,
page: page.value,
+7 -16
View File
@@ -37,30 +37,22 @@
:inactive-style="{ color: '#666666', 'font-size': '30rpx' }"></uv-tabs>
</view>
</uv-sticky>
<!-- <swiper class="body-swiper" @change="swiper_change" :current="tabAct">
<swiper-item> -->
<!-- <swiper class="body-swiper" @change="swiper_change" :current="tabAct"><swiper-item> -->
<view class="course-info" v-if="tabAct == 0">
<introduceVue v-model="form"></introduceVue>
</view>
<!-- </swiper-item>
<swiper-item> -->
<!--</swiper-item><swiper-item>-->
<view class="point" v-if="tabAct == 1">
<knowledge v-model="form" @toStudyPrgh="toStudyPrgh"></knowledge>
</view>
<!-- </swiper-item>
<swiper-item> -->
<!--</swiper-item><swiper-item>-->
<view class="evaluate" v-if="tabAct == 2 && form">
<comment ref="commentRef" :crsNum="form.crsNum" :crsId="form.crsId" :imgId="form.imgId">
</comment>
</view>
<!-- </swiper-item>
</swiper> -->
<!--</swiper-item></swiper>-->
</view>
</view>
</scroll-view>
<view class="btn-box btn-box-height font_pf">
<template v-if="[0,1].includes(tabAct)">
@@ -75,8 +67,6 @@
</template>
</view>
</view>
</template>
<script setup>
@@ -171,7 +161,8 @@
onMounted(async () => {
uni.$on('refresh_comment_data', () => {
commentRef.value?.getData();
console.log('发评论了刷新');
commentRef.value?.getData('submit');
tabAct.value = 2
})
})
@@ -315,7 +306,7 @@
.evaluate {
min-height: calc(100vh - 92rpx - 22rpx - 245rpx - var(--status-bar-height));
}
.btn-box-height {
height: 187rpx;
}
+1 -1
View File
@@ -86,7 +86,7 @@
publishCrsEvaluation(formData).then(res => {
common.msg('发表成功')
setTimeout(() => {
uni.$emit('setMascot')
uni.$emit('refresh_comment_data')
if(from.value === 'study'){
} else {
}
+19 -4
View File
@@ -1,5 +1,11 @@
<template>
<view class="answer-content">
<view class="answer-content" v-if="props.isLoading">
<view class="talking-cont">
<CommonLoading color="#06f"/>
</view>
</view>
<view class="answer-content" v-else>
<view class="talking-cont">
<MarkdownPreview :mdString="mdText"/>
</view>
@@ -39,7 +45,7 @@
</template>
<script setup>
import { onMounted, computed, ref } from 'vue'
import { onMounted, computed, ref, watch } from 'vue'
import MarkdownPreview from '@/components/markdown-preview/markdown-preview.vue';
const emit = defineEmits(['handleEvents'])
@@ -48,10 +54,16 @@
default: () => ({}),
type: Object
},
isLoading:{
default: false,
type:Boolean
}
})
watch(() => props.dataInfo, () => {},{deep: true,immediate: true})
watch(() => props.isLoading, () => {},{deep: true,immediate: true})
const mdText = computed(() => props.dataInfo?.talkingText)
const reAnswer = () => {
emit('handleEvents', 'reAnswer')
}
@@ -70,7 +82,10 @@
border-radius: 15rpx;
padding-bottom: 10rpx;
position: relative;
float: left;
overflow: hidden;
float: left;
width: 100%;
min-height: 80rpx;
.talking-cont{
padding-bottom: 20rpx;
}
+3 -3
View File
@@ -127,10 +127,10 @@ import { onUnload } from '@dcloudio/uni-app';
}
const setVoiceTime = (sum) => {
sum += 1
if(talkVoiceObj.value.duration){
voiceTime.value = ( Math.ceil(talkVoiceObj.value.duration) || 0 ) + 's'
if(Math.ceil(talkVoiceObj.value.duration)>0){
voiceTime.value = (Math.ceil(talkVoiceObj.value.duration) || 1 ) + 's'
}else{
if(sum === 10) {
if(sum === 20) {
voiceTime.value = 0 + 's'
return
}
@@ -9,6 +9,7 @@
<answerVue
v-else-if="talkingType === 'answer'"
:dataInfo="props.talkingInfo"
:isLoading="!!props.talkingInfo.isLoading"
@handleEvents="handleEvents"
></answerVue>
<view v-else></view>
+7
View File
@@ -251,6 +251,12 @@
...body,
talkingVoice: askData.value.talkingVoice
})
talkingList.value.push({
type: 'answer',
isLoading: true,
id: _id+'loading'
})
scrollToBottomNow()
return
}
if (commond === 'ASK-STOP') {
@@ -266,6 +272,7 @@
console.log('开始回答!')
answerIsOver.value = false
answerText.value = ''
talkingList.value.pop()
talkingList.value.push({
type: 'answer',
talkingText: answerText.value,