|
@@ -26,6 +26,14 @@
|
|
></u-tabs>
|
|
></u-tabs>
|
|
</view>
|
|
</view>
|
|
</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="onClickReport(item)">
|
|
<view class="list-item-box" v-for="item in list" :key="item.id" @click="onClickReport(item)">
|
|
<view class="icon-box">
|
|
<view class="icon-box">
|
|
@@ -36,7 +44,7 @@
|
|
{{item.title}}
|
|
{{item.title}}
|
|
</view>
|
|
</view>
|
|
<view class="text">
|
|
<view class="text">
|
|
- 【{{item.type}}】
|
|
|
|
|
|
+ 【{{item.typeName}}】
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="suffix-box">
|
|
<view class="suffix-box">
|
|
@@ -46,12 +54,14 @@
|
|
</view>
|
|
</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 } from '@dcloudio/uni-app'
|
|
|
|
|
|
+ import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
|
|
|
+ import { query } from '@/api/collect.js'
|
|
|
|
|
|
const searchInputStyle = {
|
|
const searchInputStyle = {
|
|
backgroundColor: '#E5E5E5'
|
|
backgroundColor: '#E5E5E5'
|
|
@@ -70,50 +80,52 @@
|
|
value: 2
|
|
value: 2
|
|
},
|
|
},
|
|
]
|
|
]
|
|
|
|
+ const pageNum = ref(1)
|
|
|
|
+ const pageSize = ref(10)
|
|
|
|
+ const visualLoadMore = ref(false)
|
|
|
|
+ const loadMoreStatus = ref('more')
|
|
const searchForm = ref({
|
|
const searchForm = ref({
|
|
keyword: '',
|
|
keyword: '',
|
|
- type: 0
|
|
|
|
|
|
+ type: 0,
|
|
|
|
+ pageNumber: 1,
|
|
|
|
+ pageSize: 10
|
|
})
|
|
})
|
|
|
|
|
|
const list = ref([
|
|
const list = ref([
|
|
{
|
|
{
|
|
id: '01',
|
|
id: '01',
|
|
title: '2024年11月关注是中介促成二手住宅市场交易简报',
|
|
title: '2024年11月关注是中介促成二手住宅市场交易简报',
|
|
- type: '月度成交简报',
|
|
|
|
|
|
+ type: 1,
|
|
|
|
+ typeName: '月度成交简报',
|
|
isNew: true
|
|
isNew: true
|
|
},
|
|
},
|
|
- {
|
|
|
|
- id: '02',
|
|
|
|
- title: '客户需求理解与匹配',
|
|
|
|
- type: '精英修炼营',
|
|
|
|
- isNew: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: '03',
|
|
|
|
- title: '2024年11月关注是中介促成二手住宅市场交易简报',
|
|
|
|
- type: '月度成交简报',
|
|
|
|
- isNew: false
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: '04',
|
|
|
|
- title: '客户需求理解与匹配',
|
|
|
|
- type: '精英修炼营',
|
|
|
|
- isNew: false
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: '05',
|
|
|
|
- title: '2024年11月关注是中介促成二手住宅市场交易简报',
|
|
|
|
- type: '月度成交简报',
|
|
|
|
- isNew: false
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: '06',
|
|
|
|
- title: '客户需求理解与匹配',
|
|
|
|
- type: '精英修炼营',
|
|
|
|
- isNew: false
|
|
|
|
- },
|
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
+ function onSearchConfirm() {
|
|
|
|
+ searchForm.value.pageNumber = 1
|
|
|
|
+ pageNum.value = 1
|
|
|
|
+ onSearch()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function onSearchClear() {
|
|
|
|
+ searchForm.value.keyword = null
|
|
|
|
+ searchForm.value.pageNumber = 1
|
|
|
|
+ pageNum.value = 1
|
|
|
|
+ onSearch()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function onSearch() {
|
|
|
|
+ loadMoreStatus.value = 'more'
|
|
|
|
+ query(searchForm.value).then(res => {
|
|
|
|
+ if (res && res.message === 'success') {
|
|
|
|
+ list.value = res.data
|
|
|
|
+ if (res.count === 0) {
|
|
|
|
+ visualLoadMore.value = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
function onSearchTypeChange(val) {}
|
|
function onSearchTypeChange(val) {}
|
|
|
|
|
|
function onClickReport(report) {
|
|
function onClickReport(report) {
|
|
@@ -121,9 +133,62 @@
|
|
url: `/pages/reportDetail/reportDetail?id=${report.id}&title=${report.title}`
|
|
url: `/pages/reportDetail/reportDetail?id=${report.id}&title=${report.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 () => {
|
|
|
|
+ if (loadMoreStatus.value === 'noMore') {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '没有更多啦>﹏<',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ visualLoadMore.value = true
|
|
|
|
+ loadMoreStatus.value = 'loading'
|
|
|
|
+ searchForm.value.pageNum++
|
|
|
|
+ query(searchForm.value).then(res => {
|
|
|
|
+ if (res && res.message === 'success') {
|
|
|
|
+ if (res.data) {
|
|
|
|
+ if (res.count >= list.value.length) {
|
|
|
|
+ if (list.value.length === res.count) {
|
|
|
|
+ loadMoreStatus.value = 'noMore'
|
|
|
|
+ visualLoadMore.value = true
|
|
|
|
+ } else {
|
|
|
|
+ list.value.push(...res.data)
|
|
|
|
+ loadMoreStatus.value = 'more'
|
|
|
|
+ visualLoadMore.value = false
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ loadMoreStatus.value = 'noMore'
|
|
|
|
+ visualLoadMore.value = true
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ loadMoreStatus.value = 'noMore'
|
|
|
|
+ visualLoadMore.value = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
- console.log('onLoad')
|
|
|
|
|
|
+ onSearch()
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
|
|
|