Просмотр исходного кода

已售罄商品链接支持传参

萤火科技 5 лет назад
Родитель
Сommit
77e0c8b7cf
2 измененных файлов с 5 добавлено и 1 удалено
  1. 4 0
      src/views/goods/Index.vue
  2. 1 1
      src/views/index/Index.vue

+ 4 - 0
src/views/goods/Index.vue

@@ -176,6 +176,10 @@ export default {
     }
   },
   created () {
+    // 默认的查询参数
+    if (this.$route.query.listType) {
+      this.queryParam.listType = this.$route.query.listType
+    }
     // 获取商品分类列表
     this.getCategoryList()
   },

+ 1 - 1
src/views/index/Index.vue

@@ -149,7 +149,7 @@
           </a-col>
           <a-col :span="6">
             <div class="item">
-              <router-link to="/goods/index">
+              <router-link :to="{ path: '/goods/index', query: { listType: 'sold_out' } }">
                 <p class="name">已售罄商品</p>
                 <p class="value">{{ data.pending.soldoutGoodsTotal }}</p>
               </router-link>