往生大殿逝者记录3.0

This commit is contained in:
minimaxagent1 2025-08-11 10:53:44 +08:00
parent 141ed3a663
commit 1e2179eed8
3 changed files with 91 additions and 52 deletions

View File

@ -83,4 +83,20 @@ export function getMemorialTree() {
return get('/app/memorial/listTree', {}, { return get('/app/memorial/listTree', {}, {
showLoading: false showLoading: false
}) })
}
/**
* 获取往生者列表
* @param {Object} params - 查询参数
* @param {string} params.memorialId - 往生殿ID
* @param {number} params.pageNum - 页码
* @param {number} params.pageSize - 每页数量
* @param {string} params.keyword - 搜索关键词
* @returns {Promise} 返回往生者列表数据
*/
export function getDeceasedList(params) {
return get('/app/deceased/list', params, {
timeout: 10000,
showLoading: false
})
} }

View File

@ -151,7 +151,9 @@
"path" : "pages/memorial/memorialHall", "path" : "pages/memorial/memorialHall",
"style" : "style" :
{ {
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
} }
} }
], ],

View File

@ -17,9 +17,6 @@
@search="handleSearch" @search="handleSearch"
/> />
<view class="container"> <view class="container">
<!-- 顶部信息 --> <!-- 顶部信息 -->
<view class="memorial-header"> <view class="memorial-header">
@ -30,62 +27,33 @@
<!-- 刻铭标题 --> <!-- 刻铭标题 -->
<view class="title">刻铭</view> <view class="title">刻铭</view>
<!-- &lt;!&ndash; 牌位正文重复两次 &ndash;&gt;--> <!-- 动态渲染往生者信息 -->
<!-- <view class="memorial-text">--> <view
<!-- 显妣 陈秀恋 生吉年吉月吉日<br>--> v-for="(deceased, index) in deceasedList"
<!-- adfadsfi--> :key="deceased.id"
class="memorial-text"
<!-- </view>--> >
<view class="memorial-text">
<view class="name"> <view class="name">
<view class="honorific">显妣</view> <view class="honorific">{{ deceased.honorific }}</view>
<view class="fullName">陈秀恋</view> <view class="fullName">{{ deceased.fullName }}</view>
</view> </view>
<view class="date"> <view class="date">
<view class="bornDate"> <view class="bornDate">
<view></view> <view></view>
<view>2003</view> <view>{{ deceased.bornYear }}</view>
<view class="time"></view> <view class="time"></view>
<view>4</view> <view>{{ deceased.bornMonths }}</view>
<view class="time"></view> <view class="time"></view>
<view>5</view> <view>{{ deceased.bornDay }}</view>
<view class="time"></view> <view class="time"></view>
</view> </view>
<view class="diedDate"> <view class="diedDate">
<view></view> <view></view>
<view>一九八六</view> <view>{{ deceased.diedYear || '吉' }}</view>
<view class="time"></view> <view class="time"></view>
<view></view> <view>{{ deceased.diedMonths || '吉利' }}</view>
<view class="time"></view> <view class="time"></view>
<view>二十</view> <view>{{ deceased.diedDay || '吉' }}</view>
<view class="time"></view>
</view>
</view>
</view>
<view class="memorial-text">
<view class="name">
<view class="honorific">显妣</view>
<view class="fullName">陈秀恋</view>
</view>
<view class="date">
<view class="bornDate">
<view></view>
<view>2003</view>
<view class="time"></view>
<view>4</view>
<view class="time"></view>
<view>5</view>
<view class="time"></view>
</view>
<view class="diedDate">
<view></view>
<view>2003</view>
<view class="time"></view>
<view>4</view>
<view class="time"></view>
<view>5</view>
<view class="time"></view> <view class="time"></view>
</view> </view>
</view> </view>
@ -105,7 +73,6 @@
@view-details="handleViewDetails" @view-details="handleViewDetails"
/> />
</view> </view>
<view class="bottom"> <view class="bottom">
<bottom-button <bottom-button
@ -115,12 +82,12 @@
/> />
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {CommonEnum} from '@/enum/common.js' import {CommonEnum} from '@/enum/common.js'
import { getDeceasedList } from '@/api/memorial/index.js'
import SearchBox from "../../components/search-box/search-box.vue" import SearchBox from "../../components/search-box/search-box.vue"
import StatusDisplay from "../../components/status-display/status-display.vue" import StatusDisplay from "../../components/status-display/status-display.vue"
import EnshrinedList from "./compositons/enshrinedList.vue" import EnshrinedList from "./compositons/enshrinedList.vue"
@ -154,7 +121,14 @@ export default {
unit: null unit: null
}, },
// ID // ID
selectedUnitId: '16' selectedUnitId: '16',
//
deceasedList: [],
//
pageParams: {
pageNum: 1,
pageSize: 10
}
} }
}, },
onLoad(options) { onLoad(options) {
@ -171,6 +145,8 @@ export default {
try { try {
// //
console.log('往生殿页面初始化ID:', this.memorialId) console.log('往生殿页面初始化ID:', this.memorialId)
//
await this.getDeceasedList()
} catch (error) { } catch (error) {
console.error('页面初始化失败:', error) console.error('页面初始化失败:', error)
uni.showToast({ uni.showToast({
@ -182,16 +158,61 @@ export default {
} }
}, },
//
async getDeceasedList() {
try {
const params = {
memorialId: this.memorialId,
pageNum: this.pageParams.pageNum,
pageSize: this.pageParams.pageSize
}
//
if (this.searchName) {
params.keyword = this.searchName
}
const response = await getDeceasedList(params)//api
if (response.code === 200) {
this.deceasedList = response.rows || []
console.log('往生者列表数据:', this.deceasedList)
} else {
console.error('获取往生者列表失败:', response.msg)
uni.showToast({
title: response.msg || '获取数据失败',
icon: 'none'
})
}
} catch (error) {
console.error('获取往生者列表异常:', error)
uni.showToast({
title: '网络请求失败',
icon: 'none'
})
}
},
// //
handleSearch(value) { async handleSearch(value) {
console.log('搜索内容:', value) console.log('搜索内容:', value)
this.searchName = value this.searchName = value
// enshrinedList //
this.pageParams.pageNum = 1
//
await this.getDeceasedList()
}, },
// //
handleViewDetails(unitData) { handleViewDetails(unitData) {
console.log('查看单元详情:', unitData) console.log('查看单元详情:', unitData)
}, },
//
submitPrayer() {
console.log('提交供奉')
//
}
} }
} }
</script> </script>