|
|
@@ -8,7 +8,7 @@
|
|
|
<div class="info-form-item adfacjb">
|
|
|
<div class="info-form-item-left">您的姓名</div>
|
|
|
<div class="info-form-item-right">
|
|
|
- <u-input v-model="dto.name" border="none" placeholder="请填写姓名"></u-input>
|
|
|
+ <u-input v-model="dto.realName" border="none" placeholder="请填写姓名"></u-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="info-form-item adfacjb">
|
|
|
@@ -19,7 +19,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="zt_btn">提交</div>
|
|
|
+ <div class="zt_btn" @click="handleSubmit">提交</div>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -27,14 +27,77 @@
|
|
|
export default {
|
|
|
data(){
|
|
|
return {
|
|
|
+ info:null,
|
|
|
+ user:null,
|
|
|
dto:{
|
|
|
- name:'',
|
|
|
+ mobile:'',
|
|
|
+ realName:'',
|
|
|
email:''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onLoad(options) {
|
|
|
+ let params = JSON.parse(decodeURIComponent(options.params));
|
|
|
+ this.info = params.info;
|
|
|
+ this.user = params.user;
|
|
|
+ this.dto.mobile = this.info.mobile||'';
|
|
|
+ },
|
|
|
methods:{
|
|
|
-
|
|
|
+ handleSubmit(){
|
|
|
+ if(!this.dto.realName) return this.$showToast('请输入姓名')
|
|
|
+ if(!this.$reg.email(this.dto.email)) return this.$showToast('请输入正确的邮箱')
|
|
|
+
|
|
|
+ uni.showLoading({ title:'注册提交中' });
|
|
|
+ this.$api.post('/wx/register',this.dto,false).then(({data:res})=>{
|
|
|
+ if(res.code!==0) return this.$showToast(res.msg)
|
|
|
+ this.postRegisterRecord()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ postRegisterRecord(){
|
|
|
+ this.$api.post('/core/register/record',{
|
|
|
+ channelType:this.info.channelType||'',
|
|
|
+ referrerId:this.info.referrerId||'',
|
|
|
+ teamQuestionnaireId:this.info.teamQuestionnaireId||'',
|
|
|
+ userId:this.info.userId||''
|
|
|
+ },false).then(({data:res})=>{
|
|
|
+ if(res.code!==0) return this.$showToast(res.msg)
|
|
|
+
|
|
|
+ uni.setStorageSync('token',this.user.token);
|
|
|
+ uni.setStorageSync('userInfo',JSON.stringify({
|
|
|
+ id:this.user.id,
|
|
|
+ gender:this.user.gender,
|
|
|
+ realName:this.user.realName,
|
|
|
+ mobile:this.user.mobile,
|
|
|
+ headUrl:this.user.headUrl,
|
|
|
+ teamId:this.user.teamId,
|
|
|
+ enterpriseId:this.user.enterpriseId,
|
|
|
+ enterpriseName:this.user.enterpriseName,
|
|
|
+ teamName:this.user.teamName,
|
|
|
+ referrerId:this.user.referrerId,
|
|
|
+ teamQuestionnaireId:this.user.teamQuestionnaireId,
|
|
|
+ isRegister:1
|
|
|
+ }));
|
|
|
+
|
|
|
+ uni.hideLoading();
|
|
|
+ this.$showToast('提交成功');
|
|
|
+ uni.reLaunch({
|
|
|
+ url:'/pages/home'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ checkUser(){
|
|
|
+ this.$api.post('/wx/check',{
|
|
|
+ channelType:this.info.channelType||'',
|
|
|
+ isRegister:this.info.isRegister,
|
|
|
+ referrerId:this.info.referrerId||'',
|
|
|
+ teamQuestionnaireId:this.info.teamQuestionnaireId||'',
|
|
|
+ userId:this.info.userId||''
|
|
|
+ },false).then(({data:res})=>{
|
|
|
+ if(res.code!==0) return this.$showToast(res.msg)
|
|
|
+ uni.hideLoading();
|
|
|
+ console.log(res);
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|