| | |
| | | query.select('.select-site').boundingClientRect(rect => { |
| | | if (rect) { |
| | | const contentHeight = rect.height; |
| | | const baseHeight = bannerList.length > 0 ? 266 : contentHeight; |
| | | const baseHeight = 266; |
| | | fullHeight.current = Math.max(contentHeight, baseHeight); |
| | | minHeight.current = baseHeight; |
| | | setBoxHeight(baseHeight); |
| | | } else { |
| | | // 兜底逻辑 |
| | | const baseHeight = bannerList.length > 0 ? 266 : 0; |
| | | minHeight.current = baseHeight; |
| | | fullHeight.current = baseHeight; |
| | | setBoxHeight(baseHeight); |
| | | minHeight.current = 266; |
| | | fullHeight.current = 266; |
| | | setBoxHeight(266); |
| | | } |
| | | }).exec(); |
| | | }, 500); |
| | |
| | | {/* 选择站点 */} |
| | | <View |
| | | className="content-box" |
| | | style={{ height: `${boxHeight}px`, transition: isDragging.current ? 'none' : 'height 0.3s ease-out' }} |
| | | style={{ height: bannerList.length > 0 ? `${boxHeight}px` : `auto`, transition: isDragging.current ? 'none' : 'height 0.3s ease-out' }} |
| | | onTouchStart={handleTouchStart} |
| | | onTouchMove={handleTouchMove} |
| | | onTouchEnd={handleTouchEnd} |