个人认证

This commit is contained in:
唐明明
2021-09-24 16:34:10 +08:00
parent 9c8b34cc30
commit 03c6628e84
6 changed files with 101 additions and 85 deletions

View File

@@ -1,9 +1,5 @@
<template>
<view>
<!-- 副标题 -->
<view class="sub-title">
<text>请正确填写你的个人身份信息</text>
</view>
<!-- 填写姓名 -->
<view class="password">
<view class="group">
@@ -24,7 +20,7 @@
<text>上传身份证正面</text>
</view>
<view class="idcard-block positive">
<image :src="positive" mode="aspectFit" @click="upload('positive')"/>
<image :src="positive.showpath" mode="aspectFit" @click="upload('positive')"/>
</view>
</view>
<view class="idcard-item">
@@ -32,7 +28,7 @@
<text>上传身份证背面</text>
</view>
<view class="idcard-block reverse">
<image :src="reverse" mode="aspectFit" @click="upload('reverse')" />
<image :src="reverse.showpath" mode="aspectFit" @click="upload('reverse')"></image>
</view>
</view>
</view>
@@ -44,19 +40,22 @@
</template>
<script>
// import uploading from '@/apis/oss'
import { personal } from '@/apis/interfaces/certification'
import { uploads } from '@/apis/interfaces/uploading'
export default {
data() {
return {
positive: '',
reverse: '',
positive: {
showpath: '',
path: ''
},
reverse : {
showpath: '',
path: ''
},
nikcName: '',
idcardNo: ''
}
},
mounted() {
},
methods: {
// 创建钱包
@@ -70,27 +69,13 @@
}
personal({
name: this.nikcName,
id_card: this.idcardNo
id_card: this.idcardNo,
front_card: this.positive.path,
back_card: this.reverse.path,
}).then(res=>{
uni.showModal({
title: '提示',
content: '您的身份认证已完成,是否立即激活钱包~',
confirmText: '立即激活',
confirmColor: '#009B69',
cancelColor: '#666666',
cancelText: '稍后激活',
success: res=> {
if(res.confirm) {
uni.redirectTo({
url: '../wallet/mnemonic'
})
}
if(res.cancel) {
uni.navigateBack()
}
}
})
console.log(res)
}).catch(err => {
console.log(err)
uni.showToast({
icon: 'none',
title: err.message
@@ -98,19 +83,18 @@
})
},
// 上传身份证
upload(type){
upload(key){
uni.chooseImage({
success(files){
uni.showToast({
icon: 'none',
title: '暂未开放'
count: 1,
success: files=> {
uploads([{
uri: files.tempFilePaths[0]
}]).then(res => {
this[key] = {
showpath: res.url[0],
path: res.path[0]
}
})
// let filesArr = files.tempFilePaths.map(val => {
// return {
// uri: val
// }
// })
// uploading(filesArr)
}
})
}
@@ -129,26 +113,28 @@
// 上传证件
.idcard-flex{
display: flex;
padding: ($padding*2) $padding 0;
margin-top: $margin - 10;
background: white;
padding: $padding $padding/2;
.idcard-item{
margin: 0 $margin;
width: calc(50% - #{$margin * 2});
margin: 0 $margin/2;
width: calc(50% - #{$margin});
.idcard-title{
text-align: center;
color: $text-gray;
font-size: $title-size-m;
font-size: $title-size-sm;
padding-bottom: $padding;
}
.idcard-block{
position: relative;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
border:solid 1rpx $border-color-lg;
background-color: white;
padding-top: 63%;
background-position: center;
background-size: 36%;
background-repeat: no-repeat;
overflow: hidden;
box-sizing: border-box;
&.positive{
background-image: url(../../static/background/idcard-positive.png);
}
@@ -161,62 +147,66 @@
left: 0;
height: 100%;
width: 100%;
z-index: 1;
z-index: 2;
}
}
}
}
// 身份信息
.password{
padding: 0 $padding * 2;
.prompt{
margin-top: $margin * 2;
font-size: $title-size-m;
color: $mian-color;
}
.group{
margin-top: $margin;
border-radius: $radius-m;
box-shadow: 0 0 4rpx 4rpx rgba($color: $text-color, $alpha: .02);
background-color: white;
.inputs{
padding: $padding $padding + 10;
border-bottom: solid 1rpx $border-color;
&:last-child{
border-bottom: none;
position: relative;
height: 90rpx;
padding-left: 220rpx;
padding-right: $padding;
&::before{
position: absolute;
left: $margin;
bottom: 0;
right: 0;
height: 1rpx;
background: $border-color;
content: " ";
}
&:last-child::before{
display: none;
}
label{
position: absolute;
left: $margin;
height: 90rpx;
line-height: 90rpx;
color: $text-gray;
font-size: $title-size-m;
font-size: $title-size-lg;
}
input{
height: 70rpx;
line-height: 70rpx;
font-size: $title-size;
height: 90rpx;
line-height: 90rpx;
font-size: $title-size-lg;
}
}
}
}
// 按钮
.buttons{
padding: $padding * 2;
.text{
text-align: center;
line-height: 90rpx;
height: 90rpx;
margin-bottom: $margin * 2;
font-size: $title-size-lg;
color: $mian-color;
font-weight: bold;
}
padding: $padding;
button{
height: 90rpx;
line-height: 90rpx;
background-color: $mian-color;
border-radius: $radius-lg;
background-color: $mian-color-deep;
border-radius: 0;
color: white;
font-weight: bold;
font-size: $title-size;
font-size: $title-size-lg;
&::after{
border: none;
}
}
}
</style>