Browse Source

Merge branch 'dev' of http://gogs.ywtinfo.com/chenjunkun/th_net_hospital_ali_mp into dev

liweimin 2 years ago
parent
commit
68f1fd8c51

+ 2 - 2
antbuilder/industry/hospitalV2/components/add-inpatient-information/index.axml

@@ -9,7 +9,7 @@
                   onTap="{{ isEdit === 'NO' ? 'onChoosePatientRelation': '' }}"
                   style="{{ opacity: `${isEdit === 'YES' ? '0.4': '1'}`}}"
                 >
-                  <span>{{ form.relationShip }}</span>
+                  <text>{{ form.relationShip }}</text>
                   <view class="row-icon" a:if="{{ isEdit === 'NO' }}">
                       <am-icon type="right" size="20" color="#CCCCCC"/>
                   </view>
@@ -49,7 +49,7 @@
                 <view class="form-row-content">
                   <picker value="{{index}}" range="{{certTypes}}" disabled="{{ isEdit === 'YES' }}">
                     <view class="input-control span-input" style="{{ opacity: `${isEdit === 'YES' ? '0.4': '1'}`}}">
-                      <span>{{ form.idCardType }}</span>
+                      <text>{{ form.idCardType }}</text>
                       <am-icon a:if="{{ isEdit === 'NO' }}" size="18" type="right" color="#ccc" />
                     </view>
                   </picker>

+ 5 - 3
antbuilder/industry/hospitalV2/components/appointment-result/index.js

@@ -104,7 +104,7 @@ Component({
 			orderDetail({
 				orderId: query.orderId,
 			}).then((data) => {
-        console.log('data====', data);
+				console.log("data====", data);
 				this.setData({
 					result: Object.assign(data, cuttingDate(data.startTime)),
 				});
@@ -180,7 +180,8 @@ Component({
 
 		// 消息订阅授权
 		grantSubscribe() {
-			this.subscribe.subscribeMessage();
+			// this.subscribe.subscribeMessage();
+			console.log("预约成功后调起消息订阅授权");
 		},
 
 		// 发起倒计时
@@ -225,7 +226,8 @@ Component({
 			).then(() => {
 				this.orderDetail(); // 支付成功之后发起消息订阅授权
 
-				this.subscribe.subscribeMessage();
+				this.grantSubscribe();
+				// this.subscribe.subscribeMessage();
 			});
 			/* 服务办结,挂号缴费 */
 

+ 4 - 1
antbuilder/industry/hospitalV2/components/follow-up-notice/index.acss

@@ -59,12 +59,15 @@
 .hospital-new-component .follow-up-notice .sub-text .red {
   color: red;
   font-weight: 550;
+  font-weight: bold;
 }
 .hospital-new-component .follow-up-notice .sub-text .green {
   color: green;
   font-weight: 550;
+  font-weight: bold;
 }
 .hospital-new-component .follow-up-notice .sub-text .yellow {
-  color: yellow;
+  color: rgb(255,165,0);
   font-weight: 550;
+  font-weight: bold;
 }

+ 197 - 186
antbuilder/industry/hospitalV2/components/hospital-payment-detail/index.js

@@ -1,190 +1,201 @@
-import { payDetail } from './service';
-import { tradePay } from '../../utils/tradePay';
-import history from '../../utils/history';
-import { reportApi, reportCmPV_YL } from '../../utils/cloudMonitorHelper';
+import { payDetail } from "./service";
+import { tradePay } from "../../utils/tradePay";
+import history from "../../utils/history";
+import { reportApi, reportCmPV_YL } from "../../utils/cloudMonitorHelper";
 Component({
-  props: {},
-  data: {
-    order: {
-      orderItems: [// {
-        //   itemName: '项目名称',
-        //   itemNum: 2,
-        //   amount: 999.99,
-        // },
-      ],
-      depName: '',
-      outTradeNo: '',
-      tradeNo: '',
-      type: null,
-      // 1-挂号费订单 2-充值订单 3-诊间缴费订单
-      userName: '',
-      cardNum: '',
-      amount: 0,
-      createTime: '',
-      payTime: '',
-      payType: null,
-      // 1-自费 2-医保 3-其他
-      status: null,
-      // 0-待支付 1-已支付 9-已取消
-      medicareBinded: false,
-      idNum: '',
-      customInfo: '',
-      payDetails: '',
-      payDate: '',
-      doctorName: '',
-      reportRemind: '',
-      checkRemind: '',
-      medicineRemind: '',
-      refundRemind: '',
-      receiptRemind: ''
-    },
-    // 订单项
-    fromItem: [{
-      label: '就诊人',
-      key: 'name'
-    }, {
-      label: '就诊卡号',
-      key: 'cardNum'
-    }, {
-      label: '就诊科室',
-      key: 'depName'
-    }, {
-      label: '医生',
-      key: 'doctorName'
-    }, {
-      label: '费用日期',
-      key: 'payDate'
-    }, {
-      label: '支付单号',
-      key: 'outTradeNo'
-    }, {
-      label: '创建时间',
-      key: 'createTime'
-    }, {
-      label: '付款时间',
-      key: 'payTime'
-    }],
-    medicareExpand: false,
-    expand: false,
-    medicare: {
-      total: 0,
-      own: 0,
-      detail: {}
-    },
-    checkRemind: {}
-  },
-
-  didMount() {
-    this.payDetail(this.$page.data.query);
-    /* 服务办结,门诊缴费 */
-
-    reportApi('门诊缴费');
-    /* 服务预警,门诊缴费 */
-
-    reportCmPV_YL({
-      title: '门诊缴费'
-    });
-  },
-
-  methods: {
-    saveSubscribe(ref) {
-      this.subscribe = ref;
-    },
-
-    payDetail(send) {
-      payDetail(send).then(data => {
-        const payDetails = JSON.parse(data.payDetails || '{}');
-        const detail = payDetails['医保支付'] || {};
-        let total = 0;
-        Object.entries(detail).forEach(([k, v]) => {
-          detail[k] = numFix(v);
-          total += v * 1;
-        });
-        this.setData({
-          order: Object.assign({}, this.data.order, data),
-          medicare: {
-            total: numFix(total),
-            own: numFix(payDetails['自费支付金额']),
-            detail
-          },
-          checkRemind: JSON.parse(data.checkRemind || '{}')
-        });
-      });
-    },
-
-    // 查看更多
-    openForm() {
-      this.setData({
-        expand: !this.data.expand
-      });
-    },
-
-    medicareExpand() {
-      this.setData({
-        medicareExpand: !this.data.medicareExpand
-      });
-    },
-
-    // 发起支付
-    async onPay(e) {
-      const {
-        medicareBinded = false
-      } = e.target.dataset;
-      const {
-        order: oreder
-      } = this.data;
-
-      if (oreder.type === 1) {
-        await tradePay({
-          type: oreder.type,
-          idNum: oreder.outTradeNo,
-          depName: oreder.depName
-        }, {
-          tradeType: 'Appointment'
-        });
-      } else if (oreder.type === 2) {
-        // 充值
-        await tradePay({
-          type: oreder.type,
-          idNum: oreder.outTradeNo,
-          amount: oreder.amount
-        }, {
-          tradeType: 'Appointment'
-        });
-      } else {
-        // 门诊订单
-        await tradePay({
-          useBalance: !medicareBinded,
-          useMedicare: medicareBinded,
-          outTradeNo: oreder.outTradeNo
-        }, {
-          tradeType: 'Outpatient'
-        });
-      } // 支付成功刷新页面
-
-
-      this.payDetail(this.$page.data.query); // 支付成功以后,发起消息订阅
-
-      this.subscribe.subscribeMessage();
-    },
-
-    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);
-    }
-
-  }
+	props: {},
+	data: {
+		order: {
+			orderItems: [
+				// {
+				//   itemName: '项目名称',
+				//   itemNum: 2,
+				//   amount: 999.99,
+				// },
+			],
+			depName: "",
+			outTradeNo: "",
+			tradeNo: "",
+			type: null,
+			// 1-挂号费订单 2-充值订单 3-诊间缴费订单
+			userName: "",
+			cardNum: "",
+			amount: 0,
+			createTime: "",
+			payTime: "",
+			payType: null,
+			// 1-自费 2-医保 3-其他
+			status: null,
+			// 0-待支付 1-已支付 9-已取消
+			medicareBinded: false,
+			idNum: "",
+			customInfo: "",
+			payDetails: "",
+			payDate: "",
+			doctorName: "",
+			reportRemind: "",
+			checkRemind: "",
+			medicineRemind: "",
+			refundRemind: "",
+			receiptRemind: "",
+		},
+		// 订单项
+		fromItem: [
+			{
+				label: "就诊人",
+				key: "name",
+			},
+			{
+				label: "就诊卡号",
+				key: "cardNum",
+			},
+			{
+				label: "就诊科室",
+				key: "depName",
+			},
+			{
+				label: "医生",
+				key: "doctorName",
+			},
+			{
+				label: "费用日期",
+				key: "payDate",
+			},
+			{
+				label: "支付单号",
+				key: "outTradeNo",
+			},
+			{
+				label: "创建时间",
+				key: "createTime",
+			},
+			{
+				label: "付款时间",
+				key: "payTime",
+			},
+		],
+		medicareExpand: false,
+		expand: false,
+		medicare: {
+			total: 0,
+			own: 0,
+			detail: {},
+		},
+		checkRemind: {},
+	},
+
+	didMount() {
+		this.payDetail(this.$page.data.query);
+		/* 服务办结,门诊缴费 */
+
+		reportApi("门诊缴费");
+		/* 服务预警,门诊缴费 */
+
+		reportCmPV_YL({
+			title: "门诊缴费",
+		});
+	},
+
+	methods: {
+		saveSubscribe(ref) {
+			this.subscribe = ref;
+		},
+
+		payDetail(send) {
+			payDetail(send).then((data) => {
+				const payDetails = JSON.parse(data.payDetails || "{}");
+				const detail = payDetails["医保支付"] || {};
+				let total = 0;
+				Object.entries(detail).forEach(([k, v]) => {
+					detail[k] = numFix(v);
+					total += v * 1;
+				});
+				this.setData({
+					order: Object.assign({}, this.data.order, data),
+					medicare: {
+						total: numFix(total),
+						own: numFix(payDetails["自费支付金额"]),
+						detail,
+					},
+					checkRemind: JSON.parse(data.checkRemind || "{}"),
+				});
+			});
+		},
+
+		// 查看更多
+		openForm() {
+			this.setData({
+				expand: !this.data.expand,
+			});
+		},
+
+		medicareExpand() {
+			this.setData({
+				medicareExpand: !this.data.medicareExpand,
+			});
+		},
+
+		// 发起支付
+		async onPay(e) {
+			const { medicareBinded = false } = e.target.dataset;
+			const { order: oreder } = this.data;
+
+			if (oreder.type === 1) {
+				await tradePay(
+					{
+						type: oreder.type,
+						idNum: oreder.outTradeNo,
+						depName: oreder.depName,
+					},
+					{
+						tradeType: "Appointment",
+					}
+				);
+			} else if (oreder.type === 2) {
+				// 充值
+				await tradePay(
+					{
+						type: oreder.type,
+						idNum: oreder.outTradeNo,
+						amount: oreder.amount,
+					},
+					{
+						tradeType: "Appointment",
+					}
+				);
+			} else {
+				// 门诊订单
+				await tradePay(
+					{
+						useBalance: !medicareBinded,
+						useMedicare: medicareBinded,
+						outTradeNo: oreder.outTradeNo,
+					},
+					{
+						tradeType: "Outpatient",
+					}
+				);
+			} // 支付成功刷新页面
+
+			this.payDetail(this.$page.data.query); // 支付成功以后,发起消息订阅
+
+			this.subscribe.subscribeMessage();
+		},
+
+		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);
-}
+	const num = val * 1;
+	return num.toFixed(2);
+}

+ 1 - 1
antbuilder/industry/hospitalV2/components/hospital-payment/index.axml

@@ -16,7 +16,7 @@
     emptyTitle="该就诊人暂无记录"
     emptyMessage="你可以在顶部其他就诊人"
   >
-    <view slot-scope="props" class="payment-block" catchTap="toDetail" data-outTradeNo="{{ props.item.outTradeNo }}" data-type="{{ props.item.type }}">
+    <view slot-scope="props" class="payment-block" catchTap="toDetail" data-item="{{ props.item }}" data-outTradeNo="{{ props.item.outTradeNo }}" data-type="{{ props.item.type }}">
       <view class="payment-flex payment-top">
         <text class="payment-title" number-of-lines="1">{{ props.item.title }}</text>
         <view class="payment-pay flag" a:if="{{ props.item.status === 0 }}">待支付</view>

+ 31 - 5
antbuilder/industry/hospitalV2/components/hospital-payment/index.js

@@ -45,7 +45,6 @@ Component({
 
 	methods: {
 		onFilterHandel(filters) {
-			console.log("onFilterHandel ===>", filters);
 			if (!this.hisPatientId) return;
 			this.filters = filters;
 			this.scrollRef.refresh();
@@ -60,9 +59,8 @@ Component({
 		},
 
 		onService(page) {
-			console.log("onService ===>");
 			const { type, status } = this.filters || {};
-      if(!this.hisPatientId) return
+			if (!this.hisPatientId) return;
 			return payHistory({
 				...this.filters,
 				status: status || "0",
@@ -72,7 +70,6 @@ Component({
 		},
 
 		onAutoFilter(patient) {
-			console.log("onAutoFilter ====>");
 			if (patient) {
 				this.hisPatientId = patient.hisPatientId;
 				this.scrollRef.refresh();
@@ -81,9 +78,38 @@ Component({
 
 		// 进入详情
 		toDetail(e) {
+			const {
+				item: {
+					type,
+					outTradeNo,
+					status,
+					tradeNo,
+					invoiceNo,
+					hisPatientId,
+					date,
+					depName,
+					amount,
+					name,
+					age,
+					sex,
+				},
+			} = e.target.dataset;
 			history.push({
 				title: "缴费详情",
-				query: e.target.dataset,
+				query: {
+					type,
+					outTradeNo,
+					status,
+					tradeNo,
+					invoiceNo,
+					hisPatientId,
+					date,
+					depName,
+					amount,
+					name,
+					age,
+					sex,
+				},
 				pageType: "hospital-payment-detail",
 			});
 		},

+ 9 - 6
antbuilder/industry/hospitalV2/components/pay-result/index.js

@@ -1,5 +1,6 @@
 import { getDepositDetails, getsubscribeID } from "./service";
 import { reportApi } from "../../utils/cloudMonitorHelper";
+import { getAuthUser } from "../../../../core/utils/jsapi";
 Component({
 	data: {
 		showSubscrible: true,
@@ -61,12 +62,14 @@ Component({
 
 		async gotoSubscrible() {
 			try {
-				my.getAuthCode({
-					scopes: ["auth_user", "hospital_order"],
-					success: (res) => {
-						console.log("authCode ===>", res.authCode);
-					},
-				});
+				// my.getAuthCode({
+				// 	scopes: ["auth_user", "hospital_order"],
+				// 	success: (res) => {
+				// 		console.log("authCode ===>", res.authCode);
+				// 	},
+				// });
+				const authResult = await getAuthUser(["auth_user", "hospital_order"]);
+				console.log("authResult ===>", authResult);
 				const subscribeID = await getsubscribeID();
 				await this.requestSubscribeMessageFn(subscribeID.depositTemplateId);
 			} catch (error) {