buddhism/pages/memorial/memorial.vue

123 lines
2.9 KiB
Vue
Raw Normal View History

2025-08-08 09:33:23 +08:00
<template>
<view class="page">
<base-background />
<!-- 使用自定义导航栏组件 -->
2025-08-08 10:15:54 +08:00
<custom-navbar title="往生殿"
2025-08-08 09:33:23 +08:00
ref="customNavbar"/>
2025-08-08 10:15:54 +08:00
<view class="header">
2025-08-08 09:33:23 +08:00
<!-- 状态展示 -->
<status-display
v-if="loading"
type="loading"
loading-text="加载中..."
/>
2025-08-08 11:45:52 +08:00
<!-- 搜索框 -->
2025-08-08 10:15:54 +08:00
<search-box
v-model="searchName"
:width="'682rpx'"
:search-icon="CommonEnum.SEARCH"
placeholder="请输入姓名或分区进行查找"
btn-text="搜索"
@search="handleSearch"
/>
2025-08-08 11:45:52 +08:00
<!-- 供奉列表 -->
<enshrined-list
v-if="!loading"
:memorial-id="memorialId"
:search-keyword="searchName"
@item-click="handleItemClick"
ref="enshrinedList"
/>
2025-08-08 09:33:23 +08:00
</view>
2025-08-08 12:02:23 +08:00
<bottom-button
title="供奉"
type="primary"
@click="submitPrayer"
/>
2025-08-08 09:33:23 +08:00
</view>
</template>
<script>
2025-08-08 10:15:54 +08:00
import {CommonEnum} from '@/enum/common.js'
2025-08-08 11:45:52 +08:00
import SearchBox from "../../components/search-box/search-box.vue"
import StatusDisplay from "../../components/status-display/status-display.vue"
import EnshrinedList from "./compositons/enshrinedList.vue"
2025-08-08 12:02:23 +08:00
import BottomButton from "../../components/bottom-button/bottom-button.vue";
2025-08-08 11:45:52 +08:00
2025-08-08 09:33:23 +08:00
export default {
components: {
2025-08-08 12:02:23 +08:00
BottomButton,
2025-08-08 10:15:54 +08:00
SearchBox,
2025-08-08 11:45:52 +08:00
StatusDisplay,
EnshrinedList
2025-08-08 09:33:23 +08:00
},
data() {
return {
CommonEnum,
2025-08-08 11:45:52 +08:00
searchName: '',
loading: false,
memorialId: '16' // 默认往生殿ID可以从路由参数获取
2025-08-08 09:33:23 +08:00
}
},
2025-08-08 11:45:52 +08:00
onLoad(options) {
// 从路由参数获取往生殿ID
if (options.id) {
this.memorialId = options.id
}
this.initPage()
2025-08-08 09:33:23 +08:00
},
methods: {
2025-08-08 11:45:52 +08:00
// 初始化页面
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
}
},
// 处理搜索
handleSearch(value) {
console.log('搜索内容:', value)
this.searchName = value
// 搜索逻辑由 enshrinedList 组件处理
},
// 处理列表项点击
handleItemClick(item) {
console.log('点击供奉记录:', item)
// 可以跳转到详情页或执行其他操作
uni.showToast({
title: `查看 ${item.worshiperName} 的供奉记录`,
icon: 'none'
})
}
2025-08-08 09:33:23 +08:00
}
}
</script>
2025-08-08 11:45:52 +08:00
2025-08-08 09:33:23 +08:00
<style lang="scss" scoped>
.page {
width: 100%;
min-height: 100vh;
}
2025-08-08 11:45:52 +08:00
2025-08-08 09:33:23 +08:00
.header {
width: 100%;
2025-08-08 12:02:23 +08:00
min-height: 200vh;
2025-08-08 09:33:23 +08:00
display: flex;
2025-08-08 10:15:54 +08:00
align-items: center;
2025-08-08 09:33:23 +08:00
flex-direction: column;
2025-08-08 10:15:54 +08:00
padding: 0 15rpx 40rpx 15rpx;
2025-08-08 11:45:52 +08:00
box-sizing: border-box;
2025-08-08 09:33:23 +08:00
}
</style>