| | |
| | | <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">{{ hiddenPhoneNumber(virtualPhoneNumber) }}</div> |
| | | <div class="mine-go-login" v-else>登录</div> |
| | | </div> |
| | | </div> |
| | | <ContentScrollView> |
| | | <List class="mine-list-wrapper" v-if="isLogin"> |
| | | <List class="mine-list-wrapper"> |
| | | <ListItem title="订单管理" @click="goOrderManage"></ListItem> |
| | | <ListItem title="退出登录" @click="goLogout"></ListItem> |
| | | <ListItem title="户号管理" @click="goUserAccountList"></ListItem> |
| | | <ListItem v-if="isLogin" title="退出登录" @click="goLogout"></ListItem> |
| | | </List> |
| | | </ContentScrollView> |
| | | </PageLayoutWithBg> |
| | |
| | | |
| | | <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'; |
| | | import { Message } from '@/utils'; |
| | | import { useLifeRechargeContext } from '@life-payment/core-vue'; |
| | | import { hiddenPhoneNumber } from '@life-payment/utils'; |
| | | |
| | | const { userDetail } = useUser(); |
| | | const { userDetail, virtualPhoneNumber } = useUser(); |
| | | const isLogin = useIsLogin(); |
| | | const systemStore = useSystemStore(); |
| | | const userStore = useUserStore(); |
| | | const { blLifeRecharge } = useLifeRechargeContext(); |
| | | |
| | | const { goLoginFn } = useGoLogin(); |
| | | const bgHeight = computed(() => 133 + systemStore.navHeight); |
| | |
| | | }); |
| | | } |
| | | |
| | | Taro.showShareMenu({ |
| | | showShareItems: ['shareAppMessage'], |
| | | }); |
| | | // Taro.showShareMenu({ |
| | | // showShareItems: ['shareAppMessage'], |
| | | // }); |
| | | |
| | | Taro.useShareAppMessage((res) => { |
| | | return { |
| | |
| | | }; |
| | | }); |
| | | |
| | | function goOrderManage() {} |
| | | const goOrderManage = useAccessLogin(() => goPage(RouterPath.order)); |
| | | const goUserAccountList = useAccessLogin(() => goPage(RouterPath.userAccountList)); |
| | | |
| | | function goLogout() { |
| | | userStore.logout(); |
| | | useUserStoreWithOut().logout(); |
| | | async function goLogout() { |
| | | try { |
| | | await Message.confirm({ |
| | | message: '确定要退出登录吗?', |
| | | }); |
| | | userStore.logout(); |
| | | blLifeRecharge.loginout(); |
| | | } catch (error) {} |
| | | } |
| | | </script> |
| | | |