[企业认证格式修改及企业认证range默认值处理同步易货]

This commit is contained in:
2021-10-27 15:45:22 +08:00
parent 011eeedcc4
commit e4b1f33c6c

View File

@@ -7,7 +7,8 @@
<view class="white-box"> <view class="white-box">
<view class="inputs logo"> <view class="inputs logo">
<label>企业LOGO</label> <label>企业LOGO</label>
<image class="logo-cover" :src="logo.showpath || require('@/static/icons/add-icon.png')" @click="updImg('logo')" mode="aspectFill"></image> <image class="logo-cover" :src="logo.showpath || require('@/static/icons/add-icon.png')"
@click="updImg('logo')" mode="aspectFill"></image>
</view> </view>
<view class="inputs"> <view class="inputs">
<label>企业名称</label> <label>企业名称</label>
@@ -15,7 +16,8 @@
</view> </view>
<view class="inputs"> <view class="inputs">
<label>企业行业</label> <label>企业行业</label>
<picker v-if="industry.length > 0" :range="industry" :value="industryIndex" range-key="title" @change="changePicker" data-type="industry"> <picker v-if="industry.length > 0" :range="industry" :value="industryIndex" range-key="title"
@change="changePicker" data-type="industry">
<view class="picker-text nowrap"> <view class="picker-text nowrap">
{{industry[industryIndex].title}} {{industry[industryIndex].title}}
<uni-icons class="picker-icon" type="arrowdown"></uni-icons> <uni-icons class="picker-icon" type="arrowdown"></uni-icons>
@@ -26,12 +28,17 @@
<label>经营类目</label> <label>经营类目</label>
<view class="picker-text nowrap" @click="opnePopup"> <view class="picker-text nowrap" @click="opnePopup">
<block v-if="categorys.length > 0"> <block v-if="categorys.length > 0">
<text class="text-item" v-for="(item, index) in category" :key="index" v-if="item.check">{{item.name}}</text> <text class="text-item" v-for="(item, index) in category" :key="index"
v-if="item.check">{{item.name}}</text>
</block> </block>
<block v-else>选择经营类目</block> <block v-else>选择经营类目</block>
<uni-icons class="picker-icon" type="arrowdown"></uni-icons> <uni-icons class="picker-icon" type="arrowdown"></uni-icons>
</view> </view>
</view> </view>
<view class="inputs" v-if="is_range">
<label>经营范围</label>
<textarea :auto-height='true' v-model="range" placeholder="输入经营范围" />
</view>
<view class="inputs"> <view class="inputs">
<label>法人姓名</label> <label>法人姓名</label>
<input type="text" v-model="corporate" placeholder="输入法人姓名" /> <input type="text" v-model="corporate" placeholder="输入法人姓名" />
@@ -46,7 +53,8 @@
</view> </view>
<view class="inputs logo"> <view class="inputs logo">
<label>营业执照</label> <label>营业执照</label>
<image class="license-cover" :src="license.showpath || require('@/static/icons/add-icon.png')" @click="updImg('license')" mode="aspectFill"></image> <image class="license-cover" :src="license.showpath || require('@/static/icons/add-icon.png')"
@click="updImg('license')" mode="aspectFill"></image>
</view> </view>
<view class="btns"> <view class="btns">
<button type="default" size="default" @click="submitApplies">提交认证</button> <button type="default" size="default" @click="submitApplies">提交认证</button>
@@ -60,7 +68,8 @@
<view class="subtitle">请选择经营类目</view> <view class="subtitle">请选择经营类目</view>
</view> </view>
<view class="category-flex"> <view class="category-flex">
<view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in category" :key="index" @click="item.check = !item.check">{{item.name}}</view> <view class="category-flex-item" :class="{'show' : item.check}" v-for="(item, index) in category"
:key="index" @click="item.check = !item.check">{{item.name}}</view>
</view> </view>
<view class="btns"> <view class="btns">
<button type="default" size="default" @click="affirmCategory">确定</button> <button type="default" size="default" @click="affirmCategory">确定</button>
@@ -71,120 +80,134 @@
</template> </template>
<script> <script>
import { appliesCreate, applies, appliesInfo, appliesCategory } from '@/apis/interfaces/company' import {
import { uploads } from '@/apis/interfaces/uploading' appliesCreate,
applies,
appliesInfo,
appliesCategory
} from '@/apis/interfaces/company'
import {
uploads
} from '@/apis/interfaces/uploading'
export default { export default {
data() { data() {
return { return {
formType : "", formType: "",
name : "", name: "",
corporate : "", corporate: "",
identity : "", identity: "",
org : "", org: "",
logo : { logo: {
showpath: '', showpath: '',
path : '' path: ''
}, },
license : { license: {
showpath: '', showpath: '',
path : '' path: ''
}, },
industry : [], industry: [],
industryIndex: 0, industryIndex: 0,
reason : '', reason: '',
category : [], category: [],
categorys : [] categorys: [],
range: "",
is_range: false,
}; };
}, },
created(){ created() {
// 读取配置信息 // 读取配置信息
appliesCreate().then(res=>{ appliesCreate().then(res => {
this.industry = res this.industry = res.industries
this.formType = this.$Route.query.form_type this.formType = this.$Route.query.form_type
if(this.formType === 'put'){ this.is_range = res.is_range
if (this.formType === 'put') {
appliesInfo().then(formValue => { appliesInfo().then(formValue => {
for(let val of formValue.categories){ for (let val of formValue.categories) {
if(val.check){ if (val.check) {
this.categorys.push(val.category_id) this.categorys.push(val.category_id)
} }
} }
this.name = formValue.name this.range = formValue.range
this.industryIndex = this.industry.findIndex(val=> val.industry_id === formValue.industry.industry_id) this.name = formValue.name
this.category = formValue.categories this.industryIndex = this.industry.findIndex(val => val.industry_id === formValue
this.corporate = formValue.certification.name .industry.industry_id)
this.identity = formValue.certification.idcard this.category = formValue.categories
this.org = formValue.certification.code this.corporate = formValue.certification.name
this.logo = formValue.cover this.identity = formValue.certification.idcard
this.license = formValue.certification.license this.org = formValue.certification.code
this.logo = formValue.cover
this.license = formValue.certification.license
}).catch(valueErr => { }).catch(valueErr => {
uni.showToast({ uni.showToast({
title: valueErr.message, title: valueErr.message,
icon : 'none' icon: 'none'
}) })
}) })
}else{ } else {
this.getAppliesCategory(res[0].industry_id) console.log('11', res)
this.getAppliesCategory(res.industries[0].industry_id)
} }
}).catch(err =>{ }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon: 'none'
}) })
}) })
}, },
methods:{ methods: {
// 选择经营类目 // 选择经营类目
opnePopup(){ opnePopup() {
this.$refs.categoryPopup.open('bottom') this.$refs.categoryPopup.open('bottom')
}, },
// 确认选择类目 // 确认选择类目
affirmCategory(){ affirmCategory() {
this.categorys = [] this.categorys = []
for(let val of this.category){ for (let val of this.category) {
if(val.check){ if (val.check) {
this.categorys.push(val.category_id) this.categorys.push(val.category_id)
} }
} }
this.$refs.categoryPopup.close() this.$refs.categoryPopup.close()
}, },
// 提交信息 // 提交信息
submitApplies(){ submitApplies() {
let method = this.formType === 'put' ? 'PUT' : 'POST' let method = this.formType === 'put' ? 'PUT' : 'POST'
applies({ applies({
name : this.name, name: this.name,
cover : this.logo.path, cover: this.logo.path,
license : this.license.path, license: this.license.path,
user_name : this.corporate, user_name: this.corporate,
id_card : this.identity, id_card: this.identity,
code : this.org, code: this.org,
industry_id : this.industry[this.industryIndex].industry_id, industry_id: this.industry[this.industryIndex].industry_id,
categories : this.categorys categories: this.categorys,
range: this.range
}, method).then(res => { }, method).then(res => {
uni.showModal({ uni.showModal({
title : '提示', title: '提示',
content : '您的企业认证信息已提交审核需3-7个工作日请耐心等待', content: '您的企业认证信息已提交审核需3-7个工作日请耐心等待',
showCancel : false, showCancel: false,
confirmText : '确认', confirmText: '确认',
success : resModal => { success: resModal => {
this.$Router.back() this.$Router.back()
} }
}) })
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon: 'none'
}) })
}) })
}, },
// 选择器 // 选择器
changePicker(e){ changePicker(e) {
this.industryIndex = e.detail.value this.industryIndex = e.detail.value
this.getAppliesCategory(this.industry[e.detail.value].industry_id) this.getAppliesCategory(this.industry[e.detail.value].industry_id)
}, },
// 获取经营类目 // 获取经营类目
getAppliesCategory(id){ getAppliesCategory(id) {
appliesCategory({ appliesCategory({
industry: id, industry: id,
}).then(res => { }).then(res => {
@@ -192,18 +215,18 @@
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon: 'none'
}) })
}) })
}, },
// 上传图片 // 上传图片
updImg(type){ updImg(type) {
uni.chooseImage({ uni.chooseImage({
count : 1, count: 1,
success : path => { success: path => {
uploads([{ uploads([{
uri : path.tempFilePaths[0] uri: path.tempFilePaths[0]
}]).then(res => { }]).then(res => {
this[type] = { this[type] = {
showpath: res.url[0], showpath: res.url[0],
@@ -212,7 +235,7 @@
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon: 'none'
}) })
}) })
} }
@@ -224,30 +247,34 @@
<style lang="scss" scoped> <style lang="scss" scoped>
// 内容 // 内容
.content{ .content {
.header{ .header {
padding: $padding * 2 0; padding: $padding * 2 0;
box-sizing: border-box; box-sizing: border-box;
@extend .vertical; @extend .vertical;
.title{
.title {
text-align: center; text-align: center;
font-size: $title-size + 14; font-size: $title-size + 14;
font-weight: bold; font-weight: bold;
line-height: 90rpx; line-height: 90rpx;
} }
.subtitle{
.subtitle {
font-size: $title-size-m; font-size: $title-size-m;
color: $text-gray; color: $text-gray;
text-align: center; text-align: center;
} }
} }
.white-box{
.white-box {
background-color: white; background-color: white;
border-radius: $radius $radius 0 0; border-radius: $radius $radius 0 0;
min-height: 85vh; min-height: 85vh;
padding: $padding $padding * 2 $padding * 2; padding: $padding $padding * 2 $padding * 2;
box-sizing: border-box; box-sizing: border-box;
.inputs{
.inputs {
position: relative; position: relative;
margin-top: $margin; margin-top: $margin;
background: white; background: white;
@@ -255,38 +282,46 @@
padding-left: 200rpx; padding-left: 200rpx;
line-height: 90rpx; line-height: 90rpx;
min-height: 90rpx; min-height: 90rpx;
label{
label {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 200rpx; width: 200rpx;
font-size: $title-size; font-size: $title-size;
} }
input{
input {
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
font-size: $title-size; font-size: $title-size;
} }
.picker-text{
.picker-text {
position: relative; position: relative;
padding-right: 90rpx; padding-right: 90rpx;
.picker-icon{
.picker-icon {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
} }
.text-item{
.text-item {
margin-left: 10rpx; margin-left: 10rpx;
&:first-child{
&:first-child {
margin-left: 0; margin-left: 0;
} }
} }
} }
} }
.logo{
.logo {
height: $padding + 98; height: $padding + 98;
padding-bottom: $padding; padding-bottom: $padding;
.logo-cover{
.logo-cover {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
@@ -295,39 +330,47 @@
background: $border-color-lg; background: $border-color-lg;
border-radius: 50%; border-radius: 50%;
} }
.license-cover{
.license-cover {
@extend .logo-cover; @extend .logo-cover;
border-radius: 0; border-radius: 0;
width: 131rpx; width: 131rpx;
} }
} }
.btns{
.btns {
padding-top: $padding * 2; padding-top: $padding * 2;
button{
button {
background: $mian-color; background: $mian-color;
border-radius: 0; border-radius: 0;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
font-size: $title-size; font-size: $title-size;
color: white; color: white;
&::after{
&::after {
border: none; border: none;
} }
} }
} }
} }
// 经营类目 // 经营类目
.category-popup{ .category-popup {
background: #F5F5F5; background: #F5F5F5;
padding: 0 $padding * 2 $padding * 2 $padding * 2; padding: 0 $padding * 2 $padding * 2 $padding * 2;
.header{
.header {
padding-bottom: $padding; padding-bottom: $padding;
} }
.category-flex{
.category-flex {
margin: 0 -10rpx; margin: 0 -10rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.category-flex-item{
.category-flex-item {
margin: 10rpx; margin: 10rpx;
background: white; background: white;
width: calc(33.33% - 20rpx); width: calc(33.33% - 20rpx);
@@ -335,22 +378,26 @@
text-align: center; text-align: center;
font-size: $title-size-m; font-size: $title-size-m;
@extend .nowrap; @extend .nowrap;
&.show{
&.show {
color: white; color: white;
background-color: $mian-color; background-color: $mian-color;
} }
} }
} }
.btns{
.btns {
padding-top: $padding * 2; padding-top: $padding * 2;
button{
button {
background: $mian-color; background: $mian-color;
border-radius: 0; border-radius: 0;
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
font-size: $title-size; font-size: $title-size;
color: white; color: white;
&::after{
&::after {
border: none; border: none;
} }
} }