Browse Source

fix: 医保正式环境测试,默认不使用个账进行支付

carver 1 year ago
parent
commit
da5b1713a3

+ 1 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao-result/index.axml

@@ -3,6 +3,7 @@
   <view class="ybv2-result">
     <icon type="success" size="{{ 60 }}"/>
     <view class="text">支付成功</view>
+    <view class="text">请到门诊一楼西药房四号窗取药</view>
     <view>{{ sec }}秒后自动跳转</view>
   </view>
 </wrapper>

+ 23 - 6
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/index.js

@@ -22,7 +22,7 @@ Component(
 			canPay: false,
 			prescriptionList: [],
 			actionsheetVisible: false,
-			isUserPersonalAccount: true,
+			isUserPersonalAccount: false, // 医保正式环境测试,默认不使用个账进行支付
 			isCulculate: false,
 			preConfirmInfo: {},
 		},
@@ -81,6 +81,7 @@ Component(
 			},
 
 			async requestGetPayAuthInfo(authCode, callUrl, reqBizNo, lifeType) {
+				my.showLoading({ mask: true });
 				const _this = this;
 				const [err, result] = await getPayAuthInfo({
 					authCode,
@@ -88,6 +89,7 @@ Component(
 					reqBizNo,
 				});
 				if (!err) {
+					my.hideLoading();
 					const { payAuthNo, authNo, medicalCardInstId, medicalCardId } =
 						result;
 					if (result.authNo) {
@@ -117,6 +119,16 @@ Component(
 					} else {
 						my.navigateBack();
 					}
+				}else{
+					my.hideLoading();
+					my.showToast({
+						type: "fail",
+						content: err.info || "未知错误",
+						duration: 2000,
+						complete() {
+							my.navigateBack();
+						},
+					});
 				}
 			},
 
@@ -127,7 +139,6 @@ Component(
 				);
 				console.log("this.$page.data handlePrePayConfirm ==>", this.$page.data);
 				my.showLoading({ mask: true });
-				try {
 					const {
 						hisOrderNo: hisOrdNum,
 						hisPatientId: patientId,
@@ -158,6 +169,7 @@ Component(
 					});
 					if (!err) {
 						// 预结算成功
+						my.hideLoading();
 						const ybData = getYbParams(result);
 						this.setData({
 							preConfirmInfo: Object.assign(result, ybData),
@@ -165,11 +177,16 @@ Component(
 							canPay: true,
 						});
 					} else {
-						console.log("err ==>", err, typeof err, JSON.stringify(err));
-						my.navigateBack();
+						my.hideLoading();
+						my.showToast({
+							type: "fail",
+							content: err.info || "未知错误",
+							duration: 2000,
+							complete() {
+								my.navigateBack();
+							},
+						});
 					}
-				} finally {
-					my.hideLoading();
 				}
 			},