From bf21dd478226c01ac503c6be67b5f905722959b0 Mon Sep 17 00:00:00 2001 From: ctw Date: Fri, 12 Dec 2025 12:23:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=94=A8=E6=88=B7=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/home/detail.vue | 2 +- src/pages/profile/verify-status.vue | 23 +++++++- src/pages/tabbar/components/scroll-user.vue | 57 ++++++++++++++++++-- src/pages/tabbar/components/user-ablum.vue | 5 +- src/sheep/api/member/recent.ts | 13 +++++ src/sheep/components/user-card/user-card.vue | 5 +- 6 files changed, 97 insertions(+), 8 deletions(-) diff --git a/src/pages/home/detail.vue b/src/pages/home/detail.vue index 129e62c4..2f372f6f 100644 --- a/src/pages/home/detail.vue +++ b/src/pages/home/detail.vue @@ -104,7 +104,7 @@ - ************* + {{ userDetail.member.wechatNum || '*************' }} 成为 diff --git a/src/pages/profile/verify-status.vue b/src/pages/profile/verify-status.vue index 536df64f..e489e6a0 100644 --- a/src/pages/profile/verify-status.vue +++ b/src/pages/profile/verify-status.vue @@ -26,9 +26,12 @@ - 开始认证 + + {{ authData?.authStatus == '3' ? '重新认证' : '开始认证' }} + + @@ -37,6 +40,24 @@ import { onShow } from '@dcloudio/uni-app'; import { ref } from 'vue'; + const test = () => { + const system = uni.getSystemInfoSync(); + if (system.platform === 'android') { + const context: any = plus.android.importClass('android.content.Context'); + const locationManager: any = plus.android.importClass('android.location.LocationManager'); + const main: any = plus.android.runtimeMainActivity(); + const mainSvr = main.getSystemService(context.LOCATION_SERVICE); + if (!mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER)) { + const Intent: any = plus.android.importClass('android.content.Intent'); + const Settings: any = plus.android.importClass('android.provider.Settings'); + const intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); + main.startActivity(intent); // 打开系统设置GPS服务页面 + } else { + console.log('GPS功能已开启'); + } + } + }; + const authData = ref({}); onShow(async () => { diff --git a/src/pages/tabbar/components/scroll-user.vue b/src/pages/tabbar/components/scroll-user.vue index 58e7ad76..7b60573e 100644 --- a/src/pages/tabbar/components/scroll-user.vue +++ b/src/pages/tabbar/components/scroll-user.vue @@ -59,7 +59,7 @@ const userInfo = computed(() => sheep.$store('user').userInfo); const backdropFilter = computed(() => { const vip = userInfo.value?.memberVip.vip; - return props.scene === 'SQUARE_NEW_PERSON' && !vip; + return (props.scene === 'SQUARE_NEW_PERSON' || props.scene === 'SQUARE_FEMALE') && !vip; }); const scrollTop = ref(1); @@ -87,8 +87,27 @@ }, ); - const detail = (user: any) => { - if (props.scene === 'SQUARE_NEW_PERSON' && backdropFilter.value) { + // 判断查看用户详情时有无权限 + const judgeGetByUserRole = async (user: any) => { + const { code } = await RecentApi.judgeGetByUserRole({ id: user.memberId }); + if (code === 2001000007) { + message + .confirm({ + title: '魅力女生认证', + msg: '请先完成认证', + confirmButtonText: '去认证', + zIndex: 9999, + }) + .then(() => { + uni.navigateTo({ + url: '/pages/profile/verify-status', + }); + }) + .catch(() => {}); + return; + } + + if (code === 2001000008) { message .confirm({ title: '获取VIP特权', @@ -112,4 +131,36 @@ }, }); }; + + const detail = async (user: any) => { + // 如果男生 查看‘新人’分类-SQUARE_NEW_PERSON 且 未开通会员 + if (props.scene === 'SQUARE_NEW_PERSON' && backdropFilter.value) { + message + .confirm({ + title: '获取VIP特权', + msg: '请先开通VIP会员', + confirmButtonText: '获取会员', + zIndex: 9999, + }) + .then(() => { + uni.navigateTo({ + url: '/pages/profile/apply-vip', + }); + }); + return; + } + + // 如果女生 查看‘vip男士’分类-SQUARE_VIP_MALE 或 ‘女生’分类-SQUARE_FEMALE + if (props.scene === 'SQUARE_VIP_MALE' || props.scene === 'SQUARE_FEMALE') { + await judgeGetByUserRole(user); + return; + } + + uni.navigateTo({ + url: `/pages/home/detail?memberId=${user.memberId}`, + success: function (res) { + res.eventChannel.emit('viewRecordType', 'USER'); + }, + }); + }; diff --git a/src/pages/tabbar/components/user-ablum.vue b/src/pages/tabbar/components/user-ablum.vue index 3e6bdf91..88f95240 100644 --- a/src/pages/tabbar/components/user-ablum.vue +++ b/src/pages/tabbar/components/user-ablum.vue @@ -13,11 +13,14 @@ - + + + 暂无照片 + diff --git a/src/sheep/api/member/recent.ts b/src/sheep/api/member/recent.ts index 8511d8f9..ab3e80ba 100644 --- a/src/sheep/api/member/recent.ts +++ b/src/sheep/api/member/recent.ts @@ -70,6 +70,19 @@ const RecentApi = { }, }); }, + // 判断查看用户详情时有无权限 + judgeGetByUserRole: (params: { id: string | number }) => { + return request({ + url: '/member/recent/judgeGetByUserRole', + method: 'GET', + params, + custom: { + showLoading: true, + loadingMsg: '加载中', + showError: false, + }, + }); + }, // 查看我喜欢 likeIt: (data: any) => { return request({ diff --git a/src/sheep/components/user-card/user-card.vue b/src/sheep/components/user-card/user-card.vue index a3a188e2..3470dead 100644 --- a/src/sheep/components/user-card/user-card.vue +++ b/src/sheep/components/user-card/user-card.vue @@ -18,11 +18,12 @@ - {{ + + {{ member.memberNickname }} {{