| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750 |
- <!-- 证件识别 -->
- <template>
- <view>
- <!-- {{ userInfoData.customersfrz }} 判断该账号是否已经完成实名认证 -->
- <view class="realname">
- <!-- 输入您的姓名 -->
- <view class="cu-bar bg-white qyyyzz">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue">您的身份</text>
- <text class="text-ABC text-blue"></text>
- </view>
- </view>
- <view class="input_box">
- <u-radio-group v-model="formData.customerzjlx">
- <u-radio active-color="#eab766" name="中国大陆人员"> 中国大陆人员 </u-radio>
- <u-radio active-color="#eab766" name="港澳台/外籍人员"> 港澳台/外籍人员 </u-radio>
- </u-radio-group>
- </view>
- <view class="cu-bar bg-white qyyyzz">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue">个人信息</text>
- <text class="text-ABC text-blue"></text>
- </view>
- </view>
- <view class="input_box">
- <input class="input" placeholder="输入手机号码" v-model="formData.customertel" />
- </view>
- <view class="input_box">
- <input class="input" placeholder="输入证件姓名" v-model="formData.customername" />
- </view>
- <view class="input_box">
- <input class="input" placeholder="输入证件号" v-model="formData.customerzjhm" />
- </view>
- <view class="input_box flex">
- <input class="input" disabled style="flex-grow: 1; background: #fff" placeholder="填写验证码" v-model="smsCode" />
- <view class="inputBtn" @click="handelSmsCaptcha()">
- <text v-if="!smsState" class="activate">获取验证码</text>
- <text v-else class="un-activate">重新发送({{ times }})秒</text>
- </view>
- </view>
- <view v-if="formData.customerzjlx === '中国大陆人员'">
- <!-- 身份证 -->
- <view class="cu-bar bg-white">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue">请拍摄并上传个人证件</text>
- <text class="text-ABC text-blue"> </text>
- </view>
- </view>
- <view class="uploadBox">
- <view style="width: 43%">
- <view class="uploadItem">
- <view class="imgBox imgEx1">
- <view class="leftTop"></view>
- <view class="leftTop2"></view>
- <view class="leftbottom"></view>
- <view class="leftbottom2"></view>
- <view class="rightTop"></view>
- <view class="rightTop2"></view>
- <view class="rightbottom"></view>
- <view class="rightbottom2"></view>
- </view>
- <image class="imgUrl" v-if="imgUrl1" :src="imgUrl1"></image>
- </view>
- <view
- @click="uploadImg('imgUrl1', {attmodel: 'sfz-zhengmian', attpath: '/certificate/personageidc/', attother2: '身份证正面'})"
- class="leftBtn text-white text-lg text-center"
- >上传正面</view
- >
- </view>
- <view style="width: 43%">
- <view class="uploadItem">
- <view class="imgBox imgEx2">
- <view class="leftTop"></view>
- <view class="leftTop2"></view>
- <view class="leftbottom"></view>
- <view class="leftbottom2"></view>
- <view class="rightTop"></view>
- <view class="rightTop2"></view>
- <view class="rightbottom"></view>
- <view class="rightbottom2"></view>
- </view>
- <image class="imgUrl" v-if="imgUrl2" :src="imgUrl2"></image>
- </view>
- <view
- @click="uploadImg('imgUrl2', {attmodel: 'sfz-fanmian', attpath: '/certificate/personageidc/', attother2: '身份证反面'})"
- class="leftBtn text-white text-lg text-center"
- >上传反面</view
- >
- </view>
- </view>
- <view class="uploadText">图片格式要求PNG、JPG、BMP、TIFF、WebP,不超过5M</view>
- <!-- 身份证 -->
- <view class="cu-bar bg-white">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue" @click="renlianheshi">完成人脸核实信息</text>
- <text class="text-ABC text-blue"> </text>
- </view>
- </view>
- <view class="input_box flex">
- <view class="rlhsBtn r_flex_center" @click="handelSmsCaptcha()">
- <i-face-recognition style="margin-right: 10rpx" theme="outline" size="22" fill="#eab766" :strokeWidth="2" strokeLinejoin="bevel" strokeLinecap="square" />
- <text class="activate">{{ shibieMsg }}</text>
- </view>
- </view>
- </view>
- <!-- 护照、有效证件 -->
- <view v-if="formData.customerzjlx === '港澳台/外籍人员'">
- <!-- 身份证 -->
- <view class="cu-bar bg-white">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue">请拍摄并上传护照或其它有效证件</text>
- <text class="text-ABC text-blue"> </text>
- </view>
- </view>
- <view class="uploadBox">
- <view style="width: 43%">
- <view class="uploadItem">
- <view class="imgBox imgEx1">
- <view class="leftTop"></view>
- <view class="leftTop2"></view>
- <view class="leftbottom"></view>
- <view class="leftbottom2"></view>
- <view class="rightTop"></view>
- <view class="rightTop2"></view>
- <view class="rightbottom"></view>
- <view class="rightbottom2"></view>
- </view>
- <image class="imgUrl" v-if="imgHzUrl1" :src="imgHzUrl1"></image>
- </view>
- <view
- @click="uploadImg('imgHzUrl1', {attmodel: 'hz-zhengmian', attpath: '/certificate/personageidc/', attother2: '护照正面'})"
- class="leftBtn text-white text-lg text-center"
- >上传正面</view
- >
- </view>
- <view style="width: 43%">
- <view class="uploadItem">
- <view class="imgBox imgEx2">
- <view class="leftTop"></view>
- <view class="leftTop2"></view>
- <view class="leftbottom"></view>
- <view class="leftbottom2"></view>
- <view class="rightTop"></view>
- <view class="rightTop2"></view>
- <view class="rightbottom"></view>
- <view class="rightbottom2"></view>
- </view>
- <image class="imgUrl" v-if="imgHzUrl2" :src="imgHzUrl2"></image>
- </view>
- <view
- @click="uploadImg('imgHzUrl2', {attmodel: 'hz-fanmian', attpath: '/certificate/personageidc/', attother2: '护照反面'})"
- class="leftBtn text-white text-lg text-center"
- >上传反面</view
- >
- </view>
- </view>
- <view class="uploadText">图片格式要求PNG、JPG、BMP、TIFF、WebP,不超过5M</view>
- <!-- 人脸 -->
- <view class="cu-bar bg-white">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue">请拍摄并上传人脸正面照片</text>
- <text class="text-ABC text-blue"> </text>
- </view>
- </view>
- <view class="uploadBox">
- <view style="width: 43%">
- <view class="uploadItem">
- <view class="imgBox imgExImgUrlHuman"> </view>
- <image class="imgUrl" v-if="imgUrlHuman" :src="imgUrlHuman"></image>
- </view>
- <view
- @click="uploadImg('imgUrlHuman', {attmodel: 'ple-renlian', attpath: '/certificate/personageidc/', attother2: '人脸正面'})"
- class="leftBtn text-white text-lg text-center"
- >拍摄正脸</view
- >
- </view>
- </view>
- <view class="uploadText">照片要求清晰、无遮挡、实时拍摄;图片格式要求PNG、JPG、BMP、TIFF、WebP不超过5M</view>
- </view>
- <view class="cu-bar bg-white margin-top" v-if="false">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue">识别内容核对</text>
- <text class="text-ABC text-blue"></text>
- </view>
- </view>
- <view class="distinguishBox" v-if="false">
- <view>
- <text class="text-bold disLabel">姓名:</text>
- <text>刘德华</text>
- </view>
- <view>
- <text class="text-bold disLabel">民族:</text>
- <text>汉</text>
- </view>
- <view>
- <text class="text-bold disLabel">居住地:</text>
- <text>陕西省西安市</text>
- </view>
- <view>
- <text class="text-bold disLabel">身份证号:</text>
- <text>610104196511090809</text>
- </view>
- </view>
- <view class="cu-bar bg-white margin-top">
- <view class="action sub-title">
- <text class="text-xl text-bold text-blue">拍摄要求须知</text>
- <text class="text-ABC text-blue"></text>
- </view>
- </view>
- <view class="requirement">
- <view>
- <text class="text-gray">请上传大陆公民持有的本人有效身份证;</text>
- </view>
- <view>
- <text class="text-gray">拍摄时确保身份证</text>
- <text class="text-red">边框完整,</text>
- <text class="text-red">字体清晰,</text>
- <text class="text-red">亮度均匀;</text>
- </view>
- <view class="errorBox">
- <view class="item1">
- <image class="iconImg" src="/static/discern/ok.png" mode="widthFix"></image>
- </view>
- <view class="item2">
- <image class="iconImg" src="/static/discern/no.png" mode="widthFix"></image>
- </view>
- <view class="item3">
- <image class="iconImg" src="/static/discern/no.png" mode="widthFix"></image>
- </view>
- <view class="item4">
- <image class="iconImg" src="/static/discern/no.png" mode="widthFix"></image>
- </view>
- </view>
- </view>
- <view class="submitBtn" @click="upFormData">提交认证</view>
- </view>
- </view>
- </template>
- <script>
- import * as AppApi from '@/api/app'
- import request from '@/utils/request'
- import storage from '@/utils/storage'
- import * as Verify from '@/utils/verify'
- const apiUrl = 'https://hnapi.kdboss.cn'
- // 倒计时时长(秒)
- const times = 60
- export default {
- data() {
- return {
- list: ['隐私说明:请按要求上传真实的证件照片,您所上传的行驶证仅用于平台账户绑定,请放心上传'],
- // ../static/me/zjx_me_bg6.jpg
- imgUrl1: '',
- imgUrl2: '',
- imgUrl3: '',
- imgHzUrl1: '',
- imgHzUrl2: '',
- // 外籍人员 人脸
- imgUrlHuman: '',
- formData: {
- customerzjlx: '',
- customername: '',
- customerzjhm: '',
- // 手机号码
- customertel: ''
- },
- imgList: [],
- imgss: [],
- fileList: '',
- // 正在加载
- isLoading: false,
- // 图形验证码信息
- captcha: {},
- // 短信验证码发送状态
- smsState: false,
- // 倒计时
- times,
- // 手机号
- mobile: '',
- // 图形验证码
- captchaCode: '',
- // 短信验证码
- smsCode: '',
- payorderid: '',
- payordercustomerid: '',
- shibieMsg: '点击进入人脸活体验证'
- }
- },
- computed: {
- userInfoData: () => storage.get('wx_userinfo')
- },
- watch: {},
- onReady() {
- // 获取屏幕高度
- uni.getSystemInfo({
- success: (res) => {
- console.log(res.windowHeight)
- }
- })
- },
- onLoad(options) {
- const app = this
- app.payorderid = options.payorderid
- app.payordercustomerid = options.payordercustomerid
- },
- mounted() {
- let baseUrl = apiUrl + '/api/attachment/addtoPath?pagevalue=300'
- this.fileList = baseUrl
- },
- methods: {
- // 点击发送短信验证码
- handelSmsCaptcha() {
- const app = this
- if (Verify.isEmpty(app.formData.customertel)) {
- this.$toast('请填写手机号码')
- return false
- }
- if (app.smsState) {
- this.$toast('请稍后再发送')
- return false
- }
- app.sendSmsCaptcha()
- },
- // 人脸核实
- renlianheshi() {},
- // 请求发送短信验证码接口
- sendSmsCaptcha() {
- const app = this
- app.isLoading = true
- AppApi.getPalList()
- .then((result) => {
- // 显示发送成功
- app.$toast(result.message)
- // 执行定时器
- app.timer()
- })
- .finally(() => {
- // 显示发送成功
- app.$toast('发送成功')
- // 执行定时器
- app.timer()
- app.isLoading = false
- })
- },
- // 执行定时器
- timer() {
- const app = this
- app.smsState = true
- const inter = setInterval(() => {
- app.times = app.times - 1
- if (app.times <= 0) {
- app.smsState = false
- app.times = times
- clearInterval(inter)
- }
- }, 1000)
- },
- //头像上传
- uploadImg(url, formData) {
- const app = this
- // 选择图片并上传
- uni.chooseImage({
- count: 1, // 可选择图片的数量
- success: function (chooseResult) {
- var tempFilePaths = chooseResult.tempFilePaths
- // 上传图片
- let baseUrl = apiUrl + '/api/attachment/addtoPath?pagevalue=300'
- uni.uploadFile({
- url: baseUrl, // 上传图片的服务器接口
- filePath: tempFilePaths[0],
- name: 'file',
- formData: {
- ...formData,
- attother1: 'zhengjianhao',
- attlsh: storage.get('wx_userid')
- }, // 证件 身份证 正面
- success: function (uploadResult) {
- let res = JSON.parse(uploadResult.data)
- if (res.Status == 0) {
- app[url] = res.Data
- console.log(app[url], 'imgUrl1')
- app.$toast('上传成功')
- } else {
- app.$toast('上传失败')
- }
- // 上传成功后的处理
- },
- fail: function (error) {
- console.log('上传失败', error)
- // 上传失败后的处理
- }
- })
- }
- })
- },
- async upFormData() {
- const app = this
- if (Verify.isEmpty(app.imgUrl1)) {
- this.$toast('请上传身份证正面')
- return false
- }
- if (Verify.isEmpty(app.imgUrl2)) {
- this.$toast('请上传身份证反面')
- return false
- }
- if (Verify.isEmpty(app.formData.customername)) {
- this.$toast('请填写证件姓名')
- return false
- }
- if (Verify.isEmpty(app.formData.customerzjhm)) {
- this.$toast('请填写证件号')
- return false
- }
- if (Verify.isEmpty(app.formData.customertel)) {
- this.$toast('请填写手机号码')
- return false
- }
- app.isLoading = true
- AppApi.bindCustomer({'customerid.value': storage.get('wx_userid'), ...app.formData})
- .then((result) => {
- console.log(result, 'result')
- // 显示操作成功
- app.$toast('实名成功')
- // 跳转回原页面
- setTimeout(() => {
- // 订单开通认证
- const param = {
- orderid: app.payorderid,
- customerid: app.payordercustomerid,
- tel: app.formData.customertel,
- smscode: app.smscode,
- //鉴权后获取的token
- token: ''
- }
- this.$navTo('pages/user/index')
- }, 1000)
- })
- .finally(() => (app.isLoading = false))
- }
- },
- onPullDownRefresh() {
- console.log('下拉')
- // 获取首页数据
- uni.stopPullDownRefresh()
- }
- }
- </script>
- <style lang="scss" scoped>
- .rlhsBtn {
- width: 80%;
- background-color: #fff;
- border-radius: 10rpx;
- color: #eab766;
- margin: 10rpx 0rpx 26rpx 10rpx;
- text-align: center;
- padding: 20rpx 26rpx;
- height: auto;
- border: 1px solid #eab766;
- }
- .inputBtn {
- width: 260rpx;
- background-color: #eab766;
- border-radius: 10rpx;
- color: #fff;
- margin: 10rpx 0rpx 26rpx 10rpx;
- text-align: center;
- padding: 20rpx 26rpx;
- height: auto;
- }
- .realname {
- height: 100%;
- padding-bottom: 50rpx;
- font-size: 30rpx;
- background: #ffffff;
- .text-blue,
- .line-blue,
- .lines-blue {
- color: #eab766;
- }
- }
- .input_box {
- padding: 0 30rpx;
- .input {
- background: #eab7660a;
- border: 1rpx solid #eab766;
- border-radius: 10rpx;
- margin: 10rpx 0rpx 26rpx;
- padding: 20rpx 26rpx;
- height: auto;
- }
- }
- .uploadText {
- color: #aaaaaa;
- font-size: 22rpx;
- padding: 0rpx 30rpx 26rpx;
- background: #ffffff;
- }
- .uploadBox {
- padding: 15rpx 80rpx 40rpx;
- background-color: #ffffff;
- display: flex;
- justify-content: space-between;
- .leftBtn {
- width: 100%;
- height: 75rpx;
- line-height: 75rpx;
- background-color: #eab766;
- border-radius: 0 0 12rpx 12rpx;
- }
- .uploadItem {
- width: 100%;
- height: 200rpx;
- background-color: #eab7662d;
- border-radius: 15rpx;
- padding: 30rpx;
- position: relative;
- .imgUrl {
- width: 100%;
- height: 100%;
- position: absolute;
- left: 0;
- top: 0;
- }
- .imgBox {
- width: 100%;
- height: 100%;
- position: relative;
- }
- .imgEx1 {
- background: url('/static/discern/ex1.png');
- background-size: 82%;
- background-repeat: no-repeat;
- background-position: center;
- }
- .imgEx2 {
- background: url('/static/discern/ex2.png');
- background-size: 82%;
- background-repeat: no-repeat;
- background-position: center;
- }
- .imgEx3 {
- background: url('/static/background/wendang.png');
- background-size: 82%;
- background-repeat: no-repeat;
- background-position: center;
- }
- .imgExImgUrlHuman {
- background: url('/static/background/renlian.png');
- background-size: 82%;
- background-repeat: no-repeat;
- background-position: center;
- }
- .leftTop {
- height: 28rpx;
- width: 4rpx;
- background-color: #eab766;
- position: absolute;
- left: 0;
- }
- .leftTop2 {
- height: 4rpx;
- width: 28rpx;
- background-color: #eab766;
- position: absolute;
- top: 0;
- }
- .leftbottom {
- height: 28rpx;
- width: 4rpx;
- background-color: #eab766;
- position: absolute;
- bottom: 0;
- }
- .leftbottom2 {
- height: 4rpx;
- width: 28rpx;
- background-color: #eab766;
- position: absolute;
- bottom: 0;
- }
- .rightTop {
- height: 28rpx;
- width: 4rpx;
- background-color: #eab766;
- position: absolute;
- right: 0;
- }
- .rightTop2 {
- height: 4rpx;
- width: 28rpx;
- background-color: #eab766;
- position: absolute;
- right: 0;
- top: 0;
- }
- .rightbottom {
- height: 28rpx;
- width: 4rpx;
- background-color: #eab766;
- position: absolute;
- right: 0;
- bottom: 0;
- }
- .rightbottom2 {
- height: 4rpx;
- width: 28rpx;
- background-color: #eab766;
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- .qyyyzz_uploadItem {
- height: 255rpx;
- }
- }
- .distinguishBox {
- padding: 5rpx 30rpx 20rpx;
- background: white;
- view {
- margin-bottom: 20rpx;
- }
- }
- .disLabel {
- text-align-last: justify;
- text-align: justify;
- text-justify: distribute-all-lines;
- min-width: 142rpx;
- display: inline-block;
- margin-right: 5rpx;
- }
- .requirement {
- padding: 10rpx 30rpx 26rpx;
- background: white;
- view {
- margin-bottom: 10rpx;
- }
- .errorBox {
- display: flex;
- justify-content: space-between;
- margin-top: 30rpx;
- view {
- width: 23%;
- height: 100rpx;
- }
- .item1 {
- background-image: url('/static/discern/yes.png');
- background-repeat: no-repeat;
- background-size: 100%;
- position: relative;
- }
- .item2 {
- background-image: url('/static/discern/error1.png');
- background-repeat: no-repeat;
- background-size: 100%;
- position: relative;
- }
- .item3 {
- background-image: url('/static/discern/error2.png');
- background-repeat: no-repeat;
- background-size: 100%;
- position: relative;
- }
- .item4 {
- background-image: url('/static/discern/error3.png');
- background-repeat: no-repeat;
- background-size: 100%;
- position: relative;
- }
- .iconImg {
- width: 60rpx;
- position: absolute;
- bottom: -10px;
- left: 50%;
- margin-left: -30rpx;
- }
- }
- }
- .submitBtn {
- width: 90%;
- height: 90rpx;
- background: #eab766;
- line-height: 90rpx;
- margin: 50rpx auto;
- text-align: center;
- font-size: 34rpx;
- color: #fff;
- border-radius: 12rpx;
- }
- </style>
|