소스 검색

add 隐身功能

warrior 1 개월 전
부모
커밋
0f667c07a7

+ 15 - 12
projects/live-app/src/modules/tabs/anthorhome/anthorhome.component.ts

@@ -15,15 +15,6 @@ import { province } from '../../../services/address';
 import { FormsModule } from '@angular/forms';
 import { InfiniteScrollCustomEvent } from '@ionic/core';
 import { MessageService } from '../../../services/message.service';
-province.unshift({
-  provinceName: '全部',
-  citys: [
-    {
-      cityName: '',
-      cityType: '',
-    },
-  ],
-});
 @Component({
   selector: 'app-anthorhome',
   templateUrl: './anthorhome.component.html',
@@ -45,8 +36,8 @@ export class AnthorhomeComponent implements OnInit {
     return map[this.viewAnchor];
   }
   isOpenCity: boolean = false;
-  provinceColumns = province.map((item) => item.provinceName);
-  cityColumns = province[0].citys.map((item) => item.cityName);
+  provinceColumns = [];
+  cityColumns = [];
   province: string = ''; //省份
   city: string = ''; //市
   old_province: string = ''; //省份
@@ -81,7 +72,19 @@ export class AnthorhomeComponent implements OnInit {
     private aiServ: AiChatService,
     private msgSer: MessageService,
     private datePipe: DatePipe
-  ) {}
+  ) {
+    province.unshift({
+      provinceName: '全部',
+      citys: [
+        {
+          cityName: '',
+          cityType: '',
+        },
+      ],
+    });
+    this.provinceColumns = province.map((item) => item.provinceName);
+    this.cityColumns = province[0].citys.map((item) => item.cityName);
+  }
 
   ngOnInit() {
     // this.activateRoute.paramMap.subscribe(async (params) => {

+ 15 - 12
projects/live-app/src/modules/tabs/home/home.component.ts

@@ -12,15 +12,6 @@ import {
 import { CommonModule, DatePipe } from '@angular/common';
 import { province } from '../../../services/address';
 import { FormsModule } from '@angular/forms';
-province.unshift({
-  provinceName: '全部',
-  citys: [
-    {
-      cityName: '',
-      cityType: '',
-    },
-  ],
-});
 @Component({
   selector: 'app-home',
   templateUrl: './home.component.html',
@@ -84,8 +75,8 @@ export class HomeComponent implements OnInit {
     return map[this.viewAnchor];
   }
   isOpenCity: boolean = false;
-  provinceColumns = province.map((item) => item.provinceName);
-  cityColumns = province[0].citys.map((item) => item.cityName);
+  provinceColumns = [];
+  cityColumns = [];
   province: string = ''; //省份
   city: string = ''; //市
   old_province: string = ''; //省份
@@ -100,7 +91,19 @@ export class HomeComponent implements OnInit {
     private router: Router,
     private aiServ: AiChatService,
     private datePipe: DatePipe
-  ) {}
+  ) {
+    province.unshift({
+      provinceName: '全部',
+      citys: [
+        {
+          cityName: '',
+          cityType: '',
+        },
+      ],
+    });
+    this.provinceColumns = province.map((item) => item.provinceName);
+    this.cityColumns = province[0].citys.map((item) => item.cityName);
+  }
 
   ngOnInit() {
     // this.activateRoute.paramMap.subscribe(async (params) => {

+ 32 - 21
projects/live-app/src/modules/user/setting/setting.component.html

@@ -1,23 +1,20 @@
 <nav title="编辑信息"></nav>
 <ion-content class="content">
+  <div class="row portrait">
+    <div>头像</div>
+    @if (formData.avatar) {
+    <app-upload
+      (onChange)="saveEdit($event)"
+      #upload
+      [maxlenght]="1"
+      [files]="[{ url: formData.avatar }]"
+      [fileWidth]="80"
+      [fileHeight]="80"
+      [boxWidth]="100"
+    ></app-upload>
+    }
+  </div>
   <ion-list>
-    <ion-item>
-      <div class="row portrait">
-        <div>头像</div>
-        @if (formData.avatar) {
-        <!-- <img [src]="avatar" alt="" /> -->
-        <app-upload
-          (onChange)="saveEdit($event)"
-          #upload
-          [maxlenght]="1"
-          [files]="[{ url: formData.avatar }]"
-          [fileWidth]="80"
-          [fileHeight]="80"
-          [boxWidth]="100"
-        ></app-upload>
-        }
-      </div>
-    </ion-item>
     <ion-item>
       <div class="row">
         <div>昵称</div>
@@ -86,8 +83,7 @@
       <div class="row">
         <div>社交标签</div>
         <div class="right tags">
-          @if (getTag.length > 0) { @for (tag of getTag; track
-          $index) {
+          @if (getTag.length > 0) { @for (tag of getTag; track $index) {
           <span class="tag"
             >{{ tag.val }}<ion-icon class="close" name="close"></ion-icon
           ></span>
@@ -124,6 +120,21 @@
         </div>
       </div>
     </ion-item>
+    <ion-item>
+      <div class="row">
+        <div class="tabs-left">
+          在线隐身<img class="vip" src="img/VIP.png" alt="" />
+        </div>
+        <div class="checked">
+          <ion-toggle
+            [disabled]="!vip?.rights?.invisible"
+            [checked]="profile?.get('auditing')"
+            (ionChange)="formData.auditing = !formData.auditing"
+            color="tertiary"
+          ></ion-toggle>
+        </div>
+      </div>
+    </ion-item>
   </ion-list>
   <button class="submit" (click)="upload.onUpload()">保存修改</button>
 </ion-content>
@@ -171,8 +182,8 @@
   trigger="open-modal2"
   [isOpen]="isOpenTag"
   (didDismiss)="isOpenTag = false"
-  [initialBreakpoint]="1" 
-  [breakpoints]="[0, 0.5,1]"
+  [initialBreakpoint]="1"
+  [breakpoints]="[0, 0.5, 1]"
 >
   <ng-template>
     <div class="tag-modal">

+ 42 - 20
projects/live-app/src/modules/user/setting/setting.component.scss

@@ -4,26 +4,27 @@
 
 ion-content {
   --padding-bottom: 26.6667vw;
-  background-image: url("https://file-cloud.fmode.cn/Qje9D4bqol/20241220/b313ov054708770.png") !important;
-  background-repeat: no-repeat;
-  background-position: center top;
-  background-size: 100% 100%;
-  --background: #ffffff00;
+  // background-image: url("https://file-cloud.fmode.cn/Qje9D4bqol/20241220/b313ov054708770.png") !important;
+  // background-repeat: no-repeat;
+  // background-position: center top;
+  // background-size: 100% 100%;
+  --background: #ffffff;
   .portrait {
-    // background-color: white;
-    // padding: 1.3333vw 4vw 0 4vw;
-    // font-size: 4.2667vw;
-    // display: flex;
-    // justify-content: space-between;
-
-    div {
-      line-height: 16vw;
-    }
-    img {
-      border-radius: 50%;
-      width: 16vw;
-      height: 16vw;
-    }
+    background-color: white;
+    padding:4px 10px 4px 0;
+    font-size: 4.2667vw;
+    display: flex;
+    justify-content: space-between;
+    border-bottom: 1px solid #c8c7cc;
+    margin: 0 16px;
+    // div {
+    //   line-height: 16vw;
+    // }
+    // img {
+    //   border-radius: 50%;
+    //   width: 16vw;
+    //   height: 16vw;
+    // }
   }
 
   .row {
@@ -61,10 +62,25 @@ ion-content {
         color: #0054e9;
       }
     }
-
     ion-input {
       text-align: right;
     }
+    .tabs-left {
+      display: flex;
+      align-items: center;
+      ion-icon {
+        font-size: 5.641vw;
+        // color: #e7435c;
+      }
+      .vip{
+        width: 6.1538vw;
+        height: 6.1538vw;
+      }
+    }
+    ion-toggle {
+      --handle-height: 3.5897vw;
+      --handle-width: 3.5897vw;
+    }
   }
   // .age,.nikename{
   //     >div:last-child{
@@ -111,3 +127,9 @@ ion-modal {
   --height: auto;
   align-items: end;
 }
+ion-toggle::part(track),
+ion-toggle.toggle-checked::part(track) {
+  height: 5.1282vw;
+  width: 10.2564vw;
+  overflow: visible;
+}

+ 7 - 0
projects/live-app/src/modules/user/setting/setting.component.ts

@@ -12,6 +12,7 @@ import { AuthService } from '../../../services/auth.service';
 import { ionicStandaloneModules } from '../../ionic-standalone.modules';
 import { province } from '../../../services/address';
 import { CommonModule } from '@angular/common';
+import { AccountService } from '../../../services/account.service';
 
 @Component({
   selector: 'app-setting',
@@ -35,6 +36,7 @@ export class SettingComponent implements OnInit {
     sex: '',
     age: '',
     remark: '',
+    auditing:false
   };
   mobile: string = '';
   loading: any;
@@ -101,11 +103,13 @@ export class SettingComponent implements OnInit {
   get getTag(){
     return this.tags.filter(item=>item.check);
   }
+  vip:any
   constructor(
     private alertController: AlertController,
     public loadingCtrl: LoadingController,
     public toastController: ToastController,
     private authServ: AuthService,
+    private accServ: AccountService,
     // private router: Router
   ) {}
 
@@ -133,6 +137,7 @@ export class SettingComponent implements OnInit {
     this.formData.name = this.profile?.get('name') || '';
     this.formData.age = this.profile?.get('birthdate') || '';
     this.formData.remark = this.profile?.get('remark') || '';
+    this.formData.auditing = this.profile?.get('auditing');
     this.loading.dismiss();
     if (user?.get('city') && user?.get('province')) {
       this.address = user?.get('province') + '-' + user?.get('city');
@@ -142,6 +147,7 @@ export class SettingComponent implements OnInit {
     this.tags.map(item=>{
       item.check = this.profile?.get('tags')?.includes(item.val) || false;
     })
+    this.vip = this.accServ.userVip;
   }
   onChange(e: any, type: string) {
     this.formData[type] = e.detail.value;
@@ -198,6 +204,7 @@ export class SettingComponent implements OnInit {
     this.profile?.set('sex', this.formData.sex);
     this.profile?.set('birthdate', this.formData.age);
     this.profile?.set('remark', this.formData.remark);
+    this.profile?.set('auditing', this.formData.auditing);
     this.profile?.set('address', this.address);
     let t = this.tags.filter((x) => x.check)?.map(item=> item.val)
     this.profile?.set('tag', t);