捐款按钮的未来规划页面定制

This commit is contained in:
WindowBird 2025-09-05 11:32:33 +08:00
parent 1862c92181
commit b1ff13ebb0
2 changed files with 98 additions and 58 deletions

View File

@ -85,7 +85,7 @@
</view>
</view>
</view>
<button>捐一笔</button>
<button @click="handleDonate">捐一笔</button>
</view>
</template>
@ -112,62 +112,62 @@ export default {
buddhaIcon: "https://api.ccttiot.com/image-1756353071821.png",
loading: false,
projectDetails: {
createBy: null,
createTime: "2025-07-08 17:50:26",
updateBy: null,
updateTime: null,
remark: null,
scope: null,
deleted: null,
areaPermissions: null,
id: "6",
templeId: "11",
proName: "123",
proProfile: "我们计划在202X-203X年完成这些重要建设邀您共同见证",
formedYear: null,
imgUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
proIntroduce:
"<p>项目介绍项目介绍项目介绍项目介绍项目介绍项目介</p><p>绍项目介绍项目介绍项目介绍项目介绍项目介绍</p><p>项目介绍项目介绍项目介绍项目介绍项目介绍项目介</p><p>绍项目介绍项目介绍项目</p><p>项目介绍项目介绍项目介绍项目介绍项目介绍项目介</p><p>绍项目介绍项目介绍项目介绍项目介绍项目介绍</p>",
totalAmount: 10000101.0,
state: "1",
createId: null,
templeName: "少林寺",
donorCount: 6,
amountSum: 6666666,
// createBy: null,
// createTime: "2025-07-08 17:50:26",
// updateBy: null,
// updateTime: null,
// remark: null,
// scope: null,
// deleted: null,
// areaPermissions: null,
// id: "6",
// templeId: "11",
// proName: "123",
// proProfile: "202X-203X",
// formedYear: null,
// imgUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
// proIntroduce:
// "<p></p><p></p><p></p><p></p><p></p><p></p>",
// totalAmount: 10000101.0,
// state: "1",
// createId: null,
// templeName: "",
// donorCount: 6,
// amountSum: 6666666,
},
winB_List: [
{
id: "18",
templeId: "12",
title: "施工情况01",
content: "<p>施工情况02施工情况02...</p>",
status: "1",
templeName: "寒山寺",
createTime: "2025-07-09 13:50:57",
coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
},
{
id: "19",
templeId: "12",
title: "施工情况01232",
content:
"<p>施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02施工情况02...</p>",
status: "1",
templeName: "寒山寺",
createTime: "2025-07-09 13:50:57",
coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
},
{
id: "19",
templeId: "12",
title: "施工情况01232",
content: "<p>施工情况02施工情况02...</p>",
status: "1",
templeName: "寒山寺",
createTime: "2025-07-09 13:50:57",
coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
},
// {
// id: "18",
// templeId: "12",
// title: "01",
// content: "<p>0202...</p>",
// status: "1",
// templeName: "",
// createTime: "2025-07-09 13:50:57",
// coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
// },
//
// {
// id: "19",
// templeId: "12",
// title: "01232",
// content:
// "<p>020202020202020202020202020202020202020202020202...</p>",
// status: "1",
// templeName: "",
// createTime: "2025-07-09 13:50:57",
// coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
// },
// {
// id: "19",
// templeId: "12",
// title: "01232",
// content: "<p>0202...</p>",
// status: "1",
// templeName: "",
// createTime: "2025-07-09 13:50:57",
// coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
// },
],
};
},
@ -191,7 +191,8 @@ export default {
//
if (detailResponse?.code === 200) {
//this.projectDetails = detailResponse.data;
this.projectDetails = detailResponse.data;
console.log("projectDetails.state:", this.projectDetails.state);
} else {
console.warn("获取机构详情失败:", detailResponse?.message);
uni.showToast({
@ -241,9 +242,48 @@ export default {
url: `/pages/institutionalStructure/projectDetail?title=${encodeURIComponent(item.title)}&content=${encodeURIComponent(item.content)}&createTime=${encodeURIComponent(item.createTime)}&coverUrl=${encodeURIComponent(item.coverUrl)}`,
});
},
//
handleDonate() {
console.log("根据state进行弹窗", this.projectDetails.state);
if (this.projectDetails.state === "1") {
uni.showToast({
title: "捐款暂未开始",
icon: "none",
duration: 2000,
});
}
if (this.projectDetails.state !== "1") {
//
uni.showModal({
title: "提示", //
content: "确定要执行此操作吗?", //
confirmText: "确定", // ""
cancelText: "取消", // ""
confirmColor: "#007AFF", //
cancelColor: "#555555", //
showCancel: true, // true
success: (res) => {
if (res.confirm) {
console.log("用户点击确定");
//
} else if (res.cancel) {
console.log("用户点击取消");
//
}
},
fail: (err) => {
console.error("弹窗调用失败:", err);
uni.showToast({
title: "操作失败,请重试",
icon: "none",
});
},
});
}
},
},
computed: {
//
getProgressPercentage() {
if (
!this.projectDetails.totalAmount ||

View File

@ -89,7 +89,7 @@ export default {
//
handleViewDetail(data) {
console.log("查看详细:", data.item);
if (data.item.topRight === "进行中") {
if (data.item.topRight === "进行中" || data.item.topRight === "规划") {
uni.navigateTo({
url: `/pages/future/future?formedId=${data.item.formedId}`,
fail: (err) => {