feat: enable and refactor more service

- uncomment and restore MineSetting in DrawerSection
- replace uni-ui popup and icons with Vant components in MoreService
- switch to project's custom event emitter instead of uni global events
- add VanIcons type definitions in components.d.ts
- rework popup state management with reactive show ref for MoreService
This commit is contained in:
DEV_DSW
2026-05-27 09:48:37 +08:00
parent e2e5a750fb
commit 0d46ac0e2c
4 changed files with 15 additions and 10 deletions

2
components.d.ts vendored
View File

@@ -48,6 +48,7 @@ declare module 'vue' {
TopNavBar: typeof import('./src/components/TopNavBar/index.vue')['default']
UseDateRange: typeof import('./src/components/UseDateRange/index.vue')['default']
VanIcon: typeof import('vant/es')['Icon']
VanIcons: typeof import('vant/es')['Icons']
VanPopup: typeof import('vant/es')['Popup']
ZnIcon: typeof import('./src/components/ZnIcon/index.vue')['default']
}
@@ -91,6 +92,7 @@ declare global {
const TopNavBar: typeof import('./src/components/TopNavBar/index.vue')['default']
const UseDateRange: typeof import('./src/components/UseDateRange/index.vue')['default']
const VanIcon: typeof import('vant/es')['Icon']
const VanIcons: typeof import('vant/es')['Icons']
const VanPopup: typeof import('vant/es')['Popup']
const ZnIcon: typeof import('./src/components/ZnIcon/index.vue')['default']
}

View File

@@ -6,7 +6,7 @@
<span class="title">我的</span>
</div>
<!-- <MineSetting ref="mineSettingRef" @close="close" /> -->
<MineSetting ref="mineSettingRef" @close="close" />
</div>
</van-popup>
</template>

View File

@@ -1,9 +1,9 @@
<template>
<uni-popup ref="popup" type="bottom" :safe-area="false">
<van-popup ref="popup" position="bottom" v-model:show="show">
<div class="popup-content border-box pt-12 pl-12 pr-12">
<div class="header flex flex-items-center pb-12">
<div class="title flex-full text-center font-size-17 color-000 font-500 ml-24">更多服务</div>
<uni-icons type="close" size="24" color="#CACFD8" @click="close" />
<van-icon name="cross" size="24" color="#CACFD8" @click="close" />
</div>
<div class="list bg-white border-box pl-20 pr-20">
@@ -25,7 +25,7 @@
</div>
</div>
</div>
</uni-popup>
</van-popup>
</template>
<script setup>
@@ -33,6 +33,7 @@ import { ref } from "vue";
import { Command } from "@/constants/ChatModel";
import { SEND_MESSAGE_COMMAND_TYPE } from "@/constants/constant";
import { checkToken } from "@/hooks/useGoLogin";
import { emitter } from '@/utils/events'
const popup = ref(null);
@@ -79,12 +80,14 @@ const list = ref([
},
]);
const show = ref(false);
const open = () => {
popup.value && popup.value.open();
show.value = true;
};
const close = () => {
popup.value && popup.value.close();
show.value = false;
};
const handleClick = (item) => {
@@ -98,11 +101,11 @@ const handleClick = (item) => {
return;
}
uni.$emit(SEND_MESSAGE_COMMAND_TYPE, item);
emitter.emit(SEND_MESSAGE_COMMAND_TYPE, item);
};
// 接收更多服务
uni.$on("SHOW_MORE_POPUP", () => {
emitter.on("SHOW_MORE_POPUP", () => {
open();
});
</script>

View File

@@ -7,7 +7,7 @@
@select="handleDateSelect" /> -->
<!-- 更多服务 -->
<!-- <MoreService /> -->
<MoreService />
<!-- 抽屉组件 -->
<DrawerSection ref="drawerRef" @close="closeDrawer" />
@@ -21,7 +21,7 @@ import { emitter } from '@/utils/events'
// import { useAppStore } from "@/store";
// import { checkToken } from "@/hooks/useGoLogin";
// import ChatMainList from "./components/ChatMainList/index.vue";
// import MoreService from "./components/MoreService/index.vue";
import MoreService from "./components/MoreService/index.vue";
import DrawerSection from "./components/DrawerSection/index.vue";
// import Calender from "@/components/Calender/index.vue";