bayi 2 rokov pred
rodič
commit
ec1ce4f1d3

+ 1 - 2
components/comment/index.json

@@ -1,5 +1,4 @@
 {
   "component": true,
-  "usingComponents": {},
-  "styleIsolation": "apply-shared"
+  "usingComponents": {}
 }

+ 3 - 0
components/comment/index.less

@@ -208,4 +208,7 @@
       }
     }
   }
+  .seat2 {
+    padding-bottom: calc(130rpx + env(safe-area-inset-bottom)) !important;
+  }
 }

+ 3 - 0
components/comment/index.wxss

@@ -177,3 +177,6 @@
   color: #0091FF;
   font-size: 32rpx;
 }
+.commentBox .seat2 {
+  padding-bottom: calc(130rpx + env(safe-area-inset-bottom)) !important;
+}

+ 9 - 9
components/worksList/index.js

@@ -60,7 +60,7 @@ Component({
     tabBarPadding: {
       type: Boolean,
       value: false,
-      observer(b){
+      observer(b) {
         console.log(b);
       }
     }
@@ -91,15 +91,15 @@ Component({
     addCommentNum({
       detail
     }) {
-      let worksListCopy = JSON.parse(JSON.stringify(this.data.worksListCopy))
-      worksListCopy.forEach(item => {
-        if (item.userRead.id == detail) {
-          item.userRead.commentAmount = ++item.userRead.commentAmount
-        }
-      })
-      this.setData({
-        worksListCopy
+      let worksListCopy = this.data.worksListCopy
+      let index = worksListCopy.findIndex(item => {
+        return item.userRead.id == detail
       })
+      if (index != -1) {
+        this.setData({
+          [`worksListCopy[${index}].userRead.commentAmount`]: ++worksListCopy[index].userRead.commentAmount
+        })
+      }
     },
     deleteVideo({
       detail

+ 15 - 9
mixins/video.js

@@ -88,15 +88,21 @@ module.exports = Behavior({
       target
     }) {
       this.selectComponent('#comment').open(target.dataset.id)
-      let worksListCopy = JSON.parse(JSON.stringify(this.data.worksListCopy))
-      worksListCopy.forEach(item => {
-        if (item.userRead.id == target.dataset.id) {
-          item.unReadPostsCount = 0
-        }
-      })
-      this.setData({
-        worksListCopy
-      })
+      // if (this.data.videoInfo) {
+      //   this.setData({
+      //     ['videoInfo.unReadPostsCount']: 0
+      //   })
+      // }
+      /*    let worksListCopy = JSON.parse(JSON.stringify(this.data.worksListCopy))
+         worksListCopy.forEach(item => {
+           console.log('zz');
+           if (item.userRead.id == target.dataset.id) {
+             item.unReadPostsCount = 0
+           }
+         })
+         this.setData({
+           worksListCopy
+         }) */
     },
     // 分享
     creatShare(video) {