Browse Source

修改收藏

bding 1 year ago
parent
commit
7eb86d2a9f

+ 1 - 1
pageMy/myCollection/myCollection.vue

@@ -228,7 +228,7 @@ export default {
         PageRouter: this.$store.state.pageRouterReport,
       });
       if (res.Ret === 200) {
-        let index = this.collectList.findIndex((key) => key.Id == item.Id);
+        let index = this.collectList.findIndex((key) => key.SourceId == item.SourceId && key.Type == item.Type);
         this.collectList.splice(index, 1);
         uni.showToast({
           title: res.Msg,

+ 1 - 1
pages-search/components/roadshow.vue

@@ -49,7 +49,7 @@ export default {
         PageRouter: this.$store.state.pageRouterReport,
       });
       if (res.Ret === 200) {
-        let index = this.roadshowPageList.findIndex((key) => key.Id == item.Id);
+        let index = this.roadshowPageList.findIndex((key) => key.SourceId == item.SourceId && key.Type == item.Type);
 
         res.Data.Status == 1 ? (this.$parent.roadshowPageList[index].IsCollect = true) : (this.$parent.roadshowPageList[index].IsCollect = false);
         uni.showToast({

+ 2 - 1
pages/index/index.vue

@@ -249,7 +249,8 @@ export default {
         PageRouter: this.$store.state.pageRouterReport,
       });
       if (res.Ret === 200) {
-        let index = this.newDataList.findIndex((key) => key.Roadshow && key.Roadshow.Id == item.Id);
+        console.log(item, this.newDataList);
+        let index = this.newDataList.findIndex((key) => key.Roadshow && key.Roadshow.SourceId == item.SourceId && key.Roadshow.Type == item.Type);
         res.Data.Status == 1 ? (this.newDataList[index].Roadshow.IsCollect = true) : (this.newDataList[index].Roadshow.IsCollect = false);
         uni.showToast({
           title: res.Msg,

+ 9 - 3
pages/material/material.vue

@@ -5,7 +5,7 @@
       <view class="top-tabs">
         <block v-for="item in topTabBars" :key="item.Id">
           <view v-if="item.IsShow" :class="['item', item.Id == topTabsActive && 'tabs-active']" @click="topTabsChange(item)">
-            {{ item.Name}}
+            {{ item.Name }}
             <block v-if="(item.Id === 3 || item.Name == '图表') && wholeShowListData.IsShowChart">
               <image class="limit-img tabs-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/limit_icon.png" mode=""></image>
             </block>
@@ -486,8 +486,14 @@ export default {
         PageRouter: this.$store.state.pageRouterReport,
       });
       if (res.Ret === 200) {
-        let index = this.roadshowPageList.findIndex((key) => key.Id == item.Id);
-        res.Data.Status == 1 ? (this.roadshowPageList[index].IsCollect = true) : (this.roadshowPageList[index].IsCollect = false);
+        let index = this.roadshowPageList.findIndex((key) => key.SourceId == item.SourceId && key.Type == item.Type);
+        console.log(index);
+        // this.$nextTick(() => {
+
+        // });
+        res.Data.Status == 1 ? this.$set(this.roadshowPageList[index], "IsCollect", true) : this.$set(this.roadshowPageList[index], "IsCollect", false);
+        console.log(this.roadshowPageList[index]);
+
         uni.showToast({
           title: res.Msg,
           duration: 2000,