Эх сурвалжийг харах

refactor(novel-app): 调整智能体创建和卡片加载功能

18460000105 3 сар өмнө
parent
commit
d70a116df8

+ 2 - 1
novel-app/src/app/agent-create/agent-create.page.html

@@ -58,7 +58,8 @@
   </div>
   <comp-uploader-hwobs [url]="uploadUrl" (onUrlChange)="onUrlChange($event)"></comp-uploader-hwobs>
         @if(uploadUrl){
-         <span>已上传:{{uploadUrl}}</span>
+         <!-- <span>已上传:{{uploadUrl}}</span> -->
+         <img [src]="uploadUrl">
        }
   <ion-button (click)="createAgent()" expand="block" color="primary" >创建智能体</ion-button>
   

+ 1 - 1
novel-app/src/app/tab2/tab2.page.html

@@ -56,7 +56,7 @@
           <ion-segment-view>
       
             <ion-segment-content id="female">
-              <app-article-card (click)="openDetailModal(card)" *ngFor="let card of cards" [card]="card"></app-article-card>
+              <app-article-card (click)="openDetailModal(card)" *ngFor="let card of mycards" [card]="card"></app-article-card>
             </ion-segment-content>
           </ion-segment-view>
         </ion-card-content>

+ 10 - 10
novel-app/src/app/tab2/tab2.page.ts

@@ -88,7 +88,7 @@ content = ''
     private router:Router,
   ) { 
     this.user = new CloudUser();
-    this.loadCards(); // 初始化时加载所有科普信息
+    // this.loadCards(); // 初始化时加载所有科普信息
   }
 
   cards: Array<CloudObject> = [];
@@ -97,18 +97,18 @@ content = ''
   async typeChange(ev: any) {
     this.type = ev?.detail?.value || ev?.value || 'hotdot';
     console.log(this.type);
-    await this.loadCards(); // 重新加载卡片
+    await this.loadmyCards(); // 重新加载卡片
   }
 
-  async loadCards() {
-    const query = new CloudQuery('NovelAriticle');
-    // this.content = '',
-    this.allCards = await query.find(); 
-    console.log(this.allCards);
-    this.cards = this.allCards.filter((card) => card.get('category').toLowerCase().includes(this.type));
-    console.log(this.cards);
+  // async loadCards() {
+  //   const query = new CloudQuery('NovelAriticle');
+  //   // this.content = '',
+  //   this.allCards = await query.find(); 
+  //   console.log(this.allCards);
+  //   this.cards = this.allCards.filter((card) => card.get('category').toLowerCase().includes(this.type));
+  //   console.log(this.cards);
    
-  }
+  // }
   async loadmyCards() {
     let user = new CloudUser();
     const query = new CloudQuery('NovelAriticle');