我的祈福记录,我的建制捐款记录

This commit is contained in:
WindowBird 2025-09-22 17:15:48 +08:00
parent a707f37de0
commit ec87b2b6c4
7 changed files with 677 additions and 47 deletions

View File

@ -1,4 +1,5 @@
import { get, post } from '@/utils/request'
import { get } from "@/utils/request";
import request from "../../utils/request";
/**
* 获取捐款记录列表
@ -16,5 +17,16 @@ import { get, post } from '@/utils/request'
* @returns {Promise} 返回捐款记录列表
*/
export function getDonorList(params) {
return get('/app/donor/listDonor', params)
return get("/app/donor/listDonor", params);
}
export function getUserDonorList(params) {
return request({
url: "/app/donor/userDonor",
params: {
...params,
orderByColumn: "createTime", // 排序字段
isAsc: "desc", // 降序排列
},
});
}

View File

@ -1,4 +1,4 @@
import request from '@/utils/request'
import request from "@/utils/request";
/**
* 提交祈福
@ -11,39 +11,31 @@ import request from '@/utils/request'
*/
export function submitPrayer(data) {
return request({
url: '/app/pray',
method: 'POST',
url: "/app/pray",
method: "POST",
data: {
name: String(data.name || ''),
type: String(data.type || ''),
isOthers: String(data.isOthers || ''),
content: String(data.content || ''),
name: String(data.name || ""),
type: String(data.type || ""),
isOthers: String(data.isOthers || ""),
content: String(data.content || ""),
},
})
});
}
/**
* 获取祈福列表如果需要的话
* 获取用户祈福列表
* @param {Object} params 查询参数
* @returns {Promise} API响应
*/
export function getPrayerList(params = {}) {
export function getUserPrayerList(params) {
return request({
url: '/app/pray/list',
method: 'GET',
params: params,
})
}
url: "/app/pray",
method: "GET",
params: {
...params,
/**
* 获取祈福详情如果需要的话
* @param {string} id 祈福ID
* @returns {Promise} API响应
*/
export function getPrayerDetail(id) {
return request({
url: '/app/pray/detail',
method: 'GET',
params: { id: id },
})
orderByColumn: "pray_time", // 排序字段
isAsc: "desc", // 降序排列
},
});
}

View File

@ -202,6 +202,18 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/personalCenter/myDonationList",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/personalCenter/myPrayRecordList",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/pieChart/pieChart",
"style": {

View File

@ -0,0 +1,283 @@
<template>
<view class="page">
<custom-navbar ref="customNavbar" title="捐赠记录" />
<view :style="{ backgroundColor: CommonEnum.BASE_COLOR }" class="header">
<template>
<view class="donation-container">
<!-- 标题区域 -->
<!-- <view class="donation-header">-->
<!-- <text class="header-subtitle"-->
<!-- >{{ donationList.length }}笔捐赠-->
<!-- </text>-->
<!-- </view>-->
<!-- 捐赠列表 -->
<view class="donation-list">
<view
v-for="(item, index) in winB_List"
:key="index"
class="donation-item"
>
<view class="item-icon">
<image :src="item.imgUrl" mode="widthFix" />
</view>
<!-- 中间内容 -->
<view class="item-content">
<text class="amount">捐赠{{ item.amount }}</text>
<text class="project">助力{{ item.proName }}</text>
<text class="time">{{ item.createTime }}</text>
</view>
<!-- 右侧箭头 -->
<!-- <view class="item-arrow">-->
<!-- <image-->
<!-- class="arrow-image"-->
<!-- mode="aspectFit"-->
<!-- src="/static/images/right-arrow.png"-->
<!-- />-->
<!-- </view>-->
<!-- 分割线 -->
<view
v-if="index < winB_List.length - 1"
class="item-divider"
></view>
</view>
</view>
</view>
</template>
</view>
<!-- 捐赠弹窗 -->
</view>
</template>
<script>
import { createPagination } from "../../composables/winB_Pagination";
import { getUserDonorList } from "../../api/donor/donor";
export default {
data() {
return {
// //
// donationList: [
// {
// amount: "10.00",
// project: "",
// time: "2025/09/09 23:33:59",
// },
// {
// amount: "10.00",
// project: "殿",
// time: "2025/09/09 23:33:59",
// },
// {
// amount: "10.00",
// project: "殿",
// time: "2025/09/09 23:33:59",
// },
// ],
};
},
mixins: [
createPagination({
fetchData: getUserDonorList,
mode: "loadMore",
pageSize: 10,
autoLoad: false, // false
}),
],
onLoad() {
//
this.winB_GetList();
},
methods: {
//
async loadPageData() {
this.loading = true;
try {
// TODO: API
// const response = await getPageData()
//
setTimeout(() => {
this.loading = false;
}, 1000);
} catch (error) {
console.error("获取页面数据失败:", error);
this.loading = false;
}
},
},
onReachBottom() {
this.winB_LoadMore();
console.log("加载更多");
},
};
</script>
<style lang="scss" scoped>
page {
background: #f5f0e7;
}
.page {
position: relative;
width: 100%;
min-height: 100vh;
}
.header {
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
flex-direction: column;
padding: 0 15rpx;
}
.donation-container {
padding: 30rpx;
//background-color: #f5f5f5;
min-height: 100vh;
width: 100%;
}
.donation-header {
margin-bottom: 40rpx;
text-align: center;
.header-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
display: block;
margin-bottom: 10rpx;
}
.header-subtitle {
font-size: 28rpx;
color: #666;
}
}
.donation-list {
//background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
}
.donation-item {
position: relative;
display: flex;
align-items: center;
padding: 30rpx;
//background-color: #fff;
.item-icon {
width: 160rpx;
margin-right: 24rpx;
background-color: #f0f0f0;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
.icon-image {
}
}
.item-content {
flex: 1;
.amount {
font-size: 32rpx;
font-weight: 500;
color: #333;
display: block;
margin-bottom: 8rpx;
}
.project {
font-size: 28rpx;
color: #666;
display: block;
margin-bottom: 8rpx;
}
.time {
font-size: 24rpx;
color: #999;
display: block;
}
}
.item-arrow {
width: 40rpx;
height: 40rpx;
.arrow-image {
width: 100%;
height: 100%;
opacity: 0.5;
}
}
.item-divider {
position: absolute;
bottom: 0;
left: 134rpx; // 80 + 24 + 30
right: 30rpx;
height: 1rpx;
background-color: #eee;
}
}
/* 响应式设计 */
@media (max-width: 375px) {
.donation-container {
padding: 20rpx;
}
.donation-item {
padding: 24rpx;
}
}
/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
.donation-container {
background-color: #1a1a1a;
}
.donation-list {
background-color: #2d2d2d;
}
.donation-item {
background-color: #2d2d2d;
.item-icon {
background-color: #3d3d3d;
}
.amount {
color: #fff !important;
}
.project {
color: #ccc !important;
}
.time {
color: #888 !important;
}
.item-divider {
background-color: #444 !important;
}
}
}
</style>

View File

@ -0,0 +1,331 @@
<template>
<view class="page">
<base-background />
<custom-navbar ref="customNavbar" title="祈福记录" />
<view class="header">
<template>
<view class="blessing-container">
<!-- 标题区域 -->
<!-- 祈福卡片列表 -->
<view class="blessing-list">
<view
v-for="(item, index) in winB_List"
:key="index"
class="blessing-card"
>
<view class="blessing-time-type">
<!-- 时间 -->
<text class="blessing-time">{{ item.prayTime }}</text>
<!-- 祈福类别 -->
<view class="blessing-type">
<text class="type-text"
>{{ item.type | prayerTypeFilter }}
</text>
</view>
</view>
<!-- 祈福人信息 -->
<view class="blessing-info">
<view class="info-item">
<text class="info-label">祈福人姓名</text>
<text class="info-value">{{ item.name }}</text>
</view>
<view class="info-item">
<text class="info-label">是否为他人祈福</text>
<text class="info-value"
>{{ item.isOthers === "1" ? "是" : "否" }}
</text>
</view>
</view>
<!-- 心愿内容 -->
<view class="wish-content">
<text class="wish-label">心愿内容</text>
<text class="wish-text">{{ item.content }}</text>
</view>
<!-- 分割线 -->
<view
v-if="index < winB_List.length - 1"
class="card-divider"
></view>
</view>
</view>
</view>
</template>
</view>
<!-- 捐赠弹窗 -->
</view>
</template>
<script>
import { createPagination } from "../../composables/winB_Pagination";
import { getUserPrayerList } from "../../api/pray/pray";
import CommonEnum from "../../enum/common";
export default {
computed: {
CommonEnum() {
return CommonEnum;
},
},
data() {
return {};
},
filters: {
prayerTypeFilter(value) {
const types = {
1: "学业",
2: "健康",
3: "姻缘",
4: "财运",
5: "消灾",
};
return types[value] || "其他";
},
},
mixins: [
createPagination({
fetchData: getUserPrayerList,
mode: "loadMore",
pageSize: 5,
autoLoad: false, // false
}),
],
onLoad() {
//
this.winB_GetList();
},
methods: {
//
async loadPageData() {
this.loading = true;
try {
// TODO: API
// const response = await getPageData()
//
setTimeout(() => {
this.loading = false;
}, 1000);
} catch (error) {
console.error("获取页面数据失败:", error);
this.loading = false;
}
},
},
onReachBottom() {
this.winB_LoadMore();
console.log("加载更多");
},
};
</script>
<style lang="scss" scoped>
page {
background: #f5f0e7;
}
.page {
position: relative;
width: 100%;
min-height: 100vh;
}
.header {
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
flex-direction: column;
padding: 0 15rpx;
}
.blessing-container {
padding: 30rpx;
//background-color: #faf8f5; //
min-height: 100vh;
width: 100%;
}
.blessing-header {
margin-bottom: 40rpx;
text-align: center;
.header-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
display: block;
margin-bottom: 10rpx;
}
.header-subtitle {
font-size: 28rpx;
color: #666;
}
}
.blessing-list {
display: flex;
flex-direction: column;
gap: 30rpx;
}
.blessing-card {
background-color: #fff;
border-radius: 20rpx;
padding: 30rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
position: relative;
border: 1px solid #c7a26d;
}
.blessing-time-type {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2px solid #f8f8f8;
margin-bottom: 10rpx;
}
.blessing-time {
font-size: 26rpx;
color: #666;
margin-bottom: 20rpx;
display: block;
}
.blessing-type {
margin-bottom: 25rpx;
.type-text {
background-color: #8b4513; //
color: #fff;
font-size: 28rpx;
font-weight: 500;
padding: 8rpx 20rpx;
border-radius: 6rpx;
display: inline-block;
}
}
.blessing-info {
margin-bottom: 25rpx;
.info-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15rpx;
&:last-child {
margin-bottom: 0;
}
}
.info-label {
font-size: 28rpx;
color: #666;
flex: 1;
}
.info-value {
font-size: 28rpx;
color: #333;
font-weight: 500;
flex: 1;
text-align: right;
}
}
.wish-content {
.wish-label {
font-size: 28rpx;
color: #666;
display: block;
margin-bottom: 10rpx;
}
.wish-text {
font-size: 30rpx;
color: #333;
font-weight: 500;
line-height: 1.4;
display: block;
}
}
.card-divider {
height: 1rpx;
background-color: #eee;
margin-top: 30rpx;
}
/* 响应式设计 */
@media (max-width: 375px) {
.blessing-container {
padding: 20rpx;
}
.blessing-card {
padding: 24rpx;
}
.blessing-time {
font-size: 24rpx;
}
.type-text {
font-size: 26rpx !important;
padding: 6rpx 16rpx !important;
}
.info-label,
.info-value {
font-size: 26rpx !important;
}
.wish-text {
font-size: 28rpx !important;
}
}
/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
.blessing-container {
background-color: #2a2a2a;
}
.blessing-card {
background-color: #3a3a3a;
}
.blessing-time {
color: #ccc;
}
.info-label {
color: #ccc !important;
}
.info-value {
color: #fff !important;
}
.wish-label {
color: #ccc !important;
}
.wish-text {
color: #fff !important;
}
.card-divider {
background-color: #555 !important;
}
}
</style>

View File

@ -73,12 +73,12 @@ export default {
{
title: "捐赠历史记录",
icon: CommonEnum.MY_DONOR,
path: "/pages/personalCenter/donationHistory",
path: "/pages/personalCenter/myDonationList",
},
{
title: "祈福记录",
icon: CommonEnum.MY_PRAY,
path: "/pages/personalCenter/prayerRecords",
path: "/pages/personalCenter/myPrayRecordList",
},
{
title: "牌位录入",

View File

@ -14,23 +14,23 @@ const ENV_CONFIG = {
// 获取当前环境配置
const getCurrentConfig = () => {
try {
const { envVersion } = wx.getAccountInfoSync().miniProgram;
console.log("当前环境:", envVersion);
const envConfig = ENV_CONFIG[envVersion] || ENV_CONFIG.release;
// 确保配置对象包含所有必要属性
return {
baseUrl: envConfig.baseUrl,
appId: envConfig.appId || 1, // 确保appId有默认值
};
} catch (error) {
console.warn("获取环境失败,默认使用正式环境:", error);
const fallbackConfig = ENV_CONFIG.release;
return {
baseUrl: fallbackConfig.baseUrl,
appId: fallbackConfig.appId || 1, // 确保appId有默认值
};
}
// try {
// // const { envVersion } = wx.getAccountInfoSync().miniProgram;
// // console.log("当前环境:", envVersion);
// const envConfig = ENV_CONFIG[envVersion] || ENV_CONFIG.release;
// // 确保配置对象包含所有必要属性
// return {
// baseUrl: envConfig.baseUrl,
// appId: envConfig.appId || 1, // 确保appId有默认值
// };
// } catch (error) {
// console.warn("获取环境失败,默认使用正式环境:", error);
const fallbackConfig = ENV_CONFIG.release;
return {
baseUrl: fallbackConfig.baseUrl,
appId: fallbackConfig.appId || 1, // 确保appId有默认值
};
// }
};
const config = getCurrentConfig();