|  | @@ -8,6 +8,7 @@ import { throwError } from 'rxjs';
 | 
	
		
			
				|  |  |  import { Subscription } from 'rxjs';
 | 
	
		
			
				|  |  |  import { UserService } from '../services/user.service';
 | 
	
		
			
				|  |  |  import {ElementRef, OnInit, Renderer2 } from '@angular/core';
 | 
	
		
			
				|  |  | +import { SplashService } from '../services/splash.service';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  interface User {
 | 
	
		
			
				|  |  |    username: string;
 | 
	
	
		
			
				|  | @@ -50,7 +51,7 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |    ];
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    images = [
 | 
	
		
			
				|  |  | -    '../../assets/images/brackground.jpg',
 | 
	
		
			
				|  |  | +    '../../assets/images/brackground1.jpg',
 | 
	
		
			
				|  |  |      '../../assets/images/brackground2.jpg',
 | 
	
		
			
				|  |  |      '../../assets/images/brackground3.jpeg'
 | 
	
		
			
				|  |  |    ];
 | 
	
	
		
			
				|  | @@ -85,6 +86,8 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |    isLoginModalOpen = false;
 | 
	
		
			
				|  |  |    user: User = { username: '', password: '' };
 | 
	
		
			
				|  |  |    fileToUpload: File | null = null;
 | 
	
		
			
				|  |  | +  private splashSubscription!: Subscription;
 | 
	
		
			
				|  |  | +  isLoggedIn: boolean = false;
 | 
	
		
			
				|  |  |   
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    constructor(
 | 
	
	
		
			
				|  | @@ -95,7 +98,8 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |      private toastController: ToastController,// 添加 ToastController 注入
 | 
	
		
			
				|  |  |      private userService: UserService ,
 | 
	
		
			
				|  |  |      private el: ElementRef, 
 | 
	
		
			
				|  |  | -    private renderer: Renderer2
 | 
	
		
			
				|  |  | +    private renderer: Renderer2,
 | 
	
		
			
				|  |  | +    private splashService: SplashService
 | 
	
		
			
				|  |  |    ) {}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    ngOnInit() {
 | 
	
	
		
			
				|  | @@ -103,6 +107,11 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |      this.startImageRotation();
 | 
	
		
			
				|  |  |      // 初始化时设置第一张图片
 | 
	
		
			
				|  |  |      this.updateBackgroundImage();
 | 
	
		
			
				|  |  | +    this.splashSubscription = this.splashService.openLoginModal$.subscribe(async (shouldOpen) => {
 | 
	
		
			
				|  |  | +      if (shouldOpen) {
 | 
	
		
			
				|  |  | +        await this.openLoginModal();
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    ionViewWillEnter() {
 | 
	
	
		
			
				|  | @@ -113,6 +122,9 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |      if (this.userInfoSubscription) {
 | 
	
		
			
				|  |  |        this.userInfoSubscription.unsubscribe();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +    if (this.splashSubscription) {
 | 
	
		
			
				|  |  | +      this.splashSubscription.unsubscribe();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |    
 | 
	
		
			
				|  |  |    // 实现 AfterViewInit 接口的 ngAfterViewInit 方法
 | 
	
	
		
			
				|  | @@ -244,48 +256,6 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |      this.router.navigate([route]);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -  // // 发布求医信息
 | 
	
		
			
				|  |  | -  // handleClick() {
 | 
	
		
			
				|  |  | -  //   const fileInput = document.getElementById('fileInput');
 | 
	
		
			
				|  |  | -  //   if (fileInput) {
 | 
	
		
			
				|  |  | -  //     fileInput.click();
 | 
	
		
			
				|  |  | -  //   } else {
 | 
	
		
			
				|  |  | -  //     console.error('File input element not found');
 | 
	
		
			
				|  |  | -  //   }
 | 
	
		
			
				|  |  | -  // }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  // publishHealthInfo(files: FileList) {
 | 
	
		
			
				|  |  | -  //   if (files && files.length > 0) {
 | 
	
		
			
				|  |  | -  //     const file = files[0];
 | 
	
		
			
				|  |  | -  //     const allowedTypes = ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 
 | 
	
		
			
				|  |  | -  //                           'image/jpeg', 'image/png', 'image/gif'];
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  //     if (allowedTypes.includes(file.type)) {
 | 
	
		
			
				|  |  | -  //       console.log('Selected file:', file.name);
 | 
	
		
			
				|  |  | -  //       // 在这里可以添加上传文件的逻辑
 | 
	
		
			
				|  |  | -  //       this.fileToUpload = file;
 | 
	
		
			
				|  |  | -  //       // 在这里添加上传文件的逻辑
 | 
	
		
			
				|  |  | -  //       this.uploadFile().then(() => this.navCtrl.navigateForward('/tabs/tab2'));
 | 
	
		
			
				|  |  | -  //     } else {
 | 
	
		
			
				|  |  | -  //       this.presentToast('仅支持 .doc, .docx, .jpg, .jpeg, .png, .gif 文件类型');
 | 
	
		
			
				|  |  | -  //     }
 | 
	
		
			
				|  |  | -  //   } else {
 | 
	
		
			
				|  |  | -  //     console.log('No file selected');
 | 
	
		
			
				|  |  | -  //   }
 | 
	
		
			
				|  |  | -  // }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -  // private async uploadFile(): Promise<void> {
 | 
	
		
			
				|  |  | -  //   if (this.fileToUpload) {
 | 
	
		
			
				|  |  | -  //     // 这里是模拟文件上传的过程,您可以替换为实际的上传逻辑。
 | 
	
		
			
				|  |  | -  //     // 比如调用API进行文件上传,并处理响应。
 | 
	
		
			
				|  |  | -  //     // 简单示例:
 | 
	
		
			
				|  |  | -  //     // await this.http.post('your-upload-endpoint', this.fileToUpload).toPromise();
 | 
	
		
			
				|  |  | -  //     return new Promise((resolve) => setTimeout(resolve, 1000)); // 模拟异步操作
 | 
	
		
			
				|  |  | -  //   }
 | 
	
		
			
				|  |  | -  // }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    openLoginModal() {
 | 
	
		
			
				|  |  |      this.isLoginModalOpen = true;
 | 
	
		
			
				|  |  |      console.log('打开登录/注册模态框');
 | 
	
	
		
			
				|  | @@ -320,6 +290,7 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |          async (response) => {
 | 
	
		
			
				|  |  |            console.log('登录成功:', response);
 | 
	
		
			
				|  |  |            await this.presentToast('登录成功', 'success');
 | 
	
		
			
				|  |  | +          this.isLoggedIn = true;
 | 
	
		
			
				|  |  |            this.closeLoginModal();
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          async (error) => {
 | 
	
	
		
			
				|  | @@ -354,6 +325,7 @@ export class Tab1Page implements AfterViewInit {
 | 
	
		
			
				|  |  |          async (response) => {
 | 
	
		
			
				|  |  |            console.log('注册成功:', response);
 | 
	
		
			
				|  |  |            await this.presentToast('注册成功', 'success');
 | 
	
		
			
				|  |  | +          this.isLoggedIn = true;
 | 
	
		
			
				|  |  |            this.closeLoginModal();
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          async (error) => {
 |