|
|
@@ -2,38 +2,38 @@
|
|
|
<div style="padding:0 34px 0 20px;">
|
|
|
<el-tabs v-model="activeName">
|
|
|
<el-tab-pane label="商家注册" name="first">
|
|
|
- <el-form v-if="!isSuccess1" :model="formData" :rules="rules1" ref="form1" label-width="100px" label-position="right" size="small" style="max-width: 420px;margin-top:20px;">
|
|
|
+ <el-form v-if="!isSuccess1" :model="formData1" :rules="rules1" ref="form1" label-width="100px" label-position="right" size="small" style="max-width: 420px;margin-top:20px;">
|
|
|
<el-form-item prop="username" label="用户名">
|
|
|
- <el-input v-model="formData.username" placeholder="请输入用户名" maxlength="10" style="width:204px;"></el-input>
|
|
|
+ <el-input v-model="formData1.username" placeholder="请输入用户名" maxlength="10" style="width:204px;"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="password" label="设置密码">
|
|
|
- <el-input type="password" name='psd' placeholder="6-11位的字母或者数字(必须包含数字字母的组合)" v-model="formData.password" maxlength="11"></el-input>
|
|
|
+ <el-input type="password" name='psd' placeholder="6-11位的字母或者数字(必须包含数字字母的组合)" v-model="formData1.password" maxlength="11"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="surePassword" label="确认密码">
|
|
|
- <el-input type="password" name='surepsd' placeholder="请重复输入密码" v-model="formData.surePassword" maxlength="11"></el-input>
|
|
|
+ <el-input type="password" name='surepsd' placeholder="请重复输入密码" v-model="formData1.surePassword" maxlength="11"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="contacter" label="联系人">
|
|
|
- <el-input placeholder="请重复输入密码" v-model="formData.contacter" maxlength="8"></el-input>
|
|
|
+ <el-input placeholder="请重复输入密码" v-model="formData1.contacter" maxlength="8"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="contactPhone" label="联系人电话">
|
|
|
- <el-input v-model="formData.contactPhone" placeholder="请输入手机号码" maxlength="11"></el-input>
|
|
|
+ <el-input v-model="formData1.contactPhone" placeholder="请输入手机号码" maxlength="11"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="code" label="短信验证码">
|
|
|
- <el-input v-model="formData.code" placeholder="请输入验证码" style="width:204px;"></el-input>
|
|
|
+ <el-input v-model="formData1.code" placeholder="请输入验证码" style="width:204px;"></el-input>
|
|
|
<el-button plain style="width:110px;" @click="startSend">{{isSend?'已发送('+startNum+'S)':'获取验证码'}}</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="companyName" label="企业名称">
|
|
|
- <el-input v-model="formData.companyName" placeholder="请输入企业名称" maxlength="20"></el-input>
|
|
|
+ <el-input v-model="formData1.companyName" placeholder="请输入企业名称" maxlength="20"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="companyType" label="企业类型">
|
|
|
- <el-select v-model="formData.companyType" placeholder="请选择">
|
|
|
+ <el-select v-model="formData1.companyType" placeholder="请选择">
|
|
|
<el-option v-for="item in companyTypeList" :key="item.id" :label="item.typeName" :value="item.typeName">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="isRead" label="">
|
|
|
- <el-checkbox v-model="formData.isRead">已阅读</el-checkbox>
|
|
|
+ <el-checkbox v-model="formData1.isRead">已阅读</el-checkbox>
|
|
|
<el-button type="text" style="color:#FB6E08">《用户隐私协议和隐私条款》</el-button>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -100,11 +100,14 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
companyTypeList: [],
|
|
|
- activeName: 'first',
|
|
|
+ activeName: 'second',
|
|
|
saving: false,
|
|
|
formData: {
|
|
|
isRead: false,
|
|
|
},
|
|
|
+ formData1: {
|
|
|
+ isRead: false,
|
|
|
+ },
|
|
|
rules: {
|
|
|
username: [
|
|
|
{ required: true, message: '请输入用户名', trigger: 'blur' },
|
|
|
@@ -189,7 +192,7 @@ export default {
|
|
|
if (!value) {
|
|
|
callback(new Error('请输入用户名'));
|
|
|
} else {
|
|
|
- this.checkHas({ username: this.formData.username }).then((result) => {
|
|
|
+ this.checkHas({ username: this.formData1.username }).then((result) => {
|
|
|
if (result) {
|
|
|
callback(new Error('已存在该用户名'));
|
|
|
}
|
|
|
@@ -204,7 +207,6 @@ export default {
|
|
|
password: [
|
|
|
{ required: true, message: '请输入密码', trigger: 'blur' },
|
|
|
{
|
|
|
-
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (!value) {
|
|
|
callback(new Error('请输入密码'));
|
|
|
@@ -222,7 +224,7 @@ export default {
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (!value) {
|
|
|
callback(new Error('请输入确认密码'));
|
|
|
- } else if (value == this.formData.password) {
|
|
|
+ } else if (value == this.formData1.password) {
|
|
|
callback();
|
|
|
} else {
|
|
|
callback(new Error('两次密码输入不一致!'));
|
|
|
@@ -333,15 +335,15 @@ export default {
|
|
|
this.$http.post({
|
|
|
url: '/userInfo/register',
|
|
|
data: {
|
|
|
- username: this.formData.username,
|
|
|
- nickname: this.formData.username,
|
|
|
- password: this.formData.password,
|
|
|
- phone: this.formData.contactPhone,
|
|
|
- contacter: this.formData.contacter,
|
|
|
- companyName: this.formData.companyName,
|
|
|
- companyType: this.formData.companyType,
|
|
|
- contactPhone: this.formData.contactPhone,
|
|
|
- companyType:'Y'
|
|
|
+ username: this.formData1.username,
|
|
|
+ nickname: this.formData1.username,
|
|
|
+ password: this.formData1.password,
|
|
|
+ phone: this.formData1.contactPhone,
|
|
|
+ contacter: this.formData1.contacter,
|
|
|
+ companyName: this.formData1.companyName,
|
|
|
+ companyType: this.formData1.companyType,
|
|
|
+ contactPhone: this.formData1.contactPhone,
|
|
|
+ companyType: 'Y'
|
|
|
|
|
|
}
|
|
|
}).then(res => {
|
|
|
@@ -361,19 +363,19 @@ export default {
|
|
|
this.$message.warning('手机号格式错误')
|
|
|
return
|
|
|
}
|
|
|
- else if (!this.checkPhone(this.formData.contactPhone) && this.activeName == 'first') {
|
|
|
+ else if (!this.checkPhone(this.formData1.contactPhone) && this.activeName == 'first') {
|
|
|
this.$message.warning('手机号格式错误')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
|
|
|
- this.checkHas({ phone: (this.activeName == 'first' ? this.formData.contactPhone : this.formData.phone) }).then((result) => {
|
|
|
+ this.checkHas({ phone: (this.activeName == 'first' ? this.formData1.contactPhone : this.formData.phone) }).then((result) => {
|
|
|
console.log(result)
|
|
|
if (result) {
|
|
|
this.$message.warning('该手机号已经被用户绑定')
|
|
|
}
|
|
|
else {
|
|
|
- this.sendMeg(this.activeName == 'first' ? this.formData.contactPhone : this.formData.phone).then((json) => {
|
|
|
+ this.sendMeg(this.activeName == 'first' ? this.formData1.contactPhone : this.formData.phone).then((json) => {
|
|
|
if (json.success) {
|
|
|
this.$message.success('发送成功')
|
|
|
this.backCode = json.data
|