From 8bb9173a95a87e3ceab4f48b5b34041af38b7c70 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 28 三月 2025 15:23:14 +0800 Subject: [PATCH] fix: 四期需求 --- apps/taro/src/pages/mine/index.vue | 112 +++++++++++++++++++++++++++++++++---------------------- 1 files changed, 67 insertions(+), 45 deletions(-) diff --git a/apps/taro/src/pages/mine/index.vue b/apps/taro/src/pages/mine/index.vue index 260ba75..403801c 100644 --- a/apps/taro/src/pages/mine/index.vue +++ b/apps/taro/src/pages/mine/index.vue @@ -10,20 +10,50 @@ <template #bg> <img :src="OssAssets.mine.Bg" class="mine-page-bg" :style="{ height: `${bgHeight}px` }" /> </template> + <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"> + {{ 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> </PageLayoutWithBg> </template> <script setup lang="ts"> -import { TransparentNavigationBar, ContentScrollView } from '@/components'; -import { useUser, useIsLogin, useGoLogin } from '@/hooks'; +import { TransparentNavigationBar, List, ListItem } from '@/components'; +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 { useSystemStore } from '@/stores/modules/system'; 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, isCertified } = useUser(); +const { userDetail, virtualPhoneNumber, isChannelAccount } = useUser(); + const isLogin = useIsLogin(); const systemStore = useSystemStore(); +const userStore = useUserStore(); +const { blLifeRecharge } = useLifeRechargeContext(); const { goLoginFn } = useGoLogin(); const bgHeight = computed(() => 133 + systemStore.navHeight); @@ -35,59 +65,51 @@ } function goPage(routeName: string) { - Taro.navigateTo({ + RouteHelper.navigateTo({ url: routeName, }); } -function goSetting() { - goPage(RouterPath.setting); +// Taro.showShareMenu({ +// showShareItems: ['shareAppMessage'], +// }); +// 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 { + await Message.confirm({ + message: '纭畾瑕侀��鍑虹櫥褰曞悧锛�', + }); + userStore.logout(); + blLifeRecharge.loginout(); + } catch (error) {} } -Taro.showShareMenu({ - showShareItems: ['shareAppMessage'], -}); +const { onlineServiceLink } = useOnlineService(); -Taro.useShareAppMessage((res) => { - return { - title: `${userDetail.value?.contacter}鍚嶇墖`, - // path: `${RouterPath.userHomePage}?userId=${userDetail.value?.userId}`, - imageUrl: userDetail.value?.avatarUrl, - }; -}); - -function goAuthentication() { - goPage(RouterPath.authenticationHome); -} -function goMineSign() { - goPage(RouterPath.mineSign); -} -function goMineHire() { - goPage(RouterPath.mineHire); -} -function goMineCancel() { - goPage(RouterPath.mineCancel); -} -function goMineCollectTask() { - goPage(RouterPath.mineCollectTask); -} -function goMineAgreementSign() { - goPage(RouterPath.mineAgreementSign); +function handleChat() { + if (isWeb && onlineServiceLink.value) { + if (isInAlipay) { + Message.warning('璇峰湪寰俊涓墦寮�浣跨敤璇ュ姛鑳�'); + } else { + window.open(onlineServiceLink.value, '_blank'); + } + } } </script> <style lang="scss"> @import '@/styles/common.scss'; @import './index.scss'; - -.mine-setting-badge { - margin-right: 20px; -} - -.mine-setting-list { - .pro-list-item-icon { - width: 48px; - height: 48px; - } -} </style> -- Gitblit v1.9.1