邹能昇 hai 3 meses
pai
achega
f9b1ed9a95

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

@@ -159,16 +159,18 @@ Component({
 
 
             const currentUser = Parse.User.current();
-            let AIMomentCommentquery = new Parse.Query('AIMomentComment');
+            let AIMomentCommentquery = new Parse.Query('AIMomentLike');
             AIMomentCommentquery.equalTo('company', company);
             AIMomentCommentquery.equalTo('type', 'chickin');
             AIMomentCommentquery.equalTo('moment', P.toPointer());
             AIMomentCommentquery.equalTo('user', currentUser.id);
             let moment = await AIMomentCommentquery.first()
             if (moment) {
-                moment.set('isDeleted', this.data.isclick)
+                moment.set('isLiked', this.data.isclick)
+                // moment.set('isDeleted', true)
                 try {
                     let saveDate = await moment.save();
+                    this.showchick()
                     console.log(saveDate);
                     console.log("新数据保存成功");
                 } catch (error) {
@@ -183,14 +185,15 @@ Component({
                 let user = await userquery.first();
 
                 let companyPointer = Parse.Object.extend('Company').createWithoutData(company);
-                let Comment = new Parse.Object('AIMomentComment');
+                let Comment = new Parse.Object('AIMomentLike');
                 Comment.set('moment', P.toPointer())
                 Comment.set('company', companyPointer);
                 Comment.set('type', 'chickin');
                 Comment.set('user', user.toPointer());
-                Comment.set('isDeleted', false);
+                Comment.set('isLiked', true);
                 try {
                     let saveDate2 = await Comment.save();
+                    this.showchick()
                     console.log(saveDate2);
                     console.log("新数据保存成功");
                 } catch (error) {
@@ -202,7 +205,7 @@ Component({
         //显示是否点过赞
         async showischick() {
             const currentUser = Parse.User.current();
-            let AIMomentCommentquery2 = new Parse.Query('AIMomentComment');
+            let AIMomentCommentquery2 = new Parse.Query('AIMomentLike');
             AIMomentCommentquery2.equalTo('company', company);
             AIMomentCommentquery2.equalTo('type', 'chickin');
             AIMomentCommentquery2.equalTo('moment', this.data.objectId);
@@ -211,11 +214,11 @@ Component({
             let AIMoment1List2 = moment2.map(item => item.toJSON());
             if (AIMoment1List2.length != 0) {
                 this.setData({
-                    isclick: AIMoment1List2[0].isDeleted
+                    isclick: AIMoment1List2[0].isLiked
                 })
             } else {
                 this.setData({
-                    isclick: true
+                    isclick: false
                 })
             }
             console.log('isclick', AIMoment1List2);
@@ -224,15 +227,16 @@ Component({
         async showchick() {
 
 
-            let Momentquery = new Parse.Query('AIMomentComment');
+            let Momentquery = new Parse.Query('AIMomentLike');
             Momentquery.equalTo('company', company);
             Momentquery.equalTo('type', 'chickin');
             Momentquery.equalTo('moment', this.data.objectId);
             Momentquery.notEqualTo('isDeleted', true)
             Momentquery.include('user')
+            Momentquery.equalTo('isLiked', true);
             let r = await Momentquery.find();
             let chickList = r.map(item => item.toJSON());
-            console.log(chickList);
+            console.log('chickList',chickList);
             this.setData({
                 chickList
             })

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

@@ -57,11 +57,11 @@
         <!-- 点赞评论 -->
         <view class="functionbox" wx:if="{{isgood}}">
             <view class="function">
-                <view class="function1" wx:if="{{isclick}}" bindtap="isclick" data-id="{{cicleList[0].objectId}}">
+                <view class="function1" wx:if="{{!isclick}}" bindtap="isclick" data-id="{{cicleList[0].objectId}}">
                     <van-icon name="like-o" />
                     <view class="text2">赞</view>
                 </view>
-                <view class="function1" wx:if="{{!isclick}}" bindtap="isclick">
+                <view class="function1" wx:if="{{isclick}}" bindtap="isclick">
                     <van-icon name="like" color='red' />
                     <view class="text2">取消</view>
                 </view>

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

@@ -69,6 +69,7 @@ Component({
             Profilequery2.notEqualTo('isDeleted', true)
             let P2 = await Profilequery2.find();
             let profile1List2 = P2.map(item => item.toJSON());
+            console.log(profile1List2);
             const department = profile1List2[0].department.objectId
             console.log(department);
             let queryWhere = {

+ 1 - 1
project.private.config.json

@@ -30,7 +30,7 @@
             "list": [
                 {
                     "name": "发送朋友圈",
-                    "pathName": "nova-werun/pages/send-circle/index",
+                    "pathName": "nova-werun/pages/circle/send-circle/index",
                     "query": "",
                     "scene": null
                 },