Browse Source

更新部分问题

warrior 3 weeks ago
parent
commit
638728a387

BIN
projects/live-app/public/img/nickname.png


+ 1 - 1
projects/live-app/src/app/app.routes.ts

@@ -12,7 +12,7 @@ import { LoginAuthGuard } from '../modules/login/auth.guard';
 export const routes: Routes = [
   { path: '', redirectTo:'tabs', pathMatch: "full",}, // 默认跳转到 ''
   {
-    path: 'invite',
+    path: 'invite/:id',
     loadComponent:()=> import('../modules/login/invite/invite.component').then((mod) => mod.InviteComponent),
   },
   {

+ 1 - 1
projects/live-app/src/modules/account/wattle/wattle.component.html

@@ -9,7 +9,7 @@
         </div>
         <!-- @if (isAnthor) { -->
         <div class="balance">
-          <div class="count">{{ anthorWallet?.balance || 0 }}</div>
+          <div class="count">{{ anthorWallet?.balance || 0 }}</div>
           <div class="title">可提现</div>
         </div>
         <!-- } -->

+ 10 - 0
projects/live-app/src/modules/login/invite/invite.component.html

@@ -65,6 +65,16 @@
         placeholder="请再次输入密码"
       ></ion-input>
     </div>
+    <div class="input">
+      <div class="icon">
+        <img src="img/nickname.png" alt="" />
+      </div>
+      <ion-input
+        type="text"
+        [(ngModel)]="registerInfo.nickname"
+        placeholder="请输入昵称"
+      ></ion-input>
+    </div>
     <div class="input">
       <div class="icon">
         <img src="img/invite.png" alt="" />

+ 42 - 1
projects/live-app/src/modules/login/invite/invite.component.ts

@@ -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)

+ 10 - 0
projects/live-app/src/modules/login/login.component.html

@@ -210,6 +210,16 @@
         placeholder="请再次输入密码"
       ></ion-input>
     </div>
+    <div class="input">
+      <div class="icon">
+        <img src="img/nickname.png" alt="" />
+      </div>
+      <ion-input
+        type="text"
+        [(ngModel)]="registerInfo.nickname"
+        placeholder="请输入昵称"
+      ></ion-input>
+    </div>
     <div class="input">
       <div class="icon">
         <img src="img/invite.png" alt="" />

+ 37 - 0
projects/live-app/src/modules/login/login.component.ts

@@ -75,7 +75,30 @@ export class LoginComponent implements OnInit {
     password: '',
     confirmPassword: '',
     invite: '',
+    nickname: '',
   };
+  nicknameArr = [
+    "星辰",
+    "月夜夜影",
+    "花儿阳光",
+    "彩虹颜色",
+    "云朵天空",
+    "凤凰火焰",
+    "龙呼吸",
+    "鹰翅膀",
+    "狼族群",
+    "虎爪子",
+    "狮咆哮",
+    "熊拥抱",
+    "狐狸尾巴",
+    "鹿鹿角",
+    "马奔跑",
+    "兔跳跃",
+    "松鼠坚果",
+    "猴子香蕉",
+    "熊猫竹子",
+    "长颈鹿脖子"
+  ]
   ngOnInit() {
     let invite = localStorage.getItem('invite');
     console.log('invite:',invite);
@@ -105,6 +128,8 @@ export class LoginComponent implements OnInit {
         localStorage.setItem('tabsOption', JSON.stringify(value));
       });
     });
+
+    this.registerInfo.nickname = this.nicknameArr[Math.floor(Math.random() * 20)] + new Date().getMilliseconds()
   }
 
   //   获取验证码
@@ -487,6 +512,16 @@ export class LoginComponent 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',
@@ -519,12 +554,14 @@ export class LoginComponent 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)

+ 1 - 1
projects/live-app/src/modules/user/ranking/ranking.component.ts

@@ -31,7 +31,7 @@ export class RankingComponent implements OnInit {
     console.log(this.active);
     // console.log(this.active);
     // this.orderList = []
-    this.orderList = await this.aiServ.getOrderAnchor(this.active)
+    this.orderList = await this.aiServ.getOrderAnchor(this.active,null,'day')
   }
   async changeTop(e:any, type?:string){
     e.cancelBubble = true;

+ 1 - 3
projects/live-app/src/services/aichart.service.ts

@@ -344,13 +344,11 @@ export class AiChatService {
     let date = new Date();
     switch (range) {
       case 'month':
-        date.setDate(date.getDate() - date.getDay() + 1);
-        date = new Date();
         startTime = date.getFullYear() + '-' + (date.getMonth() + 1) + '-1';
         break;
       case 'week':
         date.setDate(date.getDate() - date.getDay() + 1);
-        date = new Date();
+        date = new Date(date);
         startTime =
           date.getFullYear() +
           '-' +

+ 1 - 1
projects/live-app/src/services/message.service.ts

@@ -400,7 +400,7 @@ export class MessageService {
         const metadata = [
           {
             key: 'nickname',
-            value: user?.get('nickname') || user?.get('name') || user?.id,
+            value: user?.get('nickname') || '',
           },
           {
             key: 'avatar',