diff --git a/api/memorial/memorial.js b/api/memorial/memorial.js new file mode 100644 index 0000000..f5a13f6 --- /dev/null +++ b/api/memorial/memorial.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +// 获取牌位详情 +export function getMemorialDetail(id) { + return request({ + url: `/app/memorial/${id}`, + method: 'get' + }) +} + +// 获取供奉记录列表 +export function getEnshrinedList(params) { + return request({ + url: '/app/enshrined/list', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/enum/common.js b/enum/common.js index 990f1d7..be5e050 100644 --- a/enum/common.js +++ b/enum/common.js @@ -6,7 +6,8 @@ export const CommonEnum = { BASE_COLOR:"#FAF8F3", //基调颜色 SEARCH: "https://api.ccttiot.com/image-1753769500465.png", //通用搜索图标 TILE: "https://api.ccttiot.com/image-1753750309203.png", //瓦片图片 - BOTTOM_TILES:"https://api.ccttiot.com/image-1754446176001.png",//底部瓦片组 + BOTTOM_TILES:"https://api.ccttiot.com/image-1754446176001.png",//底部瓦片组背景淡黄 + BOTTOM_TILES_2:" https://api.ccttiot.com/image-1754898426052.png",//底部瓦片组背景纯白 FILTER: "https://api.ccttiot.com/image-1753954149098.png", //筛选图标 REFRESH:"https://api.ccttiot.com/%E5%AE%B9%E5%99%A8-1754011714179.png", //刷新图标 NAV_ARROW:"https://api.ccttiot.com/image-1754127104177.png", //导航箭头 @@ -17,7 +18,6 @@ export const CommonEnum = { KongmingLantern:'https://api.ccttiot.com/image-1754376453672.png',//孔明灯 Refresh:'https://api.ccttiot.com/image-1754377032112.png',//刷新 LotusMeditation:'https://api.ccttiot.com/image-1754377169541.png',//莲坐禅心 - - + CENTER_TILES:"https://api.ccttiot.com/image-1754897751419.png",//腰部瓦片组 }; export default CommonEnum; \ No newline at end of file diff --git a/pages.json b/pages.json index f82aca9..f572bc7 100644 --- a/pages.json +++ b/pages.json @@ -155,6 +155,20 @@ "enablePullDownRefresh": true, "backgroundTextStyle": "dark" } + }, + { + "path" : "pages/memorial/enshrinedList", + "style" : + { + "navigationStyle": "custom" + } + }, + { + "path" : "pages/memorial/deceasedSearch", + "style" : + { + "navigationStyle": "custom" + } } ], "subPackages": [ diff --git a/pages/memorial/README.md b/pages/memorial/README.md new file mode 100644 index 0000000..3e5385c --- /dev/null +++ b/pages/memorial/README.md @@ -0,0 +1,134 @@ +# 供奉记录页面使用说明 + +## 功能概述 + +`enshrinedList.vue` 是一个供奉记录展示页面,通过调用两个API接口来获取和展示数据: + +1. **牌位详情API**: `GET /app/memorial/{id}` - 获取牌位基本信息 +2. **供奉记录API**: `GET /app/enshrined/list` - 获取该牌位的供奉记录列表 + +## 页面特性 + +### 🎨 界面设计 +- **牌位信息卡片**: 显示牌位名称和介绍信息 +- **供奉记录表格**: 展示供奉人、时间、类型等信息 +- **响应式布局**: 适配不同屏幕尺寸 +- **传统风格**: 使用佛教主题色彩和设计元素 + +### 📱 交互功能 +- **下拉刷新**: 重新加载最新数据 +- **上拉加载**: 分页加载更多记录 +- **姓名脱敏**: 保护用户隐私 +- **错误处理**: 网络错误时显示重试选项 + +### 🔧 技术特性 +- **并行API调用**: 同时请求两个接口提高加载速度 +- **数据格式化**: 日期格式化和姓名脱敏处理 +- **状态管理**: 加载状态、错误状态、空状态处理 +- **分页支持**: 支持大量数据的分页展示 + +## API接口说明 + +### 1. 牌位详情接口 +```javascript +GET /app/memorial/{id} +``` + +**响应数据结构:** +```json +{ + "msg": "操作成功", + "code": 200, + "data": { + "id": "16", + "name": "牌位名字", + "code": "A01", + "introduced": "牌位介绍信息", + "extinguishTime": "2025-07-16 14:06:58", + "state": "1", + "contactName": "黄绍春", + "address": "广西壮族自治区南宁市西乡塘区" + } +} +``` + +### 2. 供奉记录接口 +```javascript +GET /app/enshrined/list?memorialId={id}&pageNum=1&pageSize=10 +``` + +**响应数据结构:** +```json +{ + "total": 2, + "rows": [ + { + "id": "1", + "memorialId": "16", + "worshiperName": "黄绍春", + "thaliName": "贡献三天", + "startDate": "2025-07-08 00:00:00", + "endDate": "2025-07-31 00:00:00", + "isShow": "1" + } + ] +} +``` + +## 使用方法 + +### 1. 页面跳转 +```javascript +// 跳转到供奉记录页面 +uni.navigateTo({ + url: '/pages/memorial/enshrinedList?id=16' +}) +``` + +### 2. 参数说明 +- `id`: 牌位ID,必填参数 + +### 3. 测试页面 +访问 `/pages/memorial/test-enshrined` 可以测试API调用和页面功能。 + +## 文件结构 + +``` +pages/memorial/ +├── enshrinedList.vue # 主页面 +├── test-enshrined.vue # 测试页面 +└── README.md # 说明文档 + +api/memorial/ +└── memorial.js # API接口定义 +``` + +## 样式定制 + +### 颜色主题 +- 主色调: `#A24242` (深红棕色) +- 背景色: `#F5F0E7` (米色) +- 卡片背景: `#FFF1DD` (浅米色) +- 文字颜色: `#522510` (深棕色) + +### 布局调整 +可以通过修改CSS变量来调整页面样式: +```scss +// 修改主色调 +$primary-color: #A24242; +$background-color: #F5F0E7; +``` + +## 注意事项 + +1. **网络请求**: 确保API接口可正常访问 +2. **参数验证**: 传入的牌位ID必须有效 +3. **数据格式**: API返回的数据格式必须符合预期 +4. **错误处理**: 网络错误时会显示重试按钮 +5. **性能优化**: 大量数据时建议调整分页大小 + +## 更新日志 + +- **v1.0.0**: 初始版本,支持基本的供奉记录展示 +- **v1.1.0**: 添加下拉刷新和上拉加载功能 +- **v1.2.0**: 优化UI设计和错误处理 \ No newline at end of file diff --git a/pages/memorial/compositons/offeringModal.vue b/pages/memorial/compositons/offeringModal.vue new file mode 100644 index 0000000..7659507 --- /dev/null +++ b/pages/memorial/compositons/offeringModal.vue @@ -0,0 +1,298 @@ + + + + + \ No newline at end of file diff --git a/pages/memorial/deceasedSearch.vue b/pages/memorial/deceasedSearch.vue new file mode 100644 index 0000000..79d298a --- /dev/null +++ b/pages/memorial/deceasedSearch.vue @@ -0,0 +1,161 @@ + + + + + \ No newline at end of file diff --git a/pages/memorial/enshrinedList.vue b/pages/memorial/enshrinedList.vue new file mode 100644 index 0000000..13dec98 --- /dev/null +++ b/pages/memorial/enshrinedList.vue @@ -0,0 +1,387 @@ + + + + + \ No newline at end of file diff --git a/pages/memorial/memorialHall.vue b/pages/memorial/memorialHall.vue index e0ad3f8..c3d8014 100644 --- a/pages/memorial/memorialHall.vue +++ b/pages/memorial/memorialHall.vue @@ -108,6 +108,13 @@ /> + + + @@ -117,9 +124,9 @@ import { getDeceasedList, getMemorialDetail } 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" -import FloorSelector from "./compositons/floorSelector.vue" import StatusBar from "./compositons/statusBar.vue" -import BottomButton from "../../components/bottom-button/bottom-button.vue"; +import BottomButton from "../../components/bottom-button/bottom-button.vue" +import OfferingModal from "./compositons/offeringModal.vue" export default { components: { @@ -127,24 +134,14 @@ export default { SearchBox, StatusDisplay, EnshrinedList, - FloorSelector, - StatusBar + StatusBar, + OfferingModal }, data() { return { CommonEnum, searchName: '', loading: false, - // 楼层选择器默认值 - defaultFloorId: '', - defaultAreaId: '', - defaultUnitId: '', - // 当前选中的楼层信息 - currentSelection: { - floor: null, - area: null, - unit: null - }, // 当前选中的单元ID,用于状态栏查询 selectedUnitId: '', // 往生者列表数据 @@ -157,7 +154,9 @@ export default { // 往生殿详情数据 memorialDetail: null, // 滚动相关 - scrollTop: 0 + scrollTop: 0, + // 供奉弹窗显示状态 + showOfferingModal: false } }, onLoad(options) { @@ -274,8 +273,37 @@ export default { // 提交供奉 submitPrayer() { - console.log('提交供奉') - // 这里可以添加供奉逻辑 + console.log('显示供奉弹窗') + this.showOfferingModal = true + }, + + // 关闭供奉弹窗 + closeOfferingModal() { + this.showOfferingModal = false + }, + + // 确认供奉 + handleOfferingConfirm(offeringData) { + console.log('确认供奉:', offeringData) + + // 这里可以调用供奉API + uni.showLoading({ + title: '正在提交供奉...' + }) + + // 模拟API调用 + setTimeout(() => { + uni.hideLoading() + uni.showToast({ + title: '供奉成功!', + icon: 'success' + }) + + // 关闭弹窗 + this.closeOfferingModal() + + // 可以在这里刷新数据或跳转到其他页面 + }, 2000) }, // 刷新数据 @@ -479,9 +507,6 @@ export default { } - - - // 状态栏容器样式 :deep(.status-bar) { width: 100%;