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.

218 lines
6.5 KiB

3 years ago
<template>
<!--pages/release/companyAuth/index.wxml-->
<view class="auth-page">
<view class="company-info-box">
<view class="form-item acea-row row-between row-middle">
<view class="label">姓名</view>
<view class="inp-box">
<input type="text" :value="form.legalPersonName" @input="inpChange" data-type="name" placeholder="请填写姓名">
</view>
</view>
<view class="form-item acea-row row-between row-middle">
<view class="label">手机号</view>
<view class="inp-box">
<input type="text" :value="form.legalPhone" @input="inpChange" data-type="phone" placeholder="请填写手机号">
</view>
</view>
<view class="form-item acea-row row-between row-middle">
<view class="label">身份证号</view>
<view class="inp-box">
<input type="text" :value="form.legalPersonIdcard" @input="inpChange" data-type="idcard" placeholder="请填写身份证号">
</view>
</view>
<!-- <view class="form-item noBorder">
3 years ago
<view class="label">身份证</view>
<view class="inp-box sfz">
<view class="acea-row row-between-wrapper">
<image src="https://download.cyjyyjy.com/sfz1.png" @tap="upCard" data-type="b" v-if="form.idcardPicBehind == ''"></image>
<image :src="form.idcardPicBehind" @tap="upCard" data-type="b" v-else></image>
<image src="https://download.cyjyyjy.com/sfzb.png"></image>
</view>
<view class="acea-row row-between-wrapper">
<image src="https://download.cyjyyjy.com/sfz2.png" @tap="upCard" data-type="f" v-if="form.idcardPicFront == ''"></image>
<image :src="form.idcardPicFront" @tap="upCard" data-type="f" v-else></image>
<image src="https://download.cyjyyjy.com/sfzz.png"></image>
</view>
<view class="acea-row row-between-wrapper">
<image src="https://download.cyjyyjy.com/sfz3.png" @tap="upCard" data-type="h" v-if="form.idcardPicHold == ''"></image>
<image :src="form.idcardPicHold" @tap="upCard" data-type="h" v-else></image>
<image src="https://download.cyjyyjy.com/sfzs.png"></image>
</view>
</view>
</view> -->
3 years ago
</view>
<view class="submit-btn" @tap="submit">保存并提交</view>
3 years ago
<view class="argeement-box">
<checkbox-group @change="argeementClick">
<checkbox value="1" style="transform:scale(0.7);position: relative; top: 3rpx;" :checked="isCheck" />
</checkbox-group>
<view class="acea-row">
我已阅读并同意
<navigator url="/pages/login/agreementPage" open-type="navigate" style="color: rgb(255, 50, 50);">用户协议及隐私政策</navigator>
</view>
</view>
3 years ago
</view>
</template>
<script>
// pages/release/personAuth/index.js
const util = require("../../../utils/util.js");
const app = getApp();
export default {
data() {
return {
form: {
legalPersonName: '',
legalPhone: '',
legalPersonIdcard: '',
idcardPicFront: '',
idcardPicBehind: '',
idcardPicHold: ''
},
3 years ago
isEdit: false,
isCheck: false
3 years ago
};
},
components: {},
props: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.authInfo) {
let authInfo = JSON.parse(decodeURIComponent(options.authInfo));
this.isEdit = true,
this.form.authorizationType = 2;
this.form.id = authInfo.id;
this.form.idcardPicHold = authInfo.idcardPicHold;
this.form.idcardPicBehind = authInfo.idcardPicBehind;
this.form.idcardPicFront = authInfo.idcardPicFront;
this.form.legalPersonIdcard = authInfo.legalPersonIdcard;
this.form.legalPhone = authInfo.legalPhone || '';
this.form.legalPersonName = authInfo.legalPersonName;
}
},
methods: {
3 years ago
argeementClick(e){
console.log(e)
let state = e.detail.value
if(state.length > 0) {
this.isCheck = true
} else{
this.isCheck = false
}
},
3 years ago
inpChange(e) {
let type = e.currentTarget.dataset.type;
let value = e.detail.value;
if (type == 'name') {
this.form.legalPersonName = value;
} else if (type == 'phone') {
this.form.legalPhone = value;
} else if (type == 'idcard') {
this.form.legalPersonIdcard = value;
}
},
upCard(e) {
let type = e.currentTarget.dataset.type;
util.chooseImages(img => {
if (type == 'f') {
this.form.idcardPicFront = img;
} else if (type == 'b') {
this.form.idcardPicBehind = img;
} else {
this.form.idcardPicHold = img;
}
});
},
submit() {
let form = this.form;
3 years ago
if(!this.isCheck){
uni.showToast({
title: '请阅读并勾选用户隐私协议',
icon: 'none'
});
return;
}
3 years ago
if (form.legalPersonName == '') {
uni.showToast({
title: '请填写姓名',
icon: 'none'
});
return;
} else if (form.legalPhone == '') {
uni.showToast({
title: '请填写手机号',
icon: 'none'
});
return;
} else if (form.legalPersonIdcard == '') {
uni.showToast({
title: '请填写身份证号',
icon: 'none'
});
return;
} else {
if (this.isEdit == false) {
app.http('post', 'EnterpriseAuthentication/createAuthenticInfoOne', this.form).then(res => {
if (res.data.success) {
uni.showModal({
title: '提示!',
content: '提交成功!请等待审核',
success(res) {
uni.navigateBack({
delta: 1
});
}
});
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
});
}
});
} else {
app.http('post', 'EnterpriseAuthentication/editAuthenticInfo', this.form).then(res => {
if (res.data.success) {
uni.showModal({
title: '提示!',
content: '提交成功!请等待审核',
success(res) {
uni.navigateBack({
delta: 1
});
}
});
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
});
}
});
}
}
}
}
};
</script>
<style>
/* pages/release/personAuth/index.wxss */
@import "../companyAuth/index.css";
3 years ago
3 years ago
</style>