Quellcode durchsuchen

fix: 确认预约添加loading

carver vor 2 Jahren
Ursprung
Commit
ee2b161e5d
1 geänderte Dateien mit 48 neuen und 42 gelöschten Zeilen
  1. 48 42
      antbuilder/industry/hospitalV2/components/order-pay/index.js

+ 48 - 42
antbuilder/industry/hospitalV2/components/order-pay/index.js

@@ -119,49 +119,55 @@ Component(
 					feeStr,
 				} = this.getQuery();
 				if (this.data.checkedPatient && this.data.checkedPatient.name) {
-					makeAppointment({
-						doctorId: this.data.order.doctorId,
-						orderSourceId: this.data.order.orderSourceId,
-						cardNum: this.data.checkedPatient.bindCardNum,
-						serviceDate,
-						datePeriod,
-						deptCode,
-						doctorCode,
-						medicalFee,
-						registeredFee,
-						doctorName,
-						deptName,
-						registeredDate,
-						period,
-						startTime: startTimeNew,
-						endTime,
-						scheduleItemCode,
-						medicalCardId: this.data.checkedPatient.id,
-						scheduleItemCode: this.data.order.orderSourceId,
-						deptId,
-						availableNumStr,
-						regFee: fee,
-						regFeeStr: feeStr,
-					}).then((data) => {
-						if (this.data.onlinePay) {
-							tradePay(
-								{
-									type: 1,
-									idNum: data.orderId,
-									depName: this.data.order.depName,
-								},
-								{
-									tradeType: "Appointment",
-								}
-							).then(() => {
-								this.toDetail(data.orderId); // 支付成功以后,唤起消息订阅
+					try {
+						my.showLoading();
+						makeAppointment({
+							doctorId: this.data.order.doctorId,
+							orderSourceId: this.data.order.orderSourceId,
+							cardNum: this.data.checkedPatient.bindCardNum,
+							serviceDate,
+							datePeriod,
+							deptCode,
+							doctorCode,
+							medicalFee,
+							registeredFee,
+							doctorName,
+							deptName,
+							registeredDate,
+							period,
+							startTime: startTimeNew,
+							endTime,
+							scheduleItemCode,
+							medicalCardId: this.data.checkedPatient.id,
+							scheduleItemCode: this.data.order.orderSourceId,
+							deptId,
+							availableNumStr,
+							regFee: fee,
+							regFeeStr: feeStr,
+						}).then((data) => {
+							if (this.data.onlinePay) {
+								tradePay(
+									{
+										type: 1,
+										idNum: data.orderId,
+										depName: this.data.order.depName,
+									},
+									{
+										tradeType: "Appointment",
+									}
+								).then(() => {
+									this.toDetail(data.orderId); // 支付成功以后,唤起消息订阅
 
-								// this.subscribe.subscribeMessage();
-							});
-						} else {
-							this.toDetail(data.orderId);
-						}
-					});
+									// this.subscribe.subscribeMessage();
+								});
+							} else {
+								this.toDetail(data.orderId);
+							}
+						});
+					} catch (error) {
+					} finally {
+						my.hideLoading();
+					}
 				} else {
 					this.choosePatient();
 				}