This commit is contained in:
dzc committed 2025-12-03 18:17:58 +08:00
commit 8e8175d8f1
5 files changed
+737 -699

No files matched your search

+594 -590
View File
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,16 @@
<template>
<view
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme flex items-center"
>
<view v-if="title" class="text-center truncate">{{ title }}</view>
<view class="mx-4 h-1/2 w-3rpx bg-#949494"></view>
<view v-if="value">{{ value }}</view>
</view>
</template>
<script setup lang="ts">
defineProps<{
title: '';
value: '';
}>();
</script>
+99 -104
View File
@@ -1,7 +1,9 @@
<template>
<wd-config-provider theme="dark">
<wd-navbar
:title="userInfoStore.sex == 2 ? '魅力女生认证' : '精英男士认证'"
:title="
userInfoStore.sex == 2 ? '魅力女生认证' : userInfoStore.sex == 1 ? '精英男士认证' : ''
"
safeAreaInsetTop
:bordered="false"
>
@@ -12,14 +14,13 @@
</template>
</wd-navbar>
<!-- v-if="userInfoStore.sex == 2" -->
<view v-if="false" class="py-6 h-[calc(100vh - 44rpx - 200rpx)]">
<view v-if="userInfoStore.sex == 2" class="py-6 h-[calc(100vh - 44rpx - 200rpx)]">
<wd-steps :active="stepActive" align-center>
<wd-step v-for="index in 4" :key="index" />
</wd-steps>
<view class="h-30rpx"></view>
<view v-show="stepActive === 0">
<view v-if="stepActive === 0">
<view class="text-xl my-2 mx-8 c-#FCFBFE">完善详细资料(必填)</view>
<view class="text-sm my-2 mx-8 c-#949494">认真填写,展现你的魅力~</view>
<view class="h-60rpx"></view>
@@ -31,13 +32,7 @@
align-right
:default-value="180"
>
<input
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
:value="userinfo.height ? userinfo.height + 'cm' : ''"
type="text"
placeholder="请选择身高"
placeholder-style="color: rgba(255, 255, 255, 0.6)"
/>
<capsule-cell title="身高" :value="userinfo.height ? userinfo.height + 'cm' : ''" />
</wd-picker>
<wd-picker
v-model="userinfo.weight"
@@ -47,13 +42,7 @@
align-right
:default-value="60"
>
<input
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
:value="userinfo.weight ? userinfo.weight + 'kg' : ''"
type="text"
placeholder="请选择体重"
placeholder-style="color: rgba(255, 255, 255, 0.6)"
/>
<capsule-cell title="体重" :value="userinfo.weight ? userinfo.weight + 'kg' : ''" />
</wd-picker>
<wd-picker
v-model="userinfo.occ"
@@ -62,16 +51,10 @@
title="从事职业"
align-right
>
<input
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
:value="userinfo.occ"
type="text"
placeholder="请选择职业"
placeholder-style="color: rgba(255, 255, 255, 0.6)"
/>
<capsule-cell title="职业" :value="userinfo.occ" />
</wd-picker>
<textarea
class="h-200rpx mx-8 my-4 rounded-10rpx bg-color-light p-10rpx text-28rpx text-color-theme"
class="h-280rpx mx-8 my-4 rounded-10rpx bg-color-light p-10rpx text-32rpx text-color-theme"
v-model="userinfo.description"
:maxlength="100"
placeholder="个人简介(100字以内)"
@@ -79,7 +62,7 @@
/>
</view>
<view v-show="stepActive === 1">
<view v-if="stepActive === 1">
<view class="text-xl my-2 mx-8 c-#FCFBFE">请上传3-5张最美的照片</view>
<view class="text-sm my-2 mx-8 c-#949494">请上传本人真实照片,更容易受到男士青睐</view>
<view class="h-60rpx"></view>
@@ -97,7 +80,7 @@
</view>
</view>
<view v-show="stepActive === 2">
<view v-if="stepActive === 2">
<view class="text-xl my-2 mx-8 c-#FCFBFE">添加联系方式</view>
<view class="text-sm my-2 mx-8 c-#949494">
我们会保护你的隐私,联系方式只展示给审核人员和付费后的VIP男生
@@ -117,7 +100,11 @@
fileMediatype="image"
limit="1"
mode="grid"
:imageStyles="{ width: '268rpx', height: '268rpx' }"
:imageStyles="{
width: '268rpx',
height: '268rpx',
border: { width: '6rpx', color: '#D29E52', radius: '50rpx' },
}"
/>
</view>
<view class="text-sm mx-8 text-color-theme">
@@ -126,20 +113,28 @@
<view class="text-sm mx-8 text-color-theme">匹配不通过将不会认证通过哦~</view>
</view>
<view v-show="stepActive === 3">
<view v-if="stepActive === 3">
<view class="text-xl my-2 mx-8 c-#FCFBFE">基本资料</view>
<view class="text-sm my-2 mx-8 c-#949494">上传清晰的五官头像,让更多用户发现你~</view>
<view class="h-60rpx"></view>
<view class="mx-8 flex justify-between items-center">
<view class="mx-8 flex items-center">
<s-uploader
class="flex-1"
v-model:url="girlAuthPic"
fileMediatype="image"
limit="1"
mode="grid"
:imageStyles="{ width: '268rpx', height: '268rpx' }"
:imageStyles="{
width: '268rpx',
height: '268rpx',
border: { width: '6rpx', color: '#D29E52', radius: '50rpx' },
}"
/>
<view class="flex-1 text-sm mx-8 text-color-theme">确保本人头像,才能通过审核</view>
<view class="flex-1 flex-col-center">
<image class="w-160rpx h-180rpx" src="@/static/face-auth-prompt.png" mode="aspectFit" />
<view class="text-xs text-color-theme">确保本人头像</view>
<view class="text-xs text-color-theme">才能通过审核哦</view>
</view>
</view>
<wd-datetime-picker
v-model="userinfo.birthday"
@@ -151,13 +146,7 @@
:min-date="new Date(1980, 1, 1).getTime()"
:max-date="Date.now()"
>
<input
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
:value="formatDate(userinfo.birthday, 'YYYY-MM-DD')"
type="text"
placeholder="请选择生日"
placeholder-style="color: rgba(255, 255, 255, 0.6)"
/>
<capsule-cell title="生日" :value="formatDate(userinfo.birthday, 'YYYY-MM-DD')" />
</wd-datetime-picker>
<input
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
@@ -167,26 +156,28 @@
placeholder-style="color: rgba(255, 255, 255, 0.6)"
maxlength="10"
/>
<input
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
value="位置权限 未允许"
type="text"
placeholder="位置权限"
placeholder-style="color: rgba(255, 255, 255, 0.6)"
disabled
/>
<capsule-cell title="位置权限" :value="'未允许'" />
</view>
<view class="flex-row-center mt-6 gap-8">
<view
v-if="stepActive > 0"
class="size-100rpx rounded-full bg-color-light text-center line-height-100rpx active:bg-color"
@click="stepActive--"
>
<uni-icons type="arrow-left" color="#D29E52" size="36" />
</view>
<view
v-if="stepActive < 3"
class="size-100rpx rounded-full bg-color-light text-center line-height-100rpx active:bg-color"
@click="stepActive++"
>
<uni-icons type="arrow-right" color="#D29E52" size="36" />
</view>
</view>
<view
v-if="stepActive < 3"
class="size-100rpx rounded-full mx-auto bg-color-light mt-6 text-center line-height-100rpx active:bg-color"
@click="stepActive++"
>
<uni-icons type="arrow-right" color="#D29E52" size="36" />
</view>
<view
v-else
v-if="stepActive === 3"
class="mx-auto mt-6 w-200rpx rounded-full p-3 text-center bg-color-theme-dark active:bg-color-theme"
@click="girlFaceVerify"
>
@@ -194,8 +185,7 @@
</view>
</view>
<!-- v-if="userInfoStore.sex == 1" -->
<view class="py-6 h-[calc(100vh - 44rpx - 200rpx)]">
<view v-if="userInfoStore.sex == 1" class="py-6 h-[calc(100vh - 44rpx - 200rpx)]">
<view class="text-xl my-2 mx-8 c-#FCFBFE">基本资料</view>
<view class="text-sm my-2 mx-8 c-#949494">上传本人头像,女生更放心与你见面~</view>
<view class="h-60rpx"></view>
@@ -237,6 +227,7 @@
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
import { getAccessToken } from '@/sheep/request';
import { formatDate } from '@/sheep/helper/utils';
import CapsuleCell from './components/capsule-cell.vue';
const userInfoStore = computed(() => sheep.$store('user').userInfo);
@@ -274,33 +265,25 @@
// #endif
// #ifdef APP-PLUS
if (!girlAuthPic.value) return uni.showToast({ title: '请先上传人脸照片', icon: 'error' });
const aliyunVerify = uni.requireNativePlugin('AP-FaceDetectModule');
const metaInfo = JSON.stringify(aliyunVerify.getMetaInfo());
let p = uni.getSystemInfoSync().platform;
if (p === 'ios') {
}
console.log('参数:', {
// 创建人脸认证
const { code, data } = await RecentApi.createGirlFaceVerify({
memberHeight: userinfo.height,
memberWeight: userinfo.weight,
memberWechatNumber: wxInfo.wechatNum,
memberOcc: userinfo.occ,
memberDesc: userinfo.description,
authPic: girlAuthPic.value,
metaInfoJson: metaInfo,
});
// const { code, data } = await RecentApi.createGirlFaceVerify({
// authPic: girlAuthPic.value,
// metaInfoJson: metaInfo,
// });
// console.log('创建人脸认证response:', data);
// aliyunVerify.verify(
// {
// certifyId: '<替换生成的certifyId>',
// extParams: { '<扩展参数key>': '<扩展参数value>' },
// },
// function (response: any) {
// console.log(response);
// uni.navigateBack();
// },
// );
console.log('创建人脸认证接口responseData:', code, data);
if (code !== 0)
return uni.showToast({ title: '请上传包含人脸的头像', icon: 'none', duration: 6000 });
verify(data.bizId);
// #endif
};
@@ -316,38 +299,49 @@
const aliyunVerify = uni.requireNativePlugin('AP-FaceDetectModule');
const metaInfo = JSON.stringify(aliyunVerify.getMetaInfo());
console.log('参数:', {
// 查询用户人脸认证
// const { code, data } = await RecentApi.getFaceVerify();
// if (code !== 0) return uni.showToast({ title: '查询用户人脸认证失败', icon: 'error' });
// console.log('查询用户人脸认证', code, data);
// switch (data.authStatus) {
// case '1':
// // 待认证
// break;
// case '2':
// return uni.showToast({ title: '你的人脸审核中', icon: 'error' });
// case '3':
// // 审核通过
// break;
// case '4':
// // 审核失败
// break;
// }
// 创建人脸认证
const { code, data } = await RecentApi.createBoyFaceVerify({
authPic: boyAuthPic.value,
metaInfoJson: metaInfo,
});
// 查询用户人脸认证
const { code, data } = await RecentApi.getFaceVerify();
if (code === 0) {
const { bizId: certifyId } = data;
verify(certifyId);
} else {
// 创建人脸认证
const {
code,
data: { bizId },
} = await RecentApi.createBoyFaceVerify({
authPic: boyAuthPic.value,
metaInfoJson: metaInfo,
});
if (code === 0) {
console.log('创建人脸认证接口response:', data);
verify(bizId);
}
}
console.log('创建人脸认证接口responseData:', code, data);
if (code !== 0)
return uni.showToast({ title: '请上传包含人脸的头像', icon: 'none', duration: 6000 });
verify(data.bizId, data.id);
// #endif
};
const verify = (certifyId: string) => {
/**
*
* @param certifyId 阿里人脸认证id
* @param authId 发起认证的id
*/
const verify = (certifyId: string, authId: string) => {
if (!certifyId) return uni.showToast({ title: 'certifyId不存在', icon: 'none' });
const p = uni.getSystemInfoSync().platform;
if (p === 'ios') {
}
console.log('certifyId', certifyId);
const aliyunVerify = uni.requireNativePlugin('AP-FaceDetectModule');
aliyunVerify.verify(
@@ -356,7 +350,7 @@
useMsgBox: true,
extParams: null,
},
function (response: any) {
async function (response: any) {
console.log('认证结果', response);
switch (response.code) {
@@ -371,7 +365,8 @@
uni.showToast({ title: '您已认证成功', icon: 'none' });
break;
case 1001:
uni.showToast({ title: '系统错误', icon: 'none' });
await RecentApi.cancelFaceVerify({ authId });
// uni.showToast({ title: '系统错误', icon: 'none' });
break;
case 1003:
uni.showToast({ title: '验证中断', icon: 'none' });
+28 -5
View File
@@ -362,18 +362,41 @@ const RecentApi = {
},
});
},
// 查询用户人脸认证
getFaceVerify: (params: any) => {
// 创建女性人脸认证
createGirlFaceVerify: (data: any) => {
return request({
url: '/member/com-auth/get',
method: 'GET',
params,
url: '/member/com-auth/create-woman-auth',
method: 'POST',
data,
custom: {
showLoading: true,
loadingMsg: '加载中',
},
});
},
// 查询用户人脸认证
getFaceVerify: () => {
return request({
url: '/member/com-auth/get',
method: 'GET',
custom: {
showLoading: true,
loadingMsg: '加载中',
},
});
},
// 取消用户人脸认证
cancelFaceVerify: (params: { authId: string | number }) => {
return request({
url: '/member/com-auth/cancel',
method: 'GET',
params,
custom: {
showLoading: true,
loadingMsg: '正在取消',
},
});
},
};
export default RecentApi;
BIN
View File
Binary file not shown.