|
@@ -6,7 +6,6 @@ import { IonicModule } from '@ionic/angular';
|
|
|
|
|
|
// 全局消息服务和JIM插件
|
|
|
import { OnInit } from '@angular/core';
|
|
|
-// import { AlertController } from '@ionic/angular';
|
|
|
import { FlutterCompComponent } from '../../../app/components/flutter-comp/flutter-comp.component';
|
|
|
import { MessageService } from '../../../services/message.service';
|
|
|
// import { ConnectTaskService } from '../../../services/connectTask.service';
|
|
@@ -16,31 +15,34 @@ import { Filesystem } from '@capacitor/filesystem';
|
|
|
import { DeviceService } from '../../../services/device.service';
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
import { HttpService } from '../../../services/http.service';
|
|
|
+import { AlertController } from '../../ionic-standalone.modules';
|
|
|
+import { AuthService } from '../../../services/auth.service';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'live-tabs',
|
|
|
templateUrl: 'tabs.component.html',
|
|
|
styleUrls: ['tabs.component.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [IonicModule, FlutterCompComponent,CommonModule],
|
|
|
+ imports: [IonicModule, FlutterCompComponent, CommonModule],
|
|
|
})
|
|
|
export class TabsComponent implements OnInit {
|
|
|
@Input('tabsOption') tabsOption: any = {};
|
|
|
company: any = window.localStorage.getItem('company');
|
|
|
constructor(
|
|
|
private router: Router,
|
|
|
- // private alertController: AlertController,
|
|
|
+ private alertController: AlertController,
|
|
|
private activateRoute: ActivatedRoute,
|
|
|
public deviceSer: DeviceService,
|
|
|
private http: HttpService,
|
|
|
- public msgServe: MessageService,
|
|
|
- )
|
|
|
- {
|
|
|
+ private authServ: AuthService,
|
|
|
+ public msgServe: MessageService
|
|
|
+ ) {
|
|
|
this.activateRoute.paramMap.subscribe(async (params) => {
|
|
|
await this.presentAlert();
|
|
|
- this.active = this.option.findIndex((item: any) => {
|
|
|
- return item.url == location.pathname.slice(1)
|
|
|
- }) ?? 0
|
|
|
+ this.active =
|
|
|
+ this.option.findIndex((item: any) => {
|
|
|
+ return item.url == location.pathname.slice(1);
|
|
|
+ }) ?? 0;
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -86,8 +88,8 @@ export class TabsComponent implements OnInit {
|
|
|
active: number = 0;
|
|
|
|
|
|
ngOnInit() {
|
|
|
- this.initDeviceService()
|
|
|
- this.updateParent()
|
|
|
+ this.initDeviceService();
|
|
|
+ this.updateParent();
|
|
|
}
|
|
|
|
|
|
async presentAlert() {
|
|
@@ -112,6 +114,23 @@ export class TabsComponent implements OnInit {
|
|
|
name: '首页',
|
|
|
});
|
|
|
}
|
|
|
+ if (res.get('auditing')) {
|
|
|
+ const alert = await this.alertController.create({
|
|
|
+ cssClass: 'my-custom-class',
|
|
|
+ header: '账号已被封禁',
|
|
|
+ message: '您的账号已被封禁,请联系客服处理',
|
|
|
+ backdropDismiss: false,
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ text: '退出登录',
|
|
|
+ handler: () => {
|
|
|
+ this.authServ.logout();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ await alert.present();
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
// const alert = await this.alertController.create({
|
|
@@ -170,7 +189,6 @@ export class TabsComponent implements OnInit {
|
|
|
}, 1000);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
async initDeviceService() {
|
|
|
try {
|
|
|
// 请求相机权限
|
|
@@ -188,7 +206,7 @@ export class TabsComponent implements OnInit {
|
|
|
} else {
|
|
|
console.log('文件系统权限被拒绝');
|
|
|
}
|
|
|
- await this.requestMicrophonePermission()
|
|
|
+ await this.requestMicrophonePermission();
|
|
|
} catch (error) {
|
|
|
console.warn('请求权限时出错:', error);
|
|
|
}
|
|
@@ -203,8 +221,8 @@ export class TabsComponent implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- updateParent(){
|
|
|
- let url = `https://server.fmode.cn/api/user/agent/parent`
|
|
|
- this.http.httpRequst(url,{uid:Parse.User.current()?.id},'POST')
|
|
|
+ updateParent() {
|
|
|
+ let url = `https://server.fmode.cn/api/user/agent/parent`;
|
|
|
+ this.http.httpRequst(url, { uid: Parse.User.current()?.id }, 'POST');
|
|
|
}
|
|
|
}
|