476 lines
9.4 KiB
Plaintext
476 lines
9.4 KiB
Plaintext
<template>
|
||
|
||
<view class="skeleton-container" v-if="isLoading">
|
||
<!-- 顶部提示栏骨架 -->
|
||
<view class="skeleton-top-tip"></view>
|
||
|
||
<!-- 身份信息区域骨架 -->
|
||
<view class="skeleton-section">
|
||
<view class="skeleton-title"></view>
|
||
<view class="skeleton-form-item">
|
||
<view class="skeleton-label"></view>
|
||
<view class="skeleton-input"></view>
|
||
</view>
|
||
<view class="skeleton-form-item">
|
||
<view class="skeleton-label"></view>
|
||
<view class="skeleton-input"></view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 身份证照片区域骨架 -->
|
||
<view class="skeleton-section">
|
||
<view class="skeleton-title"></view>
|
||
<view class="skeleton-upload-item"></view>
|
||
<view class="skeleton-upload-item"></view>
|
||
</view>
|
||
|
||
<!-- 人脸识别区域骨架 -->
|
||
<view class="skeleton-section">
|
||
<view class="skeleton-title"></view>
|
||
<view class="skeleton-face-area">
|
||
<view class="skeleton-face-icon"></view>
|
||
<view class="skeleton-face-text"></view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 协议勾选骨架 -->
|
||
<view class="skeleton-agreement"></view>
|
||
|
||
<!-- 提交按钮骨架 -->
|
||
<view class="skeleton-submit"></view>
|
||
</view>
|
||
|
||
|
||
<view v-else class="real-name-auth-container">
|
||
<!-- 顶部提示栏 -->
|
||
<view class="top-tip">
|
||
<text class="tip-text">请完成实名认证,保障您的接单权益</text>
|
||
</view>
|
||
|
||
<!-- 表单内容 -->
|
||
<view class="form-content">
|
||
<!-- 身份信息区域 -->
|
||
<view class="section">
|
||
<view class="section-title">身份信息</view>
|
||
|
||
<!-- 姓名输入 -->
|
||
<view class="form-item">
|
||
<view class="label">姓名</view>
|
||
<u-input v-model="formData.name" placeholder="请输入身份证姓名" placeholder-color="#999" border="none"
|
||
class="input" input-align="right" />
|
||
</view>
|
||
|
||
<!-- 身份证号输入 -->
|
||
<view class="form-item">
|
||
<view class="label">身份证号</view>
|
||
<u-input v-model="formData.idCard" placeholder="请输入18位身份证号" placeholder-color="#999" border="none"
|
||
class="input" input-align="right" maxlength="18" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 身份证照片区域 -->
|
||
<view class="section">
|
||
<view class="section-title">身份证照片</view>
|
||
|
||
<!-- 上传身份证正面 -->
|
||
<view class="upload-item">
|
||
<view class="upload-area bordered-area">
|
||
<view class="upload-content">
|
||
<view class="upload-icon">+</view>
|
||
<view class="upload-text">上传身份证正面</view>
|
||
</view>
|
||
<!-- 显示上传后的占位图 -->
|
||
<view v-if="formData.frontImage" class="uploaded-placeholder">
|
||
<text>身份证正面</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 上传身份证反面 -->
|
||
<view class="upload-item">
|
||
<view class="upload-area bordered-area">
|
||
<view class="upload-content">
|
||
<view class="upload-icon">+</view>
|
||
<view class="upload-text">上传身份证反面</view>
|
||
</view>
|
||
<!-- 显示上传后的占位图 -->
|
||
<view v-if="formData.backImage" class="uploaded-placeholder">
|
||
<text>身份证反面</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 人脸识别区域 -->
|
||
<view class="section">
|
||
<view class="section-title">人脸验证</view>
|
||
|
||
<view class="face-verify-area" @click="handleFaceVerify">
|
||
<view class="face-icon">
|
||
<up-icon name="account" size="60" color="#1890ff"></up-icon>
|
||
</view>
|
||
<view class="face-text">点击进行人脸识别</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 协议勾选 -->
|
||
<view class="agreement-section">
|
||
<u-checkbox v-model="formData.agreed" shape="circle" class="checkbox" />
|
||
<text class="agreement-text">我已阅读并同意</text>
|
||
<text class="agreement-link" @click="handleAgreementClick">《骑手实名认证协议》</text>
|
||
</view>
|
||
|
||
<!-- 提交按钮 -->
|
||
<view class="submit-section">
|
||
<u-button type="primary" class="submit-btn" size="large">
|
||
提交认证
|
||
</u-button>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import { onLoad } from '@dcloudio/uni-app';
|
||
import { ref, computed } from 'vue';
|
||
|
||
let isLoading = ref(true)
|
||
|
||
// 表单数据
|
||
const formData = ref({
|
||
name: '',
|
||
idCard: '',
|
||
frontImage: '',
|
||
backImage: '',
|
||
agreed: false
|
||
});
|
||
|
||
|
||
onLoad(() => {
|
||
setTimeout(() => {
|
||
isLoading.value = false
|
||
}, 1000)
|
||
})
|
||
|
||
// 处理人脸识别
|
||
const handleFaceVerify = () => {
|
||
// 在实际应用中,这里会调用人脸识别相关API
|
||
console.log('开始人脸识别');
|
||
};
|
||
|
||
// 处理协议点击
|
||
const handleAgreementClick = () => {
|
||
// 打开协议详情
|
||
console.log('打开协议详情');
|
||
};
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
page {
|
||
background-color: #f5f5f5;
|
||
}
|
||
|
||
/* 骨架屏样式 */
|
||
.skeleton-container {
|
||
padding: 0 30rpx;
|
||
}
|
||
|
||
.skeleton-top-tip {
|
||
height: 70rpx;
|
||
width: 100%;
|
||
background-color: #e6f7ff;
|
||
margin: 20rpx 0;
|
||
border-radius: 10rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-section {
|
||
margin-bottom: 40rpx;
|
||
}
|
||
|
||
.skeleton-title {
|
||
height: 32rpx;
|
||
width: 160rpx;
|
||
background-color: #e6e6e6;
|
||
border-radius: 16rpx;
|
||
margin-bottom: 20rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-form-item {
|
||
display: flex;
|
||
align-items: center;
|
||
background-color: #fff;
|
||
padding: 30rpx;
|
||
border-bottom: 1rpx solid #f0f0f0;
|
||
}
|
||
|
||
.skeleton-form-item:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.skeleton-label {
|
||
height: 28rpx;
|
||
width: 120rpx;
|
||
background-color: #e6e6e6;
|
||
border-radius: 14rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-input {
|
||
height: 28rpx;
|
||
width: calc(100% - 140rpx);
|
||
background-color: #e6e6e6;
|
||
margin-left: 20rpx;
|
||
border-radius: 14rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-upload-item {
|
||
height: 200rpx;
|
||
width: 100%;
|
||
background-color: #fff;
|
||
border: 2rpx solid #000;
|
||
border-radius: 20rpx;
|
||
margin-bottom: 20rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-face-area {
|
||
height: 240rpx;
|
||
background-color: #fff;
|
||
border-radius: 8rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.skeleton-face-icon {
|
||
width: 120rpx;
|
||
height: 120rpx;
|
||
border-radius: 50%;
|
||
background-color: #e6e6e6;
|
||
margin-bottom: 20rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-face-text {
|
||
height: 28rpx;
|
||
width: 200rpx;
|
||
background-color: #e6e6e6;
|
||
border-radius: 14rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-agreement {
|
||
height: 30rpx;
|
||
width: 60%;
|
||
background-color: #e6e6e6;
|
||
border-radius: 15rpx;
|
||
margin-bottom: 40rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
.skeleton-submit {
|
||
height: 92rpx;
|
||
width: 100%;
|
||
background-color: #e6e6e6;
|
||
border-radius: 46rpx;
|
||
animation: skeleton-loading 1.5s infinite ease-in-out;
|
||
}
|
||
|
||
/* 骨架屏动画 */
|
||
@keyframes skeleton-loading {
|
||
0% {
|
||
opacity: 0.6;
|
||
}
|
||
|
||
50% {
|
||
opacity: 1;
|
||
}
|
||
|
||
100% {
|
||
opacity: 0.6;
|
||
}
|
||
}
|
||
|
||
.top-tip {
|
||
background-color: #E6F7FF;
|
||
padding: 20rpx 30rpx;
|
||
margin: 20rpx;
|
||
border-radius: 20rpx;
|
||
}
|
||
|
||
.tip-text {
|
||
color: #1890ff;
|
||
font-size: 28rpx;
|
||
}
|
||
|
||
.form-content {
|
||
padding: 0 30rpx;
|
||
}
|
||
|
||
.section {
|
||
margin-bottom: 40rpx;
|
||
}
|
||
|
||
.section-title {
|
||
font-size: 32rpx;
|
||
font-weight: bold;
|
||
color: #333;
|
||
margin-bottom: 20rpx;
|
||
padding-left: 10rpx;
|
||
}
|
||
|
||
.form-item {
|
||
background-color: #fff;
|
||
padding: 30rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
border-bottom: 1rpx solid #f0f0f0;
|
||
}
|
||
|
||
.form-item:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.label {
|
||
width: 120rpx;
|
||
font-size: 28rpx;
|
||
color: #333;
|
||
}
|
||
|
||
.input {
|
||
flex: 1;
|
||
font-size: 28rpx;
|
||
}
|
||
|
||
.upload-item {
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.upload-area {
|
||
height: 200rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
align-items: center;
|
||
cursor: pointer;
|
||
position: relative;
|
||
}
|
||
|
||
.bordered-area {
|
||
background-color: #fff;
|
||
border-radius: 20rpx;
|
||
width: 100%;
|
||
}
|
||
|
||
.upload-content {
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
align-items: center;
|
||
height: 100%;
|
||
z-index: 1;
|
||
}
|
||
|
||
.upload-icon {
|
||
font-size: 60rpx;
|
||
color: #1890ff;
|
||
margin-bottom: 10rpx;
|
||
}
|
||
|
||
.upload-text {
|
||
font-size: 28rpx;
|
||
color: #1890ff;
|
||
}
|
||
|
||
.uploaded-placeholder {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background-color: #fff;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
border: 2rpx solid #000;
|
||
color: #333;
|
||
font-size: 28rpx;
|
||
}
|
||
|
||
.face-verify-area {
|
||
background-color: #fff;
|
||
height: 240rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
align-items: center;
|
||
cursor: pointer;
|
||
border-radius: 8rpx;
|
||
}
|
||
|
||
.face-icon {
|
||
width: 120rpx;
|
||
height: 120rpx;
|
||
border-radius: 50%;
|
||
background-color: #e6f7ff;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.face-text {
|
||
font-size: 28rpx;
|
||
color: #1890ff;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.agreement-section {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 40rpx;
|
||
padding: 0 10rpx;
|
||
}
|
||
|
||
.checkbox {
|
||
margin-right: 10rpx;
|
||
}
|
||
|
||
.agreement-text {
|
||
font-size: 26rpx;
|
||
color: #666;
|
||
}
|
||
|
||
.agreement-link {
|
||
font-size: 26rpx;
|
||
color: #1890ff;
|
||
margin-left: 4rpx;
|
||
}
|
||
|
||
.input {
|
||
flex: 1;
|
||
font-size: 28rpx;
|
||
color: #333;
|
||
}
|
||
|
||
.submit-section {
|
||
margin-top: 60rpx;
|
||
padding: 0 20rpx;
|
||
}
|
||
|
||
.submit-btn {
|
||
height: 92rpx;
|
||
font-size: 32rpx;
|
||
border-radius: 46rpx;
|
||
background-color: #1890ff;
|
||
}
|
||
|
||
.submit-btn[disabled] {
|
||
background-color: #a0cfff;
|
||
color: #ffffff;
|
||
}
|
||
</style> |