修改登录页样式、车牌号输入问题、定位加载问题、联系物业权限问题
This commit is contained in:
@@ -8,14 +8,14 @@
|
||||
class="search-input"
|
||||
placeholder="请输入关键字进行搜索"
|
||||
placeholder-class="placeholder"
|
||||
v-model="searchText"
|
||||
:value="searchText"
|
||||
@input="handleSearchInput"
|
||||
/>
|
||||
<view v-if="searchText" class="clear-icon" @tap="clearSearch">
|
||||
<uni-icons type="clear" size="18" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<button class="search-btn" @tap="handleSearch">搜索</button>
|
||||
<!-- <button class="search-btn" @tap="handleSearch">搜索</button> -->
|
||||
</view>
|
||||
|
||||
<!-- 小区列表 -->
|
||||
@@ -103,7 +103,7 @@ const currentVillageIdFromHome = ref('') // 首页传入的当前选中小区ID
|
||||
|
||||
// 分页相关
|
||||
const currentPage = ref(1)
|
||||
const pageSize = 5
|
||||
const pageSize = 10
|
||||
const totalCount = ref(0)
|
||||
const displayedCommunities = ref([])
|
||||
const hasMoreData = ref(true)
|
||||
@@ -119,6 +119,7 @@ const getCommunityList = async (pageNum = 1, keyword = '') => {
|
||||
isLoading.value = true
|
||||
|
||||
try {
|
||||
keyword = decodeURIComponent(keyword)
|
||||
const params = {
|
||||
pageNum,
|
||||
pageSize,
|
||||
@@ -188,22 +189,19 @@ const loadMoreData = () => {
|
||||
}
|
||||
|
||||
// 处理搜索输入(防抖)
|
||||
const handleSearchInput = () => {
|
||||
const handleSearchInput = (e) => {
|
||||
let val = e.detail.value || ''
|
||||
searchText.value = val
|
||||
if (searchTimeout) {
|
||||
clearTimeout(searchTimeout)
|
||||
}
|
||||
searchTimeout = setTimeout(() => {
|
||||
handleSearch()
|
||||
currentPage.value = 1
|
||||
isSearching.value = !!val.trim()
|
||||
getCommunityList(1, val.trim())
|
||||
}, 300)
|
||||
}
|
||||
|
||||
// 处理搜索
|
||||
const handleSearch = () => {
|
||||
const keyword = searchText.value.trim()
|
||||
isSearching.value = !!keyword
|
||||
currentPage.value = 1
|
||||
getCommunityList(1, keyword)
|
||||
}
|
||||
|
||||
// 清空搜索
|
||||
const clearSearch = () => {
|
||||
@@ -274,13 +272,6 @@ const handleConfirm = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 监听搜索文本变化
|
||||
watch(searchText, (newVal) => {
|
||||
if (!newVal.trim()) {
|
||||
clearSearch()
|
||||
}
|
||||
})
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
if (displayedCommunities.value.length === 0 && !isLoading.value) {
|
||||
|
||||
Reference in New Issue
Block a user