Browse Source

feat: 筛选项回显

zhangyuhan 1 year ago
parent
commit
18e14e3b73

+ 14 - 2
apps/mobile/src/views/article/components/ContentBusinessRecommendProject.vue

@@ -62,6 +62,15 @@ export default {
       }
       this.$emit('toDetail', item)
     },
+    formatFilter() {
+      const searchFilter = this.recommendMap.search || {}
+      return {
+        keywords: searchFilter?.keywords?.split(',') || [],
+        buyerClass: searchFilter?.buyerClass ? [searchFilter?.buyerClass] : [],
+        area: searchFilter?.regionMap,
+        publishTime: searchFilter?.publishtime
+      }
+    },
     async toMore() {
       if (this.recommendMap.popup) {
         this.maskConfirmButtonClick()
@@ -69,9 +78,12 @@ export default {
         if (this.beforeLeavePage) {
           await this.beforeLeavePage()
         }
-        // 带入筛选条件
+        // 带入筛选条件
         this.$router.push({
-          path: '/search/result/bidding',
+          name: 'search-bidding',
+          params: {
+            filters: this.formatFilter()
+          },
           query: {
             nocache: 1,
             searchGroup: 2