shish 10 mēneši atpakaļ
vecāks
revīzija
ea4d64a0c8
1 mainītis faili ar 8 papildinājumiem un 25 dzēšanām
  1. 8 25
      hdApp/src/admin/goods/list.vue

+ 8 - 25
hdApp/src/admin/goods/list.vue

@@ -87,7 +87,7 @@
               v-for="(item, index) in priceOptions" 
               v-for="(item, index) in priceOptions" 
               :key="index"
               :key="index"
               class="filter-option"
               class="filter-option"
-              :class="{ 'active': selectedPrice === item.value }"
+              :class="{ 'active': priceType == item.value }"
               @click="selectPrice(item.value)"
               @click="selectPrice(item.value)"
             >
             >
               {{ item.label }}
               {{ item.label }}
@@ -103,7 +103,7 @@
               v-for="(item, index) in stockOptions" 
               v-for="(item, index) in stockOptions" 
               :key="index"
               :key="index"
               class="filter-option"
               class="filter-option"
-              :class="{ 'active': selectedStock === item.value }"
+              :class="{ 'active': hasStock === item.value }"
               @click="selectStock(item.value)"
               @click="selectStock(item.value)"
             >
             >
               {{ item.label }}
               {{ item.label }}
@@ -119,7 +119,7 @@
               v-for="(item, index) in flowerNumOptions" 
               v-for="(item, index) in flowerNumOptions" 
               :key="index"
               :key="index"
               class="filter-option"
               class="filter-option"
-              :class="{ 'active': selectedFlowerNum === item.value }"
+              :class="{ 'active': flowerNum === item.value }"
               @click="selectFlowerNum(item.value)"
               @click="selectFlowerNum(item.value)"
             >
             >
               {{ item.label }}
               {{ item.label }}
@@ -164,9 +164,6 @@ export default {
       priceType:-1, // 0 没价格,1 有价格 
       priceType:-1, // 0 没价格,1 有价格 
       // 新增筛选相关数据
       // 新增筛选相关数据
       showFilterPanel: false,
       showFilterPanel: false,
-      selectedPrice: null,  // 选中的价格筛选
-      selectedStock: null,  // 选中的库存筛选
-      selectedFlowerNum: null,  // 选中的支数筛选
       // 筛选选项配置
       // 筛选选项配置
       priceOptions: [
       priceOptions: [
         { label: '有价格', value: 1 },
         { label: '有价格', value: 1 },
@@ -192,7 +189,7 @@ export default {
   computed: {
   computed: {
     // 检查是否有活跃的筛选条件
     // 检查是否有活跃的筛选条件
     hasActiveFilters() {
     hasActiveFilters() {
-      return this.selectedPrice !== null || this.selectedStock !== null || this.selectedFlowerNum !== null;
+      return this.priceType != -1 || this.flowerNum != 0 || this.hasStock!=-1
     }
     }
   },
   },
 
 
@@ -227,24 +224,17 @@ export default {
     closeFilterPanel() {
     closeFilterPanel() {
       this.showFilterPanel = false;
       this.showFilterPanel = false;
     },
     },
-    
     selectPrice(value) {
     selectPrice(value) {
-      this.selectedPrice = this.selectedPrice === value ? null : value;
+      this.priceType = value
     },
     },
-    
     selectStock(value) {
     selectStock(value) {
-      this.selectedStock = this.selectedStock === value ? null : value;
+      this.hasStock = value
     },
     },
-    
     selectFlowerNum(value) {
     selectFlowerNum(value) {
-      this.selectedFlowerNum = this.selectedFlowerNum === value ? null : value;
+      this.flowerNum = value
     },
     },
-    
     clearFilters() {
     clearFilters() {
-      this.selectedPrice = null;
-      this.selectedStock = null;
-      this.selectedFlowerNum = null;
-      
+
       // 清空后立即更新筛选变量
       // 清空后立即更新筛选变量
       this.priceType = -1;
       this.priceType = -1;
       this.hasStock = -1;
       this.hasStock = -1;
@@ -257,16 +247,9 @@ export default {
       this.resetList();
       this.resetList();
       this.getGoodsList();
       this.getGoodsList();
     },
     },
-    
     confirmFilters() {
     confirmFilters() {
-      // 更新原有的筛选变量以保持兼容性
-      this.priceType = this.selectedPrice || -1;
-      this.hasStock = this.selectedStock || -1;
-      this.flowerNum = this.selectedFlowerNum || 0;
-      
       // 关闭筛选面板
       // 关闭筛选面板
       this.closeFilterPanel();
       this.closeFilterPanel();
-      
       // 重新加载数据
       // 重新加载数据
       this.resetList();
       this.resetList();
       this.getGoodsList();
       this.getGoodsList();