|
@@ -1,14 +1,14 @@
|
|
|
import { Component, NgModule } from '@angular/core';
|
|
|
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonItem, IonLabel, IonAvatar, IonButton, IonSegment, IonSegmentButton, IonSegmentContent, IonSegmentView, IonCardContent, IonCardTitle, IonCardHeader, IonCard } from '@ionic/angular/standalone';
|
|
|
+import { ModalController, IonModal, IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonItem, IonLabel, IonAvatar, IonButton, IonSegment, IonSegmentButton, IonSegmentContent, IonSegmentView, IonCardContent, IonCardTitle, IonCardHeader, IonCard, IonIcon, IonButtons } from '@ionic/angular/standalone';
|
|
|
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
|
import { addIcons } from 'ionicons';
|
|
|
import { airplane, bluetooth, call, wifi } from 'ionicons/icons';
|
|
|
-import { IonicModule, ModalController } from '@ionic/angular';
|
|
|
import { ArticleCardComponent } from '../component/article-card/article-card.component';
|
|
|
import { CommonModule } from '@angular/common';
|
|
|
import { CloudObject, CloudQuery } from 'src/lib/ncloud';
|
|
|
import { FormsModule } from '@angular/forms';
|
|
|
import { NavigationLanComponent } from '../component/navigation-lan/navigation-lan.component';
|
|
|
+import { Router } from '@angular/router';
|
|
|
addIcons({ airplane, bluetooth, call, wifi });
|
|
|
|
|
|
interface Article {
|
|
@@ -25,22 +25,42 @@ interface Article {
|
|
|
templateUrl: 'tab2.page.html',
|
|
|
styleUrls: ['tab2.page.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
|
|
|
+ imports: [
|
|
|
+ IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
|
|
|
IonLabel,IonItem,IonList,IonAvatar,ArticleCardComponent,CommonModule,IonButton,
|
|
|
IonSegment, IonSegmentButton,NavigationLanComponent,
|
|
|
- IonSegmentContent,IonSegmentView,IonCardContent, IonCardTitle, IonCardHeader,IonCard
|
|
|
+ IonSegmentContent,IonSegmentView,IonCardContent, IonCardTitle, IonCardHeader,IonCard,
|
|
|
+ IonModal,IonIcon, IonButtons
|
|
|
]
|
|
|
})
|
|
|
|
|
|
export class Tab2Page {
|
|
|
|
|
|
+ showDetailModal = false; // 控制模态显示与否
|
|
|
+ currentProduct: any; // 当前选择的科普信息
|
|
|
+
|
|
|
+ openDetailModal(product: any) {
|
|
|
+ this.currentProduct = product;
|
|
|
+ this.showDetailModal = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ closeDetailModal() {
|
|
|
+ this.showDetailModal = false;
|
|
|
+ this.currentProduct = null;
|
|
|
+ }
|
|
|
+
|
|
|
type:"hotdot"|"export"|"sleep"|"lift"|"male"|"female" = "hotdot"
|
|
|
typeChange(ev:any){
|
|
|
this.type = ev?.detail?.value || ev?.value || 'hotdot'
|
|
|
console.log(this.type)
|
|
|
}
|
|
|
// constructor(private modalCtrl:ModalController) { }
|
|
|
- constructor() { }
|
|
|
+
|
|
|
+ constructor(
|
|
|
+ private modalCtrl:ModalController,
|
|
|
+ private router:Router,
|
|
|
+ ) { }
|
|
|
+
|
|
|
cards: Array<CloudObject> = [];
|
|
|
async loadCards() {
|
|
|
let query = new CloudQuery('HotDot');
|