|
@@ -9,6 +9,14 @@
|
|
placeholder="请输入搜索内容"
|
|
placeholder="请输入搜索内容"
|
|
></u-search>
|
|
></u-search>
|
|
</view>
|
|
</view>
|
|
|
|
+ <u-empty
|
|
|
|
+ mode="data"
|
|
|
|
+ v-if="list.length === 0"
|
|
|
|
+ iconSize="120"
|
|
|
|
+ textSize="58"
|
|
|
|
+ text="暂无数据"
|
|
|
|
+ >
|
|
|
|
+ </u-empty>
|
|
<view class="list-box">
|
|
<view class="list-box">
|
|
<view class="list-item-box" v-for="item in list" :key="item.id" @click="onChatClick(item)">
|
|
<view class="list-item-box" v-for="item in list" :key="item.id" @click="onChatClick(item)">
|
|
<view class="main-box">
|
|
<view class="main-box">
|
|
@@ -34,12 +42,13 @@
|
|
<view class="line-box"></view>
|
|
<view class="line-box"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <uni-load-more v-show="visualLoadMore" :status="loadMoreStatus"></uni-load-more>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
- import { onLoad, onReachBottom } from '@dcloudio/uni-app'
|
|
|
|
|
|
+ import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
|
import { query, count } from '@/api/chat.js'
|
|
import { query, count } from '@/api/chat.js'
|
|
|
|
|
|
const uToast = ref()
|
|
const uToast = ref()
|
|
@@ -108,7 +117,24 @@
|
|
url: `/pages/chatDetail/chatDetail?id=${chat.id}&title=${chat.title}`
|
|
url: `/pages/chatDetail/chatDetail?id=${chat.id}&title=${chat.title}`
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ onPullDownRefresh((e) => {
|
|
|
|
+ searchForm.value.pageNumber = 1
|
|
|
|
+ loadMoreStatus.value = 'more'
|
|
|
|
+ query(searchForm.value).then(res => {
|
|
|
|
+ if (res && res.message === 'success') {
|
|
|
|
+ list.value = res.data
|
|
|
|
+ if (res.count === 0) {
|
|
|
|
+ visualLoadMore.value = false
|
|
|
|
+ }
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '刷新成功',
|
|
|
|
+ icon: 'success',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ uni.stopPullDownRefresh()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
|
|
onReachBottom(async () => {
|
|
onReachBottom(async () => {
|
|
if (loadMoreStatus.value === 'noMore') {
|
|
if (loadMoreStatus.value === 'noMore') {
|