Browse Source

fix:优化游记详情评论

qiao 3 months ago
parent
commit
1b8b35aa0f
2 changed files with 6 additions and 5 deletions
  1. 1 4
      src/pages/travel-notes/index.vue
  2. 5 1
      src/pages/yj/[id].vue

+ 1 - 4
src/pages/travel-notes/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="">
     <!-- <Navbar :title="`${menuName ?? ''}精品旅游`" /> -->
-    <div v-if="filterList.length" class="sticky top-0 z-50 bg-white w-full">
+    <div v-if="filterList.length" class="sticky top-60 z-50 bg-white w-full border-t">
       <van-dropdown-menu active-color="#FF9300" ref="dropDownMenuRef">
         <van-dropdown-item @closed="onAreaFilterClose" :title="areaFilterTitle" ref="itemRef">
           <van-tree-select @click-nav="handleAreaClick" @click-item="handleFilterClick" v-model:active-id="activeId"
@@ -36,9 +36,6 @@
                 <div class="flex items-center mr-10">
                   <van-icon name="good-job-o" class="mr-5" />{{ transferCount(itemData.likeCount) }}
                 </div>
-                <!-- <div class="flex items-center mr-10">
-                  <van-icon name="like-o" class="mr-5" />{{ itemData.hotValue }}
-                </div> -->
               </div>
             </div>
             <div class="w-full h-10 absolute top-[100%] left-0 flex items-center justify-between">

+ 5 - 1
src/pages/yj/[id].vue

@@ -129,7 +129,7 @@
         </div>
         <template v-if="commentList.length">
           <template v-for="item in commentList" :key="item.id">
-            <div class="flex mt-10 justify-between">
+            <div class="flex mt-10 justify-between" id="commentsBox">
               <div class="w-[32px] h-[32px] bg-[#ddd] rounded-full shrink-0">
                 <img v-if="item?.headImageUrlDictMap?.name" class="w-full h-full object-cover rounded-full"
                   :src="item?.headImageUrlDictMap?.name" alt="">
@@ -461,6 +461,10 @@ async function addComment() {
     showToast('评论发布成功')
     getComments()
     showEmoji.value = false
+    document.querySelector('#commentsBox').scrollIntoView({
+      behavior: 'smooth',
+      block: 'start' 
+    })
   }).finally(() => canAddComment.value = true, replyComment.value = {}, cursorIndex.value = 0)
 }
 function pageClick() {