hookehuyr

fix(StudyDetailPage): 调整评论区域底部内边距以避免内容重叠

修复底部操作栏高度动态计算问题,确保评论区域的内边距根据底部操作栏的高度自动调整,避免内容重叠
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
50 50
51 <div class="h-2 bg-gray-100"></div> 51 <div class="h-2 bg-gray-100"></div>
52 52
53 - <div id="comment" class="py-4 px-4 space-y-4"> 53 + <div id="comment" class="py-4 px-4 space-y-4" :style="{ paddingBottom: bottomWrapperHeight }">
54 <div class="flex justify-between items-center mb-4"> 54 <div class="flex justify-between items-center mb-4">
55 <div class="text-gray-900 font-medium text-sm">评论 ({{ comments.length }})</div> 55 <div class="text-gray-900 font-medium text-sm">评论 ({{ comments.length }})</div>
56 <div class="text-gray-500 cursor-pointer text-sm">查看更多</div> 56 <div class="text-gray-500 cursor-pointer text-sm">查看更多</div>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
88 </div> 88 </div>
89 89
90 <!-- 底部操作栏 --> 90 <!-- 底部操作栏 -->
91 - <div class="fixed bottom-0 left-0 right-0 bg-white border-t px-4 py-2 flex items-center space-x-4"> 91 + <div class="fixed bottom-0 left-0 right-0 bg-white border-t px-4 py-2 flex items-center space-x-4 bottom-wrapper">
92 <div class="flex-none flex flex-col items-center gap-1 cursor-pointer active:opacity-80" @click="showCatalog = true"> 92 <div class="flex-none flex flex-col items-center gap-1 cursor-pointer active:opacity-80" @click="showCatalog = true">
93 <van-icon name="bars" class="text-lg text-gray-600" /> 93 <van-icon name="bars" class="text-lg text-gray-600" />
94 <span class="text-xs text-gray-600">课程目录</span> 94 <span class="text-xs text-gray-600">课程目录</span>
...@@ -200,13 +200,18 @@ const comments = ref([ ...@@ -200,13 +200,18 @@ const comments = ref([
200 useTitle('学习详情'); 200 useTitle('学习详情');
201 201
202 const topWrapperHeight = ref(0); 202 const topWrapperHeight = ref(0);
203 +const bottomWrapperHeight = ref(0);
203 204
204 onMounted(() => { 205 onMounted(() => {
205 nextTick(() => { 206 nextTick(() => {
206 const topWrapper = document.querySelector('.top-wrapper'); 207 const topWrapper = document.querySelector('.top-wrapper');
208 + const bottomWrapper = document.querySelector('.bottom-wrapper');
207 if (topWrapper) { 209 if (topWrapper) {
208 topWrapperHeight.value = topWrapper.clientHeight + 'px'; 210 topWrapperHeight.value = topWrapper.clientHeight + 'px';
209 } 211 }
212 + if (bottomWrapper) {
213 + bottomWrapperHeight.value = bottomWrapper.clientHeight + 'px';
214 + }
210 }) 215 })
211 const courseId = route.params.id; 216 const courseId = route.params.id;
212 if (courseId) { 217 if (courseId) {
......