优化内容加修复bug

This commit is contained in:
zhouyanli
2026-08-13 08:03:26 +08:00
parent f793e16263
commit 94146ce27a
23 changed files with 406 additions and 260 deletions

View File

@@ -1,20 +1,7 @@
<template>
<view class="contentStyle" style="">
<view class="status-bar"></view>
<uni-nav-bar title="我的房屋" left-icon="left" @clickLeft="goBack" backgroundColor="transparent" :border="false">
</uni-nav-bar>
<!-- -->
<pull-refresh-scroll
custom-class="page"
:refreshing="isRefreshing"
:loading-more="loading"
:no-more-data="noMoreData"
:empty="houseList.length === 0"
empty-text="暂无数据"
@refresh="onRefresh"
@loadMore="loadMore"
>
<scroll-view class="page" scroll-y :refresher-enabled="true" :refresher-triggered="isRefreshing" @refresherrefresh="onRefresh" @scrolltolower="loadMore">
<!-- 房屋列表 v-for 渲染 -->
<view class="house-list">
<view class="house-card" v-for="(item, index) in houseList" :key="index" @click="tapHouse(item)">
@@ -54,7 +41,7 @@
</view>
</view>
</view>
</pull-refresh-scroll>
</scroll-view>
<!-- 底部添加按钮 -->
<view class="bottom-btn">
<button class="add-btn" @click="addHouse">添加房屋</button>
@@ -76,9 +63,7 @@
getMyHouseList,
setMyHouseDefault
} from '/pageSubPack/api/apiSub.js'
import PullRefreshScroll from '/components/pull-refresh-scroll/pull-refresh-scroll.vue'
const houseList = ref([])
const loading = ref(false)
const pageNum = ref(1)
@@ -86,7 +71,7 @@
const noMoreData = ref(false)
const isRefreshing = ref(false)
// ==================== 下拉刷新 ====================
// ==================== 下拉刷新 ====================
const onRefresh = () => {
isRefreshing.value = true
pageNum.value = 1
@@ -96,6 +81,11 @@
getList()
}
onPullDownRefresh(() => {
onRefresh()
})
// ==================== 获取列表数据 ====================
const getList = async () => {
if (loading.value) return
@@ -123,9 +113,8 @@
console.error('列表接口报错:', err)
} finally {
loading.value = false
if (isRefreshing.value) {
isRefreshing.value = false
}
isRefreshing.value = false
uni.stopPullDownRefresh()
}
}
@@ -223,22 +212,19 @@
display: flex;
flex-direction: column;
height: 100vh;
/* 关键:占满屏幕高度 */
/* 关键:固定高度,底部按钮不动 */
background-color: #f5f7fa;
}
.page {
flex: 1;
overflow-y: auto;
padding: 0px 40rpx;
padding: 0px 40rpx 120rpx;
box-sizing: border-box;
}
/* 列表 */
.house-list {
height: 100%;
overflow-y: scroll;
}
.house-card {
@@ -358,7 +344,12 @@
.bottom-btn {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 20rpx 30rpx 40rpx;
background-color: #f5f7fa;
}
.add-btn {