JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_开发录音组件,替换老组件功能

This commit is contained in:
田岩
2026-03-05 09:01:12 +08:00
parent 015af519fb
commit c1e7d0de47
3 changed files with 20 additions and 21 deletions
+2 -2
View File
@@ -2,10 +2,10 @@
ENV = 'development' ENV = 'development'
# 'development' # 'development'
VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001' #VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
#VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002' VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# DEV # DEV
#VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' #VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
+2 -2
View File
@@ -8,8 +8,8 @@ const IsAndEnv = getPhoneEnvBool('AND')
// const url = '/traapp/asrAiModelSocket/open'; // const url = '/traapp/asrAiModelSocket/open';
const url = '/traapp/asrAiModelSocket/open'; const url = '/traapp/asrAiModelSocket/open';
const _baseUrl = get_base_url(url).split('http').join('ws'); const _baseUrl = get_base_url(url).split('http').join('ws');
// export const wsUrl = _baseUrl + url + '?summary=' + getToken(); export const wsUrl = _baseUrl + url + '?summary=' + getToken();
export const wsUrl = 'ws://10.10.10.8:8000/ws/asr'; // export const wsUrl = 'ws://10.10.10.8:8000/ws/asr';
const windowInfo = uni.getWindowInfo(); const windowInfo = uni.getWindowInfo();
// 安全区域信息 // 安全区域信息
const safeArea = windowInfo.safeArea; const safeArea = windowInfo.safeArea;
+16 -17
View File
@@ -127,10 +127,15 @@
const voice_to_text_status = ref<VoiceToTextSubStatus>('init'); const voice_to_text_status = ref<VoiceToTextSubStatus>('init');
const popupRef = ref(null); const popupRef = ref(null);
const props = defineProps({ const props = defineProps({
isDisabled: { isDisabled: {
default: false, default: false,
type: Boolean type: Boolean
}, },
// 禁用时候点击反馈的文本
disabledText: {
default: '请稍后再试!',
type: String
},
isLoading: { isLoading: {
default: false, default: false,
type: Boolean type: Boolean
@@ -139,15 +144,12 @@
default: '发送回答中,请稍后再试!', default: '发送回答中,请稍后再试!',
type: String type: String
}, },
// 禁用时候点击反馈的文本 // 设置为true则不能发送消息
disabledText: {
default: '请稍后再试!',
type: String
},
canAnswer: { canAnswer: {
default: true, default: false,
type: Boolean type: Boolean
}, },
// 不能发送消息的提示
canAnswerText: { canAnswerText: {
default: '当前状态不能发送内容!', default: '当前状态不能发送内容!',
type: String type: String
@@ -156,11 +158,6 @@
type: Number, type: Number,
default: 500 default: 500
}, },
minRecordDuration: {
// 最小录音间隔
type: Number,
default: 1000
},
adjustPosition:{ adjustPosition:{
default: true, default: true,
type: Boolean type: Boolean
@@ -174,6 +171,7 @@
} }
} }
}); });
// 兼容以前的按钮参数
const workMode = computed<WorkModeType>(() => { const workMode = computed<WorkModeType>(() => {
const modeMap = { const modeMap = {
'01': 'both', '01': 'both',
@@ -241,6 +239,7 @@
// 开启语音 // 开启语音
const startRecord = async (obj: { touches: any[] }) => { const startRecord = async (obj: { touches: any[] }) => {
if (props.isDisabled) return; if (props.isDisabled) return;
if (props.canAnswer) return common.msg(props.canAnswerText)
try { try {
const state = await permissionApi.judgeIosPermission('record'); const state = await permissionApi.judgeIosPermission('record');
if (state === 'not determined') { if (state === 'not determined') {
@@ -471,7 +470,7 @@
console.log('禁用时点击给的提示'); console.log('禁用时点击给的提示');
if (props.isDisabled) common.msg(props.disabledText); if (props.isDisabled) common.msg(props.disabledText);
}; };
const send_msg = () => { const send_msg = () => {
if (!isInputVisible.value) { if (!isInputVisible.value) {
emit('submitAnswer', inputText.value, changeBtn); emit('submitAnswer', inputText.value, changeBtn);
@@ -480,7 +479,7 @@
closePopup(); closePopup();
} }
}; };
setupKeyboardHeightListener((height: number) => { setupKeyboardHeightListener((height: number) => {
const _height = Math.max(height - 100, 0); const _height = Math.max(height - 100, 0);
pageBoxMarginBottom.value = `${_height}px`; pageBoxMarginBottom.value = `${_height}px`;