Files
nianxx-h5/src/pages/home/components/DrawerSection/index.vue
DEV_DSW 0d46ac0e2c 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
2026-05-27 09:48:37 +08:00

49 lines
1.1 KiB
Vue

<template>
<van-popup v-model:show="show" ref="drawerRef" position="left">
<div class="drawer-home">
<div class="drawer-home-nav">
<van-icon name="cross" size="22" color="#333333" class="close-icon" @click="close" />
<span class="title">我的</span>
</div>
<MineSetting ref="mineSettingRef" @close="close" />
</div>
</van-popup>
</template>
<script setup>
import { ref, defineExpose } from "vue";
import { checkToken } from "@/hooks/useGoLogin";
import MineSetting from "./components/MineSetting/index.vue";
const drawerRef = ref(null);
// 监听抽屉显示事件
const mineSettingRef = ref(null);
const show = ref(false);
const open = async () => {
await checkToken();
show.value = true;
try {
await mineSettingRef.value?.getLoginUserPhoneInfo?.();
} catch (error) {
console.warn("获取登录用户手机号失败:", error);
}
};
// 监听抽屉隐藏事件
const close = () => show.value = false;
defineExpose({
open,
close,
});
</script>
<style lang="scss" scoped>
@import "./styles/index.scss";
</style>