|
@@ -1,4 +1,5 @@
|
|
|
import { Component,OnInit } from '@angular/core';
|
|
|
+import { NavController } from '@ionic/angular';
|
|
|
"assets"; [
|
|
|
"src/favicon.ico",
|
|
|
"src/assets"
|
|
@@ -30,8 +31,6 @@ export class Tab2Page implements OnInit {
|
|
|
selectedDynasty: string | undefined;
|
|
|
selectedAuthor: string | undefined;
|
|
|
|
|
|
- constructor() { }
|
|
|
-
|
|
|
ngOnInit() { }
|
|
|
|
|
|
segmentChanged(event: any) {
|
|
@@ -63,24 +62,30 @@ export class Tab2Page implements OnInit {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- results:Parse.Object[] = []
|
|
|
- segment = 'tang';
|
|
|
- search(event: any) {
|
|
|
- console.log('Searching for:', event.detail.value);
|
|
|
- if(event?.detail?.value){
|
|
|
+ //搜索下拉框内容
|
|
|
+ results: Parse.Object[] = []
|
|
|
+ segment = 'tang';
|
|
|
+ search(event: any) {
|
|
|
+ console.log('Searching for:', event.detail.value);
|
|
|
+ if (event?.detail?.value) {
|
|
|
this.loadShigeList(event?.detail?.value)
|
|
|
}
|
|
|
- }
|
|
|
- async loadShigeList(search:string){
|
|
|
+ }
|
|
|
+ filteredAuthors: any[] = [];
|
|
|
+
|
|
|
+ async loadShigeList(search: string) {
|
|
|
let query = new Parse.Query("Shige");
|
|
|
query.select("title");
|
|
|
- query.contains("title",search);
|
|
|
+ query.contains("title", search);
|
|
|
query.limit(5);
|
|
|
this.results = await query.find();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ constructor(private navController: NavController) { }
|
|
|
+ goToDetailPage(item: Parse.Object) {
|
|
|
+ this.results = []
|
|
|
+ this.navController.navigateForward('/detail/' + item.id);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|