| | |
| | | <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">{{ virtualPhoneNumber }}</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"> |
| | | <ListItem title="订单管理" @click="goOrderManage"></ListItem> |
| | | <ListItem title="户号管理" @click="goUserAccountList"></ListItem> |
| | | <template v-if="isChannelAccount"> |
| | | <ListItem title="数据看板" @click="goDashboard"></ListItem> |
| | | <ListItem title="推广二维码" @click="goShareQrcode"></ListItem> |
| | | </template> |
| | | <ListItem v-if="isWeb && !isInAlipay" title="在线客服" @click="handleChat"></ListItem> |
| | | <ListItem v-if="isLogin" title="退出登录" @click="goLogout"></ListItem> |
| | | </List> |
| | | </ContentScrollView> |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { TransparentNavigationBar, List, ListItem } from '@/components'; |
| | | import { useUser, useIsLogin, useGoLogin, useAccessLogin } from '@/hooks'; |
| | | import { useUser, useIsLogin, useGoLogin, useAccessLogin, useOnlineService } from '@/hooks'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { RouterPath, OssAssets } from '@/constants'; |
| | | import DefaultAvatar from '@/assets/components/icon-default-avatar.png'; |
| | |
| | | import PageLayoutWithBg from '@/components/Layout/PageLayoutWithBg.vue'; |
| | | import { useUserStore } from '@/stores/modules/user'; |
| | | import { Message } from '@/utils'; |
| | | import { isWeb, isInAlipay } from '@/utils/env'; |
| | | import { useLifeRechargeContext } from '@life-payment/core-vue'; |
| | | import { hiddenPhoneNumber } from '@life-payment/utils'; |
| | | |
| | | const { userDetail, virtualPhoneNumber } = useUser(); |
| | | const { userDetail, virtualPhoneNumber, isChannelAccount } = useUser(); |
| | | |
| | | const isLogin = useIsLogin(); |
| | | const systemStore = useSystemStore(); |
| | | const userStore = useUserStore(); |
| | |
| | | } |
| | | |
| | | function goPage(routeName: string) { |
| | | Taro.navigateTo({ |
| | | RouteHelper.navigateTo({ |
| | | url: routeName, |
| | | }); |
| | | } |
| | |
| | | // Taro.showShareMenu({ |
| | | // showShareItems: ['shareAppMessage'], |
| | | // }); |
| | | |
| | | Taro.useShareAppMessage((res) => { |
| | | return { |
| | | title: `${userDetail.value?.contacter}名片`, |
| | | // path: `${RouterPath.userHomePage}?userId=${userDetail.value?.userId}`, |
| | | imageUrl: userDetail.value?.avatarUrl, |
| | | }; |
| | | }); |
| | | // Taro.useShareAppMessage((res) => { |
| | | // return { |
| | | // title: `${userDetail.value?.contacter}名片`, |
| | | // // path: `${RouterPath.userHomePage}?userId=${userDetail.value?.userId}`, |
| | | // imageUrl: userDetail.value?.avatarUrl, |
| | | // }; |
| | | // }); |
| | | |
| | | const goOrderManage = useAccessLogin(() => goPage(RouterPath.order)); |
| | | const goUserAccountList = useAccessLogin(() => goPage(RouterPath.userAccountList)); |
| | | const goShareQrcode = useAccessLogin(() => goPage(RouterPath.shareQrcode)); |
| | | const goDashboard = useAccessLogin(() => goPage(RouterPath.dashboard)); |
| | | |
| | | async function goLogout() { |
| | | try { |
| | |
| | | blLifeRecharge.loginout(); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | const { onlineServiceLink } = useOnlineService(); |
| | | |
| | | function handleChat() { |
| | | if (isWeb && onlineServiceLink.value) { |
| | | if (isInAlipay) { |
| | | Message.warning('请在微信中打开使用该功能'); |
| | | } else { |
| | | window.open(onlineServiceLink.value, '_blank'); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |