Sfoglia il codice sorgente

fix:添加了路由,加了背景

s202226701043 3 mesi fa
parent
commit
63e7080464

+ 1 - 1
novel-app/src/app/agent-create/agent-create.page.html

@@ -1,7 +1,7 @@
 <ion-header [translucent]="true">
   <ion-toolbar>
     <ion-buttons slot="start">
-      <ion-button (click)="backhome()" color="primary" >{{back}}</ion-button>
+      <ion-back-button defaultHref="tabs/tab1"></ion-back-button>
     </ion-buttons>
     <ion-title>创建智能体</ion-title>
     <!-- <ion-progress-bar type="indeterminate"></ion-progress-bar> -->

+ 9 - 9
novel-app/src/app/agent-create/agent-create.page.ts

@@ -1,9 +1,9 @@
 import { Component, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
-import { CloudObject, CloudQuery, CloudUser } from '../lib/ncloud';
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonIcon, ModalController, IonTextarea, IonInput, IonCard, IonCardHeader, IonCardTitle, IonThumbnail, IonCardContent, IonCardSubtitle, IonItem, IonList, IonLabel, IonAvatar, IonSelect, IonSelectOption, AlertController, IonButtons, IonProgressBar, IonText } from '@ionic/angular/standalone';
+import { CloudObject,CloudUser } from '../lib/ncloud';
+import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton, ModalController, IonTextarea, IonInput, IonCard, IonItem, IonList, IonLabel, AlertController, IonButtons, IonBackButton } from '@ionic/angular/standalone';
 import { CommonModule } from '@angular/common';
-import { AvatarModule, ChatPanelOptions, DalleOptions, FmodeChat, FmodeChatCompletion, FmodeChatMessage, ImagineWork, openChatPanelModal } from 'fmode-ng';
+import {DalleOptions, FmodeChatCompletion } from 'fmode-ng';
 
 @Component({
   selector: 'app-agent-create',
@@ -11,11 +11,11 @@ import { AvatarModule, ChatPanelOptions, DalleOptions, FmodeChat, FmodeChatCompl
   styleUrls: ['./agent-create.page.scss'],
   standalone: true,
   imports: [
-    IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonTextarea,IonInput,
-    IonIcon,IonCard,IonCardHeader,IonCardTitle,
-    IonCardSubtitle,IonCardContent, IonThumbnail, IonItem,IonList,CommonModule,IonLabel,
-    IonAvatar, IonSelect, IonSelectOption,IonButtons,IonProgressBar,
-    IonText, IonCardHeader, IonCardSubtitle,]
+    IonHeader, IonToolbar, IonTitle, IonContent, IonButton, IonTextarea, IonInput,
+    IonCard, IonBackButton,
+    IonItem, IonList, CommonModule, IonLabel,
+    IonButtons
+]
 })
 export class AgentCreatePage implements OnInit {
 
@@ -31,7 +31,7 @@ export class AgentCreatePage implements OnInit {
  images:Array<string> = []
   back:string = "<";
   backhome() {
-    this.router.navigate(['/tab1']);
+    this.router.navigate(['tabs/tab1']);
   }
   ngOnInit() {
 

+ 85 - 92
novel-app/src/app/app.routes.ts

@@ -1,77 +1,70 @@
-import { HttpClientModule } from '@angular/common/http';
-import { NgModule } from '@angular/core';
-import { PreloadAllModules, RouteReuseStrategy, RouterModule, Routes } from '@angular/router';
-import { IonicRouteStrategy } from '@ionic/angular';
-
-export const routes: Routes = [
-  {
-    path: '',
-    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
-  },
-  {
-    path: 'story-generator',
-    loadComponent: () => import('./story-generator/story-generator.page').then(m => m.StoryGeneratorPage)
-  },
-  {
-    path: 'toolbox',
-    loadComponent: () => import('./toolbox/toolbox.page').then(m => m.ToolboxPage)
-  },
-  {
-    path: '',
-    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
-  },
-  {
-    path: 'register',
-    loadComponent: () => import('./register/register.page').then(m => m.RegisterPage)
-  },
-  {
-    path: 'login',
-    loadComponent: () => import('./login/login.page').then(m => m.LoginPage)
-  },
-  {
-    path: 'short-generator',
-    loadComponent: () => import('./short-generator/short-generator.page').then(m => m.ShortGeneratorPage)
-  },
-  {
-    path: 'character',
-    loadComponent: () => import('./character/character.page').then(m => m.CharacterPage)
-  },
-  {
-    path: 'character-creator',
-    loadComponent: () => import('./character-creator/character-creator.page').then(m => m.CharacterCreatorPage)
-  },
-  {
-    path: 'chapter-generator',
-    loadComponent: () => import('./chapter-generator/chapter-generator.page').then(m => m.ChapterGeneratorPage)
-  },
-  {
-    path: 'character-detail/:id',
-    loadComponent: () => import('./character-detail/character-detail.component').then(m => m.CharacterDetailComponent)
-  },
-  {
-    path: 'tab1',
-    loadComponent: () => import('./tab1/tab1.page').then(m => m.Tab1Page)
-  },
-  {
-    path: 'world-setup',
-    loadComponent: () => import('./world-setup/world-setup.page').then(m => m.WorldSetupPage)
-  },
-  {
-    path: 'character-generator',
-    loadComponent: () => import('./character-generator/character-generator.page').then(m => m.CharacterGeneratorPage)
-  },
-  {
-    path: 'name-generator',
-    loadComponent: () => import('./name-generator/name-generator.page').then(m => m.NameGeneratorPage)
-  },
-  {
-    path: 'agent-create',
-    loadComponent: () => import('./agent-create/agent-create.page').then( m => m.AgentCreatePage)
-  },
-  {
-    path: 'atest',
-    loadComponent: () => import('./atest/atest.page').then( m => m.AtestPage)
-  },
  {
+import { HttpClientModule } from '@angular/common/http';
+import { NgModule } from '@angular/core';
+import { PreloadAllModules, RouteReuseStrategy, RouterModule, Routes } from '@angular/router';
+import { IonicRouteStrategy } from '@ionic/angular';
+
+export const routes: Routes = [
+  {
+    path: '',
+    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
+  },
+  {
+    path: 'story-generator',
+    loadComponent: () => import('./story-generator/story-generator.page').then(m => m.StoryGeneratorPage)
+  },
+  {
+    path: 'toolbox',
+    loadComponent: () => import('./toolbox/toolbox.page').then(m => m.ToolboxPage)
+  },
+  {
+    path: '',
+    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
+  },
+  {
+    path: 'register',
+    loadComponent: () => import('./register/register.page').then(m => m.RegisterPage)
+  },
+  {
+    path: 'login',
+    loadComponent: () => import('./login/login.page').then(m => m.LoginPage)
+  },
+  {
+    path: 'short-generator',
+    loadComponent: () => import('./short-generator/short-generator.page').then(m => m.ShortGeneratorPage)
+  },
+  {
+    path: 'character-creator',
+    loadComponent: () => import('./character-creator/character-creator.page').then(m => m.CharacterCreatorPage)
+  },
+  {
+    path: 'chapter-generator',
+    loadComponent: () => import('./chapter-generator/chapter-generator.page').then(m => m.ChapterGeneratorPage)
+  },
+  {
+    path: 'tab1',
+    loadComponent: () => import('./tab1/tab1.page').then(m => m.Tab1Page)
+  },
+  {
+    path: 'world-setup',
+    loadComponent: () => import('./world-setup/world-setup.page').then(m => m.WorldSetupPage)
+  },
+  {
+    path: 'character-generator',
+    loadComponent: () => import('./character-generator/character-generator.page').then(m => m.CharacterGeneratorPage)
+  },
+  {
+    path: 'name-generator',
+    loadComponent: () => import('./name-generator/name-generator.page').then(m => m.NameGeneratorPage)
+  },
+  {
+    path: 'agent-create',
+    loadComponent: () => import('./agent-create/agent-create.page').then( m => m.AgentCreatePage)
+  },
+  {
+    path: 'atest',
+    loadComponent: () => import('./atest/atest.page').then( m => m.AtestPage)
+  },
+  {
     path: 'tab4',
     loadComponent: () => import('./tab4/tab4.page').then( m => m.Tab4Page)
   },
@@ -84,22 +77,22 @@ export const routes: Routes = [
     loadComponent: () => import('./tab7/tab7.page').then( m => m.Tab7Page)
   }
 
-
-
-
-
-
-];
-
-
-
-
-
-@NgModule({
-  imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }), HttpClientModule],
-  exports: [RouterModule],
-  providers: [
-    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
-  ],
-})
+
+
+
+
+
+];
+
+
+
+
+
+@NgModule({
+  imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }), HttpClientModule],
+  exports: [RouterModule],
+  providers: [
+    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
+  ],
+})
 export class AppRoutingModule { }

+ 0 - 39
novel-app/src/app/character-detail/character-detail.component.html

@@ -1,39 +0,0 @@
-<ion-header>
-  <ion-toolbar>
-    <ion-buttons slot="start">
-      <ion-back-button defaultHref="/character"></ion-back-button>
-    </ion-buttons>
-    <ion-title *ngIf="character; else loading">{{ character.name }} 的详情</ion-title>
-    <ng-template #loading>
-      <ion-title>加载中...</ion-title>
-    </ng-template>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content>
-  <div *ngIf="character; else notFound">
-    <h2>角色信息</h2>
-    <ion-card>
-      <img [src]="character.avatar" [alt]="character.name" />
-      <ion-card-header>
-        <ion-card-title>{{ character.name }}</ion-card-title>
-        <ion-card-subtitle>性别: {{ character.gender }}</ion-card-subtitle>
-      </ion-card-header>
-      <ion-card-content>
-        <p><strong>外貌描述:</strong> {{ character.appearance }}</p>
-        <p><strong>性格描述:</strong> {{ character.personality }}</p>
-      </ion-card-content>
-    </ion-card>
-
-    <ion-button expand="full" (click)="startChat()" style="margin-top: 20px; --background: #ff69b4; --color: white;">
-      开始聊天
-    </ion-button>
-    <ion-button expand="full" (click)="restoreChat('chatId')" >
-      继续聊天
-    </ion-button>
-  </div>
-  <ng-template #notFound>
-    <h2>角色未找到</h2>
-    <p>您所请求的角色信息不存在。</p>
-  </ng-template>
-</ion-content>

+ 0 - 0
novel-app/src/app/character-detail/character-detail.component.scss


+ 0 - 22
novel-app/src/app/character-detail/character-detail.component.spec.ts

@@ -1,22 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-
-import { CharacterDetailComponent } from './character-detail.component';
-
-describe('CharacterDetailComponent', () => {
-  let component: CharacterDetailComponent;
-  let fixture: ComponentFixture<CharacterDetailComponent>;
-
-  beforeEach(waitForAsync(() => {
-    TestBed.configureTestingModule({
-      imports: [CharacterDetailComponent],
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(CharacterDetailComponent);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  }));
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 80
novel-app/src/app/character-detail/character-detail.component.ts

@@ -1,80 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { ActivatedRoute, Router } from '@angular/router';
-import { CharacterService } from '../services/character.service';
-import { Character } from '../services/character.service';
-import { IonBackButton, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, 
-  IonCardTitle, IonContent, IonHeader, IonTitle, IonToolbar, ModalController } from '@ionic/angular/standalone';
-import { CommonModule } from '@angular/common';
-import { ChatPanelOptions, FmodeChat, openChatPanelModal } from 'fmode-ng';
-
-@Component({
-  selector: 'app-character-detail',
-  templateUrl: './character-detail.component.html',
-  styleUrls: ['./character-detail.component.scss'],
-  standalone: true,
-  imports: [IonHeader, IonToolbar, IonTitle, IonContent, IonCard, IonBackButton, IonButtons,
-    IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent, CommonModule, IonButton]
-})
-export class CharacterDetailComponent implements OnInit {
-  character!: Character;
-  characterNotFound: boolean = false;
-  
-
-  constructor(private route: ActivatedRoute, private characterService: CharacterService, private router: Router, private modalCtrl: ModalController) {}
-
-  ngOnInit() {
-    const characterId = this.route.snapshot.paramMap.get('id');
-    if (characterId) {
-      this.characterService.getCharacterById(characterId).subscribe(character => {
-        if (character) {
-          this.character = character;
-          this.characterNotFound = false;
-        } else {
-          this.characterNotFound = true;
-          console.error('角色未找到');
-        }
-      });
-    }
-  }
-
-  startChat() {
-    const chatOptions: ChatPanelOptions = {
-      roleId: "2DXJkRsjXK",
-      onChatInit: (chat: FmodeChat) => {
-        // 设置智能体的名字为角色名称
-        chat.role.set("name", this.character.name);
-        let newAvatar = "https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/aigc/imagine/U6UU36FsN8-0.png?x-image-process=image/resize,m_fixed,w_300"
-        chat.role.set("avatar", newAvatar); // 设置角色头像
-        chat.role.set("desc", "新的角色简介");
-        console.log(chat.role?.toJSON()) // 查看角色数据,内部属性均可覆盖
-        
-        // 决赛设定
-        chat.role.set("prompt", `你的名字是${this.character.name},你将作为${this.character.name}和用户聊天,
-          你的性别是${this.character.gender},你有着${this.character.appearance}外貌,你的性格是${this.character.personality},
-          请你在聊天过程中,按照你的人物设定和用户进行对话,并且当你准备好了时,请开始聊天`);
-        
-        // 设置角色的外貌特征和性格特点
-        chat.role.set("appearance", this.character.appearance); 
-        chat.role.set("personality", this.character.personality);
-        
-        // 设置角色头像
-        chat.role.set("avatar", this.character.avatar);
-      },
-      onChatSaved: (chat: FmodeChat) => {
-        console.log("onChatSaved",chat,chat?.chatSession,chat?.chatSession?.id);
-        // 在后端设置一张表,记录当前用户、对话角色,还有chatId为chat?.chatSession?.id
-        // 页面中加载历史对话表,循环时候,调用restoreChat()将存储的chatId传入,即可实现
-      },
-    };
-    openChatPanelModal(this.modalCtrl, chatOptions);
-  }
-
-    restoreChat(chatId:string){
-      let options:ChatPanelOptions = {
-        roleId:"2DXJkRsjXK",
-        chatId:chatId
-      }
-      openChatPanelModal(this.modalCtrl,options)
-    }
-
-}

+ 0 - 48
novel-app/src/app/character/character.page.html

@@ -1,48 +0,0 @@
-<ion-header>
-  <ion-toolbar>
-    <ion-buttons slot="start">
-      <ion-back-button defaultHref="/tabs/character"></ion-back-button>
-    </ion-buttons>
-    <ion-title>角色管理</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content>
-  <!-- 空状态显示 -->
-  <div class="empty-state" *ngIf="characters.length === 0">
-    <ion-icon name="people-outline" class="empty-icon"></ion-icon>
-    <h2>暂无角色</h2>
-    <p>点击下方按钮创建新角色</p>
-    <ion-button 
-      expand="block" 
-      style="--background: #ff69b4"
-      (click)="createNewCharacter()">
-      创建角色
-    </ion-button>
-  </div>
-
-  <!-- 角色列表 -->
-  <ion-grid *ngIf="characters.length > 0">
-    <ion-row>
-      <ion-col size="6" size-md="4" size-lg="3" *ngFor="let character of characters">
-        <ion-card class="character-card" (click)="navigateToDetail(character.id)">
-          <img [src]="character.avatar" [alt]="character.name">
-          <ion-card-header>
-            <ion-card-title>{{ character.name }}</ion-card-title>
-          </ion-card-header>
-        </ion-card>
-      </ion-col>
-    </ion-row>
-  </ion-grid>
-
-  <!-- 底部创建按钮 -->
-  <div class="bottom-button" *ngIf="characters.length > 0">
-    <ion-button 
-      expand="block" 
-      style="--background: #ff69b4" 
-      (click)="createNewCharacter()"
-      class="create-button">
-      创建角色
-    </ion-button>
-  </div>
-</ion-content>

+ 0 - 71
novel-app/src/app/character/character.page.scss

@@ -1,71 +0,0 @@
-.empty-state {
-    display: flex;
-    flex-direction: column;
-    align-items: center;
-    justify-content: center;
-    height: 100%;
-    padding: 2rem;
-    text-align: center;
-  
-    .empty-icon {
-      font-size: 6rem;
-      color: var(--ion-color-medium);
-      margin-bottom: 1rem;
-    }
-  
-    h2 {
-      color: var(--ion-color-dark);
-      margin-bottom: 0.5rem;
-    }
-  
-    p {
-      color: var(--ion-color-medium);
-      margin-bottom: 2rem;
-    }
-  
-    ion-button {
-      max-width: 200px;
-    }
-  }
-  
-  .character-card {
-    margin: 8px;
-    cursor: pointer;
-    transition: transform 0.2s;
-  
-    &:hover {
-      transform: translateY(-4px);
-    }
-  
-    img {
-      width: 100%;
-      height: 200px;
-      object-fit: cover;
-    }
-  
-    ion-card-header {
-      padding: 12px;
-    }
-  
-    ion-card-title {
-      font-size: 1.1rem;
-      text-align: center;
-    }
-  }
-  
-  .bottom-button {
-    position: fixed;
-    bottom: 20px;
-    left: 50%;
-    transform: translateX(-50%);
-    width: 200px;
-    z-index: 999;
-  }
-  
-  .create-button {
-    --background: #ff69b4;  // 粉色
-    --background-hover: #ff1493;  // 深粉色
-    --border-radius: 20px;
-    font-weight: bold;
-    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
-  } 

+ 0 - 17
novel-app/src/app/character/character.page.spec.ts

@@ -1,17 +0,0 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { CharacterPage } from './character.page';
-
-describe('CharacterPage', () => {
-  let component: CharacterPage;
-  let fixture: ComponentFixture<CharacterPage>;
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(CharacterPage);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 41
novel-app/src/app/character/character.page.ts

@@ -1,41 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { IonicModule } from '@ionic/angular';
-import { Router } from '@angular/router';
-import { CharacterService } from '../services/character.service';
-import type { Character } from '../services/character.service';
-
-
-@Component({
-  selector: 'app-character',
-  templateUrl: './character.page.html',
-  styleUrls: ['./character.page.scss'],
-  standalone: true,
-  imports: [CommonModule, IonicModule]
-})
-export class CharacterPage implements OnInit {
-  characters: Character[] = [];
-
-  constructor(
-    private router: Router,
-    private characterService: CharacterService
-  ) { }
-
-  ngOnInit() {
-    this.loadCharacters();
-  }
-
-  loadCharacters() {
-    this.characterService.characters$.subscribe(chars => {
-      this.characters = chars;
-    });
-  }
-
-  createNewCharacter() {
-    this.router.navigate(['/character-creator']);
-  }
-
-  navigateToDetail(characterId: string) {
-    this.router.navigate(['/character-detail', characterId]); // 确保这里的 characterId 是有效的
-  }
-}

+ 0 - 10
novel-app/src/app/person/person.page.html

@@ -1,16 +1,6 @@
 <ion-header>
   <ion-toolbar class="header-toolbar">
-    <ion-buttons slot="start">
-      <ion-button (click)="goBack()">
-        <ion-icon name="arrow-back"></ion-icon>
-      </ion-button>
-    </ion-buttons>
     <ion-title>个人中心</ion-title>
-    <ion-buttons slot="end">
-      <ion-button>
-        <ion-icon name="settings"></ion-icon>
-      </ion-button>
-    </ion-buttons>
   </ion-toolbar>
 </ion-header>
 

+ 0 - 7
novel-app/src/app/person/person.page.scss

@@ -8,13 +8,6 @@ ion-app {
   padding: 0;
 }
 
-/* 保持大部分样式不变,只添加必要的样式 */
-.buttons {
-  display: flex;
-  justify-content: space-between;
-  margin-top: 20px;
-}
-
 .modal-content {
   --background: #fff;
   padding: 20px;

+ 2 - 2
novel-app/src/app/person/person.page.ts

@@ -1,13 +1,13 @@
 import { Component } from '@angular/core';
 import { NavController } from '@ionic/angular';
-import { IonButton, IonButtons, IonHeader, IonToolbar, IonIcon, IonTitle, IonContent, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonItem, IonList } from '@ionic/angular/standalone';
+import { IonButton, IonHeader, IonToolbar, IonIcon, IonTitle, IonContent, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonItem, IonList } from '@ionic/angular/standalone';
 
 @Component({
   selector: 'app-person',
   templateUrl: 'person.page.html',
   styleUrls: ['person.page.scss'],
   standalone: true,
-  imports: [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonTitle,
+  imports: [IonHeader, IonToolbar, IonButton, IonIcon, IonTitle,
     IonContent, IonCard, IonCardHeader, IonCardTitle, IonCardContent, IonItem, IonList
   ]
 })

+ 6 - 1
novel-app/src/app/tab1/tab1.page.html

@@ -1,5 +1,10 @@
+<ion-header>
+  <ion-toolbar class="header-toolbar">
+    <ion-title>智能体</ion-title>
+  </ion-toolbar>
+</ion-header>
 
-<ion-content>
+<ion-content [fullscreen]="true" class="ion-padding" style="background-image: url('../../assets/images/background-image1.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat;">
   <ion-refresher slot="fixed" (ionRefresh)="handleRefresh($event)">
     <ion-refresher-content></ion-refresher-content>
   </ion-refresher>

+ 23 - 0
novel-app/src/app/tab1/tab1.page.scss

@@ -1,3 +1,26 @@
+/* 全局样式 */
+ion-app {
+  background: url('/assets/images/background-image1.jpg') no-repeat center center fixed;
+  /* 添加背景图片 */
+  background-size: cover;
+  /* 背景图片覆盖整个内容区域 */
+  background-position: center;
+  /* 背景图片居中 */
+  height: 100vh;
+  /* 确保背景覆盖整个视口高度 */
+  margin: 0;
+  /* 移除默认的外边距 */
+  padding: 0;
+  /* 移除默认的内边距 */
+}
+
+
+ion-content {
+  --background: transparent;
+  /* 设置为透明,以便背景从 ion-app 继承 */
+  padding: 16px;
+}
+
 .searchbar-container {
   display: flex; /* 使用 Flexbox 布局 */
   align-items: center; /* 垂直居中 */

+ 3 - 4
novel-app/src/app/tab1/tab1.page.ts

@@ -1,8 +1,7 @@
 import { CloudUser } from './../lib/ncloud';
 import { FmodeChat, FmodeChatMessage, openChatPanelModal, ChatPanelOptions } from 'fmode-ng';
 import { Component } from '@angular/core';
-import { IonCardHeader, IonHeader, IonToolbar, IonTitle, IonContent, IonTabButton, IonSearchbar, IonLabel, IonItem, IonList, NavController, IonCard, IonCardTitle, IonCardSubtitle, IonCardContent, IonThumbnail, IonFab, IonFabButton } from '@ionic/angular/standalone';
-import { ExploreContainerComponent } from '../explore-container/explore-container.component';
+import { IonCardHeader, IonHeader, IonToolbar, IonTitle, IonContent,  IonItem, IonList, IonCard, IonCardTitle, IonCardSubtitle, IonCardContent, IonThumbnail, IonFab, IonFabButton, } from '@ionic/angular/standalone';
 import { IonButton } from '@ionic/angular/standalone';
 import { IonIcon } from '@ionic/angular/standalone';
 import { Router } from '@angular/router';
@@ -24,8 +23,8 @@ addIcons({ documentText, chatbubbles, person, calendar, newspaper,
   styleUrls: ['tab1.page.scss'],
   standalone: true,
   imports: [
-    IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent, IonTabButton, IonButton,
-    IonIcon,IonSearchbar,IonLabel,IonItem,IonList,CommonModule,IonCard,IonCardHeader,IonCardTitle,IonCardSubtitle,
+    IonHeader, IonToolbar, IonTitle, IonContent, IonButton,
+    IonIcon,IonItem,IonList,CommonModule,IonCard,IonCardHeader,IonCardTitle,IonCardSubtitle,
     IonCardContent, IonThumbnail, IonFab,IonFabButton,IonIcon,IonRefresher,IonRefresherContent
 
   ],

+ 3 - 0
novel-app/src/app/tab4/tab4.page.html

@@ -1,5 +1,8 @@
 <ion-header [translucent]="true">
   <ion-toolbar class="custom-toolbar">
+    <ion-buttons slot="start">
+      <ion-back-button defaultHref="tabs/person"></ion-back-button>
+    </ion-buttons>
     <ion-title class="custom-title">
       我的
     </ion-title>

+ 2 - 2
novel-app/src/app/tab4/tab4.page.ts

@@ -1,5 +1,5 @@
 import { Component } from '@angular/core';
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonCard, IonCardContent, IonButton, IonCardHeader, IonCardTitle, IonCardSubtitle, ModalController, IonRefresher, IonRefresherContent } from '@ionic/angular/standalone';
+import { IonHeader, IonToolbar, IonTitle, IonContent, IonCard, IonCardContent, IonButton, IonCardHeader, IonCardTitle, IonCardSubtitle, ModalController, IonRefresher, IonRefresherContent, IonBackButton, IonButtons } from '@ionic/angular/standalone';
 import { CloudUser } from '../lib/ncloud';
 import { openUserEditModal } from '../lib/user/modal-user-edit/modal-user-edit.component';
 import { openUserLoginModal } from '../lib/user/modal-user-login/modal-user-login.component';
@@ -13,7 +13,7 @@ import { Router } from '@angular/router';
   standalone: true,
   imports: [IonHeader, IonToolbar, IonTitle, IonContent, 
     IonCard,IonCardContent,IonButton,IonCardHeader,IonCardTitle,IonCardSubtitle,
-    IonRefresher,IonRefresherContent
+    IonRefresher,IonRefresherContent, IonBackButton, IonButtons
   ],
 })
 export class Tab4Page {

+ 1 - 1
novel-app/src/app/tabs/tabs.page.html

@@ -5,7 +5,7 @@
       <ion-label>首页</ion-label>
     </ion-tab-button>
 
-    <ion-tab-button tab="character" (click)="goPage('/tab1')">
+    <ion-tab-button tab="tab1" (click)="goPage('/tabs/tab1')">
       <ion-icon aria-hidden="true" name="chatbox"></ion-icon>
       <ion-label>角色</ion-label>
     </ion-tab-button>

+ 3 - 2
novel-app/src/app/tabs/tabs.routes.ts

@@ -17,8 +17,9 @@ export const routes: Routes = [
           import('../person/person.page').then((m) => m.PersonPage),
       },
       {
-        path: 'character',
-        loadComponent: () => import('../character/character.page').then(m => m.CharacterPage)
+        path: 'tab1',
+        loadComponent: () =>
+          import('../tab1/tab1.page').then((m) => m.Tab1Page),
       },
       {
         path: 'story-generator',

BIN
novel-app/src/assets/images/background-image1.jpg