|
@@ -55,23 +55,52 @@ export class InviteComponent implements OnInit {
|
|
|
password: '',
|
|
|
confirmPassword: '',
|
|
|
invite: '',
|
|
|
+ nickname: '',
|
|
|
};
|
|
|
isRegister: boolean = false; //是否注册成功
|
|
|
app:Parse.Object
|
|
|
+ nicknameArr = [
|
|
|
+ "星辰",
|
|
|
+ "月夜夜影",
|
|
|
+ "花儿阳光",
|
|
|
+ "彩虹颜色",
|
|
|
+ "云朵天空",
|
|
|
+ "凤凰火焰",
|
|
|
+ "龙呼吸",
|
|
|
+ "鹰翅膀",
|
|
|
+ "狼族群",
|
|
|
+ "虎爪子",
|
|
|
+ "狮咆哮",
|
|
|
+ "熊拥抱",
|
|
|
+ "狐狸尾巴",
|
|
|
+ "鹿鹿角",
|
|
|
+ "马奔跑",
|
|
|
+ "兔跳跃",
|
|
|
+ "松鼠坚果",
|
|
|
+ "猴子香蕉",
|
|
|
+ "熊猫竹子",
|
|
|
+ "长颈鹿脖子"
|
|
|
+ ]
|
|
|
ngOnInit() {
|
|
|
if (this.platform.is('hybrid')) {
|
|
|
this.authServ.logout();
|
|
|
return;
|
|
|
}
|
|
|
+ this.registerInfo.nickname = this.nicknameArr[Math.floor(Math.random() * 20)] + new Date().getMilliseconds()
|
|
|
let invite = localStorage.getItem('invite');
|
|
|
- console.log('invite:', invite);
|
|
|
+ // console.log('invite:', invite);
|
|
|
if (invite) this.registerInfo.invite = invite;
|
|
|
this.activatedRoute.paramMap.subscribe(async (param) => {
|
|
|
+ let id = param?.get('id');
|
|
|
+ if(!invite) invite = id
|
|
|
if (invite) {
|
|
|
let query = new Parse.Query('User');
|
|
|
query.equalTo('invite', invite);
|
|
|
query.select('mobile', 'username', 'nickname');
|
|
|
this.inviteUser = await query.first();
|
|
|
+ this.registerInfo.invite = invite;
|
|
|
+ }else{
|
|
|
+ window.location.href = '';
|
|
|
}
|
|
|
localStorage.setItem('APP_DEFAULT_COMPANY', 'Qje9D4bqol');
|
|
|
localStorage.setItem('company', this.company);
|
|
@@ -235,6 +264,16 @@ export class InviteComponent implements OnInit {
|
|
|
toast.present();
|
|
|
return;
|
|
|
}
|
|
|
+ this.registerInfo.nickname = this.registerInfo.nickname?.trim()
|
|
|
+ if(!this.registerInfo.nickname){
|
|
|
+ const toast = await this.toastController.create({
|
|
|
+ message: '请输入昵称',
|
|
|
+ color: 'warning',
|
|
|
+ duration: 1000,
|
|
|
+ });
|
|
|
+ toast.present();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!this.agreement) {
|
|
|
const alert = await this.alertController.create({
|
|
|
cssClass: 'my-custom-class',
|
|
@@ -267,12 +306,14 @@ export class InviteComponent implements OnInit {
|
|
|
mobile: this.registerInfo.mobile,
|
|
|
password: this.registerInfo.password,
|
|
|
invite: this.registerInfo.invite,
|
|
|
+ nickname:this.registerInfo.nickname,
|
|
|
}
|
|
|
: {
|
|
|
company: this.company,
|
|
|
code: this.registerInfo.code,
|
|
|
mobile: this.registerInfo.mobile,
|
|
|
password: this.registerInfo.password,
|
|
|
+ nickname:this.registerInfo.nickname,
|
|
|
};
|
|
|
this.http
|
|
|
.post(`https://server.fmode.cn/api/auth/register`, data)
|