|
@@ -1,4 +1,6 @@
|
|
|
// nova-werun/components/circle/index.js
|
|
|
+const Parse = getApp().Parse;
|
|
|
+const company = getApp().globalData.company;
|
|
|
Component({
|
|
|
/**
|
|
|
* 组件的属性列表
|
|
@@ -17,30 +19,10 @@ Component({
|
|
|
customHeight: 0, // 自定义导航栏高度(如小程序右上角胶囊按钮)
|
|
|
bottomNavHeight: 0, // 底部导航栏高度
|
|
|
contentHeight: 0, // 可用内容高度
|
|
|
- contentHeight2: 0,
|
|
|
contentpadding: 0, //顶部padding高度
|
|
|
- //图片
|
|
|
- images: [
|
|
|
- 'http://img2.baidu.com/it/u=2324169262,1340424811&fm=253&app=138&f=JPEG?w=800&h=1422',
|
|
|
- 'https://img2.baidu.com/it/u=2814429148,2262424695&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422',
|
|
|
- 'https://img2.baidu.com/it/u=2814429148,2262424695&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://img2.baidu.com/it/u=2814429148,2262424695&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422',
|
|
|
- 'https://img2.baidu.com/it/u=2814429148,2262424695&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
- 'https://inews.gtimg.com/om_bt/OE8piEBa-tbqn-wNvWZl8coi4AlzoUD43upEkoAnIkYL8AA/641',
|
|
|
|
|
|
- ],
|
|
|
- imageclass:'',
|
|
|
- //是否展示点赞评论按钮
|
|
|
- isgood:false,
|
|
|
- isclick:false,
|
|
|
+ //朋友圈
|
|
|
+ cardList:[]
|
|
|
},
|
|
|
lifetimes: {
|
|
|
|
|
@@ -56,20 +38,16 @@ Component({
|
|
|
const custom = wx.getMenuButtonBoundingClientRect();
|
|
|
const customHeight = custom.height + 10 + 2 || 0;
|
|
|
const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
|
|
|
-
|
|
|
- const contentpadding = (statusBarHeight + customHeight) * 750 / systemInfo.windowWidth;
|
|
|
- const contentHeight = (screenHeight - bottomNavHeight - 50) * 750 / systemInfo.windowWidth;
|
|
|
- const contentHeight2 = (screenHeight - bottomNavHeight - 50 - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
|
|
|
+ const contentHeight = (screenHeight - 50-bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
|
|
|
this.setData({
|
|
|
statusBarHeight,
|
|
|
screenHeight,
|
|
|
customHeight,
|
|
|
bottomNavHeight,
|
|
|
- contentHeight,
|
|
|
- contentpadding,
|
|
|
- contentHeight2
|
|
|
+ contentHeight
|
|
|
});
|
|
|
- console.log('123', contentHeight, contentHeight2);
|
|
|
+ console.log('123', contentHeight);
|
|
|
+ this.getcircle()
|
|
|
},
|
|
|
|
|
|
},
|
|
@@ -78,49 +56,43 @@ Component({
|
|
|
* 组件的方法列表
|
|
|
*/
|
|
|
methods: {
|
|
|
-
|
|
|
- onImageLoad: function (e) {
|
|
|
- const {
|
|
|
- width,
|
|
|
- height
|
|
|
- } = e.detail; // 获取图片的宽高
|
|
|
- console.log('11', e.detail);
|
|
|
- const imageClass = width > height ? 'image-landscape' : 'image-portrait'; // 判断横竖屏
|
|
|
-
|
|
|
- this.setData({
|
|
|
- imageclass: imageClass // 动态设置图片的类名
|
|
|
- });
|
|
|
- },
|
|
|
- previewImage: function(e) {
|
|
|
- const index = e.currentTarget.dataset.index; // 获取当前点击图片的索引
|
|
|
- const images = this.data.images; // 获取所有图片的链接
|
|
|
|
|
|
- wx.previewImage({
|
|
|
- current: images[index], // 当前显示图片的链接
|
|
|
- urls: images // 需要预览的图片链接列表
|
|
|
- });
|
|
|
- },
|
|
|
- gourl(e){
|
|
|
- const url = e.currentTarget.dataset.url
|
|
|
- wx.navigateTo({
|
|
|
- url: url // 目标页面的路径
|
|
|
- });
|
|
|
- },
|
|
|
- showgood(){
|
|
|
- this.setData({
|
|
|
- isgood:!this.data.isgood
|
|
|
- })
|
|
|
- console.log(this.data.isgood);
|
|
|
- },
|
|
|
- isclick(){
|
|
|
- this.setData({
|
|
|
- isclick:!this.data.isclick
|
|
|
- })
|
|
|
- setTimeout(()=>{
|
|
|
- this.showgood()
|
|
|
- },400)
|
|
|
- console.log(this.data.isclick);
|
|
|
- }
|
|
|
+ //查全部朋友圈
|
|
|
+ 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());
|
|
|
+ const department = profile1List2[0].department.objectId
|
|
|
+ console.log(department);
|
|
|
+ let queryWhere = {
|
|
|
+ where: {
|
|
|
+ profile: {
|
|
|
+ $inQuery: {
|
|
|
+ where: {
|
|
|
+ department: department
|
|
|
+ },
|
|
|
+ className: 'Profile',
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let Profilequery = Parse.Query.fromJSON('AIMoment', queryWhere);
|
|
|
+ Profilequery.equalTo('company', company);
|
|
|
+ Profilequery.equalTo('isVisible', true);
|
|
|
+ Profilequery.notEqualTo('isDeleted', true)
|
|
|
+ let P = await Profilequery.find();
|
|
|
+ let profile1List = P.map(item => item.toJSON());
|
|
|
+ console.log(profile1List);
|
|
|
+ this.setData({
|
|
|
+ cardList:profile1List
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
}
|
|
|
})
|