Pārlūkot izejas kodu

初始化的时候不设置滚动动画,发消息才有动画

lifanagju_citu 6 mēneši atpakaļ
vecāks
revīzija
17c5597167
2 mainītis faili ar 11 papildinājumiem un 4 dzēšanām
  1. 9 3
      pagesA/chart/index.vue
  2. 2 1
      pagesB/inviteRecord/index.vue

+ 9 - 3
pagesA/chart/index.vue

@@ -38,7 +38,7 @@
       <uni-notice-bar v-if="hasWaitingProcessingInterview" show-get-more single text="您有待处理的面试邀请,点击查看详情" @click="handleToCenter"/>
     </view>
       <!-- newsId 需要和聊天列表里面的id对应 永远取最后列表中的最后一个就可以做到发送消息即时滚动到底部 -->
-      <scroll-view ref="chatRef" scroll-with-animation :scroll-into-view="newsId" class="box-main" scroll-y="true">
+      <scroll-view ref="chatRef" :scroll-with-animation="scrollAnimation" :scroll-into-view="newsId" class="box-main" scroll-y="true">
         <view class="box-main-more" v-if="hasMore">
           <text @click="handleMore">查看更多</text>
         </view>
@@ -201,7 +201,7 @@
 </template>
 
 <script setup>
-import { ref, watch } from 'vue'
+import { ref, watch, onMounted } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { useIMStore } from '@/store/im'
 import { userStore } from '@/store/user'
@@ -245,12 +245,18 @@ const inputValue = ref('')
 // const chooseInvite = ref(null)
 
 const newsId = ref('') // newsId 需要和聊天列表里面的id对应 永远取最后列表中的最后一个就可以做到发送消息即时滚动到底部
-const scrollInto = ref(0)
+const scrollAnimation = ref(false)
 
 const isSendResume = ref(false)
 const positionInfo = ref({})
 const isEmployment = ref('-1')
 
+onMounted(() => {
+  setTimeout(() => {
+    scrollAnimation.value = true
+  }, 1500)
+})
+
 const {
   conversationList,
   // updateConversation,

+ 2 - 1
pagesB/inviteRecord/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<layout-page>
 		<scroll-view class="scrollBox" scroll-y="true" @scrolltolower="loadingMore" style="height: calc(100vh - 102rpx);">
-			<view v-if="total" class="totalShow">恭喜你,已经邀请{{ total }}个新用户啦!</view>
+			<view v-if="total" class="totalShow">恭喜你,已经成功邀请{{ total }}个新用户啦!</view>
       <view v-if="items.length" class="listBox">
         <!-- <m-list :items="items"></m-list> -->
 				<uni-table ref="table" :loading="loading" border stripe emptyText="暂无更多数据" style="width: 100%;">
@@ -110,5 +110,6 @@ function loadingMore () {
 }
 .totalShow {
 	margin: 30rpx 0 0 30rpx;
+	color: #333;
 }
 </style>