refactor: fix routing, update APIs and clean up miscellaneous code
- add mitt-based event emitter utility in src/utils/events.ts - replace deprecated navigateTo calls with vue router push across multiple components - fix incorrect API function name (updateImageFile → uploadFile) in CreateServiceOrder - correct typo in imported function name in AnswerComponent - temporarily disable location fetch logic in Discovery page - update external link token handling in LongTextGuideCardPreview
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { getTimeNoticeList } from "@/api/home";
|
||||
import { NOTICE_EVENT_LOGIN_SUCCESS } from "@/constants/constant";
|
||||
import { emitter } from '@/utils/events'
|
||||
|
||||
const props = defineProps({
|
||||
tipsMessage: {
|
||||
@@ -68,14 +69,18 @@ const getTimeNoticeListData = async () => {
|
||||
|
||||
onMounted(() => {
|
||||
getTimeNoticeListData();
|
||||
uni.$on(NOTICE_EVENT_LOGIN_SUCCESS, () => {
|
||||
|
||||
emitter.on(NOTICE_EVENT_LOGIN_SUCCESS, () => {
|
||||
getTimeNoticeListData();
|
||||
});
|
||||
});
|
||||
|
||||
const clickItem = (item) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/ChatMain/NoticeMessage/detail?noticeData=${encodeURIComponent(JSON.stringify(item))}`
|
||||
router.push({
|
||||
path: '/pages/ChatMain/NoticeMessage/detail',
|
||||
query: {
|
||||
noticeData: encodeURIComponent(JSON.stringify(item))
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user