往生大殿逝者记录3.0
This commit is contained in:
parent
141ed3a663
commit
1e2179eed8
|
|
@ -84,3 +84,19 @@ export function getMemorialTree() {
|
|||
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
|
||||
})
|
||||
}
|
||||
|
|
@ -151,7 +151,9 @@
|
|||
"path" : "pages/memorial/memorialHall",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom"
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true,
|
||||
"backgroundTextStyle": "dark"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@
|
|||
@search="handleSearch"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="container">
|
||||
<!-- 顶部信息 -->
|
||||
<view class="memorial-header">
|
||||
|
|
@ -30,62 +27,33 @@
|
|||
<!-- 刻铭标题 -->
|
||||
<view class="title">刻铭</view>
|
||||
|
||||
<!-- <!– 牌位正文(重复两次) –>-->
|
||||
<!-- <view class="memorial-text">-->
|
||||
<!-- 显妣 陈秀恋 生吉年吉月吉日<br>-->
|
||||
<!-- adfadsfi-->
|
||||
|
||||
<!-- </view>-->
|
||||
|
||||
<view class="memorial-text">
|
||||
<!-- 动态渲染往生者信息 -->
|
||||
<view
|
||||
v-for="(deceased, index) in deceasedList"
|
||||
:key="deceased.id"
|
||||
class="memorial-text"
|
||||
>
|
||||
<view class="name">
|
||||
<view class="honorific">显妣</view>
|
||||
<view class="fullName">陈秀恋</view>
|
||||
<view class="honorific">{{ deceased.honorific }}</view>
|
||||
<view class="fullName">{{ deceased.fullName }}</view>
|
||||
</view>
|
||||
<view class="date">
|
||||
<view class="bornDate">
|
||||
<view>生</view>
|
||||
<view>2003</view>
|
||||
<view>{{ deceased.bornYear }}</view>
|
||||
<view class="time">年</view>
|
||||
<view>4</view>
|
||||
<view>{{ deceased.bornMonths }}</view>
|
||||
<view class="time">月</view>
|
||||
<view>5</view>
|
||||
<view>{{ deceased.bornDay }}</view>
|
||||
<view class="time">日</view>
|
||||
</view>
|
||||
<view class="diedDate">
|
||||
<view>卒</view>
|
||||
<view>一九八六</view>
|
||||
<view>{{ deceased.diedYear || '吉' }}</view>
|
||||
<view class="time">年</view>
|
||||
<view>四</view>
|
||||
<view>{{ deceased.diedMonths || '吉利' }}</view>
|
||||
<view class="time">月</view>
|
||||
<view>二十</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>{{ deceased.diedDay || '吉' }}</view>
|
||||
<view class="time">日</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -105,7 +73,6 @@
|
|||
@view-details="handleViewDetails"
|
||||
/>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<bottom-button
|
||||
|
|
@ -115,12 +82,12 @@
|
|||
/>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {CommonEnum} from '@/enum/common.js'
|
||||
import { getDeceasedList } from '@/api/memorial/index.js'
|
||||
import SearchBox from "../../components/search-box/search-box.vue"
|
||||
import StatusDisplay from "../../components/status-display/status-display.vue"
|
||||
import EnshrinedList from "./compositons/enshrinedList.vue"
|
||||
|
|
@ -154,7 +121,14 @@ export default {
|
|||
unit: null
|
||||
},
|
||||
// 当前选中的单元ID,用于状态栏查询
|
||||
selectedUnitId: '16'
|
||||
selectedUnitId: '16',
|
||||
// 往生者列表数据
|
||||
deceasedList: [],
|
||||
// 分页参数
|
||||
pageParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
@ -171,6 +145,8 @@ export default {
|
|||
try {
|
||||
// 页面初始化逻辑
|
||||
console.log('往生殿页面初始化,ID:', this.memorialId)
|
||||
// 获取往生者列表
|
||||
await this.getDeceasedList()
|
||||
} catch (error) {
|
||||
console.error('页面初始化失败:', error)
|
||||
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)
|
||||
this.searchName = value
|
||||
// 搜索逻辑由 enshrinedList 组件处理
|
||||
// 重置页码
|
||||
this.pageParams.pageNum = 1
|
||||
// 重新获取数据
|
||||
await this.getDeceasedList()
|
||||
},
|
||||
|
||||
// 处理查看详情
|
||||
handleViewDetails(unitData) {
|
||||
console.log('查看单元详情:', unitData)
|
||||
},
|
||||
|
||||
// 提交供奉
|
||||
submitPrayer() {
|
||||
console.log('提交供奉')
|
||||
// 这里可以添加供奉逻辑
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user