fix
This commit is contained in:
@@ -103,7 +103,7 @@ import { reactive, ref, computed, onMounted ,onUnmounted ,inject} from 'vue';
|
|||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad } from '@dcloudio/uni-app';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import useUserStore from '@/stores/useUserStore';
|
import useUserStore from '@/stores/useUserStore';
|
||||||
|
import { playTextDirectly } from '@/hook/useTTSPlayer-all-in-one';
|
||||||
const { $api ,navBack} = inject('globalFunction');
|
const { $api ,navBack} = inject('globalFunction');
|
||||||
const { isMiniProgram } = storeToRefs(useUserStore());
|
const { isMiniProgram } = storeToRefs(useUserStore());
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ const codeBtnText = ref('发送验证码');
|
|||||||
// 认证状态
|
// 认证状态
|
||||||
const authStatus = ref(null);
|
const authStatus = ref(null);
|
||||||
|
|
||||||
// 计算属性
|
|
||||||
const canSendCode = computed(() => {
|
const canSendCode = computed(() => {
|
||||||
return codeCountdown.value === 0 && formData.value.phone.length === 11 && !phoneError.value;
|
return codeCountdown.value === 0 && formData.value.phone.length === 11 && !phoneError.value;
|
||||||
});
|
});
|
||||||
@@ -138,6 +138,7 @@ const canSubmit = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 身份证输入处理
|
// 身份证输入处理
|
||||||
const onIdCardInput = (e) => {
|
const onIdCardInput = (e) => {
|
||||||
formData.value.idCard = e.detail.value.toUpperCase();
|
formData.value.idCard = e.detail.value.toUpperCase();
|
||||||
@@ -305,10 +306,8 @@ const sendCode = async () => {
|
|||||||
|
|
||||||
// 发送成功提示
|
// 发送成功提示
|
||||||
showAuthStatus('success', '验证码已发送至您的手机');
|
showAuthStatus('success', '验证码已发送至您的手机');
|
||||||
|
playTextDirectly('验证码已发送,请注意查收');
|
||||||
|
|
||||||
if (isMachineEnv.value) {
|
|
||||||
playTextDirectly('验证码已发送,请注意查收');
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 发送失败,重置倒计时
|
// 发送失败,重置倒计时
|
||||||
@@ -319,10 +318,7 @@ const sendCode = async () => {
|
|||||||
|
|
||||||
// 错误提示
|
// 错误提示
|
||||||
showAuthStatus('error', '验证码发送失败,请重试');
|
showAuthStatus('error', '验证码发送失败,请重试');
|
||||||
|
playTextDirectly('验证码发送失败');
|
||||||
if (isMachineEnv.value) {
|
|
||||||
playTextDirectly('验证码发送失败');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -393,11 +389,7 @@ const submitAuth = async () => {
|
|||||||
|
|
||||||
// 认证成功
|
// 认证成功
|
||||||
showAuthStatus('success', '身份认证成功');
|
showAuthStatus('success', '身份认证成功');
|
||||||
|
playTextDirectly('身份认证成功');
|
||||||
// 语音提示
|
|
||||||
if (isMachineEnv.value) {
|
|
||||||
playTextDirectly('身份认证成功');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存认证信息到store
|
// 保存认证信息到store
|
||||||
useUserStore().getUserResume().then(()=>{
|
useUserStore().getUserResume().then(()=>{
|
||||||
@@ -421,19 +413,11 @@ const submitAuth = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showAuthStatus('error', errorMsg);
|
showAuthStatus('error', errorMsg);
|
||||||
|
playTextDirectly(errorMsg);
|
||||||
// 语音提示
|
|
||||||
if (isMachineEnv.value) {
|
|
||||||
playTextDirectly(errorMsg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TTS语音播放(假设已引入)
|
|
||||||
const playTextDirectly = (text) => {
|
|
||||||
// 这里调用TTS功能
|
|
||||||
console.log('TTS播放:', text);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 组件卸载时清理定时器
|
// 组件卸载时清理定时器
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user