Parcourir la source

Merge branch 'dev' of http://git.jihengcc.cn/sendy/KM-PC-Front-Milestone2 into dev

zhangli il y a 2 ans
Parent
commit
b612a28553

+ 11 - 1
src/views/modules/knowledge/album/detail.vue

@@ -402,10 +402,20 @@ export default {
       yelpPageNum:1,
       yelpPageSize:10,
       yelpDataList:[],
-      yelpPageTotle:0
+      yelpPageTotle:0,
+      scope: 2
     }
   },
+  beforeRouteLeave(to, from, next) {
+    if(to.name == 'albumIndex') {
+      to.query.scope = this.scope
+    }
+    next();
+  },
   mounted() {
+    if(this.$route.query.scope) {
+      this.scope = this.$route.query.scope
+    }
     if(this.$route.query.isAdd) {
       this.isAdd = this.$route.query.isAdd==1?true:false
     }

+ 8 - 3
src/views/modules/knowledge/album/index.vue

@@ -57,7 +57,7 @@
             <p class="noDataText">暂无搜索结果</p>
           </div>
           <div class="listBox" v-for="(item, index) in dataList" :key="index">
-            <albumBox :item="item" @del='del' class="listBoxitem"></albumBox>
+            <albumBox :item="item" :scope="scope" @del='del' class="listBoxitem"></albumBox>
           </div>
         </div>
       </div>
@@ -92,7 +92,7 @@ import albumBox from '../components/albumBox'
 import pageBar from '../components/pageBar'
 import album from '@/api/knowledge/album'
 export default {
-  name: 'contentData',
+  name: 'albumIndex',
   components: {
     search,
     albumBox,
@@ -123,7 +123,11 @@ export default {
       classifyArr:[],
     }
   },
+  
   created() {
+    if(this.$router.query.scope) {
+      this.scope = this.$router.query.scope
+    }
     if (this.user.photo && this.user.photo != '') {
       this.imgUrl = '/api/api-system/system/core/sysFile/previewFile?fileId='+this.user.photo
     }
@@ -192,7 +196,8 @@ export default {
       this.$router.push({
         name: "albumDetail",
         query: {
-          isAdd: 1
+          isAdd: 1,
+          scope: this.scope
         }
       })
     },

+ 10 - 3
src/views/modules/knowledge/components/albumBox.vue

@@ -44,7 +44,12 @@ export default {
     item: {
       type: Object,
       default: []
-    }
+    },
+    // scope:2,//1-我的专辑  2-全部专辑  3-我的点评
+    scope: {
+      type: Number,
+      default: 2
+    },
   },
   computed: {
  
@@ -66,7 +71,8 @@ export default {
         name: "albumDetail",
         query: {
             pkId: this.item.pkId,
-            isAdd: 1
+            isAdd: 1,
+            scope: this.scope
         }
       })
     },
@@ -75,7 +81,8 @@ export default {
         name: "albumDetail",
         query: {
             pkId: this.item.pkId,
-            isAdd: 2
+            isAdd: 2,
+            scope: this.scope
         }
       })
     },