Bläddra i källkod

fix: 新增医保支付成功页

carver 1 år sedan
förälder
incheckning
c5b10197bc

+ 12 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao-result/index.acss

@@ -0,0 +1,12 @@
+.ybv2-result {
+  display: flex;
+  align-content: center;
+  margin-top: 50px;
+  flex-direction: column;
+  text-align: center;
+}
+
+.ybv2-result .text{
+  margin: 20px 0;
+  font-size: 26px;
+}

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

@@ -0,0 +1,8 @@
+<wrapper>
+  <!-- 新页面 -->
+  <view class="ybv2-result">
+    <icon type="success" size="{{ 60 }}"/>
+    <view class="text">支付成功</view>
+    <view>{{ sec }}秒后自动跳转</view>
+  </view>
+</wrapper>

+ 40 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao-result/index.js

@@ -0,0 +1,40 @@
+import { createSubscribe } from "applet-page-component";
+
+Component(
+	createSubscribe({
+		onShow() {},
+	})({
+		props: {},
+		data: {
+			isPaySuccess: true,
+			sec: 3,
+		},
+
+		didMount() {
+			this.init();
+		},
+
+		methods: {
+			init() {
+				const _this = this;
+
+				const myInterval = () => {
+					if (_this.data.sec > 0) {
+						_this.setData({
+							sec: _this.data.sec - 1,
+						});
+					} else {
+						clearInterval(myIntervalId);
+						// 支付成功后暂时返回首页,方便通过验收
+						const len = getCurrentPages().length;
+						my.navigateBack({
+							delta: len + 1,
+						});
+					}
+				};
+
+				const myIntervalId = setInterval(myInterval, 1000);
+			},
+		},
+	})
+);

+ 7 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao-result/index.json

@@ -0,0 +1,7 @@
+{
+  "component": true,
+  "usingComponents": {
+    "wrapper": "../components/wrapper/index",
+    "am-icon": "mini-ali-ui/es/am-icon/index"
+  }
+}

+ 0 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao-result/service.js


+ 11 - 10
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/index.js

@@ -195,11 +195,12 @@ Component(
 			},
 
 			async handleIsUserPersonalAccount(e) {
-				my.showLoading();
 				const _this = this;
 				const { valuex } = e.currentTarget.dataset;
 				const { hisOrderNo, hisPatientId } = this.$page.data.query;
-				const { preConfirmInfo } = this.data;
+				const { preConfirmInfo, isUserPersonalAccount } = this.data;
+				if (isUserPersonalAccount === valuex) return;
+				my.showLoading();
 				this.setData(
 					{
 						isUserPersonalAccount: valuex,
@@ -219,11 +220,11 @@ Component(
 								type: "fail",
 								content: "撤销预结算失败",
 								duration: 2000,
+								complete() {
+									my.hideLoading();
+									my.navigateBack();
+								},
 							});
-							setTimeout(() => {
-								my.hideLoading();
-								my.navigateBack();
-							}, 2000);
 						}
 					}
 				);
@@ -354,10 +355,10 @@ Component(
 					// 支付成功后返回列表页
 					// my.navigateBack();
 
-					// 支付成功后暂时返回首页,方便通过验收
-					const len = getCurrentPages().length;
-					my.navigateBack({
-						delta: len + 1,
+					history.replace({
+						title: "支付成功",
+						query: {},
+						pageType: "hospital-payment-detail-yibao-result",
 					});
 				}
 			},

+ 120 - 120
antbuilder/industry/hospitalV2/components/personal-center-head/personalCenterHead.js

@@ -6,137 +6,137 @@ import history from "../../utils/history";
 import doLogin from "../../utils/doLogin";
 const app = getApp();
 const qrImage =
-  "https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*z8duR6vAPp0AAAAAAAAAAAAAARQnAQ";
+	"https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*z8duR6vAPp0AAAAAAAAAAAAAARQnAQ";
 const addIcon =
-  "https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*dqcsTZEuGTgAAAAAAAAAAAAAARQnAQ";
+	"https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*dqcsTZEuGTgAAAAAAAAAAAAAARQnAQ";
 Component(
-  createSubscribe({
-    onShow() {
-      const { isLogin } = this.data;
-      if (isLogin) this.fetchCardInfo();
-    },
-  })(
-    connect({
-      mapStateToProps: {
-        scopes: ({ $global }) => $global.scopes,
-        userInfo: ({ $global }) => $global.userInfo || {},
-        isLogin: ({ $global }) => $global.userInfo.isLogin,
-      },
-    })({
-      props: {
-        componentData: {},
-      },
-      data: {
-        addIcon,
-        qrImage,
-        cardInfo: null,
-        showPatient: false,
-        imgSrcPrefix: app.globalData.imgSrcPrefix,
-      },
+	createSubscribe({
+		onShow() {
+			const { isLogin } = this.data;
+			if (isLogin) this.fetchCardInfo();
+		},
+	})(
+		connect({
+			mapStateToProps: {
+				scopes: ({ $global }) => $global.scopes,
+				userInfo: ({ $global }) => $global.userInfo || {},
+				isLogin: ({ $global }) => $global.userInfo.isLogin,
+			},
+		})({
+			props: {
+				componentData: {},
+			},
+			data: {
+				addIcon,
+				qrImage,
+				cardInfo: null,
+				showPatient: false,
+				imgSrcPrefix: app.globalData.imgSrcPrefix,
+			},
 
-      async didUpdate(_, preState) {
-        const { isLogin = false } = preState;
-        const { isLogin: curLogin } = this.data;
+			async didUpdate(_, preState) {
+				const { isLogin = false } = preState;
+				const { isLogin: curLogin } = this.data;
 
-        if (isLogin !== curLogin && curLogin) {
-          await this.fetchCardInfo();
-        }
-      },
+				if (isLogin !== curLogin && curLogin) {
+					await this.fetchCardInfo();
+				}
+			},
 
-      methods: {
-        async fetchCardInfo() {
-          const info = await getMyCardInfo();
-          this.setData({
-            cardInfo: info,
-          });
-        },
+			methods: {
+				async fetchCardInfo() {
+					const info = await getMyCardInfo();
+					this.setData({
+						cardInfo: info,
+					});
+				},
 
-        onHandleYb2() {
-          history.push({
-            title: "确认支付",
-            query: {},
-            pageType: "hospital-payment-detail-yibao",
-          });
-        },
+				onHandleYb2() {
+					history.push({
+						title: "支付成功",
+						query: {},
+						pageType: "hospital-payment-detail-yibao-result",
+					});
+				},
 
-        setQuery(patientId) {
-          setPagesQuery({
-            currentUserId: patientId,
-          });
-        },
+				setQuery(patientId) {
+					setPagesQuery({
+						currentUserId: patientId,
+					});
+				},
 
-        /**
-         * 去登陆
-         */
-        async onLogin() {
-          await doLogin.call(this, {
-            scopes: "auth_user",
-          });
-        },
+				/**
+				 * 去登陆
+				 */
+				async onLogin() {
+					await doLogin.call(this, {
+						scopes: "auth_user",
+					});
+				},
 
-        /**
-         * 切换就诊人
-         */
-        changeBtn() {
-          console.log("1111111");
-          this.setData({
-            showPatient: true,
-          });
-        },
+				/**
+				 * 切换就诊人
+				 */
+				changeBtn() {
+					console.log("1111111");
+					this.setData({
+						showPatient: true,
+					});
+				},
 
-        onClose() {
-          this.setData({
-            showPatient: false,
-          });
-        },
+				onClose() {
+					this.setData({
+						showPatient: false,
+					});
+				},
 
-        onChange(item) {
-          const { cardInfo } = this.data;
-          const { id: patientId, bindCardNum: cardNum, hisPatientId } = item;
-          this.setData({
-            showPatient: false,
-            cardInfo: { ...cardInfo, cardNum, patientId, hisPatientId },
-          });
-          my.showToast({
-            duration: 1500,
-            content: "就诊人切换成功",
-          });
-        },
+				onChange(item) {
+					const { cardInfo } = this.data;
+					const { id: patientId, bindCardNum: cardNum, hisPatientId } = item;
+					this.setData({
+						showPatient: false,
+						cardInfo: { ...cardInfo, cardNum, patientId, hisPatientId },
+					});
+					my.showToast({
+						duration: 1500,
+						content: "就诊人切换成功",
+					});
+				},
 
-        toPatientDetail() {
-          const { patientId } = this.data.cardInfo;
-          history.push({
-            title: "就诊人详情",
-            query: {
-              id: patientId,
-            },
-            pageType: "patient-detail",
-          });
-        },
+				toPatientDetail() {
+					const { patientId } = this.data.cardInfo;
+					history.push({
+						title: "就诊人详情",
+						query: {
+							id: patientId,
+						},
+						pageType: "patient-detail",
+					});
+				},
 
-        toAddCard() {
-          const { userInfo } = this.data;
-          const { gender } = userInfo || {};
-          const editForm = {
-            // idCardNo,
-            // name: fullName,
-            defaultCard: "是",
-            // phoneNumber: phone,
-            // relationShip: "本人",
-            sex: gender === "m" ? "男" : "女",
-          };
-          history.push({
-            title: "添加就诊人",
-            pageType: "edit-patient",
-            query: {
-              // editType: "card",
-            },
-            componentData: {
-              editForm,
-            },
-          });
-        },
-      },
-    })
-  )
+				toAddCard() {
+					const { userInfo } = this.data;
+					const { gender } = userInfo || {};
+					const editForm = {
+						// idCardNo,
+						// name: fullName,
+						defaultCard: "是",
+						// phoneNumber: phone,
+						// relationShip: "本人",
+						sex: gender === "m" ? "男" : "女",
+					};
+					history.push({
+						title: "添加就诊人",
+						pageType: "edit-patient",
+						query: {
+							// editType: "card",
+						},
+						componentData: {
+							editForm,
+						},
+					});
+				},
+			},
+		})
+	)
 );

+ 2 - 0
antbuilder/industry/hospitalV2/pages/page-no-pull/index.axml

@@ -85,4 +85,6 @@
   <select-hospital-area-introduce componentData="{{ componentData }}"  a:elif="{{ pageType === 'select-hospital-area-introduce' }}" />
   <!-- 医保2.0 支付页面 -->
   <hospital-payment-detail-yibao componentData="{{ componentData }}" a:elif="{{ pageType === 'hospital-payment-detail-yibao' }}" />
+  <!-- 医保2.0 支付成功页面 -->
+  <hospital-payment-detail-yibao-result componentData="{{ componentData }}" a:elif="{{ pageType === 'hospital-payment-detail-yibao-result' }}" />
 </block>

+ 52 - 51
antbuilder/industry/hospitalV2/pages/page-no-pull/index.json

@@ -1,52 +1,53 @@
 {
-  "defaultTitle": "",
-  "transparentTitle": "auto",
-  "backgroundColor": "#FFFFFF",
-  "usingComponents": {
-    "deposit-list": "../../components/deposit-list/index",
-    "pay-result": "../../components/pay-result/index",
-    "mas-adc-nav-bar": "@mas.io/adc-nav-bar/es/index",
-    "inventory-day": "../../components/inventory-day/index",
-    "deposit": "../../components/deposit/index",
-    "hospital-project": "../../components/hospital-project/index",
-    "hospital-home": "../../components/hospital-home/index",
-    "booking-detail": "../../components/booking-detail/index",
-    "follow-up-notice": "../../components/follow-up-notice/index",
-    "select-department": "../../components/select-department/index",
-    "service-agreement": "../../components/service-agreement/index",
-    "hospital-num-source": "../../components/hospital-num-source/index",
-    "select-hospital-area": "../../components/select-hospital-area/index",
-    "general-services": "../../components/general-services/generalServices",
-    "report-details-list": "../../components/report-details-list/reportDetailsList",
-    "doctor-profile-item": "../../components/doctor-profile-item/doctorProfileItem",
-    "doctor-page": "../../components/doctor-page/index",
-    "order-pay": "../../components/order-pay/index",
-    "appointment-result": "../../components/appointment-result/index",
-    "hospital-recharge": "../../components/hospital-recharge/index",
-    "patient-list": "../../components/patient-list/index",
-    "patient-detail": "../../components/patient-detail/index",
-    "patient-detail-edit": "../../components/patient-detail-edit/index",
-    "patient-detail-phone": "../../components/patient-detail-phone/index",
-    "hospital-payment": "../../components/hospital-payment/index",
-    "hospital-payment-detail": "../../components/hospital-payment-detail/index",
-    "line-up-record": "../../components/line-up-record/index",
-    "edit-patient": "../../components/edit-patient/index",
-    "subscribe-record": "../../components/subscribe-record/index",
-    "report-list": "../../components/report-list/index",
-    "payment-success": "../../components/payment-success/index",
-    "admission-record": "../../components/admission-record/index",
-    "add-inpatient-information": "../../components/add-inpatient-information/index",
-    "add-inpatient": "../../components/add-inpatient/index",
-    "registration-result": "../../components/registration-result/index",
-    "settlement": "../../components/settlement/index",
-    "discharge-settlement-detail": "../../components/discharge-settlement-detail/index",
-    "pre-settlement": "../../components/pre-settlement/index",
-    "discharge-settlement": "../../components/discharge-settlement/index",
-    "patient-guide": "../../components/patient-guide/index",
-    "hospital-introduce": "../../components/hospital-introduce/index",
-    "select-hospital-area-introduce": "../../components/select-hospital-area-introduce/index",
-    "hospital-payment-detail-yibao": "../../components/hospital-payment-detail-yibao/index"
-  },
-  "allowsBounceVertical": "NO",
-  "pullRefresh": false
-}
+	"defaultTitle": "",
+	"transparentTitle": "auto",
+	"backgroundColor": "#FFFFFF",
+	"usingComponents": {
+		"deposit-list": "../../components/deposit-list/index",
+		"pay-result": "../../components/pay-result/index",
+		"mas-adc-nav-bar": "@mas.io/adc-nav-bar/es/index",
+		"inventory-day": "../../components/inventory-day/index",
+		"deposit": "../../components/deposit/index",
+		"hospital-project": "../../components/hospital-project/index",
+		"hospital-home": "../../components/hospital-home/index",
+		"booking-detail": "../../components/booking-detail/index",
+		"follow-up-notice": "../../components/follow-up-notice/index",
+		"select-department": "../../components/select-department/index",
+		"service-agreement": "../../components/service-agreement/index",
+		"hospital-num-source": "../../components/hospital-num-source/index",
+		"select-hospital-area": "../../components/select-hospital-area/index",
+		"general-services": "../../components/general-services/generalServices",
+		"report-details-list": "../../components/report-details-list/reportDetailsList",
+		"doctor-profile-item": "../../components/doctor-profile-item/doctorProfileItem",
+		"doctor-page": "../../components/doctor-page/index",
+		"order-pay": "../../components/order-pay/index",
+		"appointment-result": "../../components/appointment-result/index",
+		"hospital-recharge": "../../components/hospital-recharge/index",
+		"patient-list": "../../components/patient-list/index",
+		"patient-detail": "../../components/patient-detail/index",
+		"patient-detail-edit": "../../components/patient-detail-edit/index",
+		"patient-detail-phone": "../../components/patient-detail-phone/index",
+		"hospital-payment": "../../components/hospital-payment/index",
+		"hospital-payment-detail": "../../components/hospital-payment-detail/index",
+		"line-up-record": "../../components/line-up-record/index",
+		"edit-patient": "../../components/edit-patient/index",
+		"subscribe-record": "../../components/subscribe-record/index",
+		"report-list": "../../components/report-list/index",
+		"payment-success": "../../components/payment-success/index",
+		"admission-record": "../../components/admission-record/index",
+		"add-inpatient-information": "../../components/add-inpatient-information/index",
+		"add-inpatient": "../../components/add-inpatient/index",
+		"registration-result": "../../components/registration-result/index",
+		"settlement": "../../components/settlement/index",
+		"discharge-settlement-detail": "../../components/discharge-settlement-detail/index",
+		"pre-settlement": "../../components/pre-settlement/index",
+		"discharge-settlement": "../../components/discharge-settlement/index",
+		"patient-guide": "../../components/patient-guide/index",
+		"hospital-introduce": "../../components/hospital-introduce/index",
+		"select-hospital-area-introduce": "../../components/select-hospital-area-introduce/index",
+		"hospital-payment-detail-yibao": "../../components/hospital-payment-detail-yibao/index",
+		"hospital-payment-detail-yibao-result": "../../components/hospital-payment-detail-yibao-result/index"
+	},
+	"allowsBounceVertical": "NO",
+	"pullRefresh": false
+}