diff --git a/packages/community/propertyPayment/index.vue b/packages/community/propertyPayment/index.vue
index f44fae20..07442198 100644
--- a/packages/community/propertyPayment/index.vue
+++ b/packages/community/propertyPayment/index.vue
@@ -83,8 +83,8 @@
{{ items.community_fee_type ? items.community_fee_type.type_name : '' }}
¥{{ items.money }}
- 未付款
-
+ 未付款
+
已付款
@@ -447,7 +447,7 @@ export default {
} else if (this.payType == 2) {
name_mini = "物业公积金";
} else {
- name_mimi = "微信 + 物业公积金";
+ name_mini = "微信 + 物业公积金";
}
if (!this.currentMoney) {
return uni.showToast({
@@ -455,22 +455,79 @@ export default {
duration: 2000,
});
}
- await request(apiArr.createPayOrder, "POST", {
+
+ // 构建支付参数,根据支付类型决定传递哪些字段
+ const payParams = {
order_ids: order_ids,
community_id: this.currentCommunity.id,
room_id: this.currentRoom.room_id,
pay_user_id: uni.getStorageSync("userId"),
user_name: uni.getStorageSync("nickName"),
pay_user_name: uni.getStorageSync("nickName"),
- //格式化年月日 时分秒
pay_time: formatDate(new Date()),
- money: this.currentMoney,
name_mini,
- }).then((res) => {
- console.log(res);
- this.payInfoId = res.id;
- this.OrderPay();
- });
+ };
+
+ // 判断是否是组合支付
+ const isComboPay = this.show2;
+
+ if (this.payType == 1 || isComboPay) {
+ //微信支付或组合支付
+ payParams.money = this.currentMoney;
+ }
+
+ if (this.payType == 2 || isComboPay) {
+ // 公积金支付或组合支付
+ const fundAmount = Math.min(Number(this.balanceMoney), Number(this.currentMoney));
+ payParams.property_housing_fund = fundAmount.toFixed(2);
+
+ // 仅公积金支付 公积金不足
+ if (this.payType == 2 && !isComboPay) {
+ if (Number(this.balanceMoney) < Number(this.currentMoney)) {
+ uni.showToast({
+ title: '可用公积金不足,可选择组合支付',
+ icon: 'none',
+ duration: 3000
+ });
+ return;
+ }
+ }
+ }
+
+ // 组合支付
+ if (isComboPay) {
+ this.payType = 3;
+ name_mini = "微信 + 物业公积金";
+ }
+
+ payParams.name_mini = name_mini;
+
+ if (this.payType == 2) {
+ uni.showModal({
+ title: '提示',
+ content: '确定使用物业公积金支付?',
+ success: async function (res) {
+ if (res.confirm) {
+ await request(apiArr.createPayOrder, "POST", payParams).then((res) => {
+ const params = {
+ order_pay_id: res.id,
+ }
+ request(apiArr.tradeQuery, "POST", params).then(res => {
+ this.getRoomSelect();
+ this.getUserGovenmentMoney();
+ })
+ });
+ } else if (res.cancel) {
+ console.log('用户点击取消');
+ }
+ }
+ });
+ } else {
+ await request(apiArr.createPayOrder, "POST", payParams).then((res) => {
+ this.payInfoId = res.id;
+ this.OrderPay();
+ });
+ }
},
//根据支付订单查询交易信息
async getPayInfo() {
@@ -498,6 +555,8 @@ export default {
order_pay_id: this.payInfoId,
}
request(apiArr.tradeQuery, "POST", params).then(res => {
+ this.getRoomSelect();
+ this.getUserGovenmentMoney();
})
},
fail: (payErr) => {
@@ -528,7 +587,6 @@ export default {
//支付记录
getPayList() {
-
request(apiArr.getPayOrderList, "POST", {
room_id: this.currentRoom.room_id,
page_num: this.page_num,