|
|
|
|
@ -3,41 +3,42 @@ |
|
|
|
|
<view class="container"> |
|
|
|
|
<betone-header-top :title="title" /> |
|
|
|
|
<u-form labelPosition="left" :model="registerInfo" :rules="rules" ref="registerForm"> |
|
|
|
|
<u-form-item prop="businessName" ref="item1" :border-bottom="false" label-width="0"> |
|
|
|
|
<u-form-item prop="businessName" :border-bottom="false" label-width="0"> |
|
|
|
|
<betone-new-input label="企业名称" v-model="registerInfo.businessName" placeholder="请输入" :isRequire="true" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="area" ref="item1" :border-bottom="false" label-width="0"> |
|
|
|
|
<u-form-item prop="area" :border-bottom="false" label-width="0"> |
|
|
|
|
<view @click.stop="addMap()" style="width: 100%;height: 100%;"> |
|
|
|
|
<betone-new-input label="实验室地址" v-model="registerInfo.area" placeholder="请选择" :isRequire="true" |
|
|
|
|
type="select" /> |
|
|
|
|
</view> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="personName" ref="item1" :border-bottom="false" label-width="0"> |
|
|
|
|
<u-form-item prop="personName" :border-bottom="false" label-width="0"> |
|
|
|
|
<betone-new-input label="负责人姓名" v-model="registerInfo.personName" placeholder="请输入" :isRequire="true" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="phoneNumber" ref="item1" :border-bottom="false" label-width="0"> |
|
|
|
|
<u-form-item prop="phoneNumber" :border-bottom="false" label-width="0"> |
|
|
|
|
<betone-new-input label="手机号" v-model="registerInfo.phoneNumber" placeholder="请输入" :isRequire="true" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="password" ref="item1" :border-bottom="false" label-width="0"> |
|
|
|
|
<u-form-item prop="verificationCode" :border-bottom="false" label-width="0"> |
|
|
|
|
<betone-new-input label="手机验证码" v-model="registerInfo.verificationCode" placeholder="请输入手机6位数验证码" |
|
|
|
|
:isSms="true" @ch="sendCode" :isRequire="true" ref="verificationCode" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="password" :border-bottom="false" label-width="0"> |
|
|
|
|
<betone-new-input label="设置密码" v-model="registerInfo.password" placeholder="请输入8-16位数字与字母的组合" |
|
|
|
|
:isRequire="true" type="password" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="confirmPassword" ref="item1" :border-bottom="false" label-width="0"> |
|
|
|
|
<u-form-item prop="confirmPassword" :border-bottom="false" label-width="0"> |
|
|
|
|
<betone-new-input label="确认密码" v-model="registerInfo.confirmPassword" placeholder="请再次输入密码" :isRequire="true" |
|
|
|
|
type="password" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="verificationCode" ref="item1" :border-bottom="false" label-width="0"> |
|
|
|
|
<betone-new-input label="手机验证码" v-model="registerInfo.verificationCode" placeholder="请输入手机6位数验证码" |
|
|
|
|
:isSms="true" @ch="sendCode" :isRequire="true" /> |
|
|
|
|
</u-form-item> |
|
|
|
|
<u-form-item prop="checked" ref="item1" :border-bottom="false"> |
|
|
|
|
|
|
|
|
|
<u-form-item prop="checked" :border-bottom="false"> |
|
|
|
|
<u-checkbox-group style="margin-bottom: 16rpx" shape="square"> |
|
|
|
|
<u-checkbox v-model="registerInfo.checked" key="index" labelSize="24" |
|
|
|
|
name="我已阅读并接受《注册服务协议》及《隐私权政策》">我已阅读并接受《注册服务协议》及《隐私权政策》</u-checkbox> |
|
|
|
|
</u-checkbox-group> |
|
|
|
|
</u-form-item> |
|
|
|
|
</u-form> |
|
|
|
|
<u-button class="item-bottom" type="primary" @click="formSubmit"> |
|
|
|
|
<u-button class="item-bottom" type="primary" @click="formSubmit()"> |
|
|
|
|
注册 |
|
|
|
|
</u-button> |
|
|
|
|
</view> |
|
|
|
|
@ -46,7 +47,7 @@ |
|
|
|
|
:showResetting='mapInfo.showResetting' :listIco='mapInfo.listIco' :orientationIco='mapInfo.orientationIco' |
|
|
|
|
:resettingIco='mapInfo.resettingIco'></map-Point> |
|
|
|
|
</betone-dialog> |
|
|
|
|
|
|
|
|
|
<betone-loading ref="BetLoading"></betone-loading> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
@ -129,6 +130,7 @@ export default { |
|
|
|
|
if (value != this.registerInfo.password) { |
|
|
|
|
callback(new Error('两次密码校验不一致')) |
|
|
|
|
} |
|
|
|
|
callback() |
|
|
|
|
}, |
|
|
|
|
message: '两次密码校验不一致', |
|
|
|
|
trigger: ["blur"] |
|
|
|
|
@ -156,8 +158,8 @@ export default { |
|
|
|
|
resettingIco: "/uni_modules/map-Point/static/position.png", |
|
|
|
|
showResetting: true, |
|
|
|
|
Radius: '', |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
selectMap: {},//选中地点的详细信息 |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
@ -180,28 +182,66 @@ export default { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
formSubmit() { |
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
// url: "/pages/register/registerSuccess", |
|
|
|
|
// }); |
|
|
|
|
this.$refs.registerForm.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.registerInfo.checked.length <= 0) { |
|
|
|
|
uni.$u.toast("请勾选《注册服务协议》及《隐私权政策》"); |
|
|
|
|
return false; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
// url: "/pages/register/registerSuccess?account=" + this.registerInfo.phoneNumber + '&pwd=' + this.registerInfo.password, |
|
|
|
|
// }); |
|
|
|
|
this.$refs.registerForm.validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.registerInfo.checked.length <= 0) { |
|
|
|
|
uni.$u.toast("请勾选《注册服务协议》及《隐私权政策》"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
this.$refs.BetLoading.show(); |
|
|
|
|
let query_ = { |
|
|
|
|
"deptName": this.registerInfo.businessName,//企业名称 |
|
|
|
|
"address": this.registerInfo.area,//详细地址 |
|
|
|
|
"name": this.registerInfo.personName,//负责人姓名 |
|
|
|
|
"phone": this.registerInfo.phoneNumber,//手机号 |
|
|
|
|
"password": this.registerInfo.password,//设置密码 |
|
|
|
|
"addressLon": this.selectMap.location.split(',')[0],//经度 |
|
|
|
|
"addressLat": this.selectMap.location.split(',')[1],//纬度 |
|
|
|
|
"verifyCode": this.registerInfo.verificationCode,//验证码 |
|
|
|
|
} |
|
|
|
|
this.$u.api.registerUser(query_).then(res => { |
|
|
|
|
this.$refs.BetLoading.hide(); |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: "/pages/register/registerSuccess?account=" + this.registerInfo.phoneNumber + '&pwd=' + this.registerInfo.password, |
|
|
|
|
}); |
|
|
|
|
}, 1000) |
|
|
|
|
} else { |
|
|
|
|
uni.$u.toast(res.msg); |
|
|
|
|
} |
|
|
|
|
}).finally(err => { |
|
|
|
|
this.$refs.BetLoading.hide(); |
|
|
|
|
uni.$u.toast(err.data.msg); |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.$refs.BetLoading.hide(); |
|
|
|
|
console.log('验证失败'); |
|
|
|
|
} |
|
|
|
|
console.log('验证通过'); |
|
|
|
|
} else { |
|
|
|
|
console.log('验证失败'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 发送验证码 |
|
|
|
|
sendCode() { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
// this.isCanSms = true; |
|
|
|
|
uni.$u.toast("发送成功"); |
|
|
|
|
}, 1500); |
|
|
|
|
if (this.registerInfo.phoneNumber == '') { |
|
|
|
|
uni.$u.toast("请先输入手机号"); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
let query = { |
|
|
|
|
phone: this.registerInfo.phoneNumber |
|
|
|
|
} |
|
|
|
|
this.$u.api.sendVerify(query).then(res => { |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
this.$refs.verificationCode.sendSuceess() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 打开地图选择框 |
|
|
|
|
addMap() { |
|
|
|
|
@ -209,6 +249,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
commitCheck(e) { |
|
|
|
|
if (e) { |
|
|
|
|
this.selectMap = e |
|
|
|
|
console.log('选中地点', e) |
|
|
|
|
uni.$emit('commitCheck', e); |
|
|
|
|
this.registerInfo.area = e.name |
|
|
|
|
} |
|
|
|
|
|