Browse Source

Merge branch '2d展厅' of xiongzhu/raex_front into dev

panhui 4 years ago
parent
commit
7d228af8d4
2 changed files with 17 additions and 11 deletions
  1. 16 11
      src/views/hall/Detail.vue
  2. 1 0
      src/views/hall/ProductAdd.vue

+ 16 - 11
src/views/hall/Detail.vue

@@ -153,7 +153,8 @@ export default {
             assets: [],
             distances: [0, 0, 0, 0],
             swiperRef: null,
-            inApp
+            inApp,
+            isEdit: false
         };
     },
     computed: {
@@ -203,15 +204,11 @@ export default {
         }
         this.emitter.on('setIntroduction', e => {
             this.info.introduction = e;
+            this.isEdit = true;
         });
         this.emitter.on('setAssets', assets => {
-            console.log(assets);
             this.assets = assets;
-            setTimeout(() => {
-                this.$nextTick(() => {
-                    this.swiperRef.updateSlides();
-                });
-            }, 500);
+            this.isEdit = true;
         });
     },
     beforeRouteEnter(to, from) {
@@ -288,6 +285,7 @@ export default {
         back() {
             let _this = this;
             this.$dialog.confirm({ title: '提示', message: '确定要退出展馆吗?' }).then(() => {
+                this.isEdit = false;
                 if (_this.isMine) {
                     _this.backPage();
                 } else {
@@ -378,12 +376,19 @@ export default {
         }
     },
     beforeRouteLeave(to, from, next) {
-        if (!to.meta.isHall) {
-            this.setKeeps(['Hall'], false);
+        if (to.path === '/store' && this.isEdit) {
+            next(false);
+            setTimeout(() => {
+                this.back();
+            }, 100);
         } else {
-            this.setKeeps(['Hall']);
+            if (!to.meta.isHall) {
+                this.setKeeps(['Hall'], false);
+            } else {
+                this.setKeeps(['Hall']);
+            }
+            next();
         }
-        next();
     }
 };
 </script>

+ 1 - 0
src/views/hall/ProductAdd.vue

@@ -238,6 +238,7 @@ export default {
     .flex();
     padding: 9px 16px;
     background-color: #222426;
+    z-index: 20;
     .bottom(9px);
     .van-button {
         flex-grow: 1;