JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_开发录音组件,替换老组件功能
This commit is contained in:
+2
-2
@@ -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'
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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') {
|
||||||
|
|||||||
Reference in New Issue
Block a user