zhaoxiaohai 3 سال پیش
والد
کامیت
d893df300b
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      pages/tabbar/smartStore/modules/viewPage.js

+ 4 - 3
pages/tabbar/smartStore/modules/viewPage.js

@@ -50,9 +50,10 @@ Component({
     methods: {
         /* 是否收藏 */
         isCollect() {
+            const isCollect = this.data.fileSelected.isCollect;
             _Http.basic({
                 "classname": "system.attachment.MediaCenter",
-                "method": this.data.fileSelected.isCollect == 0 ? "collectAttachment" : "uncollectAttachment",
+                "method": isCollect == 0 ? "collectAttachment" : "uncollectAttachment",
                 "content": {
                     "collecttype": "营销物料",
                     "attachmentid": this.data.fileSelected.attachmentid
@@ -63,11 +64,11 @@ Component({
                     icon: "none"
                 })
                 wx.showToast({
-                    title: this.data.fileSelected.isCollect == 0 ? '收藏成功' : "取消收藏",
+                    title: isCollect == 0 ? '收藏成功' : "取消收藏",
                 })
                 let list = this.data.list,
                     index = this.data.fileSelected.queryrow - 1;
-                this.data.tabActiveTitle == '列表' ? list[index].isCollect = this.data.fileSelected.isCollect == 0 ? 1 : 0 : list.splice(index, 1);
+                this.data.tabActiveTitle == '列表' ? list[index].isCollect = isCollect == 0 ? 1 : 0 : list.splice(index, 1);
                 this.setData({
                     list
                 })