feat; 发送的消息类型的统一

This commit is contained in:
2025-10-16 20:19:43 +08:00
parent 1f590202a8
commit d9287b47fa
8 changed files with 31 additions and 30 deletions

View File

@@ -26,7 +26,7 @@
<script setup>
import { ref } from "vue";
import { SEND_COMMAND_TYPE } from "@/constant/constant";
import { SEND_MESSAGE_COMMAND_TYPE } from "@/constant/constant";
const commandModel = ref({
icon: "",
@@ -46,7 +46,7 @@ const props = defineProps({
});
const handleClick = () => {
uni.$emit(SEND_COMMAND_TYPE, commandModel.value);
uni.$emit(SEND_MESSAGE_COMMAND_TYPE, commandModel.value);
};
</script>

View File

@@ -12,9 +12,12 @@
</template>
<script setup>
import { ref, nextTick, defineEmits } from "vue";
import { ref, nextTick } from "vue";
import { onMounted } from "vue";
import { SCROLL_TO_BOTTOM } from "@/constant/constant";
import {
SCROLL_TO_BOTTOM,
SEND_MESSAGE_CONTENT_TEXT,
} from "@/constant/constant";
const props = defineProps({
question: {
@@ -24,10 +27,9 @@ const props = defineProps({
});
const tags = ref([]);
const emits = defineEmits(["replySent"]);
const handleClick = (item) => {
emits("replySent", item);
uni.$emit(SEND_MESSAGE_CONTENT_TEXT, item);
};
onMounted(() => {

View File

@@ -20,7 +20,7 @@
</template>
<script setup>
import { RECOMMEND_POSTS_TITLE } from "@/constant/constant";
import { SEND_MESSAGE_CONTENT_TEXT } from "@/constant/constant";
import { defineProps } from "vue";
import ModuleTitle from "@/components/ModuleTitle/index.vue";
@@ -33,7 +33,7 @@ const props = defineProps({
const sendReply = (item) => {
const topic = item.userInputContent || item.topic.replace(/^#/, "");
uni.$emit(RECOMMEND_POSTS_TITLE, topic);
uni.$emit(SEND_MESSAGE_CONTENT_TEXT, topic);
};
</script>

View File

@@ -40,7 +40,7 @@
<script setup>
import { ref } from "vue";
import { Command } from "@/model/ChatModel";
import { SEND_COMMAND_TYPE } from "@/constant/constant";
import { SEND_MESSAGE_COMMAND_TYPE } from "@/constant/constant";
const popup = ref(null);
@@ -87,7 +87,7 @@ const open = () => {
};
const handleClick = (item) => {
uni.$emit(SEND_COMMAND_TYPE, item);
uni.$emit(SEND_MESSAGE_COMMAND_TYPE, item);
close();
};

View File

@@ -34,7 +34,7 @@
<script setup>
import { defineProps } from "vue";
import { RECOMMEND_POSTS_TITLE } from "@/constant/constant";
import { SEND_MESSAGE_CONTENT_TEXT } from "@/constant/constant";
import ModuleTitle from "@/components/ModuleTitle/index.vue";
const props = defineProps({
@@ -46,7 +46,7 @@ const props = defineProps({
const sendReply = (item) => {
const topic = item.userInputContent || item.topic.replace(/^#/, "");
uni.$emit(RECOMMEND_POSTS_TITLE, topic);
uni.$emit(SEND_MESSAGE_CONTENT_TEXT, topic);
};
</script>