2 Commits c49f6345e4 ... 29a0b91845

Author SHA1 Message Date
  0225263 29a0b91845 Merge branch 'master' of http://git.fmode.cn:3000/0225273/APPmy 4 months ago
  0225263 d6c2693824 tab4 4 months ago
2 changed files with 8 additions and 1 deletions
  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
     }