From d8816bbe422185b75cc4fcc5cd73d51a5c7dfe6d Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Sat, 18 Jul 2026 10:31:35 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E8=BF=98=E5=8E=9F=E5=88=B0?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF3=E4=BA=8C=E7=BA=A7=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components-diy/diy-category-item.vue | 34 +++++++++++----------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue index 042f33b..0e45101 100644 --- a/components-diy/diy-category-item.vue +++ b/components-diy/diy-category-item.vue @@ -180,7 +180,7 @@ - + {{ $lang('components-diy.diy-category-item.all') }} + v-for="(one, oneIndex) in category.child_list" :key="oneIndex"> {{ one.category_name }} @@ -201,7 +201,7 @@ :class="{ 'screen-category-4': value.template == 4 }"> {{ $lang('components-diy.diy-category-item.all') }} {{ one.category_name }} @@ -630,7 +630,6 @@ export default { }, watch: { oneCategorySelect: function () { - if (this.index != this.select) return; this.scrollTop = -1; this.goodsList = []; this.selectCategory(-1); @@ -638,7 +637,6 @@ export default { select: function () { if (this.index == this.select) { this.scrollTop = 0; - this.categoryId = -1; if (this.pageIndex == 0) { this.getGoodsList(); } else if (this.$refs.loadingCover && this.loadType == 'part') { @@ -742,14 +740,13 @@ export default { sort = 'desc'; } } - const childList = this.value.template == 4 && this.currentOneCategory ? this.currentOneCategory.child_list : this.category.child_list; - const baseCategoryId = this.value.template == 4 && this.currentOneCategory ? this.currentOneCategory.category_id : this.category.category_id; this.$api.sendRequest({ url: '/api/goodssku/pageByCategory', data: { page: this.pageIndex, page_size: this.pageSize, - category_id: this.categoryId != -1 ? childList[this.categoryId].category_id : baseCategoryId, + category_id: this.categoryId != -1 ? this.category.child_list[this.categoryId] + .category_id : this.category.category_id, order: order, sort: sort }, @@ -1057,7 +1054,6 @@ export default { * @param {Object} action */ switchCategory(action) { - const childList = this.value.template == 4 && this.currentOneCategory ? this.currentOneCategory.child_list : this.category.child_list; if (action == 'prev') { if (this.categoryId == -1) { let index = this.index - 1; @@ -1068,7 +1064,7 @@ export default { this.selectCategory(index); } } else { - if (this.categoryId == -1 || (childList && this.categoryId == childList.length - 1)) { + if (this.categoryId == -1 || (this.category.child_list && this.categoryId == this.category.child_list.length - 1)) { let index = this.index + 1; this.$emit('switch', index); } else { @@ -2242,7 +2238,6 @@ export default { flex: 1; height: 0; transform: translateX(0px); - margin-top: -50rpx; } } @@ -2259,7 +2254,7 @@ export default { .screen-category { flex: 1; width: 0; - padding: 0 0 10rpx 0; + padding: 0 0 20rpx 0; white-space: nowrap; height: 60rpx; @@ -2269,7 +2264,7 @@ export default { background: #f5f5f5; color: #666; margin-right: 20rpx; - border-radius: 8rpx; + border-radius: 40rpx; &.selected { background-color: $base-color; @@ -2338,17 +2333,14 @@ export default { } .screen-category-4 .item { - background-color: #fff !important; - padding: 16rpx 40rpx; + background-color: #f2f2f2 !important; + padding: 10rpx 24rpx; line-height: 1; - font-size: 28rpx; - border: 1rpx solid #eee; - border-radius: 12rpx !important; + font-size: $font-size-tag; &.selected { - background-color: $base-color !important; - color: #fff; - border-color: $base-color; + background-color: var(--main-color-shallow) !important; + color: var(--main-color); } }