|
@@ -20,9 +20,12 @@ Component({
|
|
|
bottomNavHeight: 0, // 底部导航栏高度
|
|
|
contentHeight: 0, // 可用内容高度
|
|
|
contentpadding: 0, //顶部padding高度
|
|
|
+ navheight:0,
|
|
|
|
|
|
circlecount: 0,
|
|
|
- User1List:[]
|
|
|
+ likesCount:0,
|
|
|
+ User1List:[],
|
|
|
+ profile1List2:[]
|
|
|
},
|
|
|
lifetimes: {
|
|
|
|
|
@@ -41,13 +44,15 @@ Component({
|
|
|
|
|
|
const contentpadding = (statusBarHeight + customHeight) * 750 / systemInfo.windowWidth;
|
|
|
const contentHeight = (screenHeight - bottomNavHeight - 50 - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
|
|
|
+ const navheight = (statusBarHeight+customHeight) * 750 / systemInfo.windowWidth;
|
|
|
this.setData({
|
|
|
statusBarHeight,
|
|
|
- screenHeight,
|
|
|
+ screenHeight:(screenHeight-50-bottomNavHeight) * 750 / systemInfo.windowWidth,
|
|
|
customHeight,
|
|
|
bottomNavHeight,
|
|
|
contentHeight,
|
|
|
- contentpadding
|
|
|
+ contentpadding,
|
|
|
+ navheight
|
|
|
});
|
|
|
this.getcircle()
|
|
|
this.getname()
|
|
@@ -65,28 +70,78 @@ Component({
|
|
|
});
|
|
|
},
|
|
|
//查全部朋友圈
|
|
|
+ // async getcircle() {
|
|
|
+ // const currentUser = Parse.User.current();
|
|
|
+ // let Profilequery2 = new Parse.Query('Profile');
|
|
|
+ // Profilequery2.equalTo('company', company);
|
|
|
+ // Profilequery2.equalTo('user', currentUser.id);
|
|
|
+ // Profilequery2.equalTo('isCheck', true);
|
|
|
+ // Profilequery2.notEqualTo('isDeleted', true)
|
|
|
+ // let P2 = await Profilequery2.find();
|
|
|
+ // let profile1List2 = P2.map(item => item.toJSON());
|
|
|
+
|
|
|
+ // let Profilequery = new Parse.Query('AIMoment');
|
|
|
+ // Profilequery.equalTo('company', company);
|
|
|
+ // Profilequery.equalTo('isVisible', true);
|
|
|
+ // Profilequery.notEqualTo('isDeleted', true)
|
|
|
+ // Profilequery.equalTo('profile', profile1List2[0].objectId);
|
|
|
+ // Profilequery.descending('createdAt');
|
|
|
+
|
|
|
+ // let count = await Profilequery.count();
|
|
|
+
|
|
|
+ // if (count) {
|
|
|
+ // this.setData({
|
|
|
+ // circlecount: count
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
async getcircle() {
|
|
|
const currentUser = Parse.User.current();
|
|
|
let Profilequery2 = new Parse.Query('Profile');
|
|
|
Profilequery2.equalTo('company', company);
|
|
|
Profilequery2.equalTo('user', currentUser.id);
|
|
|
Profilequery2.equalTo('isCheck', true);
|
|
|
- Profilequery2.notEqualTo('isDeleted', true)
|
|
|
+ Profilequery2.notEqualTo('isDeleted', true);
|
|
|
+ Profilequery2.include('user');
|
|
|
+ Profilequery2.include('center');
|
|
|
+ Profilequery2.include('department');
|
|
|
let P2 = await Profilequery2.find();
|
|
|
let profile1List2 = P2.map(item => item.toJSON());
|
|
|
-
|
|
|
+ this.setData({
|
|
|
+ profile1List2,
|
|
|
+ })
|
|
|
+ console.log('信息',this.data.profile1List2);
|
|
|
let Profilequery = new Parse.Query('AIMoment');
|
|
|
Profilequery.equalTo('company', company);
|
|
|
Profilequery.equalTo('isVisible', true);
|
|
|
- Profilequery.notEqualTo('isDeleted', true)
|
|
|
+ Profilequery.notEqualTo('isDeleted', true);
|
|
|
Profilequery.equalTo('profile', profile1List2[0].objectId);
|
|
|
Profilequery.descending('createdAt');
|
|
|
-
|
|
|
- let count = await Profilequery.count();
|
|
|
-
|
|
|
- if (count) {
|
|
|
+
|
|
|
+ let moments = await Profilequery.find(); // 查找所有动态
|
|
|
+
|
|
|
+ if (moments.length) {
|
|
|
+ this.setData({
|
|
|
+ circlecount: moments.length
|
|
|
+ });
|
|
|
+
|
|
|
+ // 获取所有动态的ID
|
|
|
+ let momentIds = moments.map(moment => moment.id);
|
|
|
+
|
|
|
+ // 创建对 AIMomentLike 表的查询
|
|
|
+ let LikeQuery = new Parse.Query('AIMomentLike');
|
|
|
+ LikeQuery.equalTo('isLiked', true);
|
|
|
+ LikeQuery.equalTo('company', company);
|
|
|
+ LikeQuery.notEqualTo('isDeleted', true);
|
|
|
+ LikeQuery.containedIn('moment', momentIds); // 使用 containedIn 来一次性查询多个动态的点赞
|
|
|
+
|
|
|
+ // 统计点赞数量
|
|
|
+ let likesCount = await LikeQuery.count();
|
|
|
+
|
|
|
+ // 这里可以进一步处理 likesCount,按动态分配点赞数量
|
|
|
+ console.log(`总点赞数量: ${likesCount}`);
|
|
|
this.setData({
|
|
|
- circlecount: count
|
|
|
+ likesCount,
|
|
|
})
|
|
|
}
|
|
|
},
|