Browse Source

circle page

邹能昇 4 months ago
parent
commit
2ccba1d6e1

+ 9 - 3
nova-werun/components/circle-card/index.js

@@ -208,9 +208,15 @@ Component({
             AIMomentCommentquery2.equalTo('user', currentUser.id);
             let moment2 = await AIMomentCommentquery2.find()
             let AIMoment1List2 = moment2.map(item => item.toJSON());
-            this.setData({
-                isclick: AIMoment1List2[0].isDeleted
-            })
+            if(AIMoment1List2.length!=0){
+                this.setData({
+                    isclick:AIMoment1List2[0].isDeleted
+                })
+            }else{
+                this.setData({
+                    isclick:true
+                })
+            }
             console.log('isclick', AIMoment1List2);
         },
         //显示点赞人

+ 1 - 0
nova-werun/components/circle/index.js

@@ -89,6 +89,7 @@ Component({
             Profilequery.notEqualTo('isDeleted', true)
             let P = await Profilequery.find();
             let profile1List = P.map(item => item.toJSON());
+            profile1List.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
             console.log(profile1List);
             this.setData({
                 cardList: profile1List