|
|
@ -16,6 +16,7 @@ |
|
|
|
:label-col="formItemLayout.labelCol" |
|
|
|
:wrapper-col="formItemLayout.wrapperCol" |
|
|
|
label="所属社区" |
|
|
|
v-if="source === 'index'" |
|
|
|
> |
|
|
|
<a-radio-group @change="onChange" v-model.trim="platform.platform"> |
|
|
|
<a-radio :value="1">创新社区</a-radio> |
|
|
@ -49,7 +50,7 @@ |
|
|
|
@change="changePhone" |
|
|
|
placeholder="请输入联系电话.." |
|
|
|
type="tel" |
|
|
|
v-decorator="['tel', { rules: phoneRules }]" |
|
|
|
v-model.trim="platform.tel" |
|
|
|
/> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item |
|
|
@ -158,6 +159,10 @@ export default { |
|
|
|
type: String, |
|
|
|
default: '', |
|
|
|
}, |
|
|
|
source: { |
|
|
|
type: String, |
|
|
|
default: '', |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -186,9 +191,6 @@ export default { |
|
|
|
showInterval: false, |
|
|
|
codeTimer: null, |
|
|
|
interval: 120, // 验证码有效时间倒计时 |
|
|
|
phoneRules: [ |
|
|
|
{ required: true, pattern: new RegExp(/^[1][3,4,5,6,7,8,9][0-9]{9}$/), whitespace: true, message: '请输入正确的手机号' }, |
|
|
|
], |
|
|
|
typeData: { |
|
|
|
type: 0, |
|
|
|
Id: '', |
|
|
@ -222,7 +224,6 @@ export default { |
|
|
|
|
|
|
|
// 选择社区 |
|
|
|
onChange(e) { |
|
|
|
console.log('radio checked', e.target.value); |
|
|
|
this.platform.platform = e.target.value; |
|
|
|
}, |
|
|
|
// 点击确定 |
|
|
@ -236,7 +237,9 @@ export default { |
|
|
|
// 验证电话 |
|
|
|
changePhone(e) { |
|
|
|
this.platform.tel = e.target.value; |
|
|
|
console.log('this.platform.tel: ', this.platform.tel); |
|
|
|
this.platform.isTel = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.platform.tel); |
|
|
|
console.log('this.platform.isTel: ', this.platform.isTel); |
|
|
|
}, |
|
|
|
// 点击确定 |
|
|
|
handleOk() { |
|
|
@ -244,6 +247,8 @@ export default { |
|
|
|
this.$message.error('请输入联系人'); |
|
|
|
} else if (!this.platform.tel) { |
|
|
|
this.$message.error('请输入联系电话'); |
|
|
|
} else if (!this.verification(this.platform.tel)) { |
|
|
|
this.$message.error('请输入正确的联系电话'); |
|
|
|
} else if (!this.platform.code) { |
|
|
|
this.$message.error('请输入验证码'); |
|
|
|
} else { |
|
|
@ -257,6 +262,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 验证手机号 |
|
|
|
verification(phone) { |
|
|
|
if (/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone)) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 加入接口 |
|
|
|
async subMitAdd() { |
|
|
|
this.confirmLoading = true; |
|
|
@ -271,10 +286,11 @@ export default { |
|
|
|
filesId: this.platform.files, |
|
|
|
serviceId: this.typeData.Id, |
|
|
|
type: this.typeData.type, |
|
|
|
platform: this.platform.platform, |
|
|
|
}, |
|
|
|
}; |
|
|
|
console.log('params: ', params); |
|
|
|
if (this.source === 'index') { |
|
|
|
params.param.platform = this.platform.platform; |
|
|
|
} |
|
|
|
const res = await serviceApply(params); |
|
|
|
const { code, msg, data } = res.data; |
|
|
|
if (code === 200) { |
|
|
@ -283,10 +299,12 @@ export default { |
|
|
|
for (let key in this.platform) { |
|
|
|
this.platform[key] = ''; |
|
|
|
} |
|
|
|
for (let key in this.typeData) { |
|
|
|
this.typeData[key] = ''; |
|
|
|
} |
|
|
|
this.platform.platform = 0; |
|
|
|
this.typeData.Id = ''; |
|
|
|
this.typeData.type = 0; |
|
|
|
this.platform.files = []; |
|
|
|
this.platform.isTel = false; |
|
|
|
this.codeNum = ''; |
|
|
|
} else { |
|
|
|
throw msg; |
|
|
|
} |
|
|
@ -296,6 +314,7 @@ export default { |
|
|
|
this.confirmLoading = false; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取验证码 |
|
|
|
async getCode() { |
|
|
|
try { |
|
|
@ -308,7 +327,7 @@ export default { |
|
|
|
this.getCodeInterval(); |
|
|
|
} catch (error) { |
|
|
|
// throw new Error(`SignIn.vue method getCode: ${error}`); |
|
|
|
// console.log(error); |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -329,6 +348,9 @@ export default { |
|
|
|
|
|
|
|
// 刷新验证码 |
|
|
|
changePicCode() { |
|
|
|
if (!this.verification(this.platform.tel)) { |
|
|
|
this.$message.error('请输入正确的联系电话'); |
|
|
|
} |
|
|
|
this.sendPicCode(); |
|
|
|
}, |
|
|
|
beforeUpload(file) { |
|
|
|