2 次代码提交 c49f6345e4 ... 29a0b91845

作者 SHA1 备注 提交日期
  0225263 29a0b91845 Merge branch 'master' of http://git.fmode.cn:3000/0225273/APPmy 4 月之前
  0225263 d6c2693824 tab4 4 月之前
共有 2 个文件被更改,包括 8 次插入1 次删除
  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
     }