分页pageSize修改,输入框placeholder修改

This commit is contained in:
WindowBird 2025-09-19 10:35:37 +08:00
parent e9e36537d7
commit 35540269d8
2 changed files with 178 additions and 173 deletions

View File

@ -67,7 +67,7 @@ export default {
createPagination({
fetchData: getProjectSchedule,
mode: "loadMore",
pageSize: 3,
pageSize: 5,
autoLoad: false, // false
}),
],

View File

@ -5,24 +5,24 @@
<custom-navbar ref="customNavbar" title="往生殿" />
<view class="header">
<!-- 状态展示 -->
<status-display v-if="loading" type="loading" loading-text="加载中..." />
<status-display v-if="loading" loading-text="加载中..." type="loading" />
<!-- 搜索框 -->
<search-box
v-model="searchName"
:width="'682rpx'"
:search-icon="CommonEnum.SEARCH"
placeholder="请输入姓名或分区进行查找"
:width="'682rpx'"
btn-text="搜索"
placeholder="请输入姓名"
@search="handleSearch"
/>
<!-- 供奉列表 -->
<enshrined-list
v-if="!loading"
ref="enshrinedList"
:memorial-id="memorialId"
:search-keyword="searchName"
@item-click="handleItemClick"
ref="enshrinedList"
/>
<!-- 状态栏 -->
<StatusBar
@ -35,8 +35,8 @@
<view class="floor-selector-container">
<FloorSelector
ref="floorSelector"
:default-floor-id="defaultFloorId"
:default-area-id="defaultAreaId"
:default-floor-id="defaultFloorId"
:default-unit-id="defaultUnitId"
@selection-change="handleSelectionChange"
/>
@ -49,182 +49,187 @@
</template>
<script>
import { CommonEnum } from '@/enum/common.js'
import SearchBox from '../../components/search-box/search-box.vue'
import StatusDisplay from '../../components/status-display/status-display.vue'
import EnshrinedList from './compositons/enshrinedListIndex.vue'
import FloorSelector from './compositons/floorSelector.vue'
import StatusBar from './compositons/statusBar.vue'
import BottomButton from '../../components/bottom-button/bottom-button.vue'
import { CommonEnum } from "@/enum/common.js";
import SearchBox from "../../components/search-box/search-box.vue";
import StatusDisplay from "../../components/status-display/status-display.vue";
import EnshrinedList from "./compositons/enshrinedListIndex.vue";
import FloorSelector from "./compositons/floorSelector.vue";
import StatusBar from "./compositons/statusBar.vue";
import BottomButton from "../../components/bottom-button/bottom-button.vue";
export default {
components: {
BottomButton,
SearchBox,
StatusDisplay,
EnshrinedList,
FloorSelector,
StatusBar,
},
data() {
return {
CommonEnum,
searchName: '',
loading: false,
memorialId: '16', // 殿ID
//
defaultFloorId: '',
defaultAreaId: '',
defaultUnitId: '',
//
currentSelection: {
floor: null,
area: null,
unit: null,
},
// ID
selectedUnitId: '',
}
},
onLoad(options) {
// 殿ID
if (options.id) {
this.memorialId = options.id
}
this.initPage()
},
methods: {
//
async initPage() {
this.loading = true
try {
//
console.log('往生殿页面初始化ID:', this.memorialId)
} catch (error) {
console.error('页面初始化失败:', error)
uni.showToast({
title: '页面加载失败',
icon: 'none',
})
} finally {
this.loading = false
}
export default {
components: {
BottomButton,
SearchBox,
StatusDisplay,
EnshrinedList,
FloorSelector,
StatusBar,
},
data() {
return {
CommonEnum,
searchName: "",
loading: false,
memorialId: "16", // 殿ID
//
defaultFloorId: "",
defaultAreaId: "",
defaultUnitId: "",
//
currentSelection: {
floor: null,
area: null,
unit: null,
},
//
handleSearch(value) {
console.log('搜索内容:', value)
this.searchName = value
//
uni.navigateTo({
url: `/pages/memorial/deceasedSearch?keyword=${encodeURIComponent(value)}`,
success: () => {
console.log('跳转到搜索页面成功')
},
fail: error => {
console.error('跳转失败:', error)
uni.showToast({
title: '页面跳转失败',
icon: 'none',
})
},
})
},
//
handleItemClick(item) {
console.log('点击供奉记录:', item)
//
// ID
selectedUnitId: "",
};
},
onLoad(options) {
// 殿ID
if (options.id) {
this.memorialId = options.id;
}
this.initPage();
},
methods: {
//
async initPage() {
this.loading = true;
try {
//
console.log("往生殿页面初始化ID:", this.memorialId);
} catch (error) {
console.error("页面初始化失败:", error);
uni.showToast({
title: `查看 ${item.worshiperName} 的供奉记录`,
icon: 'none',
})
},
//
handleSelectionChange(selection) {
console.log('楼层选择变化:', selection)
this.currentSelection = selection
// selectedUnitId
if (selection.unit) {
console.log('选中单元:', selection.unit.label, 'ID:', selection.unit.id)
this.selectedUnitId = selection.unit.id
} else {
//
this.selectedUnitId = ''
}
},
// 殿
navigateToMemorialHall(unitId) {
console.log('跳转到往生大殿页面ID:', unitId)
uni.navigateTo({
url: `/pages/memorial/memorialHall?id=${unitId}`,
success: () => {
console.log('跳转成功')
},
fail: error => {
console.error('跳转失败:', error)
uni.showToast({
title: '页面跳转失败',
icon: 'none',
})
},
})
},
//
handleViewDetails(unitData) {
console.log('查看单元详情:', unitData)
this.navigateToMemorialHall(unitData.id)
},
// - 殿
submitPrayer() {
console.log('提交供奉跳转到往生大殿页面ID:', this.selectedUnitId)
this.navigateToMemorialHall(this.selectedUnitId)
},
title: "页面加载失败",
icon: "none",
});
} finally {
this.loading = false;
}
},
}
//
handleSearch(value) {
console.log("搜索内容:", value);
this.searchName = value;
//
uni.navigateTo({
url: `/pages/memorial/deceasedSearch?keyword=${encodeURIComponent(value)}`,
success: () => {
console.log("跳转到搜索页面成功");
},
fail: (error) => {
console.error("跳转失败:", error);
uni.showToast({
title: "页面跳转失败",
icon: "none",
});
},
});
},
//
handleItemClick(item) {
console.log("点击供奉记录:", item);
//
uni.showToast({
title: `查看 ${item.worshiperName} 的供奉记录`,
icon: "none",
});
},
//
handleSelectionChange(selection) {
console.log("楼层选择变化:", selection);
this.currentSelection = selection;
// selectedUnitId
if (selection.unit) {
console.log(
"选中单元:",
selection.unit.label,
"ID:",
selection.unit.id,
);
this.selectedUnitId = selection.unit.id;
} else {
//
this.selectedUnitId = "";
}
},
// 殿
navigateToMemorialHall(unitId) {
console.log("跳转到往生大殿页面ID:", unitId);
uni.navigateTo({
url: `/pages/memorial/memorialHall?id=${unitId}`,
success: () => {
console.log("跳转成功");
},
fail: (error) => {
console.error("跳转失败:", error);
uni.showToast({
title: "页面跳转失败",
icon: "none",
});
},
});
},
//
handleViewDetails(unitData) {
console.log("查看单元详情:", unitData);
this.navigateToMemorialHall(unitData.id);
},
// - 殿
submitPrayer() {
console.log("提交供奉跳转到往生大殿页面ID:", this.selectedUnitId);
this.navigateToMemorialHall(this.selectedUnitId);
},
},
};
</script>
<style lang="scss" scoped>
.page {
width: 100%;
min-height: 100vh;
}
.page {
width: 100%;
min-height: 100vh;
}
.header {
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
flex-direction: column;
padding-bottom: 180rpx;
box-sizing: border-box;
}
.header {
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
flex-direction: column;
padding-bottom: 180rpx;
box-sizing: border-box;
}
.floor-selector-container {
margin-bottom: 30rpx;
display: flex;
justify-content: center;
}
.floor-selector-container {
margin-bottom: 30rpx;
display: flex;
justify-content: center;
}
//
:deep(.status-bar) {
width: 100%;
max-width: 750rpx;
}
//
:deep(.status-bar) {
width: 100%;
max-width: 750rpx;
}
.bottom {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #fffbf5;
height: 180rpx;
}
.bottom {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #fffbf5;
height: 180rpx;
}
</style>