预约成功的界面跳转

This commit is contained in:
WindowBird 2025-08-15 12:03:09 +08:00
parent bda8e4e9fe
commit 460ed0643e
3 changed files with 115 additions and 64 deletions

View File

@ -1,29 +1,29 @@
import request from '@/utils/request' import request from "@/utils/request";
// 获取牌位详情 // 获取牌位详情
export function getMemorialDetail(id) { export function getMemorialDetail(id) {
return request({ return request({
url: `/app/memorial/${id}`, url: `/app/memorial/${id}`,
method: 'get', method: "get",
}) });
} }
// 获取供奉记录列表 // 获取供奉记录列表
export function getEnshrinedList(params) { export function getEnshrinedList(params) {
return request({ return request({
url: '/app/enshrined/list', url: "/app/enshrined/list",
method: 'get', method: "get",
params, params,
}) });
} }
// 搜索往生者 // 搜索往生者
export function searchDeceased(params) { export function searchDeceased(params) {
return request({ return request({
url: '/app/deceased/search', url: "/app/deceased/search",
method: 'get', method: "get",
params, params,
}) });
} }
// 收藏牌位 (使用 x-www-form-urlencoded 格式) // 收藏牌位 (使用 x-www-form-urlencoded 格式)
@ -31,35 +31,22 @@ export function collectMemorial(data) {
// 将数据转换为 x-www-form-urlencoded 格式 // 将数据转换为 x-www-form-urlencoded 格式
return request({ return request({
url: '/app/collect', url: "/app/collect",
method: 'post', method: "post",
data, data,
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded', "Content-Type": "application/x-www-form-urlencoded",
}, },
}) });
} }
// 检查是否已收藏 // 检查是否已收藏
export function checkIsCollected(memorialId) { export function checkIsCollected(memorialId) {
return request({ return request({
url: '/app/collect/isCollect', url: "/app/collect/isCollect",
method: 'get', method: "get",
params: { params: {
memorialId: memorialId, memorialId: memorialId,
}, },
}) });
} }
// // 收藏牌位 (使用 form-data 格式,可选)
// export function collectMemorialFormData(data) {
// return request({
// url: '/app/collect',
// method: 'post',
// data,
// header: {
// 'Content-Type': 'multipart/form-data'
// }
// })
// }

View File

@ -96,6 +96,8 @@ export default {
// ID // ID
activityId: "", activityId: "",
//
activityName: "",
// //
loading: false, loading: false,
@ -130,6 +132,10 @@ export default {
if (options.actId) { if (options.actId) {
this.activityId = parseInt(options.actId); this.activityId = parseInt(options.actId);
} }
// 使
if (options.activityName) {
this.activityName = decodeURIComponent(options.activityName);
}
this.fetchActivitySlots(); this.fetchActivitySlots();
}, },
methods: { methods: {
@ -263,9 +269,20 @@ export default {
icon: "success", icon: "success",
}); });
// //
setTimeout(() => { 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); }, 1500);
} else { } else {
uni.showToast({ uni.showToast({
@ -287,6 +304,7 @@ export default {
const selectedDate = this.dateOptions.find( const selectedDate = this.dateOptions.find(
(date) => date.value === this.selectedDate, (date) => date.value === this.selectedDate,
); );
return selectedDate ? selectedDate.label : ""; return selectedDate ? selectedDate.label : "";
}, },

View File

@ -1,45 +1,48 @@
<template> <template>
<view class="page"> <view class="page">
<custom-navbar ref="customNavbar" title="基础页面" /> <custom-navbar ref="customNavbar" title="预约成功" />
<tile-grid />
<view :style="{ backgroundColor: CommonEnum.BASE_COLOR }" class="header"> <image :src="CommonEnum.SUCCESS_APPOINTMENT"></image>
<!-- 状态展示 --> <view class="container">
<status-display v-if="loading" loading-text="加载中..." type="loading" /> <view class="info">
<!-- 页面内容将在这里添加 --> <text class="success">您提交的预约已成功</text>
<text class="date">预约日期{{ date }}</text>
<text class="time">预约时段{{ time }}</text>
</view> </view>
</view> </view>
<view class="back" @click="back">返回首页</view>
</view>
</template> </template>
<script> <script>
import CommonEnum from "../../enum/common"; import CommonEnum from "../../enum/common";
import BottomButton from "../../components/bottom-button/bottom-button.vue";
export default { export default {
components: {}, components: { BottomButton },
data() { data() {
return { return {
CommonEnum, CommonEnum,
loading: false, loading: false,
time: "",
date: "",
number: "",
activityName: "",
}; };
}, },
onLoad() { onLoad(options) {
// //
this.loadPageData(); this.time = decodeURIComponent(options.time || "");
this.date = decodeURIComponent(options.date || "");
this.number = decodeURIComponent(options.number || "");
}, },
methods: { methods: {
// //
async loadPageData() { back() {
this.loading = true; uni.switchTab({
try { url: '/pages/index/index'
// TODO: API });
// const response = await getPageData()
//
setTimeout(() => {
this.loading = false;
}, 1000);
} catch (error) {
console.error("获取页面数据失败:", error);
this.loading = false;
}
}, },
}, },
}; };
@ -47,16 +50,59 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .page {
background: #f5f0e7; background: #faf8f3;
display: flex;
flex-direction: column;
align-items: center;
//border: 1rpx solid #250404;
image {
margin-top: 24rpx;
width: 564rpx;
height: 564rpx;
//border: 1rpx solid #250404;
} }
.header { .container {
width: 100%; position: relative;
//min-height: 100vh;// top: -46rpx;
margin-bottom: 150rpx;
.info {
display: flex; display: flex;
align-items: flex-start;
flex-direction: column; flex-direction: column;
padding: 0 15rpx; align-items: center;
padding-bottom: 40rpx; //border: 1rpx solid #250404;
text {
color: #695347;
text-align: center;
//border: 1rpx solid #250404;
font-size: 32rpx;
font-weight: 500;
line-height: 216.5%;
}
.success {
}
.time {
}
}
}
.back {
width: 552rpx;
height: 100rpx;
border-radius: 50rpx;
box-sizing: border-box;
border: 2rpx solid #c7a26d;
text-align: center;
font-size: 36rpx;
font-weight: 500;
line-height: 100rpx;
color: #c7a26d;
}
} }
</style> </style>