Browse Source

circle page

邹能昇 5 tháng trước cách đây
mục cha
commit
87d42f6c73

+ 21 - 13
nova-werun/components/circle-card/index.js

@@ -24,7 +24,7 @@ Component({
         cicleList: [],
         time: '',
         //点赞人
-        chickList:''
+        chickList: ''
     },
     lifetimes: {
 
@@ -34,6 +34,7 @@ Component({
         attached: async function () {
             // 在组件实例进入页面节点树时执行
             this.getcircle()
+            this.showischick()
         },
 
     },
@@ -77,9 +78,7 @@ Component({
             console.log(this.data.isgood);
         },
         isclick() {
-            // this.setData({
-            //     isclick: !this.data.isclick
-            // })
+
             this.chickin()
             setTimeout(() => {
                 this.showchick()
@@ -102,6 +101,7 @@ Component({
             this.setData({
                 images: this.data.cicleList[0].images
             })
+            console.log('isclick', this.data.isclick);
             // 将 ISO 字符串转换为时间戳并传递给 formatTime
             const createdAt = new Date(this.data.cicleList[0].createdAt).getTime();
             const time = this.formatTime(createdAt);
@@ -128,6 +128,9 @@ Component({
         },
         //点击点赞按钮
         async chickin() {
+            this.setData({
+                isclick: !this.data.isclick
+            })
             let AIMomentquery = new Parse.Query('AIMoment');
             AIMomentquery.equalTo('company', company);
             AIMomentquery.equalTo('objectId', this.data.objectId);
@@ -136,13 +139,12 @@ Component({
             AIMomentquery.include('profile');
             AIMomentquery.notEqualTo('isDeleted', true)
             let P = await AIMomentquery.first();
-              //点赞成功
-            this.setData({
-                isclick: !this.data.isclick
-            })
+
+
             const currentUser = Parse.User.current();
             let AIMomentCommentquery = new Parse.Query('AIMomentComment');
             AIMomentCommentquery.equalTo('company', company);
+            AIMomentCommentquery.equalTo('type', 'chickin');
             AIMomentCommentquery.equalTo('moment', P.toPointer());
             AIMomentCommentquery.equalTo('user', currentUser.id);
             let moment = await AIMomentCommentquery.first()
@@ -167,6 +169,7 @@ Component({
                 let Comment = new Parse.Object('AIMomentComment');
                 Comment.set('moment', P.toPointer())
                 Comment.set('company', companyPointer);
+                Comment.set('type', 'chickin');
                 Comment.set('user', user.toPointer());
                 Comment.set('isDeleted', false);
                 try {
@@ -176,11 +179,11 @@ Component({
                 } catch (error) {
                     console.error("保存数据时出现错误:", error);
                 }
-               
+
             }
         },
-        //显示点赞
-        async showchick() {
+        //显示是否
+        async showischick() {
             const currentUser = Parse.User.current();
             let AIMomentCommentquery2 = new Parse.Query('AIMomentComment');
             AIMomentCommentquery2.equalTo('company', company);
@@ -188,13 +191,18 @@ Component({
             AIMomentCommentquery2.equalTo('user', currentUser.id);
             let moment2 = await AIMomentCommentquery2.find()
             let AIMoment1List2 = moment2.map(item => item.toJSON());
-            console.log('AIMoment1List2',AIMoment1List2);
             this.setData({
                 isclick:AIMoment1List2[0].isDeleted
             })
+        },
+        //显示点赞人
+        async showchick() {
+
+
             let Momentquery = new Parse.Query('AIMomentComment');
             Momentquery.equalTo('company', company);
-            Momentquery.equalTo('moment', this.data.cicleList[0].objectId);
+            Momentquery.equalTo('type', 'chickin');
+            Momentquery.equalTo('moment', this.data.objectId);
             Momentquery.notEqualTo('isDeleted', true)
             Momentquery.include('user')
             let r = await Momentquery.find();

+ 18 - 0
nova-werun/components/circle-card/index.less

@@ -5,6 +5,7 @@
     border-bottom: grey solid 1px;
     padding-left: 30rpx;
     padding-right: 20rpx;
+    padding-bottom: 20rpx;
     .namebax{
         width: 100%;
         height: 100rpx;
@@ -188,7 +189,24 @@
             background-color: #efefef;
             color: #506692;
             font-size: 50rpx;
+            margin-left: auto;
         }
 
     }
+    .chinkinbox{
+        padding-top: 10rpx;
+        padding-bottom: 10rpx;
+    
+        border-radius: 15rpx;
+        margin-left: 90rpx;
+        display: flex;
+        background-color: #efefef;
+        align-items: center;
+        padding-left: 18rpx;
+        flex-wrap: wrap;
+        .chickname{
+            font-size: 28rpx;
+            margin-left: 8rpx;
+        }
+    }
 }

+ 4 - 2
nova-werun/components/circle-card/index.wxml

@@ -75,9 +75,11 @@
         <view class="point" bindtap="showgood"> ·· </view>
 
     </view>
-    <view>
+    <view class="chinkinbox" wx:if="{{chickList.length!=0}}">
+        <van-icon name="like-o" size='18' />
         <block wx:for="{{chickList}}">
-            <view>{{item.user.nickname}}</view>
+            <view class="chickname" wx:if="{{index!=chickList.length-1}}">{{item.user.nickname}} ,</view>
+            <view class="chickname" wx:if="{{index==chickList.length-1}}">{{item.user.nickname}}</view>
         </block>
 
     </view>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
nova-werun/components/circle-card/index.wxss


+ 4 - 0
nova-werun/components/circle/index.less

@@ -10,6 +10,9 @@
             padding-top: 20rpx;
             
         }
+        .trends::-webkit-scrollbar {
+            display: none; /* 隐藏滚动条 */
+        }
         .publishbox{
             position: absolute;
             bottom: 170rpx;
@@ -19,4 +22,5 @@
                 height: 80rpx;
             }
         }
+
 }

+ 1 - 1
nova-werun/components/circle/index.wxss

@@ -1 +1 @@
-.all{width:100vw;position:relative}.all .trends{width:100%;border-top:grey solid 1px;overflow-y:scroll;padding-top:20rpx}.all .publishbox{position:absolute;bottom:170rpx;right:12rpx}.all .publishbox image{width:80rpx;height:80rpx}
+.all{width:100vw;position:relative}.all .trends{width:100%;border-top:grey solid 1px;overflow-y:scroll;padding-top:20rpx}.all .trends::-webkit-scrollbar{display:none}.all .publishbox{position:absolute;bottom:170rpx;right:12rpx}.all .publishbox image{width:80rpx;height:80rpx}

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác