幼教产品B2B生态平台小程序端
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.

151 lines
3.9 KiB

12 months ago
<template>
<view class="page">
11 months ago
<view class="block">
<view class="title">上传营业执照</view>
<image class="credential" :src="businessLicense" mode="widthFix" @click="uploadBusinessLicense"></image>
</view>
<view v-if="isPreschool" class="block">
<view class="title">上传办学许可证</view>
<image class="credential" src="https://occupationlab.com/images/preschoolEdu/credentials2.png" mode="widthFix"></image>
</view>
12 months ago
<view class="block">
<view class="form-list">
<view class="line with-arrow">
11 months ago
<view class="name">{{ platformName }}名称</view>
<input type="text" :placeholder="'请输入' + platformName + '名称'" v-model="form.comapnyName" />
12 months ago
<uni-icons type="right" size="18" color="#ababab"></uni-icons>
12 months ago
</view>
<view class="line with-arrow">
<view class="name">统一社会信用代码</view>
11 months ago
<input type="text" placeholder="请输入证件号码" v-model="form.creditCode" />
12 months ago
<uni-icons type="right" size="18" color="#ababab"></uni-icons>
12 months ago
</view>
<view class="line with-arrow">
<view class="name">法人</view>
11 months ago
<input type="text" placeholder="请输入法人" v-model="form.legalPerson" />
12 months ago
<uni-icons type="right" size="18" color="#ababab"></uni-icons>
12 months ago
</view>
</view>
</view>
<view class="btn-wrap">
<view class="btn" @click="submit">认证信息</view>
</view>
</view>
</template>
<script>
11 months ago
import { creditCodeAuthentication, businessLicensePictureVerification } from '@/apis/modules/user.js'
12 months ago
import OSS from '@/libs/Oss/upload'
export default {
data() {
return {
11 months ago
form: {
comapnyName: '',
creditCode: '',
legalPerson: '',
},
platformId: uni.getStorageSync('platformId'),
businessLicense: 'https://occupationlab.com/images/preschoolEdu/credentials1.png'
12 months ago
}
},
11 months ago
computed: {
// 幼儿园
isPreschool() {
return this.platformId === 5
},
// 平台名字
platformName() {
return this.platformId === 6 ? '供应商' : this.platformId === 5 ? '幼儿园' : ''
},
},
12 months ago
onShow() {
11 months ago
12 months ago
},
methods: {
// 上传营业执照
11 months ago
uploadBusinessLicense() {
const that = this
uni.chooseImage({
success: (res) => {
const file = res.tempFilePaths[0];
OSS(file, async (name) => {
that.businessLicense = name
const { data } = await businessLicensePictureVerification(name)
if (data) {
that.form = {
comapnyName: data.name,
creditCode: data.reg_num,
legalPerson: data.person,
address: data.address,
business: data.business,
capital: data.capital,
establish_date: data.establish_date,
type: data.type,
valid_period: data.valid_period,
}
}
})
}
});
},
// 上传办学许可证
uploadBack() {
12 months ago
const that = this
uni.chooseImage({
12 months ago
success: (res) => {
const file = res.tempFilePaths[0];
11 months ago
OSS(file, async (name) => {
that.reverseOfIDCard = name
12 months ago
})
}
});
},
submit() {
11 months ago
const { form } = this
if (!form.comapnyName) return this.$util.errMsg(`请输入${platformName}名称!`)
if (!form.creditCode) return this.$util.errMsg('请输入统一社会信用代码!')
if (!form.legalPerson) return this.$util.errMsg('请输入法人!')
creditCodeAuthentication(form).then(res => {
this.$util.sucMsg('认证成功!')
setTimeout(() => {
uni.switchTab({
url: '/pages/person/person'
})
}, 1500)
}).catch(e => {})
12 months ago
},
}
}
</script>
<style scoped lang="scss">
.page {
padding-bottom: 170rpx;
-webkit-overflow-scrolling: touch;
}
.avatar {
width: 80rpx;
height: 80rpx;
border: 0;
border-radius: 50%;
}
.block {
padding: 24rpx;
}
.title {
margin-bottom: 20rpx;
font-size: 28rpx;
}
.credential {
width: 100%;
}
12 months ago
.form-list {
.name {
min-width: 250rpx;
}
}
12 months ago
</style>