async _handleBrandListScroll() { const { ids, mainScrollerOffset } = this.data; let indexs: number[] = []; // Step 1: 批量处理异步请求 const rectTops = await Promise.all(ids.map(id => queryBoundingClient(this, id))); for (let i = 0; i < rectTops.length; i++) { const [[{ top: rectTop }]] = rectTops[i]; if (typeof rectTop !== 'number') continue; if (rectTop <= mainScrollerOffset) { const idIndexs = getIdIndexs(ids[i]); if (!_.isUndefined(idIndexs)) { indexs = idIndexs; } } else { break; } } const [mainIndex, subIndex] = indexs; if (this.data.currentLeftTabIndex !== mainIndex) { this.setData({ currentLeftTabIndex: mainIndex }); this.updateCurrentTopTabList(mainIndex); } if (this.data.currentTopTabIndex !== subIndex) { this.setData({ currentTopTabIndex: subIndex }); this.updateTopTabsScrollLeft(subIndex); } },