Browse Source

完善认证详情

master
453530270@qq.com 2 years ago
parent
commit
301cd90bb5
  1. 30
      api/verify.js
  2. 252
      pages/user/mycertinfo/orgverify.vue

30
api/verify.js

@ -0,0 +1,30 @@
//认证api
import request from '@/utils/request'
// api地址
const api = {
// 扫描证书上传接口
cerscan_url: 'Paymentlist/entuiprise/v1/user/cer-scan',
// 行业类目
industry:"slb/userself/v1/industry/0",
}
/**
* 扫描证书上传
*/
export const cerscan = (data) => {
return request.post(api.cerscan_url, data )
}
// do upload
export const upload = files => {
// 文件上传大小, 2M
const maxSize = 1024 * 1024 * 2
// 执行上传
return new Promise((resolve, reject) => {
request.urlFileUpload({ files, maxSize })
.then(result => resolve(result.map(item => item.data.fileInfo.file_id), result))
.catch(reject)
})
}

252
pages/user/mycertinfo/orgverify.vue

@ -47,22 +47,104 @@
</view>
</view>
<!-- step 3 -->
<view class="vfbox" v-if="step==3">
<view class="ver-form">
<view class="form-item sfsel">
<view class="sf-tit">选择身份</view>
<view class="sf-item">
<view class="sfiv" :class="{ active: sfval == 10 }" @click="selsf(10)"> </view>
<view class="sfiv" :class="{ active: sfval == 20 }" @click="selsf(20)">经办人</view>
</view>
</view>
<!-- 如果是代办需要下面的 -->
<view v-if="sfval==20">
<!-- 经办人授权委托书 预览图 -->
<view class="image-list" v-if="jfr_entfile!=''">
<view class="image-preview" v-for="(image, imageIndex) in jfr_entfile[0]">
<image class="image" mode="aspectFill" :src="image.path"></image>
</view>
</view>
<view class="form-item" v-else>
<button class="form-item--input" @click="chooseImage('jfr_entfile')">上传经办人授权委托书</button>
</view>
<!-- 经办人身份证扫描件需盖章 -->
<!-- 预览图 -->
<view class="image-list" v-if="jfr_idafile!=''">
<view class="image-preview" v-for="(image, imageIndex) in jfr_idafile[0]">
<image class="image" mode="aspectFill" :src="image.path"></image>
</view>
</view>
<view class="form-item" v-else>
<button class="form-item--input" @click="chooseImage('jfr_idafile')">经办人身份证扫描件需盖章国徽面</button>
</view>
<!-- 经办人身份证扫描件需盖章 预览图 -->
<view class="image-list" v-if="jfr_idbfile!=''">
<view class="image-preview" v-for="(image, imageIndex) in jfr_idbfile[0]">
<image class="image" mode="aspectFill" :src="image.path"></image>
</view>
</view>
<view class="form-item" v-else>
<button class="form-item--input" @click="chooseImage('jfr_idbfile')">经办人身份证扫描件需盖章头像面</button>
</view>
<!-- 经办人姓名 -->
<view class="form-item">
<input class="form-item--input" v-model="managerName" autocomplete="off" placeholder="经办人姓名" />
</view>
<!-- 经办人身份证号 -->
<view class="form-item">
<input class="form-item--input" v-model="managerIdnum" autocomplete="off" placeholder="经办人身份证号" />
</view>
</view>
<!-- 公用表单部分 -->
<!-- 机构名称 -->
<view class="form-item">
<input class="form-item--input" v-model="name" autocomplete="off" placeholder="机构名称" />
</view>
<!-- 行业类别 -->
<view class="form-item">
<select class="form-item--input" v-model="industryType" placeholder="行业类别">
<option>选择行业类别</option>
<option value="0">IT</option>
<option value="1">金融</option>
<option value="2">空乘</option>
</select>
</view>
</view>
</view>
<!-- step 4 -->
</view>
</template>
<script>
// api
import * as VerifyApi from '@/api/verify'
export default {
data() {
return {
//
step:1,
step:3,
//
curvf: 0,
//
vfindex:0,
//
Organizationcode:"",
//
sfval:10,
//
dbsqfile:"",
//
name:"",
//
jfr_entfile:[],
//
jfr_idafile:[],
jfr_idbfile:[],
}
},
methods: {
@ -114,13 +196,68 @@
this.$toast("统一社会信用代码格式不对")
return false;
} else {
this.step =3
console.info("yes");
}
// this.$toast("")
// return true;
}
},
//
selsf(val){
this.sfval = val
},
//
chooseImage( item) {
const app = this
const oldImageList = app.$data[item]
//
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'], //
sourceType: ['album', 'camera'], //
success({ tempFiles }) {
//tempFiles = [{path:'xxx', size:100}]
//app.formData[index].imageList = oldImageList.concat(tempFiles)
//oldImageList.concat(tempFiles)
oldImageList.push(tempFiles)
}
});
console.log(oldImageList.length)
},
//
deleteImage(index, imageIndex) {
this.formData[index].imageList.splice(imageIndex, 1)
},
//
uploadFile() {
const app = this
const { formData } = app
//
const files = []
formData.forEach((item, index) => {
if (item.content.trim() && item.imageList.length) {
const images = item.imageList.map(image => image)
files.push({ formDataIndex: index, images })
}
})
//
return new Promise((resolve, reject) => {
Promise.all(files.map((file, index) => {
return new Promise((resolve, reject) => {
VerifyApi.upload(file.images)
.then(fileIds => {
app.formData[index].uploaded = fileIds
resolve(fileIds)
})
.catch(reject)
})
}))
.then(resolve, reject)
})
}
}
}
</script>
@ -183,6 +320,43 @@
}
}
.ver-form{
// todo o
}
.sfsel{
float: left;
width: 100%;
.sf-tit{
width: 20%;
padding: 10rpx 0;
display: flex;
flex-direction: center;
}
.sf-item{
background: #EAEAEA;
width: 80%;
display: flex;
text-align: center;
color: #333;
border-radius: 12rpx;
.sfiv{
width: 50%;
padding: 10rpx;
&.active{
border-radius: 12rpx;
background: #487AEE;
color: #fff;
}
}
}
}
//
.form-item {
display: flex;
@ -205,6 +379,76 @@
}
.image-list {
display: flex;
padding: 0 20rpx;
margin-top: 20rpx;
margin-bottom: -20rpx;
&:after {
clear: both;
content: " ";
display: table;
}
.image {
display: block;
width: 100%;
height: 100%;
}
.image-picker,
.image-preview {
width: 196rpx;
height: 196rpx;
margin-right: 30rpx;
margin-bottom: 30rpx;
float: left;
&:nth-child(3n+0) {
margin-right: 0;
}
}
.image-picker {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border: 1rpx dashed #ccc;
color: #ccc;
.choose-icon {
font-size: 48rpx;
margin-bottom: 6rpx;
}
.choose-text {
font-size: 24rpx;
}
}
.image-preview {
position: relative;
.image-delete {
position: absolute;
top: -15rpx;
right: -15rpx;
height: 42rpx;
width: 42rpx;
line-height: 42rpx;
background: rgba(0, 0, 0, 0.64);
border-radius: 50%;
color: #fff;
font-weight: bolder;
font-size: 22rpx;
z-index: 10;
text-align: center;
}
}
}
}
}

Loading…
Cancel
Save