|
|
@@ -1,13 +1,59 @@
|
|
|
-import { Component } from '@angular/core';
|
|
|
-import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone';
|
|
|
+import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
|
+import {
|
|
|
+ IonHeader, IonToolbar, IonTitle, IonContent,
|
|
|
+ IonButton, IonButtons, IonIcon, IonCard, IonCardHeader, IonCardTitle, IonCardContent,
|
|
|
+ IonItem, IonLabel, IonList, IonInput, IonTextarea, IonAvatar } from '@ionic/angular/standalone';
|
|
|
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
|
+import { CommonModule } from '@angular/common';
|
|
|
+
|
|
|
@Component({
|
|
|
selector: 'app-tab1',
|
|
|
templateUrl: 'tab1.page.html',
|
|
|
styleUrls: ['tab1.page.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent],
|
|
|
+ imports: [
|
|
|
+ CommonModule,
|
|
|
+ IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
|
|
|
+
|
|
|
+ IonButton, IonButtons, IonIcon,
|
|
|
+
|
|
|
+ IonCard, IonCardHeader, IonCardTitle, IonCardContent,
|
|
|
+ IonList, IonItem, IonLabel, IonAvatar, IonInput, IonTextarea,
|
|
|
+ ],
|
|
|
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
|
})
|
|
|
export class Tab1Page {
|
|
|
- constructor() {}
|
|
|
+ topics = [
|
|
|
+ { title: '年度最佳剧集', participants: 120, popularity: '⭐⭐⭐⭐⭐' },
|
|
|
+ { title: '经典电影回顾', participants: 80, popularity: '⭐⭐⭐⭐' },
|
|
|
+ { title: '新剧推荐', participants: 200, popularity: '⭐⭐⭐⭐⭐⭐' },
|
|
|
+ ];
|
|
|
+
|
|
|
+ posts = [
|
|
|
+ { title: '对《某某剧名》的看法', author: '用户A', comments: 5, popularity: '⭐⭐⭐⭐⭐' },
|
|
|
+ { title: '最新剧集讨论', author: '用户B', comments: 2, popularity: '⭐⭐⭐⭐' },
|
|
|
+ ];
|
|
|
+
|
|
|
+ newPost = {
|
|
|
+ title: '',
|
|
|
+ content: ''
|
|
|
+ };
|
|
|
+
|
|
|
+ comments = [
|
|
|
+ { username: '用户C', content: '我觉得这部剧非常精彩!', userAvatar: 'assets/avatar1.png' },
|
|
|
+ { username: '用户D', content: '剧情发展很吸引人!', userAvatar: 'assets/avatar2.png' },
|
|
|
+ ];
|
|
|
+
|
|
|
+ submitPost() {
|
|
|
+ if (this.newPost.title && this.newPost.content) {
|
|
|
+ this.posts.push({
|
|
|
+ title: this.newPost.title,
|
|
|
+ author: '当前用户', // 这里可以替换为实际用户
|
|
|
+ comments: 0,
|
|
|
+ popularity: '⭐⭐' // 默认热度
|
|
|
+ });
|
|
|
+ this.newPost.title = '';
|
|
|
+ this.newPost.content = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|