You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
234 lines
6.5 KiB
234 lines
6.5 KiB
<template>
|
|
<view class="notice">
|
|
<view class="notice-bd">
|
|
<view class="a">
|
|
<view class="title">请上传法人身份证照片</view>
|
|
<view class="desc">身份证照片仅用于相关监管要求的认证和 备案使用,不对外展示</view>
|
|
<image @click="uploadImage(1)" v-if="card_front_img_id" :src="card_front_img_url"></image>
|
|
<image @click="uploadImage(1)" v-else src="https://www.amiami.com.cn/static/caigou/icon-03.png"></image>
|
|
<image @click="uploadImage(2)" v-if="card_back_img_id" :src="card_back_img_url"></image>
|
|
<image @click="uploadImage(2)" v-else src="https://www.amiami.com.cn/static/caigou/icon-04.png"></image>
|
|
</view>
|
|
</view>
|
|
<view class="notice-fd">
|
|
<view class="btn" @click="openPage()">下一步</view>
|
|
</view>
|
|
<addShuiyin />
|
|
</view>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
import Config from '@/core/config'
|
|
import * as newFunApi from '@/api/newFun'
|
|
export default {
|
|
data() {
|
|
return {
|
|
card_front_img_id: "",
|
|
card_front_img_url: "",
|
|
card_back_img_id: "",
|
|
card_back_img_url: "",
|
|
"address": "",
|
|
"sex": "",
|
|
"nation": "",
|
|
"birthday": "",
|
|
"username": "",
|
|
"card_no": ""
|
|
};
|
|
},
|
|
onLoad() {
|
|
if(uni.getStorageSync("orcInfo") && uni.getStorageSync("orcInfo").card_back_img_id){
|
|
this.address = uni.getStorageSync("orcInfo").address
|
|
this.sex = uni.getStorageSync("orcInfo").sex
|
|
this.nation = uni.getStorageSync("orcInfo").nation
|
|
this.birthday = uni.getStorageSync("orcInfo").birthday
|
|
this.username = uni.getStorageSync("orcInfo").username
|
|
this.card_no = uni.getStorageSync("orcInfo").card_no
|
|
this.invalid_date = uni.getStorageSync("orcInfo").invalid_date
|
|
this.issuance_date = uni.getStorageSync("orcInfo").issuance_date
|
|
this.issuance_office = uni.getStorageSync("orcInfo").issuance_office
|
|
this.card_front_img_id = uni.getStorageSync("orcInfo").card_front_img_id
|
|
this.card_front_img_url = uni.getStorageSync("orcInfo").card_front_img_url
|
|
this.card_back_img_id = uni.getStorageSync("orcInfo").card_back_img_id
|
|
this.card_back_img_url = uni.getStorageSync("orcInfo").card_back_img_url
|
|
}
|
|
},
|
|
methods: {
|
|
//上传照片
|
|
uploadImage(index) {
|
|
const that = this
|
|
// 选择图片
|
|
uni.chooseImage({
|
|
count: 1,
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
success(res) {
|
|
console.log(res)
|
|
uni.uploadFile({
|
|
url: (Config.get('apiUrl')+'upload/image').replace("index.php?s=/",""), // 仅为示例,非真实的接口地址
|
|
filePath: res.tempFiles[0].path,
|
|
name: 'file',
|
|
header: {
|
|
'content-type': 'multipart/form-data',
|
|
'Storeid': uni.getStorageSync('Store').storeInfo.store_id,
|
|
'Access-Token': uni.getStorageSync('AccessToken'),
|
|
'platform': "MP-WEIXIN",
|
|
},
|
|
formData: {
|
|
'Storeid': uni.getStorageSync('Store').storeInfo.store_id,
|
|
'Access-Token': uni.getStorageSync('AccessToken'),
|
|
'platform': "MP-WEIXIN",
|
|
},
|
|
success: (res1) => {
|
|
const {status,data,message} = JSON.parse(res1.data);
|
|
setTimeout(()=>{
|
|
if(status == 200){
|
|
uni.showToast({
|
|
title: '上传成功',
|
|
})
|
|
if(index == 1){
|
|
that.card_front_img_url = data.fileInfo.external_url
|
|
that.card_front_img_id = data.fileInfo.file_id
|
|
that.ocrCheckCard(that.card_front_img_id,1);
|
|
}else{
|
|
that.card_back_img_url = data.fileInfo.external_url
|
|
that.card_back_img_id = data.fileInfo.file_id
|
|
that.ocrCheckCard(that.card_back_img_id,2);
|
|
}
|
|
}else{
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: msg,
|
|
})
|
|
}
|
|
},1500)
|
|
},
|
|
fail: (err) => {
|
|
console.log(err)
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
},
|
|
//识别营业执照
|
|
async ocrCheckCard(img_id,type) {
|
|
const { status, data, message } = await newFunApi.ocrCheckCard({img_id, type});
|
|
if (status == 200) {
|
|
if(type == 1){
|
|
this.address = data.address
|
|
this.sex = data.sex
|
|
this.nation = data.nation
|
|
this.birthday = data.birthday
|
|
this.username = data.username
|
|
this.card_no = data.card_no
|
|
}else{
|
|
this.invalid_date = data.invalid_date
|
|
this.issuance_date = data.issuance_date
|
|
this.issuance_office = data.issuance_office
|
|
}
|
|
}
|
|
},
|
|
openPage() {
|
|
if(!this.card_front_img_id){
|
|
uni.showToast({
|
|
icon: "none",
|
|
title: "请上传身份证正面"
|
|
})
|
|
return ;
|
|
}
|
|
|
|
if(!this.card_back_img_id){
|
|
uni.showToast({
|
|
icon: "none",
|
|
title: "请上传身份证反面"
|
|
})
|
|
return ;
|
|
}
|
|
let orcInfo = uni.getStorageSync("orcInfo");
|
|
orcInfo.address = this.address
|
|
orcInfo.sex = this.sex
|
|
orcInfo.nation = this.nation
|
|
orcInfo.birthday = this.birthday
|
|
orcInfo.username = this.username
|
|
orcInfo.card_no = this.card_no
|
|
orcInfo.invalid_date = this.invalid_date
|
|
orcInfo.issuance_date = this.issuance_date
|
|
orcInfo.issuance_office = this.issuance_office
|
|
orcInfo.card_front_img_id = this.card_front_img_id
|
|
orcInfo.card_front_img_url = this.card_front_img_url
|
|
orcInfo.card_back_img_id = this.card_back_img_id
|
|
orcInfo.card_back_img_url = this.card_back_img_url
|
|
console.log(orcInfo)
|
|
uni.setStorageSync("orcInfo",orcInfo)
|
|
uni.navigateTo({
|
|
url: "/pages/news/caigou/notice4"
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.notice{
|
|
background-color: #fff;
|
|
padding-bottom: 150rpx;
|
|
&-bd{
|
|
width: 700rpx;
|
|
margin: 0 auto;
|
|
text-align: justify;
|
|
border-radius: 10rpx;
|
|
padding: 0 45rpx;
|
|
box-sizing: border-box;
|
|
.a{
|
|
padding: 20rpx 0;
|
|
.title{
|
|
font-size: 36rpx;
|
|
color: #222222;
|
|
text-align: center;
|
|
}
|
|
.desc{
|
|
width: 550rpx;
|
|
font-size: 28rpx;
|
|
color: #333333;
|
|
line-height: 48rpx;
|
|
text-align: center;
|
|
margin: 0 auto;
|
|
margin-top: 20rpx;
|
|
}
|
|
image{
|
|
width: 550rpx;
|
|
height: 340rpx;
|
|
display: block;
|
|
margin: 0 auto;
|
|
margin-top: 30rpx;
|
|
}
|
|
}
|
|
}
|
|
&-fd{
|
|
height: 140rpx;
|
|
width: 100%;
|
|
position: fixed;
|
|
left: 0;
|
|
bottom: 0;
|
|
z-index: 22;
|
|
background-color: #FFFFFF;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
.btn{
|
|
width: 662rpx;
|
|
height: 90rpx;
|
|
line-height: 90rpx;
|
|
background: #F34A40;
|
|
border-radius: 90rpx;
|
|
text-align: center;
|
|
font-size: 32rpx;
|
|
color: #FFFFFF;
|
|
&-on{
|
|
background-color: #ccc;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|