zym2525
2025-02-23 797fa07355a312a06541ca105a00928e95dbded6
apps/taro/src/pages/mine/index.vue
@@ -13,13 +13,14 @@
    <div class="mine-page-top-view" @click="goLogin">
      <img class="mine-avatar" :src="DefaultAvatar" alt="" />
      <div class="user-info">
        <div class="user-info-name" v-if="isLogin">{{ userDetail?.userName ?? '123' }}</div>
        <div class="user-info-name" v-if="isLogin">{{ virtualPhoneNumber }}</div>
        <div class="mine-go-login" v-else>登录</div>
      </div>
    </div>
    <ContentScrollView>
      <List class="mine-list-wrapper">
        <ListItem title="订单管理" @click="goOrderManage"></ListItem>
        <ListItem v-if="isLogin" title="退出登录" @click="goLogout"></ListItem>
      </List>
    </ContentScrollView>
  </PageLayoutWithBg>
@@ -27,16 +28,19 @@
<script setup lang="ts">
import { TransparentNavigationBar, List, ListItem } from '@/components';
import { useUser, useIsLogin, useGoLogin } from '@/hooks';
import { useUser, useIsLogin, useGoLogin, useAccessLogin } from '@/hooks';
import Taro from '@tarojs/taro';
import { RouterPath, OssAssets } from '@/constants';
import DefaultAvatar from '@/assets/components/icon-default-avatar.png';
import { useSystemStore } from '@/stores/modules/system';
import PageLayoutWithBg from '@/components/Layout/PageLayoutWithBg.vue';
import { useUserStore } from '@/stores/modules/user';
import { useUserStoreWithOut } from '@/stores/modules/user';
const { userDetail } = useUser();
const { userDetail, virtualPhoneNumber } = useUser();
const isLogin = useIsLogin();
const systemStore = useSystemStore();
const userStore = useUserStore();
const { goLoginFn } = useGoLogin();
const bgHeight = computed(() => 133 + systemStore.navHeight);
@@ -65,7 +69,12 @@
  };
});
function goOrderManage() {}
const goOrderManage = useAccessLogin(() => goPage(RouterPath.order));
function goLogout() {
  userStore.logout();
  useUserStoreWithOut().logout();
}
</script>
<style lang="scss">