From 1910e9f27373b8b4da75f076762025ceb3419965 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 12 六月 2025 15:40:50 +0800
Subject: [PATCH] fix: 暂时隐藏电信充值通道
---
apps/taro/src/hooks/user.ts | 36 +++++++++++++++++++++++++++++++++---
1 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/apps/taro/src/hooks/user.ts b/apps/taro/src/hooks/user.ts
index 711c45e..0125a2e 100644
--- a/apps/taro/src/hooks/user.ts
+++ b/apps/taro/src/hooks/user.ts
@@ -10,8 +10,32 @@
useLifeRechargeContext,
APIgetLifePayWxIndentityParams,
WxMiniAppIndentityInfo,
+ LifePayPhoneMesssageCodeLoginOutput,
} from '@life-payment/core-vue';
import { isInWeChat } from '@/utils/env';
+
+export function useVirtualUserInfo() {
+ const { blLifeRecharge } = useLifeRechargeContext();
+
+ const { data: virtualUserInfo } = useQuery({
+ queryKey: ['blLifeRecharge/lifePayUserMesssageByIduser', blLifeRecharge.accountModel.userId],
+ queryFn: async () => {
+ return await blLifeRecharge.services.lifePayUserMesssageByIduser(
+ {
+ id: blLifeRecharge.accountModel.userId,
+ },
+ {
+ showLoading: false,
+ }
+ );
+ },
+ placeholderData: () => ({} as LifePayPhoneMesssageCodeLoginOutput),
+ enabled: computed(() => !!blLifeRecharge.accountModel.userId),
+ staleTime: Infinity,
+ });
+
+ return { virtualUserInfo };
+}
export function useUser() {
const userStore = useUserStore();
@@ -30,7 +54,11 @@
return userStore.getCurrentUserInfo();
}
- const isChannelAccount = computed(() => !!virtualUserId.value && true);
+ const { blLifeRecharge } = useLifeRechargeContext();
+ // const { virtualUserInfo } = useVirtualUserInfo();
+
+ const isChannelAccount = computed(() => blLifeRecharge.accountModel.isBackClientUser);
+ const userPromoterIdNumber = computed(() => blLifeRecharge.accountModel.promoterIdNumber);
return {
user: userInfo,
@@ -42,6 +70,8 @@
wxCode,
wxOpenId,
isChannelAccount,
+ userPromoterIdNumber,
+ // virtualUserInfo,
};
}
@@ -144,12 +174,12 @@
const { wxCode, wxOpenId } = useUser();
const { getLifePayWxIndentity } = useLifePayWxIndentity();
- async function ensureOpenId() {
+ async function ensureOpenId(): Promise<string> {
if (wxOpenId.value) {
return wxOpenId.value;
} else {
let rea = await getLifePayWxIndentity(wxCode.value);
- return rea.openId ? rea.openId : wxOpenId.value;
+ return rea.openId ? rea.openId : await ensureOpenId();
}
}
--
Gitblit v1.9.1