refactor(components): replace uni.$emit with event emitter

update Feedback and CreateServiceOrder components to use the imported @/utils/events emitter instead of global uni.$emit, reducing reliance on global properties for better maintainability and consistency
This commit is contained in:
duanshuwen
2026-05-29 21:24:16 +08:00
parent ecb6e676b9
commit 656c592da2
2 changed files with 4 additions and 2 deletions

View File

@@ -69,6 +69,7 @@
<script setup>
import { ref, computed, onMounted, nextTick, defineProps, watch } from "vue";
import { emitter } from '@/utils/events'
import { SCROLL_TO_BOTTOM } from "@/constants/constant";
import { createWorkOrder } from "@/api/workOrder";
import { uploadFile } from "@/api/upload";
@@ -220,7 +221,7 @@ const divWorkOrder = () => {
onMounted(() => {
nextTick(() => {
setTimeout(() => {
uni.$emit(SCROLL_TO_BOTTOM, true);
emitter.emit(SCROLL_TO_BOTTOM, true);
}, 200);
});
});

View File

@@ -45,6 +45,7 @@
<script setup>
import { ref, onMounted, nextTick, computed } from "vue";
import { emitter } from '@/utils/events'
import { SCROLL_TO_BOTTOM } from "@/constants/constant";
import { getCurrentConfig } from "@/constants/base";
import { submitFeedback } from "@/api/home";
@@ -102,7 +103,7 @@ const sendFeedback = async () => {
onMounted(() => {
nextTick(() => {
setTimeout(() => {
uni.$emit(SCROLL_TO_BOTTOM, true);
emitter.emit(SCROLL_TO_BOTTOM, true);
}, 200);
});
});