chore:二级分类按钮显示

This commit is contained in:
2026-07-18 11:13:34 +08:00
parent d8816bbe42
commit 81ecd45de4

View File

@@ -180,7 +180,7 @@
<view class="categoty-goods-wrap" v-if="loadType == 'part'"
:style="'padding-top:' + (value.search ? 0 : '20rpx')">
<!-- 分类筛选 -->
<block v-if="category.child_list && value.goodsLevel == 2">
<block v-if="(value.template == 4 ? (currentOneCategory && currentOneCategory.child_list) : category.child_list) && value.goodsLevel == 2">
<view class="screen-category-wrap">
<scroll-view scroll-x="true" class="screen-category"
:class="{ 'screen-category-4': value.template == 4 }" :scroll-with-animation="true"
@@ -189,7 +189,7 @@
@tap.stop="selectCategory(-1)">{{ $lang('components-diy.diy-category-item.all') }}</view>
<view class="item" :id="'category-2-' + oneIndex"
:class="{ selected: categoryId == oneIndex }" @tap.stop="selectCategory(oneIndex)"
v-for="(one, oneIndex) in category.child_list" :key="oneIndex">
v-for="(one, oneIndex) in (value.template == 4 ? currentOneCategory.child_list : category.child_list)" :key="oneIndex">
{{ one.category_name }}
</view>
</scroll-view>
@@ -201,7 +201,7 @@
:class="{ 'screen-category-4': value.template == 4 }">
<view class="title">{{ $lang('components-diy.diy-category-item.all') }}</view>
<view class="item" :class="{ selected: categoryId == oneIndex }"
@tap.stop="selectCategory(oneIndex)" v-for="(one, oneIndex) in category.child_list"
@tap.stop="selectCategory(oneIndex)" v-for="(one, oneIndex) in (value.template == 4 ? currentOneCategory.child_list : category.child_list)"
:key="oneIndex">
{{ one.category_name }}
</view>
@@ -745,8 +745,8 @@ export default {
data: {
page: this.pageIndex,
page_size: this.pageSize,
category_id: this.categoryId != -1 ? this.category.child_list[this.categoryId]
.category_id : this.category.category_id,
category_id: this.categoryId != -1 ? (this.value.template == 4 && this.currentOneCategory && this.currentOneCategory.child_list ? this.currentOneCategory.child_list[this.categoryId].category_id : this.category.child_list[this.categoryId].category_id)
: this.category.category_id,
order: order,
sort: sort
},