Compare commits
No commits in common. "1f9057a38a720bb8722fa0dbd96357a35a44333c" and "23057efe1fe4775e9dd08e2cd3eb2895552c0df4" have entirely different histories.
1f9057a38a
...
23057efe1f
@ -4,22 +4,7 @@
|
|||||||
<div class="top-tit">
|
<div class="top-tit">
|
||||||
开元云
|
开元云
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索 -->
|
|
||||||
<div class="search">
|
|
||||||
<div class="search-box">
|
|
||||||
<div class="input">
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="请输入产品名称"
|
|
||||||
v-model="searchValue"
|
|
||||||
@keyup.enter="handleSearch"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="search-btn" @click="handleSearch">
|
|
||||||
搜索
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 供应商 -->
|
<!-- 供应商 -->
|
||||||
<div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier-container">
|
<div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier-container">
|
||||||
<div
|
<div
|
||||||
@ -47,7 +32,6 @@
|
|||||||
v-for="product in thrMenu.value"
|
v-for="product in thrMenu.value"
|
||||||
:key="product.id"
|
:key="product.id"
|
||||||
class="box-item"
|
class="box-item"
|
||||||
v-show="shouldShowProduct(product)"
|
|
||||||
>
|
>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<div class="item-tit">
|
<div class="item-tit">
|
||||||
@ -99,8 +83,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
cloudData: {},
|
cloudData: {},
|
||||||
activeSupplierIndex: 0, // 默认选中第一个供应商
|
activeSupplierIndex: 0, // 默认选中第一个供应商
|
||||||
searchValue: '', // 搜索关键词
|
|
||||||
isSearching: false, // 是否正在搜索
|
|
||||||
|
|
||||||
// 咨询弹窗相关
|
// 咨询弹窗相关
|
||||||
showConsultDialog: false,
|
showConsultDialog: false,
|
||||||
@ -134,26 +116,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理搜索
|
|
||||||
handleSearch() {
|
|
||||||
this.isSearching = !!this.searchValue.trim()
|
|
||||||
// 这里可以根据需要添加实际的搜索逻辑,比如调用API
|
|
||||||
console.log('搜索关键词:', this.searchValue)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 判断产品是否应该显示
|
|
||||||
shouldShowProduct(product) {
|
|
||||||
if (!this.isSearching) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// 模糊搜索:检查产品名称或描述中是否包含搜索关键词
|
|
||||||
const keyword = this.searchValue.toLowerCase().trim()
|
|
||||||
return (
|
|
||||||
(product.name && product.name.toLowerCase().includes(keyword)) ||
|
|
||||||
(product.description && product.description.toLowerCase().includes(keyword))
|
|
||||||
)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选择供应商
|
// 选择供应商
|
||||||
selectSupplier(index) {
|
selectSupplier(index) {
|
||||||
this.activeSupplierIndex = index
|
this.activeSupplierIndex = index
|
||||||
|
|||||||
@ -4,22 +4,6 @@
|
|||||||
<div class="top-tit">
|
<div class="top-tit">
|
||||||
开元云
|
开元云
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索 -->
|
|
||||||
<div class="search">
|
|
||||||
<div class="search-box">
|
|
||||||
<div class="input">
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="请输入产品名称"
|
|
||||||
v-model="searchValue"
|
|
||||||
@keyup.enter="handleSearch"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="search-btn" @click="handleSearch">
|
|
||||||
搜索
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 供应商 -->
|
<!-- 供应商 -->
|
||||||
<div class="supplier-container">
|
<div class="supplier-container">
|
||||||
@ -35,7 +19,7 @@
|
|||||||
<!-- 只显示当前选中的供应商的产品 -->
|
<!-- 只显示当前选中的供应商的产品 -->
|
||||||
<template v-if="cloudData.secMenu && cloudData.secMenu.length > 0 && activeSupplierIndex >= 0">
|
<template v-if="cloudData.secMenu && cloudData.secMenu.length > 0 && activeSupplierIndex >= 0">
|
||||||
<template v-for="thrMenu in cloudData.secMenu[activeSupplierIndex].thrMenu">
|
<template v-for="thrMenu in cloudData.secMenu[activeSupplierIndex].thrMenu">
|
||||||
<div v-for="product in thrMenu.value" :key="product.id" class="box-item" v-show="shouldShowProduct(product)">
|
<div v-for="product in thrMenu.value" :key="product.id" class="box-item">
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<div class="item-tit">
|
<div class="item-tit">
|
||||||
{{ product.name }}
|
{{ product.name }}
|
||||||
@ -83,8 +67,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
cloudData: {},
|
cloudData: {},
|
||||||
activeSupplierIndex: 0, // 默认选中第一个供应商
|
activeSupplierIndex: 0, // 默认选中第一个供应商
|
||||||
searchValue: '', // 搜索关键词
|
|
||||||
isSearching: false, // 是否正在搜索
|
|
||||||
|
|
||||||
// 咨询弹窗相关
|
// 咨询弹窗相关
|
||||||
showConsultDialog: false,
|
showConsultDialog: false,
|
||||||
@ -116,27 +98,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 处理搜索
|
|
||||||
handleSearch() {
|
|
||||||
this.isSearching = !!this.searchValue.trim()
|
|
||||||
console.log('搜索关键词:', this.searchValue)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 判断产品是否应该显示
|
|
||||||
shouldShowProduct(product) {
|
|
||||||
if (!this.isSearching) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// 模糊搜索
|
|
||||||
const keyword = this.searchValue.toLowerCase().trim()
|
|
||||||
return (
|
|
||||||
(product.name && product.name.toLowerCase().includes(keyword)) ||
|
|
||||||
(product.description && product.description.toLowerCase().includes(keyword)) ||
|
|
||||||
(product.label && product.label.toLowerCase().includes(keyword)) ||
|
|
||||||
(product.ssecTitle && product.ssecTitle.toLowerCase().includes(keyword))
|
|
||||||
)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 判断是否显示供应商标签
|
// 判断是否显示供应商标签
|
||||||
showProductDesc(product) {
|
showProductDesc(product) {
|
||||||
// 如果是百度云且有label字段
|
// 如果是百度云且有label字段
|
||||||
|
|||||||
@ -111,42 +111,8 @@
|
|||||||
.search {
|
.search {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0.2rem 0;
|
margin: 0.2rem 0;
|
||||||
padding: 0.2rem;
|
|
||||||
}
|
|
||||||
.search .search-box {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #f3f3f3;
|
|
||||||
border-radius: 0.24rem;
|
|
||||||
}
|
}
|
||||||
.search .search-btn {
|
.search .search-btn {
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 0.2rem;
|
font-size: 0.2rem;
|
||||||
width: 18%;
|
|
||||||
color: #fff;
|
|
||||||
padding: 0.2rem 0;
|
|
||||||
background: linear-gradient(90deg, #1f70ff, #3a8cff);
|
|
||||||
border-bottom-right-radius: 0.24rem;
|
|
||||||
border-top-right-radius: 0.24rem;
|
|
||||||
font-size: 0.24rem;
|
|
||||||
}
|
|
||||||
.search .input {
|
|
||||||
width: 80%;
|
|
||||||
padding: 0.2rem 0;
|
|
||||||
padding-left: 0.2rem;
|
|
||||||
}
|
|
||||||
.search .input input {
|
|
||||||
border: none;
|
|
||||||
/* 去除边框 */
|
|
||||||
outline: none;
|
|
||||||
/* 去除焦点时的外框 */
|
|
||||||
background: none;
|
|
||||||
/* 去除背景色 */
|
|
||||||
padding: 0;
|
|
||||||
/* 去除内边距 */
|
|
||||||
margin: 0;
|
|
||||||
/* 去除外边距,根据需要设置 */
|
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,24 +5,20 @@
|
|||||||
-webkit-background-clip: text;
|
-webkit-background-clip: text;
|
||||||
-webkit-text-fill-color: transparent;
|
-webkit-text-fill-color: transparent;
|
||||||
background-clip: text;
|
background-clip: text;
|
||||||
font-size: .39rem;
|
font-size: .39rem; /* 增大30%: .3rem * 1.3 = .39rem */
|
||||||
/* 增大30%: .3rem * 1.3 = .39rem */
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: .3rem 0;
|
margin: .3rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.supplier-container {
|
.supplier-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap; /* 允许换行 */
|
||||||
/* 允许换行 */
|
|
||||||
padding: .2rem .22rem;
|
padding: .2rem .22rem;
|
||||||
gap: .15rem;
|
gap: .15rem; /* 使用gap控制间距 */
|
||||||
/* 使用gap控制间距 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.supplier {
|
.supplier {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0; /* 防止收缩 */
|
||||||
/* 防止收缩 */
|
|
||||||
|
|
||||||
.supplier-title {
|
.supplier-title {
|
||||||
font-size: .28rem;
|
font-size: .28rem;
|
||||||
@ -33,8 +29,7 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
white-space: nowrap;
|
white-space: nowrap; /* 防止文字换行 */
|
||||||
/* 防止文字换行 */
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
@ -57,7 +52,6 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 .3rem;
|
padding: 0 .3rem;
|
||||||
|
|
||||||
.box-item {
|
.box-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 48%;
|
width: 48%;
|
||||||
@ -81,14 +75,12 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: .1rem;
|
margin-bottom: .1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-detail{
|
.item-detail{
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size: .22rem;
|
font-size: .22rem;
|
||||||
margin: .15rem 0;
|
margin: .15rem 0;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-desc{
|
.item-desc{
|
||||||
color: #666;
|
color: #666;
|
||||||
background-color: #f8f9fa;
|
background-color: #f8f9fa;
|
||||||
@ -98,12 +90,10 @@
|
|||||||
margin-bottom: .15rem;
|
margin-bottom: .15rem;
|
||||||
border: .01rem solid #e9ecef;
|
border: .01rem solid #e9ecef;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-btn{
|
.item-btn{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
||||||
.btn{
|
.btn{
|
||||||
background: linear-gradient(90deg, #1f70ff, #3a8cff);
|
background: linear-gradient(90deg, #1f70ff, #3a8cff);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -123,49 +113,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.search{
|
.search{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: .2rem 0;
|
margin: .2rem 0;
|
||||||
padding: .2rem;
|
|
||||||
|
|
||||||
.search-box {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #f3f3f3;
|
|
||||||
border-radius: .24rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-btn{
|
.search-btn{
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: .2rem;
|
font-size: .2rem;
|
||||||
width: 18%;
|
|
||||||
color: #fff;
|
|
||||||
padding: .2rem 0;
|
|
||||||
background: linear-gradient(90deg, #1f70ff, #3a8cff);
|
|
||||||
border-bottom-right-radius: .24rem;
|
|
||||||
border-top-right-radius: .24rem;
|
|
||||||
font-size: .24rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
width: 80%;
|
|
||||||
padding: .2rem 0;
|
|
||||||
padding-left: .2rem;
|
|
||||||
input {
|
|
||||||
border: none;
|
|
||||||
/* 去除边框 */
|
|
||||||
outline: none;
|
|
||||||
/* 去除焦点时的外框 */
|
|
||||||
background: none;
|
|
||||||
/* 去除背景色 */
|
|
||||||
padding: 0;
|
|
||||||
/* 去除内边距 */
|
|
||||||
margin: 0;
|
|
||||||
/* 去除外边距,根据需要设置 */
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,45 +117,3 @@
|
|||||||
transform: translateY(-0.02rem);
|
transform: translateY(-0.02rem);
|
||||||
box-shadow: 0 0.04rem 0.1rem rgba(31, 112, 255, 0.3);
|
box-shadow: 0 0.04rem 0.1rem rgba(31, 112, 255, 0.3);
|
||||||
}
|
}
|
||||||
.search {
|
|
||||||
width: 100%;
|
|
||||||
margin: 0.2rem 0;
|
|
||||||
padding: 0.2rem;
|
|
||||||
}
|
|
||||||
.search .search-box {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #f3f3f3;
|
|
||||||
border-radius: 0.24rem;
|
|
||||||
}
|
|
||||||
.search .search-btn {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 0.2rem;
|
|
||||||
width: 18%;
|
|
||||||
color: #fff;
|
|
||||||
padding: 0.2rem 0;
|
|
||||||
background: linear-gradient(90deg, #1f70ff, #3a8cff);
|
|
||||||
border-bottom-right-radius: 0.24rem;
|
|
||||||
border-top-right-radius: 0.24rem;
|
|
||||||
font-size: 0.24rem;
|
|
||||||
}
|
|
||||||
.search .input {
|
|
||||||
width: 80%;
|
|
||||||
padding: 0.2rem 0;
|
|
||||||
padding-left: 0.2rem;
|
|
||||||
}
|
|
||||||
.search .input input {
|
|
||||||
border: none;
|
|
||||||
/* 去除边框 */
|
|
||||||
outline: none;
|
|
||||||
/* 去除焦点时的外框 */
|
|
||||||
background: none;
|
|
||||||
/* 去除背景色 */
|
|
||||||
padding: 0;
|
|
||||||
/* 去除内边距 */
|
|
||||||
margin: 0;
|
|
||||||
/* 去除外边距,根据需要设置 */
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -134,48 +134,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.search {
|
|
||||||
width: 100%;
|
|
||||||
margin: .2rem 0;
|
|
||||||
padding: .2rem;
|
|
||||||
|
|
||||||
.search-box {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #f3f3f3;
|
|
||||||
border-radius: .24rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-btn {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: .2rem;
|
|
||||||
width: 18%;
|
|
||||||
color: #fff;
|
|
||||||
padding: .2rem 0;
|
|
||||||
background: linear-gradient(90deg, #1f70ff, #3a8cff);
|
|
||||||
border-bottom-right-radius: .24rem;
|
|
||||||
border-top-right-radius: .24rem;
|
|
||||||
font-size: .24rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
width: 80%;
|
|
||||||
padding: .2rem 0;
|
|
||||||
padding-left: .2rem;
|
|
||||||
input {
|
|
||||||
border: none;
|
|
||||||
/* 去除边框 */
|
|
||||||
outline: none;
|
|
||||||
/* 去除焦点时的外框 */
|
|
||||||
background: none;
|
|
||||||
/* 去除背景色 */
|
|
||||||
padding: 0;
|
|
||||||
/* 去除内边距 */
|
|
||||||
margin: 0;
|
|
||||||
/* 去除外边距,根据需要设置 */
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,22 +4,7 @@
|
|||||||
<div class="top-tit">
|
<div class="top-tit">
|
||||||
开元云
|
开元云
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索 -->
|
|
||||||
<div class="search">
|
|
||||||
<div class="search-box">
|
|
||||||
<div class="input">
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="请输入产品名称"
|
|
||||||
v-model="searchValue"
|
|
||||||
@keyup.enter="handleSearch"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="search-btn" @click="handleSearch">
|
|
||||||
搜索
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 供应商 -->
|
<!-- 供应商 -->
|
||||||
<div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier-container">
|
<div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier-container">
|
||||||
<div
|
<div
|
||||||
@ -47,7 +32,6 @@
|
|||||||
v-for="product in thrMenu.value"
|
v-for="product in thrMenu.value"
|
||||||
:key="product.id"
|
:key="product.id"
|
||||||
class="box-item"
|
class="box-item"
|
||||||
v-show="shouldShowProduct(product)"
|
|
||||||
>
|
>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<div class="item-tit">
|
<div class="item-tit">
|
||||||
@ -92,14 +76,13 @@ import { reqProductConsult } from '@/api/H5/index'
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ProductConsultDialog,
|
ProductConsultDialog,
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cloudData: {},
|
cloudData: {},
|
||||||
activeSupplierIndex: 0, // 默认选中第一个供应商
|
activeSupplierIndex: 0, // 默认选中第一个供应商
|
||||||
searchValue: '', // 搜索关键词
|
|
||||||
isSearching: false, // 是否正在搜索
|
|
||||||
|
|
||||||
// 咨询弹窗相关
|
// 咨询弹窗相关
|
||||||
showConsultDialog: false,
|
showConsultDialog: false,
|
||||||
@ -133,25 +116,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理搜索
|
|
||||||
handleSearch() {
|
|
||||||
this.isSearching = !!this.searchValue.trim()
|
|
||||||
console.log('搜索关键词:', this.searchValue)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 判断产品是否应该显示
|
|
||||||
shouldShowProduct(product) {
|
|
||||||
if (!this.isSearching) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// 模糊搜索
|
|
||||||
const keyword = this.searchValue.toLowerCase().trim()
|
|
||||||
return (
|
|
||||||
(product.name && product.name.toLowerCase().includes(keyword)) ||
|
|
||||||
(product.description && product.description.toLowerCase().includes(keyword))
|
|
||||||
)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选择供应商
|
// 选择供应商
|
||||||
selectSupplier(index) {
|
selectSupplier(index) {
|
||||||
this.activeSupplierIndex = index
|
this.activeSupplierIndex = index
|
||||||
|
|||||||
@ -6,20 +6,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<div class="search-box">
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input
|
<input type="text" placeholder="请输入产品名称" v-model="searchValue"></input>
|
||||||
type="text"
|
|
||||||
placeholder="请输入产品名称"
|
|
||||||
v-model="searchValue"
|
|
||||||
@keyup.enter="handleSearch"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="search-btn" @click="handleSearch">
|
<div class="search-btn">
|
||||||
搜索
|
搜索
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<!-- 供应商 -->
|
<!-- 供应商 -->
|
||||||
<div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier-container">
|
<div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier-container">
|
||||||
<div v-for="(value, index) in cloudData.secMenu" :key="index" class="supplier" @click="selectSupplier(index)">
|
<div v-for="(value, index) in cloudData.secMenu" :key="index" class="supplier" @click="selectSupplier(index)">
|
||||||
@ -35,7 +28,7 @@
|
|||||||
<template v-if="cloudData.secMenu && cloudData.secMenu.length > 0 && activeSupplierIndex >= 0">
|
<template v-if="cloudData.secMenu && cloudData.secMenu.length > 0 && activeSupplierIndex >= 0">
|
||||||
<template v-for="thrMenu in cloudData.secMenu[activeSupplierIndex].thrMenu">
|
<template v-for="thrMenu in cloudData.secMenu[activeSupplierIndex].thrMenu">
|
||||||
<!-- 循环每个分类下的产品 -->
|
<!-- 循环每个分类下的产品 -->
|
||||||
<div v-for="product in thrMenu.value" :key="product.id" class="box-item" v-show="shouldShowProduct(product)">
|
<div v-for="product in thrMenu.value" :key="product.id" class="box-item">
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<div class="item-tit">
|
<div class="item-tit">
|
||||||
{{ product.name }}
|
{{ product.name }}
|
||||||
@ -80,8 +73,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
cloudData: {},
|
cloudData: {},
|
||||||
activeSupplierIndex: 0, // 默认选中第一个供应商
|
activeSupplierIndex: 0, // 默认选中第一个供应商
|
||||||
searchValue: '', // 搜索关键词
|
|
||||||
isSearching: false, // 是否正在搜索
|
|
||||||
|
|
||||||
// 咨询弹窗相关
|
// 咨询弹窗相关
|
||||||
showConsultDialog: false,
|
showConsultDialog: false,
|
||||||
@ -115,25 +106,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理搜索
|
|
||||||
handleSearch() {
|
|
||||||
this.isSearching = !!this.searchValue.trim()
|
|
||||||
console.log('搜索关键词:', this.searchValue)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 判断产品是否应该显示
|
|
||||||
shouldShowProduct(product) {
|
|
||||||
if (!this.isSearching) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// 模糊搜索:检查产品名称或分类名称中是否包含搜索关键词
|
|
||||||
const keyword = this.searchValue.toLowerCase().trim()
|
|
||||||
return (
|
|
||||||
(product.name && product.name.toLowerCase().includes(keyword)) ||
|
|
||||||
(this.currentCategory && this.currentCategory.thrTitle && this.currentCategory.thrTitle.toLowerCase().includes(keyword))
|
|
||||||
)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选择供应商
|
// 选择供应商
|
||||||
selectSupplier(index) {
|
selectSupplier(index) {
|
||||||
this.activeSupplierIndex = index
|
this.activeSupplierIndex = index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user