2 Komitmen 5e5fa4b1cc ... be921377fc

Pembuat SHA1 Pesan Tanggal
  0225268 be921377fc tab3 4 bulan lalu
  0225268 a6b75511ef tab4 4 bulan lalu

+ 64 - 4
src/app/app-routing.module.ts

@@ -1,8 +1,67 @@
-import { NgModule } from '@angular/core';
-import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
-// 引用路由守卫
-import { authGuard } from 'src/modules/user/auth.guard';
+import { NgModule } from '@angular/core';
+import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
+// 引用路由守卫
+import { authGuard } from 'src/modules/user/auth.guard';
+
+const routes: Routes = [
+  {
+    path: '',
+    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
+  },
+  {
+    path: 'tab4',
+    loadChildren: () => import('./tab4/tab4.module').then( m => m.Tab4PageModule)
+  },
+  {
+    path: 'feedback',
+    loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule)
+  },
+  {
+    path: 'settings',
+    loadChildren: () => import('./settings/settings.module').then( m => m.SettingsPageModule)
+  },
+  // {
+  //   path: 'login',
+  //   loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
+  // },
+  {
+    path: 'edit-profile',
+    loadChildren: () => import('./edit-profile/edit-profile.module').then( m => m.EditProfilePageModule)
+  },
+  {
+    path: 'notification-settings',
+    loadChildren: () => import('./notification-settings/notification-settings.module').then( m => m.NotificationSettingsPageModule)
+  },
+  {
+    path: 'privacy',
+    loadChildren: () => import('./privacy/privacy.module').then( m => m.PrivacyPageModule)
+  },
+    // 添加:
+    {
+      path: 'user',
+      loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
+    },
  {
+    path: 'theme-settings',
+    loadChildren: () => import('./theme-settings/theme-settings.module').then( m => m.ThemeSettingsPageModule)
+  },
+  {
+    path: 'language-settings',
+    loadChildren: () => import('./language-settings/language-settings.module').then( m => m.LanguageSettingsPageModule)
+  }
 
+<<<<<<< HEAD
+
+  
+
+];
+@NgModule({
+  imports: [
+    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
+  ],
+  exports: [RouterModule]
+})
+export class AppRoutingModule {}
+=======
 const routes: Routes = [
   {
     path: '',
@@ -59,3 +118,4 @@ const routes: Routes = [
   exports: [RouterModule]
 })
 export class AppRoutingModule {}
+>>>>>>> 5e5fa4b1cc44df8d6d24f2f95a16130573bb10b3

+ 17 - 0
src/app/language-settings/language-settings-routing.module.ts

@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { LanguageSettingsPage } from './language-settings.page';
+
+const routes: Routes = [
+  {
+    path: '',
+    component: LanguageSettingsPage
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class LanguageSettingsPageRoutingModule {}

+ 20 - 0
src/app/language-settings/language-settings.module.ts

@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { LanguageSettingsPageRoutingModule } from './language-settings-routing.module';
+
+import { LanguageSettingsPage } from './language-settings.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    LanguageSettingsPageRoutingModule
+  ],
+  declarations: [LanguageSettingsPage]
+})
+export class LanguageSettingsPageModule {}

+ 26 - 0
src/app/language-settings/language-settings.page.html

@@ -0,0 +1,26 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-back-button slot="start" defaultHref="/settings"></ion-back-button>
+    <ion-title>
+      语言设置
+    </ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>选择语言</ion-label>
+      <ion-select [(ngModel)]="selectedLanguage" (ionChange)="changeLanguage()">
+        <ion-select-option value="English">English</ion-select-option>
+        <ion-select-option value="China">中文</ion-select-option>
+        <ion-select-option value="Español">Español</ion-select-option>
+        <ion-select-option value="Français">Français</ion-select-option>
+      </ion-select>
+    </ion-item>
+    <ion-item>
+      <ion-label>当前语言设置</ion-label>
+      <ion-text>{{ selectedLanguage }}</ion-text>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 0 - 0
src/app/language-settings/language-settings.page.scss


+ 17 - 0
src/app/language-settings/language-settings.page.spec.ts

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

+ 23 - 0
src/app/language-settings/language-settings.page.ts

@@ -0,0 +1,23 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-language-settings',
+  templateUrl: './language-settings.page.html',
+  styleUrls: ['./language-settings.page.scss'],
+})
+export class LanguageSettingsPage implements OnInit {
+
+  selectedLanguage: string;
+  constructor() {
+    this.selectedLanguage = localStorage.getItem('selectedLanguage') || 'English'; // 默认为英语
+  }
+
+  changeLanguage() {
+    localStorage.setItem('selectedLanguage', this.selectedLanguage);
+    // 在这里可以设置应用的语言
+  }
+
+  ngOnInit() {
+  }
+
+}

+ 2 - 0
src/app/settings/settings.page.ts

@@ -28,6 +28,7 @@ export class SettingsPage implements OnInit {
 
   selectTheme() {
     // 选择主题设置
+    this.router.navigate(['/theme-settings']);
   }
 
   manageSecurity() {
@@ -36,6 +37,7 @@ export class SettingsPage implements OnInit {
 
   selectLanguage() {
     // 选择语言设置
+    this.router.navigate(['/language-settings']);
   }
 
   getHelp() {

+ 1 - 1
src/app/tab3/tab3.page.html

@@ -14,7 +14,7 @@
   <ion-searchbar placeholder="输入关键字搜索"></ion-searchbar>
   <ion-card class="card">
     <ion-card-header >
-      <ion-card-title>最新推荐</ion-card-title>
+      <ion-card-title style="color: rgb(0, 4, 255);">最新推荐</ion-card-title>
     </ion-card-header>
     <ion-card-content >
       <ion-avatar>

+ 1 - 1
src/app/tab3/tab3.page.scss

@@ -14,7 +14,7 @@ ion-avatar {
   width: 365px;
   height: 250px;
   background-color: #4158D0;
-  background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
+  background-image: linear-gradient(43deg, #4158D0 0%, #0c8dd8 46%, #baff70 100%);
   border-radius: 8px;
   color: white;
   overflow: hidden;

+ 17 - 0
src/app/theme-settings/theme-settings-routing.module.ts

@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { ThemeSettingsPage } from './theme-settings.page';
+
+const routes: Routes = [
+  {
+    path: '',
+    component: ThemeSettingsPage
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class ThemeSettingsPageRoutingModule {}

+ 20 - 0
src/app/theme-settings/theme-settings.module.ts

@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { ThemeSettingsPageRoutingModule } from './theme-settings-routing.module';
+
+import { ThemeSettingsPage } from './theme-settings.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    ThemeSettingsPageRoutingModule
+  ],
+  declarations: [ThemeSettingsPage]
+})
+export class ThemeSettingsPageModule {}

+ 35 - 0
src/app/theme-settings/theme-settings.page.html

@@ -0,0 +1,35 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-back-button slot="start" defaultHref="/settings"></ion-back-button>
+    <ion-title>主题设置</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>主题颜色</ion-label>
+      <ion-select placeholder="选择颜色">
+        <ion-select-option value="primary">主题色</ion-select-option>
+        <ion-select-option value="secondary">次要色</ion-select-option>
+        <ion-select-option value="tertiary">第三色</ion-select-option>
+      </ion-select>
+    </ion-item>
+
+    <ion-item>
+      <ion-label>字体大小</ion-label>
+      <ion-select placeholder="选择字体大小">
+        <ion-select-option value="small">小</ion-select-option>
+        <ion-select-option value="medium">中</ion-select-option>
+        <ion-select-option value="large">大</ion-select-option>
+      </ion-select>
+    </ion-item>
+
+    <ion-item>
+      <ion-label>夜间模式</ion-label>
+      <ion-toggle slot="end"></ion-toggle>
+    </ion-item>
+
+    <ion-button expand="block" (click)="saveSettings()">保存设置</ion-button>
+  </ion-list>
+</ion-content>

+ 5 - 0
src/app/theme-settings/theme-settings.page.scss

@@ -0,0 +1,5 @@
+ion-item {
+    ion-label {
+      font-weight: bold;
+    }
+  }

+ 17 - 0
src/app/theme-settings/theme-settings.page.spec.ts

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

+ 18 - 0
src/app/theme-settings/theme-settings.page.ts

@@ -0,0 +1,18 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-theme-settings',
+  templateUrl: './theme-settings.page.html',
+  styleUrls: ['./theme-settings.page.scss'],
+})
+export class ThemeSettingsPage implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+  saveSettings() {
+    // 在这里处理保存主题设置的逻辑
+  }
+
+}