Bladeren bron

feat: 添加医保2.0页面

carver 1 jaar geleden
bovenliggende
commit
612ab81f51

BIN
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/assets/icon-close.png


BIN
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/assets/info-icon.png


BIN
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/assets/medical-logo.png


File diff suppressed because it is too large
+ 320 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/index.acss


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

@@ -0,0 +1,115 @@
+<wrapper>
+  <!-- 新页面 -->
+  <View class="ybv2">
+    <View class="page-index" a:if="{{ canPay }}">
+      <View class="hd">
+        <View class="info">
+          <View class="info-hd">付款给</View>
+          <View class="info-bd">*****医院</View>
+        </View>
+        <View class="info-icon">
+          <image class="info-icon-img" src="./info-icon.png" alt="" />
+        </View>
+        <View class="bg"></View>
+      </View>
+      <View class="bd">
+        <View class="box">
+          <View class="box-hd">
+            <View class="box-hd-label">费用总额</View>
+            <View class="box-hd-value">342.23元</View>
+          </View>
+          <View class="box-bd">
+            <View class="box-item">
+              <View class="box-bd-label">医保基金支付</View>
+              <View class="box-bd-value">233元</View>
+            </View>
+            <View class="box-item">
+              <View class="box-bd-label">个人帐户支付</View>
+              <View class="box-bd-value">233元</View>
+            </View>
+            <View class="box-item">
+              <View class="box-bd-label">其他抵扣金额</View>
+              <View class="box-bd-value">233元</View>
+            </View>
+          </View>
+          <View class="box-ft">
+            <View class="box-ft-label">现金支付</View>
+            <View class="box-ft-value">56元</View>
+          </View>
+          <View
+            class="box-append"
+            onTap="handleActionsheet"
+          >
+            查看明细
+          </View>
+        </View>
+        <View class="bd-append">
+          <view class="bd-append-icon"></view>
+          <View class="bd-append-text">医保移动支付</View>
+        </View>
+      </View>
+      <View class="ft">
+        <View class="pay">
+          <View class="pay-label">您还需支付:</View>
+          <View class="pay-value">¥5823</View>
+        </View>
+        <View
+          class="{{!canPay ? 'disable btn' : 'btn'}}"
+          onTap="onPay"
+        >
+          去支付
+        </View>
+      </View>
+      <View
+        class="actionsheet"
+        style="{{ display: actionsheetVisible ? 'block' : 'none' }}"
+      >
+        <View
+          class="actionsheet-mask"
+          onTap="handleActionsheet"
+        ></View>
+        <View class="actionsheet-panel">
+          <View class="actionsheet-hd">
+            <View class="actionsheet-hd-tt">处方明细</View>
+            <view
+              class="actionsheet-icon-close"
+              onTap="handleActionsheet"
+            ></view>
+          </View>
+          <View class="actionsheet-bd">
+              <View a:for="{{ prescriptionList }}" class="actionsheet-box" key="{{item.title}}">
+                <View class="actionsheet-box-hd">{{item.title}}</View>
+                <View class="actionsheet-box-bd">
+                    <View
+                      class="actionsheet-box-item"
+                      key="{{ boxItem.label }}"
+                      a:for="{{ item.list }}"
+                      a:for-item="boxItem"
+                    >
+                      <View class="actionsheet-box-item-label-wrap">
+                        <View class="actionsheet-box-item-label">
+                          {{boxItem.label}}
+                        </View>
+                        <View class="actionsheet-box-item-sublabel">
+                          {{boxItem.subLabel}}
+                        </View>
+                      </View>
+                      <View
+                        class="{{
+                          boxItem.highlight
+                            ? 'actionsheet-box-item-value em'
+                            : 'actionsheet-box-item-value'
+                        }}"
+                      >
+                        {{boxItem.value}}
+                      </View>
+                    </View>
+                </View>
+              </View>
+          </View>
+        </View>
+      </View>
+    </View>
+    <View a:elif class="loading-page"></View>
+  </View>
+</wrapper>

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

@@ -0,0 +1,199 @@
+// import { payDetail } from "./service";
+import { tradePay } from "../../utils/tradePay";
+import history from "../../utils/history";
+// import { reportApi, reportCmPV_YL } from "../../utils/cloudMonitorHelper";
+import { getSubscribeAuth } from "../../../../core/utils/ywtService";
+// import { createSubscribe } from "applet-page-component";
+
+Component({
+  props: {},
+  data: {
+    authCode: undefined,
+    canPay: true,
+    prescriptionList: [
+      {
+        title: "就诊信息",
+        list: [
+          { label: "门诊类别", value: "门(急)诊" },
+          { label: "门诊科室", value: "普通内科" },
+          { label: "医生姓名", value: "张三" },
+          { label: "处方时间", value: "2021/06/08 14:54:00" },
+          { label: "费用总额", value: "368.50元", highlight: true },
+        ],
+      },
+      {
+        title: "诊断信息",
+        list: [
+          { label: "诊断名称", value: "外伤肿胀" },
+          { label: "诊断编号", value: "E3D.25" },
+        ],
+      },
+      {
+        title: "费用信息",
+        list: [
+          { label: "万通胫骨贴*1", subLabel: "8g/片/3", value: "37.80元" },
+          { label: "阿莫西林*1", subLabel: "8g/片/3", value: "7.80元" },
+        ],
+      },
+    ],
+    actionsheetVisible: false,
+  },
+
+  didMount() {
+    this.payDetail(this.$page.data.query);
+  },
+
+  methods: {
+    saveSubscribe(ref) {
+      this.subscribe = ref;
+    },
+
+    payDetail(query) {
+      console.log("query ==>", query);
+      return;
+      my.getAuthCode({
+        scopes: ["nhsamp", "auth_user"], // 主动授权:auth_user,静默授权:auth_base。或者其它scopes
+        success: (res) => {
+          if (res.authCode) {
+            // 认证成功
+            // 调用自己的服务端接口,让服务端进行后端的授权认证,并且利用session,需要解决跨域问题
+            my.request({
+              url: "https://isv.com/auth", // 该url是您自己的服务地址,实现的功能是服务端拿到authcode去开放平台进行token验证
+              data: {
+                authcode: res.authCode,
+              },
+              success: () => {
+                // 授权成功并且服务器端登录成功
+              },
+              fail: () => {
+                // 根据自己的业务场景来进行错误处理
+              },
+            });
+          }
+        },
+      });
+    },
+
+    // 查看更多
+    openForm() {
+      this.setData({
+        expand: !this.data.expand,
+      });
+    },
+
+    medicareExpand() {
+      this.setData({
+        medicareExpand: !this.data.medicareExpand,
+      });
+    },
+
+    handleActionsheet() {
+      this.setData({
+        actionsheetVisible: !this.data.actionsheetVisible,
+      });
+    },
+
+    // 发起支付
+    async onPay(e) {
+      const { medicareBinded = false } = e.target.dataset;
+      const { order: oreder } = this.data;
+      let result = false;
+      try {
+        my.showLoading();
+        // 获取授权
+        await getSubscribeAuth();
+
+        if (oreder.type === 1) {
+          result = await tradePay(
+            {
+              type: oreder.type,
+              idNum: oreder.outTradeNo,
+              depName: oreder.depName,
+            },
+            {
+              tradeType: "Appointment",
+            }
+          );
+        } else if (oreder.type === 2) {
+          // 充值
+          result = await tradePay(
+            {
+              type: oreder.type,
+              idNum: oreder.outTradeNo,
+              amount: oreder.amount,
+            },
+            {
+              tradeType: "Appointment",
+            }
+          );
+        } else {
+          // 门诊订单
+          const {
+            hisPatientId,
+            age,
+            sex,
+            orderId,
+            hisOrderNo,
+            amount,
+            deptName,
+            doctorName,
+            doctorCode,
+            total,
+            hisClinicCode,
+            name,
+            prescribeDate,
+          } = oreder;
+          result = await tradePay(
+            {
+              useBalance: !medicareBinded,
+              useMedicare: medicareBinded,
+              outTradeNo: oreder.outTradeNo,
+              hisPatientId,
+              age,
+              sex,
+              orderId,
+              hisOrderNo,
+              amount,
+              deptName,
+              doctorName,
+              doctorCode,
+              total,
+              hisClinicCode,
+              name,
+              prescribeDate,
+            },
+            {
+              tradeType: "Outpatient",
+            }
+          );
+        }
+      } catch (error) {
+        console.log("error ===>", error);
+      } finally {
+        my.hideLoading();
+      }
+      // 支付成功刷新页面
+      this.payDetail(this.$page.data.query);
+      if (result) {
+        // 支付成功后返回列表页
+        my.navigateBack();
+      }
+    },
+
+    hrefTo() {
+      my.ap.navigateToAlipayPage({
+        path: "alipays://platformapi/startapp?appId=77700284&page=pages/medical/index?chInfo=YY_xiaochengxu",
+      });
+    },
+
+    toH5(e) {
+      const { url } = e.target.dataset;
+      history.toH5(url);
+    },
+  },
+});
+
+function numFix(val) {
+  const num = val * 1;
+  return num.toFixed(2);
+}

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

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

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

@@ -0,0 +1,9 @@
+import request from '../../service/request'; // 查询订单状态
+
+function payDetail(data) {
+  return request.post('/miniProRequest.pay.payDetail', data);
+}
+
+export default {
+  payDetail
+};

+ 1 - 0
antbuilder/industry/hospitalV2/components/personal-center-head/personalCenterHead.axml

@@ -84,6 +84,7 @@
       </view>
     </view>
   </view>
+  <button onTap="onHandleYb2" style="{{ margin: '10px' }}">测试医保2.0页面</button>
 </wrapper>
 <patient-selector
   onClose="onClose"

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

@@ -6,129 +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,
+          });
+        },
 
-				setQuery(patientId) {
-					setPagesQuery({
-						currentUserId: patientId,
-					});
-				},
+        onHandleYb2() {
+          history.push({
+            title: "确认支付",
+            query: {},
+            pageType: "hospital-payment-detail-yibao",
+          });
+        },
 
-				/**
-				 * 去登陆
-				 */
-				async onLogin() {
-					await doLogin.call(this, {
-						scopes: "auth_user",
-					});
-				},
+        setQuery(patientId) {
+          setPagesQuery({
+            currentUserId: patientId,
+          });
+        },
 
-				/**
-				 * 切换就诊人
-				 */
-				changeBtn() {
-					console.log("1111111");
-					this.setData({
-						showPatient: true,
-					});
-				},
+        /**
+         * 去登陆
+         */
+        async onLogin() {
+          await doLogin.call(this, {
+            scopes: "auth_user",
+          });
+        },
 
-				onClose() {
-					this.setData({
-						showPatient: false,
-					});
-				},
+        /**
+         * 切换就诊人
+         */
+        changeBtn() {
+          console.log("1111111");
+          this.setData({
+            showPatient: true,
+          });
+        },
 
-				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: "就诊人切换成功",
-					});
-				},
+        onClose() {
+          this.setData({
+            showPatient: false,
+          });
+        },
 
-				toPatientDetail() {
-					const { patientId } = this.data.cardInfo;
-					history.push({
-						title: "就诊人详情",
-						query: {
-							id: patientId,
-						},
-						pageType: "patient-detail",
-					});
-				},
+        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: "就诊人切换成功",
+          });
+        },
 
-				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,
-						},
-					});
-				},
-			},
-		})
-	)
+        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,
+            },
+          });
+        },
+      },
+    })
+  )
 );

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

@@ -83,4 +83,6 @@
   <hospital-introduce componentData="{{ componentData }}"  a:elif="{{ pageType === 'hospital-introduce' }}" />
   <!-- 院区选择首页 -->
   <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' }}" />
 </block>

+ 2 - 1
antbuilder/industry/hospitalV2/pages/page-no-pull/index.json

@@ -44,7 +44,8 @@
     "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"
+    "select-hospital-area-introduce": "../../components/select-hospital-area-introduce/index",
+    "hospital-payment-detail-yibao": "../../components/hospital-payment-detail-yibao/index"
   },
   "allowsBounceVertical": "NO",
   "pullRefresh": false

Some files were not shown because too many files changed in this diff