|
@@ -2,9 +2,13 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
|
import {
|
|
import {
|
|
|
IonHeader, IonToolbar, IonTitle, IonContent,
|
|
IonHeader, IonToolbar, IonTitle, IonContent,
|
|
|
IonButton, IonButtons, IonIcon, IonCard, IonCardHeader, IonCardTitle, IonCardContent,
|
|
IonButton, IonButtons, IonIcon, IonCard, IonCardHeader, IonCardTitle, IonCardContent,
|
|
|
- IonItem, IonLabel, IonList, IonInput, IonTextarea, IonAvatar, IonSearchbar} from '@ionic/angular/standalone';
|
|
|
|
|
|
|
+ IonItem, IonLabel, IonList, IonInput, IonTextarea, IonAvatar, IonSearchbar,
|
|
|
|
|
+ ModalController} from '@ionic/angular/standalone';
|
|
|
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
|
import { CommonModule } from '@angular/common';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
|
+import { openPostPublisherModal } from 'src/lib/public/post-publisher/post-publisher.component';
|
|
|
|
|
+import { CloudUser } from 'src/lib/ncloud';
|
|
|
|
|
+import { openUserLoginModal } from 'src/lib/user/modal-user-login/modal-user-login.component';
|
|
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
|
selector: 'app-tab1',
|
|
selector: 'app-tab1',
|
|
@@ -23,7 +27,25 @@ import { CommonModule } from '@angular/common';
|
|
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
|
})
|
|
})
|
|
|
export class Tab1Page {
|
|
export class Tab1Page {
|
|
|
|
|
+ currentUser:CloudUser|undefined
|
|
|
|
|
+ constructor(private modalCtrl:ModalController){
|
|
|
|
|
+ this.currentUser=new CloudUser();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+async openPublishModal(){
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(!this.currentUser?.id){
|
|
|
|
|
+ openUserLoginModal(this.modalCtrl);
|
|
|
|
|
+ }
|
|
|
|
|
+if(this.currentUser){
|
|
|
|
|
+ openPostPublisherModal(this.modalCtrl);
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onSearch(event: any) {
|
|
onSearch(event: any) {
|
|
|
const searchTerm = event.target.value; // 获取用户输入的搜索内容
|
|
const searchTerm = event.target.value; // 获取用户输入的搜索内容
|
|
|
console.log('搜索内容:', searchTerm);
|
|
console.log('搜索内容:', searchTerm);
|