feat: 一些文本的统一处理
This commit is contained in:
14
src/constant/local.js
Normal file
14
src/constant/local.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { getCurrentConfig, currentClientType, ClientType } from "@/constant/base";
|
||||
/// 根据不同的端配置不同的文案等常量
|
||||
|
||||
export const chatInputPlaceholder = () => {
|
||||
const config = getCurrentConfig();
|
||||
return `快告诉${config.name}您在想什么~`;
|
||||
}
|
||||
|
||||
export const chatGuideSubTitle = () => {
|
||||
if (currentClientType() === ClientType.XIAOQI) {
|
||||
return "这里什么都没有哦";
|
||||
}
|
||||
return "陪您畅玩小七孔";
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ossChengduUrl } from "@/request/base/baseUrl";
|
||||
import { chatGuideSubTitle } from "@/constant/local";
|
||||
|
||||
const props = defineProps({
|
||||
hasMessage: {
|
||||
@@ -36,7 +37,7 @@ const props = defineProps({
|
||||
// 副标题
|
||||
subTitle: {
|
||||
type: String,
|
||||
default: '这里什么都没有哦'
|
||||
default: chatGuideSubTitle()
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch, nextTick, onMounted, defineExpose, onUnmounted } from "vue";
|
||||
import RecordingWaveBtn from "@/components/Speech/RecordingWaveBtn.vue";
|
||||
import { getCurrentConfig } from "@/constant/base";
|
||||
import { chatInputPlaceholder } from "@/constant/local";
|
||||
// #ifdef APP-PLUS
|
||||
import { appSpeechRecognitionOptions } from "@/constant/speech";
|
||||
// #endif
|
||||
@@ -168,8 +168,7 @@ const appSpeechRef = ref(null);
|
||||
const appSpeechKey = ref(0);
|
||||
const appSpeechVisible = ref(true);
|
||||
const placeholder = computed(() => {
|
||||
const config = getCurrentConfig();
|
||||
return `快告诉${config.name}您在想什么~`;
|
||||
return chatInputPlaceholder();
|
||||
});
|
||||
const inputMessage = ref(props.modelValue || "");
|
||||
const isFocused = ref(false);
|
||||
|
||||
Reference in New Issue
Block a user