feat:人脸认证页

This commit is contained in:
ctw committed 2025-12-02 17:01:03 +08:00
1 parent ec07bc5804
commit f07a41e5cc
5 files changed
+89 -36

No files matched your search

+18 -5
View File
@@ -83,11 +83,11 @@
<view class="my-2 text-size-base">相册</view>
<image
class="size-140rpx rounded-1 mr-2 mb-1"
v-for="(item, index) in userDetail.coverPic?.split(',')"
v-for="(item, index) in photoListUrls"
:key="index"
:src="item"
mode="aspectFill"
@click="previewPhoto(userDetail.coverPic?.split(','), index)"
@click="previewPhoto(index)"
/>
</view>
@@ -142,7 +142,13 @@
class="text-base py-2 px-10 rounded-full bg-white c-black flex gap-2"
@click="handleLike"
>
<uni-icons type="heart" size="24" color="#B5B4BC"></uni-icons>
<uni-icons
v-if="userDetail.operationStatus.isLike"
type="heart-filled"
size="24"
color="#D29E52"
/>
<uni-icons v-else type="heart" size="24" color="#B5B4BC"></uni-icons>
<text>喜欢</text>
</view>
</view>
@@ -184,6 +190,12 @@
memberId: '',
});
const photoListUrls = computed(() =>
userDetail.value.memberPhotoList
?.filter((i) => i.resourceType === 'IMAGE')
.map((item) => item.address),
);
onLoad(async (options: any) => {
const { memberId } = options;
if (!memberId) return uni.showToast({ title: '参数错误', icon: 'none' });
@@ -237,10 +249,11 @@
scrollTop.value = e.detail.scrollTop;
}
const previewPhoto = (urls: string[], current: number) => {
// 相册预览
const previewPhoto = (current: number) => {
uni.previewImage({
current,
urls,
urls: photoListUrls.value,
indicator: 'number',
});
};
+32 -13
View File
@@ -8,30 +8,49 @@
</template>
</wd-navbar>
<view class="bg-color-theme-dark" @click="faceVerify">人脸认证</view>
<view
class="mx-auto mt-30 w-200rpx rounded-full p-4 text-center bg-color-theme-dark active:bg-color-theme"
@click="faceVerify"
>
人脸认证
</view>
</wd-config-provider>
</template>
<script setup lang="ts">
const faceVerify = () => {
import RecentApi from '@/sheep/api/member/recent';
const faceVerify = async () => {
// #ifdef APP-PLUS
const aliyunVerify = uni.requireNativePlugin('AP-FaceDetectModule');
let metaInfo = aliyunVerify.getMetaInfo();
metaInfo = JSON.stringify(metaInfo);
let p = uni.getSystemInfoSync().platform;
if (p === 'ios') {
metaInfo = JSON.stringify(metaInfo);
}
console.log('metaInfo', metaInfo);
aliyunVerify.verify(
{
certifyId: '<替换生成的certifyId>',
extParams: { '<扩展参数key>': '<扩展参数value>' },
},
function (response: any) {
console.log(response);
},
);
console.log('设备信息metaInfo:', metaInfo);
const { code, data } = await RecentApi.createManFaceVerify({
authPic:
'https://img3.redocn.com/tupian/20160316/qingxinpugongyingqingxinbeijing_6012341.jpg',
metaInfoJson: metaInfo,
});
console.log('创建人脸认证response:', data);
// aliyunVerify.verify(
// {
// certifyId: '<替换生成的certifyId>',
// extParams: { '<扩展参数key>': '<扩展参数value>' },
// },
// function (response: any) {
// console.log(response);
// },
// );
// #endif
// #ifndef APP-PLUS
uni.showToast({ title: '当前设备不支持' });
// #endif
};
</script>
+11 -2
View File
@@ -25,7 +25,10 @@
/>
<view class="flex-1">
<view class="mb-1 text-base">{{ userInfo.nickname }}</view>
<view class="mb-2 text-xs text-#ffffff80">ID: {{ userInfo.id }}</view>
<view class="mb-2 text-xs text-#ffffff80 flex items-center">
<text>ID: {{ userInfo.id }}</text>
<image class="size-24rpx ml-4" :src="userGenderImageSrc" mode="scaleToFill" />
</view>
<text
v-if="userCity?.t"
class="bg-#333 text-color-theme-dark text-xs px-2 py-1 rounded-1 truncate"
@@ -177,6 +180,12 @@
const userInfo = computed(() => sheep.$store('user').userInfo);
const userCity = computed(() => sheep.$store('user').userCity);
const userWallet = computed(() => sheep.$store('user').userWallet);
const userGenderImageSrc = computed(() => {
const sex = userInfo.value.sex;
if (sex === 1) return '/static/gender-man.png';
if (sex === 2) return '/static/gender-woman.png';
return '';
});
onLoad(async () => {
const { data: totalData } = await RecentApi.recentTotal();
@@ -226,7 +235,7 @@
{ title: '访客记录', value: '', icon: 'dong', to: '/pages/profile/view-record' },
{ title: '认证中心', value: '', icon: 'user', to: '/pages/profile/face-verify' },
{ title: '我的动态√', value: '', icon: 'star', to: '/pages/profile/my-moment' },
{ title: '我的评价', value: '', icon: 'view-module', to: '', click: lookMyEvaluation },
{ title: '我的评价√', value: '', icon: 'view-module', to: '', click: lookMyEvaluation },
{ title: '问题反馈√', value: '', icon: 'backtop-rectangle', to: '', click: goFeedback },
// { title: '客服助手', value: '', icon: 'service', to: '' },
{ title: '关注公众号√', value: '获取最新消息', icon: 'qrcode', to: '', click: subOfficial },
+1 -4
View File
@@ -45,8 +45,5 @@
const activeTab = ref();
const params = reactive({});
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
RecentApi.viewRecord,
params,
);
const { listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(RecentApi.xxx, params);
</script>
+27 -12
View File
@@ -116,18 +116,6 @@ const RecentApi = {
},
});
},
// 查看访客记录
viewRecord: (data: any) => {
return request({
url: '/member/recent/xxx/xxx',
method: 'POST',
data,
custom: {
showLoading: true,
loadingMsg: '加载中',
},
});
},
// 查看我的评价
myEvaluate: () => {
return request({
@@ -221,6 +209,21 @@ const RecentApi = {
},
});
},
// 添加朋友圈或用户详情页面的查看和访问记录
createViewRecord: (data: {
bizType: 'CLASSIFY' | 'RECENT';
viewStartTime: string;
viewEndTime: string;
}) => {
return request({
url: '/member/recent/create/view-record',
method: 'POST',
data,
custom: {
showLoading: false,
},
});
},
// 获得用户协议或隐私政策文章
getPromotionArticle: (params: any) => {
return request({
@@ -347,6 +350,18 @@ const RecentApi = {
},
});
},
// 创建男性人脸认证
createManFaceVerify: (data: any) => {
return request({
url: '/member/com-auth/create-man-auth',
method: 'POST',
data,
custom: {
showLoading: true,
loadingMsg: '加载中',
},
});
},
};
export default RecentApi;