tanghaolin
2022-09-07 f6ed109d2075ec9dd2a15d606be0a43129d080c9
产品搜索增加品牌筛选
已修改3个文件
102 ■■■■■ 文件已修改
src/views/EBook/SeriesListLX.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Select/FindKeyWordsData.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Select/SelParams.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/EBook/SeriesListLX.vue
@@ -16,7 +16,6 @@
      </template>
    </van-nav-bar>
    <!-- 过滤菜单 -->
    <van-dropdown-menu active-color="#528abe" style="flex: 1">
      <van-dropdown-item :title="$t('ebookPage.screen.TR')" ref="filterOne">
        <van-cell left :title="$t('ebookPage.motorFrequency.TR')">
@@ -226,7 +225,7 @@
    },
    //根据电机功率的值筛选泵列表
    getFilterValue() {
      this.$refs.item1.filterOne();
      this.$refs.item1.toggle();
      //console.log(val,777)
      let motorFrequece = this.m_MotorFrequece ? "60" : "50";
      this.m_showPumpList = this.filterSeriseList(
src/views/Select/FindKeyWordsData.vue
@@ -162,7 +162,7 @@
        <!-- 过滤菜单 -->
        <van-dropdown-menu active-color="#528abe" style="flex: 1">
            <van-dropdown-item :title="$t('ebookPage.screen.TR')" ref="filterOne">
            <van-cell left :title="$t('ebookPage.motorFrequency.TR')">
            <van-cell v-if="false" left :title="$t('ebookPage.motorFrequency.TR')">
                <template #right-icon>
                <span style="margin-right: 10px"
                    >{{ m_MotorFrequece ? "60" : "50" }}Hz</span
@@ -224,7 +224,7 @@
            title-style="color:#528abe"
            :title="item.Name"
            :label="item.CatalogName"
            v-for="(item, index) in m_dataList"
            v-for="(item, index) in m_visibleDataList"
            :key="index"
          >
            <template #icon>
@@ -343,7 +343,11 @@
        },
      ],
      m_dataList: [], //查询出来的列表
      m_visibleDataList:[],//用于展示的数据
      m_allBrandList:[],//品牌
      showSearchList: false,
      m_isUL: false, //是否是UL
      m_isFirePump: false, //是否是消防泵
    };
  },
  mounted() {
@@ -388,6 +392,7 @@
              _this.m_historyKeyWords.push(_this.m_keyWord);
            }
            db.set("historyRecord", _this.m_historyKeyWords);
            let brandList = []
            let seriesList = [];
            result.Data.forEach((item) => {
              let productItem = {
@@ -400,10 +405,17 @@
                ThumbnailImage: item.ThumbnailImage,
                Description: item.Description,
              };
            let brandObj = {
              name:item.CorpName,
              isSelect:false
            }
              brandList.push(brandObj)
              seriesList.push(productItem);
            });
            _this.m_dataList = seriesList;
            _this.m_visibleDataList = _this.m_dataList
            _this.m_allBrandList = _this.uniqueCorpList(brandList)
            //console.log(Object.entries(_this.m_ShowSeriesList), 80);
          }
        })
@@ -411,6 +423,40 @@
          Toast.clear();
          console.log(err);
        });
    },
        //根据电机功率的值筛选泵列表
    getFilterValue() {
      this.$refs.filterOne.toggle();
    },
    //根据品牌筛选泵列表
    getFilterBrand() {
      this.$refs.brandFilter.toggle();
      //console.log(val,777)
      let showSeriesList = [];
      let currentSelectBrand = [];
      this.m_allBrandList.forEach((item) => {
        if (item.isSelect) {
          currentSelectBrand.push(item.name);
        }
      });
      if (currentSelectBrand.length == 0) {
      this.m_visibleDataList= this.m_dataList
        return;
      }
      currentSelectBrand.forEach((brand) => {
        this.m_visibleDataList.forEach((series_item) => {
          if (brand == series_item.CorpName) {
            showSeriesList.push(series_item);
          }
        });
      });
    //    console.log(showSeriesList,568)
     this.m_visibleDataList= showSeriesList
    },
        //监听品牌选择
    onChangeBrandSelect(e, index) {
      this.m_allBrandList[index].isSelect = !this.m_allBrandList[index].isSelect;
    },
    //点击历史记录标签搜索
    changeTagSearch(name) {
@@ -432,6 +478,16 @@
        let query = { ID: item.SeriesID };
        this.gotoPage("/EBook/SeriesDetailPump", query, null);
      }
    },
    //公司筛选列表去重
    uniqueCorpList(arr) {
      let map = new Map();
      for (let item of arr) {
        if (!map.has(item.name)) {
          map.set(item.name, item);
        }
      }
      return [...map.values()];
    },
    //返回上一页
    pageBack() {
@@ -503,6 +559,39 @@
      right: 15px;
    }
    }
      .brand-content {
    height: 23vh;
    padding: 0px 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
    overflow: auto;
  }
  .brand-item {
    display: flex;
    flex-direction: column;
    width: 120px;
    height: 32px;
    justify-content: center;
    align-items: center;
    background-color: #f1f2f3;
    border-radius: 20px;
    margin-top: 10px;
    margin-right: 5px;
    box-sizing: border-box;
    span {
      font-size: 12px;
    }
  }
  .brand-item-active {
    border: 1px solid #578ebe;
    background-color: #ecf5ff;
    span {
      font-size: 12px;
      color: #578ebe;
    }
  }
  }
  .kwy-style {
    margin-right: 5px;
src/views/Select/SelParams.vue
@@ -60,9 +60,7 @@
          <van-button
            size="small"
            type="primary"
            @click="m_showDpHuPicker = true"
            >{{ m_DpHuText }}</van-button
          >
            @click="m_showDpHuPicker = true">{{ m_DpHuText }}</van-button>
        </template>
      </van-field>
      <!-- 设置频率 -->