Forráskód Böngészése

Merge branch 'master' of http://git.fmode.cn:3000/0225273/APPmy

0225236 4 hónapja
szülő
commit
d3786c4ab9

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 847 - 8
package-lock.json


+ 1 - 0
package.json

@@ -28,6 +28,7 @@
     "@capacitor/status-bar": "6.0.0",
     "@ionic/angular": "^8.0.0",
     "ionicons": "^7.0.0",
+    "node-nlp": "^4.27.0",
     "parse": "^5.3.0",
     "rxjs": "~7.8.0",
     "swiper": "^11.1.4",

+ 17 - 0
src/app/aichat/aichat-routing.module.ts

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

+ 20 - 0
src/app/aichat/aichat.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 { AIChatPageRoutingModule } from './aichat-routing.module';
+
+import { AIChatPage } from './aichat.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    AIChatPageRoutingModule
+  ],
+  declarations: [AIChatPage]
+})
+export class AIChatPageModule {}

+ 26 - 0
src/app/aichat/aichat.page.html

@@ -0,0 +1,26 @@
+<ion-header [translucent]="true">
+  <ion-toolbar>
+    <ion-back-button slot="start" defaultHref="/tabs/tab3"></ion-back-button>
+    <ion-title>AIChat</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list lines="none">
+    <ion-item *ngFor="let message of chatMessages">
+      <ion-avatar slot="start">
+        <ion-img [src]="message.senderAvatar"></ion-img>
+      </ion-avatar>
+      <ion-label>
+        <h3>{{ message.sender }}</h3>
+        <p>{{ message.content }}</p>
+        <p class="message-time">{{ message.timestamp | date: 'medium' }}</p>
+      </ion-label>
+    </ion-item>
+  </ion-list>
+
+  <ion-item>
+    <ion-input placeholder="请输入消息" [(ngModel)]="newMessage"></ion-input>
+    <ion-button slot="end" (click)="sendMessage()">发送</ion-button>
+  </ion-item>
+</ion-content>

+ 14 - 0
src/app/aichat/aichat.page.scss

@@ -0,0 +1,14 @@
+page-aichat {
+    ion-content {
+      ion-item {
+        ion-avatar {
+          width: 40px;
+          height: 40px;
+        }
+        .message-time {
+          font-size: 12px;
+          color: #999;
+        }
+      }
+    }
+  }

+ 17 - 0
src/app/aichat/aichat.page.spec.ts

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

+ 26 - 0
src/app/aichat/aichat.page.ts

@@ -0,0 +1,26 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-aichat',
+  templateUrl: './aichat.page.html',
+  styleUrls: ['./aichat.page.scss'],
+})
+export class AIChatPage implements OnInit {
+
+  constructor() { }
+  chatMessages: any[] = [
+    { sender: 'AI Bot', senderAvatar: 'assets/img/d.webp', content: '欢迎来到AI对话', timestamp: new Date() }
+  ];
+  newMessage: string = '';
+
+  sendMessage() {
+    if (this.newMessage.trim() !== '') {
+      this.chatMessages.push({ sender: 'User', senderAvatar: 'assets/user-avatar.png', content: this.newMessage, timestamp: new Date() });
+      this.newMessage = ''; // 清空输入框
+    }
+  }
+
+  ngOnInit() {
+  }
+
+}

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

@@ -60,6 +60,10 @@ const routes: Routes = [
     },
  {
     path: 'creator',
     loadChildren: () => import('./creator/creator.module').then( m => m.CreatorPageModule)
+  },
+  {
+    path: 'aichat',
+    loadChildren: () => import('./aichat/aichat.module').then( m => m.AIChatPageModule)
   }
 
 

+ 74 - 2
src/app/creator/creator.page.html

@@ -1,13 +1,85 @@
 <ion-header [translucent]="true">
   <ion-toolbar>
-    <ion-title>creator</ion-title>
+    <ion-buttons slot="start">
+      <ion-back-button defaultHref="/tabs/tab4"></ion-back-button>
+    </ion-buttons>
+    <ion-title>创作者中心</ion-title>
   </ion-toolbar>
 </ion-header>
 
-<ion-content [fullscreen]="true">
+<!-- <ion-content [fullscreen]="true">
   <ion-header collapse="condense">
     <ion-toolbar>
       <ion-title size="large">creator</ion-title>
     </ion-toolbar>
   </ion-header>
+</ion-content> -->
+
+
+<ion-content>
+  <div class="creator-info">
+    <div class="profile">
+      <ion-avatar>
+        <img src="avatar.jpg"> <!-- 头像图片 -->
+      </ion-avatar>
+      <ion-label class="nickname">0105</ion-label> <!-- 昵称 -->
+    </div>
+    <div class="stats">
+      <ion-label class="label-icon"><ion-icon name="thumbs-up-outline"></ion-icon> 点赞数:300</ion-label>
+      <ion-label class="label-icon"><ion-icon name="eye-outline"></ion-icon> 浏览量:6000</ion-label>
+      <ion-label class="label-icon"><ion-icon name="star-outline"></ion-icon> 最佳作品点赞数:150</ion-label>
+      <ion-label class="label-icon"><ion-icon name="cash-outline"></ion-icon> 收入:2000元</ion-label>
+    </div>
+</div>
+
+  <div class="best-works">
+    <ion-card>
+      <ion-card-header>
+        <ion-card-title>最佳作品</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <!-- 最佳作品列表 -->
+      </ion-card-content>
+    </ion-card>
+  </div>
+
+  <div class="exclusive-services">
+    <ion-card>
+      <ion-card-header>
+        <ion-card-title>专属服务</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <ion-label>专属服务内容:</ion-label>
+        <ion-label>1. 学创作</ion-label>
+        <ion-label>2. 任务中心</ion-label>
+      </ion-card-content>
+    </ion-card>
+  </div>
+
+  <div class="tools-resources">
+    <ion-card>
+      <ion-card-header>
+        <ion-card-title>创作工具和资源</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <!-- 创作工具和资源列表 -->
+      </ion-card-content>
+    </ion-card>
+  </div>
+
+  <div class="community-interaction">
+    <ion-card>
+      <ion-card-header>
+        <ion-card-title>创作者社区和互动</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <ion-button expand="block" fill="clear" (click)="goToCommunity()">
+          <ion-icon name="people-outline"></ion-icon>
+          创作者社区
+        </ion-button>
+      </ion-card-content>
+    </ion-card>
+  </div>
 </ion-content>
+
+

+ 23 - 0
src/app/creator/creator.page.scss

@@ -0,0 +1,23 @@
+.creator-info {
+  //background-image: url('../assets/img/paint.png'); /* 背景图片路径 */
+  background-size: cover;
+  background-position: center;
+  padding: 20px;
+  border-radius: 10px;
+}
+
+.profile {
+  /* 个人信息样式 */
+}
+
+.stats {
+  /* 统计信息样式 */
+}
+
+.nickname {
+  color: black; /* 昵称文字颜色 */
+}
+
+.label-icon {
+  color: black; /* 图标和文字颜色 */
+}

+ 3 - 0
src/app/creator/creator.page.ts

@@ -7,6 +7,9 @@ import { Component, OnInit } from '@angular/core';
 })
 export class CreatorPage implements OnInit {
 
+  goToCommunity(){
+    
+  }
   constructor() { }
 
   ngOnInit() {

+ 8 - 4
src/app/tab3/tab3.page.html

@@ -1,5 +1,5 @@
 <ion-header [translucent]="true">
-  <ion-toolbar>
+  <ion-toolbar color="primary">
     <ion-title>
       消息
     </ion-title>
@@ -11,7 +11,7 @@
 </ion-header>
 
 <ion-content>
-<div style="background-image: url(assets/img/c.jpg);">
+<div style="background-color: rgb(0, 132, 255);">
   <ion-searchbar placeholder="输入关键字搜索"></ion-searchbar>
   <ion-card class="card">
     <ion-card-header >
@@ -67,8 +67,7 @@
     </ion-item>
     <ion-item>
       <ion-input placeholder="添加评论" ></ion-input>
-      <ion-button slot="start" (click)="sendComment()"></ion-button>
-      <ion-button slot="end" (click)="sendComment()">
+          <ion-button slot="end" (click)="sendComment()">
         <ion-icon name="send"></ion-icon>
       </ion-button>
     </ion-item>
@@ -159,4 +158,9 @@
    </div>
   </div>
 </div>
+<ion-item>一键AI
+  <ion-button slot="end" (click)="goToAIChatPage()">
+    <ion-icon name="logo-android"></ion-icon>
+  </ion-button>
+</ion-item>
 </ion-content>

+ 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%, #0c8dd8 46%, #baff70 100%);
+  background-image: linear-gradient(43deg, #41d0d0 0%, #0c94d8 46%, #baff70 100%);
   border-radius: 8px;
   color: white;
   overflow: hidden;

+ 3 - 0
src/app/tab3/tab3.page.ts

@@ -73,4 +73,7 @@ export class Tab3Page {
   isUserFollowed(userId: number): boolean {
     return this.followedUsers.includes(userId);
   }
+  goToAIChatPage() {
+    this.router.navigate(['/aichat']); // 导航到AI对话页面
+  }
 }

+ 1 - 0
src/app/tab4/tab4.page.html

@@ -53,6 +53,7 @@
 </ion-grid>
     
     <ion-card-content>
+      
     <ion-segment-button value="creators" (click)="openLogin2Page()">
       <ion-icon name="color-palette-outline"></ion-icon>
       创作者中心

+ 0 - 11
src/app/tab4/tab4.page.scss

@@ -26,17 +26,6 @@ ion-segment-button {
   padding: 10px 0px; /* 设置按钮内边距,增加按钮的大小 */
 }
 
-ion-segment {
-  scrollbar-width: none; /* 隐藏滚动条(适用于部分浏览器) */
-  -ms-overflow-style: none; /* 隐藏滚动条(适用于 IE 和 Edge) */
-  &::-webkit-scrollbar {
-    display: none; /* 隐藏滚动条(适用于 Chrome 和 Safari) */
-  }
-  &::-ms-overflow-style {
-    display: none; /* 隐藏滚动条(适用于 IE 和 Edge) */
-  }
-}
-
 
 p {
   font-size: 20px; /* 设置文字大小为20px */

BIN
src/assets/img/c.jpg


BIN
src/assets/img/d.webp


BIN
src/assets/img/paint.png


+ 11 - 6
src/modules/user/login/login.page.html

@@ -4,13 +4,13 @@
   </ion-toolbar>
 </ion-header>
 
-<ion-content [fullscreen]="true">
+<ion-content [fullscreen]="true" class="centered-card">
 
+  <div class="container">
   <ion-card>
     <ion-card-header>
       <ion-card-title>登录/注册</ion-card-title>
     </ion-card-header>
-  
     <ion-card-content>
 
       <ion-list [inset]="true">
@@ -21,13 +21,18 @@
           <ion-input [(ngModel)]="password" label="密码" type="password" placeholder="请输入密码"></ion-input>
         </ion-item>
       </ion-list>
-     
+
     </ion-card-content>
   
     <ion-button (click)="login()" fill="clear">登录</ion-button>
     <ion-button (click)="register()" fill="clear">注册</ion-button>
-  </ion-card>
 
-  <!-- 新增路由返回逻辑,执行back函数 -->
+    <!-- 新增路由返回逻辑,执行back函数 -->
   <ion-button expand="block" (click)="back()">返回</ion-button>
-</ion-content>
+
+    
+  </ion-card>
+    </div>
+  </ion-content>
+
+  

+ 14 - 0
src/modules/user/login/login.page.scss

@@ -0,0 +1,14 @@
+ion-card-title{
+    text-align: center;
+}
+
+.container {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+
+  height: 60vh;
+}
+.centered-card{
+    height:400px;
+}

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott