往生殿供奉的支付功能

This commit is contained in:
WindowBird 2025-09-18 15:14:08 +08:00
parent f63c334aeb
commit 365284dd5f
2 changed files with 21 additions and 14 deletions

View File

@ -107,17 +107,21 @@ export default {
return; return;
} }
console.log("this.durationOptions", this.durationOptions);
// //
const selectedOption = this.durationOptions.find( const selectedOption = this.durationOptions.find(
(option) => option.value === this.selectedDuration, (option) => option.id === this.selectedDuration,
); );
console.log("selectedOption", selectedOption);
// //
this.$emit("confirm", { this.$emit("confirm", {
duration: this.selectedDuration, thaliId: this.selectedDuration,
durationLabel: selectedOption.label, // durationLabel: selectedOption.name,
price: selectedOption.price, payAmount: selectedOption.amount,
offererName: this.offererName.trim(), worName: this.offererName.trim(),
}); });
}, },
}, },

View File

@ -144,6 +144,7 @@ import BottomButton from "../../components/bottom-button/bottom-button.vue";
import OfferingModal from "./compositons/offeringModal.vue"; import OfferingModal from "./compositons/offeringModal.vue";
import { getPackageList } from "../../api/memorial/memorial"; import { getPackageList } from "../../api/memorial/memorial";
import { ordersEnshrined } from "../../api/order/order";
export default { export default {
components: { components: {
@ -228,6 +229,8 @@ export default {
this.PackageList = response.data; this.PackageList = response.data;
console.log("this.PackageList", this.PackageList);
console.log("获取的套餐数据:", this.PackageList); console.log("获取的套餐数据:", this.PackageList);
}, },
@ -399,7 +402,8 @@ export default {
}, },
// //
handleOfferingConfirm(offeringData) { async handleOfferingConfirm(offeringData) {
offeringData = { ...offeringData, memorialId: this.selectedUnitId };
console.log("确认供奉:", offeringData); console.log("确认供奉:", offeringData);
// API // API
@ -407,19 +411,18 @@ export default {
title: "正在提交供奉...", title: "正在提交供奉...",
}); });
// API let res = await ordersEnshrined(offeringData);
setTimeout(() => { uni.hideLoading();
uni.hideLoading(); if (res.code === 200) {
uni.showToast({ uni.showToast({
title: "供奉成功!", title: "供奉成功!",
icon: "success", icon: "success",
}); });
}
//
this.closeOfferingModal();
// //
this.closeOfferingModal();
//
}, 2000);
}, },
// //