Bladeren bron

Merge branch 'master' of http://git.fmode.cn:3000/0225273/APPmy

0225273 4 maanden geleden
bovenliggende
commit
4068544a23
2 gewijzigde bestanden met toevoegingen van 8 en 1 verwijderingen
  1. 2 0
      src/app/feedback/feedback.page.html
  2. 6 1
      src/app/feedback/feedback.page.ts

+ 2 - 0
src/app/feedback/feedback.page.html

@@ -37,6 +37,8 @@
 <ion-content class="chat-content">
   <ion-list lines="none">
     <ion-item *ngFor="let message of messageList" class="message-item">
+      1{{message?.get('sendUser')?.objectId}} - 2{{user?.id}}
+      3{{message?.get('receiveUser')?.objectId}} - 4{{targetId}}
       <ion-label class="message-container"
                  [class.sent-message-container]="message?.get('sendUser')?.id === user?.id"
                  [class.received-message-container]="message?.get('receiveUser')?.id === targetId">

+ 6 - 1
src/app/feedback/feedback.page.ts

@@ -79,7 +79,7 @@ export class FeedbackPage implements OnInit {
       return;
     }
     let sendUser = Parse.User?.current()?.toPointer()
-    let receiveUser = {__type:"Pointer",className:"_User",objectId:this.userid}
+    let receiveUser = {__type:"Pointer",className:"_User",objectId:this.targetId}
     let Message = Parse.Object.extend("Message");
     let message = new Message();
     message.set("sendUser",sendUser)
@@ -144,7 +144,12 @@ export class FeedbackPage implements OnInit {
       ]
     }})
 
+    query.addDescending("createdAt")
+    query.limit(5)
+    query.include("sendUser","receiveUser")
+
     let list = await query.find();
+    console.log(list)
     if(list?.length){
       this.messageList = list
     }