From 460ed0643e4c56e8443c7198b309332c8eb37755 Mon Sep 17 00:00:00 2001
From: WindowBird <13870814+windows-bird@user.noreply.gitee.com>
Date: Fri, 15 Aug 2025 12:03:09 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E6=88=90=E5=8A=9F=E7=9A=84?=
=?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=B7=B3=E8=BD=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/memorial/memorial.js | 45 ++++-------
pages/activity/application.vue | 22 ++++-
pages/activity/appointmentSuccess.vue | 112 ++++++++++++++++++--------
3 files changed, 115 insertions(+), 64 deletions(-)
diff --git a/api/memorial/memorial.js b/api/memorial/memorial.js
index 6dd5ba5..5dbd499 100644
--- a/api/memorial/memorial.js
+++ b/api/memorial/memorial.js
@@ -1,29 +1,29 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
// 获取牌位详情
export function getMemorialDetail(id) {
return request({
url: `/app/memorial/${id}`,
- method: 'get',
- })
+ method: "get",
+ });
}
// 获取供奉记录列表
export function getEnshrinedList(params) {
return request({
- url: '/app/enshrined/list',
- method: 'get',
+ url: "/app/enshrined/list",
+ method: "get",
params,
- })
+ });
}
// 搜索往生者
export function searchDeceased(params) {
return request({
- url: '/app/deceased/search',
- method: 'get',
+ url: "/app/deceased/search",
+ method: "get",
params,
- })
+ });
}
// 收藏牌位 (使用 x-www-form-urlencoded 格式)
@@ -31,35 +31,22 @@ export function collectMemorial(data) {
// 将数据转换为 x-www-form-urlencoded 格式
return request({
- url: '/app/collect',
- method: 'post',
+ url: "/app/collect",
+ method: "post",
data,
header: {
- 'Content-Type': 'application/x-www-form-urlencoded',
+ "Content-Type": "application/x-www-form-urlencoded",
},
- })
+ });
}
// 检查是否已收藏
export function checkIsCollected(memorialId) {
return request({
- url: '/app/collect/isCollect',
- method: 'get',
+ url: "/app/collect/isCollect",
+ method: "get",
params: {
memorialId: memorialId,
},
- })
+ });
}
-
-// // 收藏牌位 (使用 form-data 格式,可选)
-// export function collectMemorialFormData(data) {
-// return request({
-// url: '/app/collect',
-// method: 'post',
-// data,
-// header: {
-
-// 'Content-Type': 'multipart/form-data'
-// }
-// })
-// }
diff --git a/pages/activity/application.vue b/pages/activity/application.vue
index 66d9679..5567474 100644
--- a/pages/activity/application.vue
+++ b/pages/activity/application.vue
@@ -96,6 +96,8 @@ export default {
// 活动ID
activityId: "",
+ // 活动名称
+ activityName: "",
// 加载状态
loading: false,
@@ -130,6 +132,10 @@ export default {
if (options.actId) {
this.activityId = parseInt(options.actId);
}
+ // 如果传递了活动名称,使用传递的名称
+ if (options.activityName) {
+ this.activityName = decodeURIComponent(options.activityName);
+ }
this.fetchActivitySlots();
},
methods: {
@@ -263,9 +269,20 @@ export default {
icon: "success",
});
- // 可以在这里添加跳转逻辑
+ // 跳转到报名成功页面,传递详细数据
setTimeout(() => {
- uni.navigateBack();
+ const params = {
+ date: this.getSelectedDateLabel(),
+ time: this.getSelectedTimeLabel(),
+ number: this.getSelectedNumberLabel(),
+ activityName: this.activityName || '活动'
+ };
+ const queryString = Object.keys(params)
+ .map(key => `${key}=${encodeURIComponent(params[key])}`)
+ .join('&');
+ uni.navigateTo({
+ url: `/pages/activity/appointmentSuccess?${queryString}`,
+ });
}, 1500);
} else {
uni.showToast({
@@ -287,6 +304,7 @@ export default {
const selectedDate = this.dateOptions.find(
(date) => date.value === this.selectedDate,
);
+
return selectedDate ? selectedDate.label : "";
},
diff --git a/pages/activity/appointmentSuccess.vue b/pages/activity/appointmentSuccess.vue
index 8cc76a4..e30c0ec 100644
--- a/pages/activity/appointmentSuccess.vue
+++ b/pages/activity/appointmentSuccess.vue
@@ -1,45 +1,48 @@
-
-
-