Browse Source

展示返回

panhui 4 years ago
parent
commit
fac276f283
3 changed files with 16 additions and 11 deletions
  1. 1 2
      src/router/index.js
  2. 4 0
      src/views/Discover.vue
  3. 11 9
      src/views/product/Detail.vue

+ 1 - 2
src/router/index.js

@@ -369,8 +369,7 @@ const routes = [
         component: () => import('../views/product/HopeMarket.vue'),
         meta: {
             pageType: Page.Every,
-            tabColor: '#222426',
-            title: '二手市场'
+            tabColor: '#222426'
         }
     },
     {

+ 4 - 0
src/views/Discover.vue

@@ -367,6 +367,10 @@ export default {
         this.$nextTick(() => {
             this.changeScroll(this.scrollTop);
         });
+        if (window.cordova && StatusBar && StatusBar.isVisible) {
+            StatusBar.backgroundColorByHexString('#222426');
+            StatusBar.styleLightContent();
+        }
     },
     beforeRouteLeave(to, from, next) {
         if (!to.meta.menuPage) {

+ 11 - 9
src/views/product/Detail.vue

@@ -394,7 +394,7 @@ export default {
     mixins: [product, coupon],
     name: 'productDetail',
     watch: {
-        $route() {
+        '$route.params'() {
             this.getInit();
         }
     },
@@ -613,14 +613,16 @@ export default {
                 .catch(e => {
                     this.$toast.clear();
                     if (e && e.error) {
-                        this.$dialog
-                            .alert({
-                                title: '提示',
-                                message: e.error
-                            })
-                            .then(res => {
-                                this.$router.back();
-                            });
+                        if (this.$route.name == 'productDetail') {
+                            this.$dialog
+                                .alert({
+                                    title: '提示',
+                                    message: e.error
+                                })
+                                .then(res => {
+                                    this.$router.back();
+                                });
+                        }
                     }
                 });
         },