From df60073f4fb06ea2d16984635e0714bae8a1f8e9 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Mon, 22 Dec 2025 18:03:35 +0800
Subject: [PATCH] 1.在总后台首页装修增加了活动专区和智能匹配 模块 2.目前活动专区获取的是发布需求最新的数据,智能匹配是用户没登录前也是获取发布需求最新数据,登录后会根据用户发布的需求,通过分类匹配到对应的数据 3.修复缴纳保证金报错 4.修复发布需求报错

---
 supplier_vue/src/components/setlink/part/Product.vue |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/supplier_vue/src/components/setlink/part/Product.vue b/supplier_vue/src/components/setlink/part/Product.vue
index 52e6d9b..d098ee6 100644
--- a/supplier_vue/src/components/setlink/part/Product.vue
+++ b/supplier_vue/src/components/setlink/part/Product.vue
@@ -6,9 +6,24 @@
     -->
   <div class="marketing-box">
     <el-tabs v-model="activeTab">
+      <el-tab-pane label="分类" name="type"></el-tab-pane>
       <el-tab-pane label="详情" name="detail"></el-tab-pane>
     </el-tabs>
 
+    <div class="product" v-if="activeTab == 'type'">
+      <!--内容-->
+      <div class="product-content" v-loading="loading">
+        <div class="table-wrap type-table">
+          <el-cascader class="ww100"
+                       ref="cascader"
+                       v-model="categoryActive"
+                       :options="categoryList"
+                       :props="{ children: 'child', value: 'category_id', label: 'name' }"
+                       @change="changeCategory">
+          </el-cascader>
+        </div>
+      </div>
+    </div>
     <div class="product-list" v-if="activeTab == 'detail'" v-loading="loading">
       <!--搜索表单-->
       <div class="common-seach-wrap">
@@ -102,6 +117,9 @@
     activeTab: function(n, o) {
       if (n != o) {
         this.tableData = [];
+        if (n == 'type') {
+          this.autoType();
+        }
         if (n == 'detail') {
           this.getData();
         }
@@ -135,6 +153,7 @@
         .then(data => {
           self.loading = false;
           self.tableData = data.data.list.data;
+          self.categoryList = data.data.category;
           self.totalDataNumber = data.data.list.total;
           if(self.curPage==1&&self.tableData.length>0){
             self.changeFunc(self.tableData[0]);
@@ -154,6 +173,11 @@
     /*选中的值*/
     changeFunc(e) {
       let obj={};
+      if (this.activeTab == 'type') {
+        obj.name = e.name;
+        obj.url = 'pages/product/list/list?category_id=' + e.category_id;
+        obj.type = '商品分类';
+      }
       if (this.activeTab == 'detail') {
         obj.name = e.product_name;
         obj.url = 'pages/product/detail/detail?product_id=' + e.product_id;
@@ -161,7 +185,28 @@
       }
 
       this.$emit('changeData', obj);
-    }
+    },
+    /*自动选择类别*/
+    autoType(i){
+      i=i|0;
+      this.categoryActive=[];
+      if(this.categoryList.length>0){
+        let item=this.categoryList[i];
+        this.categoryActive.push(item.category_id);
+        if(item.child&&typeof item.child!='undefined'&&item.child.length>0){
+          this.categoryActive.push(item.child[0].category_id);
+          this.changeFunc(item.child[0]);
+        }else{
+          i++;
+          this.autoType(i);
+        }
+      }
+    },
+    /*选择类别*/
+    changeCategory(e){
+      let item= this.$refs['cascader'].getCheckedNodes();
+      this.changeFunc(item[0].data);
+    },
 
 
   }

--
Gitblit v1.9.2