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>
|
<script setup>
|
||||||
import { ossChengduUrl } from "@/request/base/baseUrl";
|
import { ossChengduUrl } from "@/request/base/baseUrl";
|
||||||
|
import { chatGuideSubTitle } from "@/constant/local";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
hasMessage: {
|
hasMessage: {
|
||||||
@@ -36,7 +37,7 @@ const props = defineProps({
|
|||||||
// 副标题
|
// 副标题
|
||||||
subTitle: {
|
subTitle: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '这里什么都没有哦'
|
default: chatGuideSubTitle()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch, nextTick, onMounted, defineExpose, onUnmounted } from "vue";
|
import { ref, computed, watch, nextTick, onMounted, defineExpose, onUnmounted } from "vue";
|
||||||
import RecordingWaveBtn from "@/components/Speech/RecordingWaveBtn.vue";
|
import RecordingWaveBtn from "@/components/Speech/RecordingWaveBtn.vue";
|
||||||
import { getCurrentConfig } from "@/constant/base";
|
import { chatInputPlaceholder } from "@/constant/local";
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import { appSpeechRecognitionOptions } from "@/constant/speech";
|
import { appSpeechRecognitionOptions } from "@/constant/speech";
|
||||||
// #endif
|
// #endif
|
||||||
@@ -168,8 +168,7 @@ const appSpeechRef = ref(null);
|
|||||||
const appSpeechKey = ref(0);
|
const appSpeechKey = ref(0);
|
||||||
const appSpeechVisible = ref(true);
|
const appSpeechVisible = ref(true);
|
||||||
const placeholder = computed(() => {
|
const placeholder = computed(() => {
|
||||||
const config = getCurrentConfig();
|
return chatInputPlaceholder();
|
||||||
return `快告诉${config.name}您在想什么~`;
|
|
||||||
});
|
});
|
||||||
const inputMessage = ref(props.modelValue || "");
|
const inputMessage = ref(props.modelValue || "");
|
||||||
const isFocused = ref(false);
|
const isFocused = ref(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user