dusenyao 3 rokov pred
rodič
commit
6e927f0570
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      src/views/course_details/index.vue

+ 2 - 2
src/views/course_details/index.vue

@@ -300,7 +300,7 @@ export default {
         this.isData = 'id' in res;
         this.getBackTime();
         this.checkMyGoodsCollectionStatus();
-        this.getMyGoodsBuyInfo(this.CourseData.book_list.map(book_id => book_id));
+        this.getMyGoodsBuyInfo(this.CourseData.book_list.map(({ book_id }) => book_id));
         this.loading = false;
       })
       .catch(() => {
@@ -418,7 +418,7 @@ export default {
     getMyGoodsBuyInfo(goods_id_list) {
       GetMyGoodsBuyInfo({ goods_type: 101, goods_id_list }).then(({ goods_id_list_buy }) => {
         this.CourseData.book_list.forEach(book => {
-          book.is_buy = goods_id_list_buy.includes(book.book_id);
+          this.$set(book, 'is_buy', goods_id_list_buy.includes(book.book_id));
         });
       });
     },