chore:二级标题按钮和一级标题第一个对齐

This commit is contained in:
2026-07-22 17:49:08 +08:00
parent 25fc8311f8
commit 658396c9a3
2 changed files with 23 additions and 19 deletions

View File

@@ -2404,6 +2404,7 @@ export default {
align-items: center;
justify-content: flex-start;
padding: 20rpx 20rpx 20rpx 24rpx;
min-height: 96rpx;
background: #fff;
border-bottom: 1rpx solid #f0f0f0;
box-sizing: border-box;

View File

@@ -299,12 +299,20 @@ export default {
})
.exec();
if (this.value.template == 1) this.getHeightArea(-1);
if (this.value.template == 99) this.getOneCategoryItemHeight(0);
}, 500);
},
watch: {
// 组件刷新监听
componentRefresh: function (nval) { }
componentRefresh: function (nval) { },
categoryTreeLoading: function (nval, oval) {
if (nval === false && oval === true && this.value.template == 99) {
this.$nextTick(() => {
setTimeout(() => {
this.measureFirstCategoryItemHeight();
}, 500);
});
}
}
},
computed: {
cartTotalMoney() {
@@ -378,6 +386,18 @@ export default {
this.$store.dispatch('getCartNumber');
if (!this.heightArea.length) this.getHeightArea(-1);
},
measureFirstCategoryItemHeight() {
if (this.value.template != 99) return;
const query = uni.createSelectorQuery().in(this);
query
.selectAll('.tree-wrap .category-item')
.boundingClientRect(data => {
if (data && data.length > 0 && data[0].height) {
this.oneCategoryItemHeight = data[0].height;
}
})
.exec();
},
/**
* 获取高度区间
*
@@ -534,23 +554,6 @@ export default {
this.select = index;
this.categoryId = 'category-' + index;
this.scrollLock = true;
this.getOneCategoryItemHeight(index);
},
getOneCategoryItemHeight(index) {
setTimeout(() => {
const newQuery = uni.createSelectorQuery && uni.createSelectorQuery().in(this);
if (!newQuery || typeof newQuery.selectAll !== 'function') {
return;
}
newQuery
.selectAll('.category-item-wrap .category-item')
.boundingClientRect(data => {
if (data && data.length > index && data[index].height) {
this.oneCategoryItemHeight = data[index].height;
}
})
.exec();
}, 200);
},
saveSecondCategoryName(name) {
this.lastSecondCategoryName = name;