YY 2 years ago
parent
commit
a8eaf90b95

+ 12 - 0
src/layout/Header.vue

@@ -16,6 +16,9 @@
           </el-col>
           <el-col :span="16" class="right">
             <!-- <notice v-if="user.lab_id"></notice> -->
+            <el-badge :value="1000" class="item" type="danger">
+              <i class="el-icon-message-solid" @click="toJump()"></i>
+            </el-badge>
             <i class="el-icon-refresh" v-if="$dev_env" @click="toRefresh()"></i>
             <i class="el-icon-user-solid"></i>
             <span>{{ user.name || '游客' }}</span>
@@ -62,6 +65,9 @@ export default {
     toRefresh() {
       this.$emit('refresh');
     },
+    toJump() {
+      this.$router.push({ path: `/selfShop/notice` });
+    },
   },
   computed: {
     ...mapState(['user']),
@@ -118,7 +124,13 @@ export default {
         font-size: 16px;
         padding: 0 15px 0 0px;
       }
+      .item {
+        right: 30px;
+      }
     }
   }
 }
+/deep/.el-badge__content.is-fixed {
+  top: 17px;
+}
 </style>

+ 0 - 1
src/views/selfShop/notice/index.vue

@@ -139,7 +139,6 @@ export default {
       let info = { _id: data._id, status: '1' };
       let res = await this.update(info);
       if (this.$checkRes(res)) {
-        this.$message({ type: `success`, message: `已读` });
         this.search();
       }
     },

+ 7 - 2
src/views/selfShop/order/index.vue

@@ -124,8 +124,8 @@ export default {
     ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      if (this.orders_id) {
-        let data = this.orders_id;
+      if (this.$route.query.id) {
+        let data = this.$route.query.id;
         this.toDetail_t(data);
       } else {
         if (this.active) this.$set(this, 'activeName', this.active);
@@ -186,6 +186,11 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.loadings = true;
+      if (this.sales_id) {
+        delete this.$route.query.id;
+      }
+      this.search(this.searchQuery);
     },
     getAddress(i) {
       let name = i.name + ',' + i.phone;

+ 6 - 3
src/views/selfShop/sales/index.vue

@@ -91,8 +91,8 @@ export default {
     },
     // 查询
     async search({ skip = 0, limit = this.$limit, ...info } = {}) {
-      if (this.sales_id) {
-        let data = { data: { id: this.sales_id } };
+      if (this.$route.query.id) {
+        let data = { data: { id: this.$route.query.id } };
         this.toExam(data);
       } else {
         info.shop = this.user.shop.id;
@@ -105,7 +105,6 @@ export default {
           this.$set(this, `searchQuery`, query);
         }
       }
-
       this.loadings = false;
     },
     toExam({ data }) {
@@ -114,6 +113,10 @@ export default {
     },
     toBack() {
       this.view = 'list';
+      this.loadings = true;
+      if (this.sales_id) {
+        delete this.$route.query.id;
+      }
       this.search(this.searchQuery);
     },
     toClose() {