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

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> </view>
</view> </view>
<button>捐一笔</button> <button @click="handleDonate">捐一笔</button>
</view> </view>
</template> </template>
@ -112,62 +112,62 @@ export default {
buddhaIcon: "https://api.ccttiot.com/image-1756353071821.png", buddhaIcon: "https://api.ccttiot.com/image-1756353071821.png",
loading: false, loading: false,
projectDetails: { projectDetails: {
createBy: null, // createBy: null,
createTime: "2025-07-08 17:50:26", // createTime: "2025-07-08 17:50:26",
updateBy: null, // updateBy: null,
updateTime: null, // updateTime: null,
remark: null, // remark: null,
scope: null, // scope: null,
deleted: null, // deleted: null,
areaPermissions: null, // areaPermissions: null,
id: "6", // id: "6",
templeId: "11", // templeId: "11",
proName: "123", // proName: "123",
proProfile: "我们计划在202X-203X年完成这些重要建设邀您共同见证", // proProfile: "202X-203X",
formedYear: null, // formedYear: null,
imgUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg", // imgUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
proIntroduce: // proIntroduce:
"<p>项目介绍项目介绍项目介绍项目介绍项目介绍项目介</p><p>绍项目介绍项目介绍项目介绍项目介绍项目介绍</p><p>项目介绍项目介绍项目介绍项目介绍项目介绍项目介</p><p>绍项目介绍项目介绍项目</p><p>项目介绍项目介绍项目介绍项目介绍项目介绍项目介</p><p>绍项目介绍项目介绍项目介绍项目介绍项目介绍</p>", // "<p></p><p></p><p></p><p></p><p></p><p></p>",
totalAmount: 10000101.0, // totalAmount: 10000101.0,
state: "1", // state: "1",
createId: null, // createId: null,
templeName: "少林寺", // templeName: "",
donorCount: 6, // donorCount: 6,
amountSum: 6666666, // amountSum: 6666666,
}, },
winB_List: [ winB_List: [
{ // {
id: "18", // id: "18",
templeId: "12", // templeId: "12",
title: "施工情况01", // title: "01",
content: "<p>施工情况02施工情况02...</p>", // content: "<p>0202...</p>",
status: "1", // status: "1",
templeName: "寒山寺", // templeName: "",
createTime: "2025-07-09 13:50:57", // createTime: "2025-07-09 13:50:57",
coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg", // coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
}, // },
//
{ // {
id: "19", // id: "19",
templeId: "12", // templeId: "12",
title: "施工情况01232", // title: "01232",
content: // 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>", // "<p>020202020202020202020202020202020202020202020202...</p>",
status: "1", // status: "1",
templeName: "寒山寺", // templeName: "",
createTime: "2025-07-09 13:50:57", // createTime: "2025-07-09 13:50:57",
coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg", // coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
}, // },
{ // {
id: "19", // id: "19",
templeId: "12", // templeId: "12",
title: "施工情况01232", // title: "01232",
content: "<p>施工情况02施工情况02...</p>", // content: "<p>0202...</p>",
status: "1", // status: "1",
templeName: "寒山寺", // templeName: "",
createTime: "2025-07-09 13:50:57", // createTime: "2025-07-09 13:50:57",
coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg", // coverUrl: "https://api.ccttiot.com/IMG01-1751968117197.jpg",
}, // },
], ],
}; };
}, },
@ -191,7 +191,8 @@ export default {
// //
if (detailResponse?.code === 200) { if (detailResponse?.code === 200) {
//this.projectDetails = detailResponse.data; this.projectDetails = detailResponse.data;
console.log("projectDetails.state:", this.projectDetails.state);
} else { } else {
console.warn("获取机构详情失败:", detailResponse?.message); console.warn("获取机构详情失败:", detailResponse?.message);
uni.showToast({ 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)}`, 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: { computed: {
//
getProgressPercentage() { getProgressPercentage() {
if ( if (
!this.projectDetails.totalAmount || !this.projectDetails.totalAmount ||

View File

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