This commit is contained in:
hrx 2025-12-10 13:51:06 +08:00
parent 3f9d89dab5
commit f1aa6f4278

View File

@ -6,8 +6,14 @@
</div> </div>
<!-- 供应商 --> <!-- 供应商 -->
<div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier"> <div v-if="cloudData.secMenu && cloudData.secMenu.length > 0" class="supplier" v-for="(value, index) in cloudData.secMenu" :key="index">
<div class="supplier-title">{{ cloudData.secMenu[0].secTitle }}</div> <div
class="supplier-title"
:class="{ 'active': activeSupplierIndex === index }"
@click="toggleSupplier(index)"
>
{{ value.secTitle }}
</div>
</div> </div>
<!-- 云产品 --> <!-- 云产品 -->
@ -54,6 +60,7 @@ export default {
data() { data() {
return { return {
cloudData: {}, cloudData: {},
activeSupplierIndex: 0//
} }
}, },
created() { created() {
@ -65,6 +72,20 @@ export default {
if (res.status == true) { if (res.status == true) {
this.cloudData = res.data.product_service[0] this.cloudData = res.data.product_service[0]
console.log(this.cloudData); console.log(this.cloudData);
//
// if (this.cloudData.secMenu && this.cloudData.secMenu.length > 0) {
// this.activeSupplierIndex = 0
// }
}
},
//
toggleSupplier(index) {
//
if (this.activeSupplierIndex === index) {
this.activeSupplierIndex = 0
} else {
//
this.activeSupplierIndex = index
} }
} }
} }
@ -89,7 +110,6 @@ export default {
} }
.supplier { .supplier {
display: flex; display: flex;
padding: .22rem; padding: .22rem;
@ -97,8 +117,15 @@ export default {
font-size: .2rem; font-size: .2rem;
color: #000; color: #000;
padding: .1rem .16rem; padding: .1rem .16rem;
background-color: pink; background-color: #eee;
border-radius: 0.08rem; border-radius: 0.08rem;
cursor: pointer;
transition: all 0.3s ease;
&.active {
background: linear-gradient(90deg, #275aff, #2ebdfa);
color: #fff;
}
} }
} }