Browse Source

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

liweimin 2 years ago
parent
commit
acae5d5bb2

+ 17 - 4
antbuilder/industry/hospitalV2/components/appointment-result/index.js

@@ -4,6 +4,7 @@ import { cuttingDate } from "../../utils";
 import history from "../../utils/history";
 import { tradePay } from "../../utils/tradePay";
 import { reportApi } from "../../utils/cloudMonitorHelper";
+import { getAuthUser } from "../../../../core/utils/jsapi";
 Component({
 	props: {},
 	data: {
@@ -124,7 +125,7 @@ Component({
 				} else if (status === 1) {
 					/* 如果是从下单页面过来的,拉起消息授权 */
 					if (where === "order-pay") {
-						this.grantSubscribe();
+						this.grantSubscribe(query.orderId);
 					}
 				}
 
@@ -179,8 +180,20 @@ Component({
 		},
 
 		// 消息订阅授权
-		grantSubscribe() {
-			// this.subscribe.subscribeMessage();
+		async grantSubscribe(orderId) {
+			// todo 添加智能推送接口
+			console.log("orderId =====>", orderId);
+			const [err, authResult] = await getAuthUser([
+				"auth_user",
+				"hospital_order",
+			]);
+			if (err) {
+				my.showToast({
+					type: "fail",
+					content: "智能消息推送授权失败",
+				});
+			}
+			console.log("authResult ===>", authResult.authCode);
 			console.log("预约成功后调起消息订阅授权");
 		},
 
@@ -226,7 +239,7 @@ Component({
 			).then(() => {
 				this.orderDetail(); // 支付成功之后发起消息订阅授权
 
-				this.grantSubscribe();
+				this.grantSubscribe(query.orderId);
 				// this.subscribe.subscribeMessage();
 			});
 			/* 服务办结,挂号缴费 */

+ 1 - 1
antbuilder/industry/hospitalV2/components/booking-detail/index.acss

@@ -77,7 +77,7 @@
   font-size: 32rpx;
 }
 .booking-detail-container .booking-detail-content .cancel-booking .button {
-  width: calc(50% - 12rpx);
+  width: 100%;
   height: 98rpx;
   line-height: 98rpx;
   border-radius: 8rpx;

+ 1 - 1
antbuilder/industry/hospitalV2/components/booking-detail/index.axml

@@ -51,7 +51,7 @@
     <!-- 取消预约 -->
     <view class="cancel-booking">
       <button class="button" onTap="handleBack">返回</button>
-      <button class="button" onTap="handleCancelBook">取消预约</button>
+      <!-- <button class="button" onTap="handleCancelBook">取消预约</button> -->
     </view>
   </view>
 </view>

+ 2 - 3
antbuilder/industry/hospitalV2/components/deposit/index.js

@@ -222,9 +222,8 @@ Component({
 		// 支付前先要订阅
 		async payMoney() {
 			try {
-				const subscribeID = await getsubscribeID();
-
-				await this.requestSubscribeMessageFn(subscribeID.depositTemplateId);
+				// const subscribeID = await getsubscribeID();
+				// await this.requestSubscribeMessageFn(subscribeID.depositTemplateId);
 			} catch (error) {
 				console.log(error, "error");
 			}

+ 15 - 2
antbuilder/industry/hospitalV2/components/hospital-project/index.js

@@ -1,4 +1,5 @@
 import { createSubscribe } from "applet-page-component";
+import { getAuthUser } from "../../../../core/utils/jsapi";
 import {
 	getTestTimeList,
 	getQuestionnaire,
@@ -11,7 +12,7 @@ import { tradePay } from "../../utils/tradePay";
 import { reportCmPV_YL } from "../../utils/cloudMonitorHelper";
 const deptCodeMap = {
 	黄石总院: 500,
-	沙河分院: 667,
+	沙河分院: 499,
 };
 Component(
 	createSubscribe({
@@ -329,7 +330,19 @@ Component(
 								tradeType: "Appointment",
 							}
 						)
-							.then(() => {
+							.then(async () => {
+								// todo 添加智能推送接口
+								const [err, authResult] = await getAuthUser([
+									"auth_user",
+									"hospital_order",
+								]);
+								console.log("authResult ===>", authResult.authCode);
+								if (err) {
+									my.showToast({
+										type: "fail",
+										content: "智能消息推送授权失败",
+									});
+								}
 								history.replace({
 									query: {
 										hospitalDistrictId,

+ 43 - 47
antbuilder/industry/hospitalV2/components/index-head/indexHead.sjs

@@ -1,75 +1,71 @@
 /*
-* 获取扩展字段
-* */
+ * 获取扩展字段
+ * */
 const getExtInfo = (item) => {
-  const { componentExtInfo } = item;
-  return componentExtInfo || {};
+	const { componentExtInfo } = item;
+	return componentExtInfo || {};
 };
 
 /*
-* 获取消息列表
-* */
+ * 获取消息列表
+ * */
 const getNotifyList = (item) => {
-  const { serviceList = [] } = item;
-  return serviceList;
+	const { serviceList = [] } = item;
+	return serviceList;
 };
 
 const msgClass = (item, showMsg) => {
-  const { length } = getNotifyList(item);
-  return !length || !showMsg ? ' no-msg' : '';
+	const { length } = getNotifyList(item);
+	return !length || !showMsg ? " no-msg" : "";
 };
 
 /*
-* 获取样式
-* */
+ * 获取样式
+ * */
 const getStyleMode = (item) => {
-  const {
-    icon,
-    styleMode = 'a',
-  } = getExtInfo(item);
-  /*
-  * 三种模式
-  * */
-  const modes = {
-    a: 'head-a',
-    b: 'head-b',
-    c: 'head-c',
-  };
-  return icon ? 'head-custom' : modes[styleMode];
+	const { icon, styleMode = "a" } = getExtInfo(item);
+	/*
+	 * 三种模式
+	 * */
+	const modes = {
+		a: "head-a",
+		b: "head-b",
+		c: "head-c",
+	};
+	return icon ? "head-custom" : modes[styleMode];
 };
 
-const getImgUrl = (url, prefix) => (
-  url.length === 32 ? `${prefix}${url}` : url
-);
+const getImgUrl = (url, prefix) =>
+	url.length === 32 ? `${prefix}${url}` : url;
 
 const getBgStyle = (item, imgSrcPrefix) => {
-  const styles = [];
-  const { icon } = getExtInfo(item);
-  if (icon) {
-    styles.push(`background-image:url(${getImgUrl(icon, imgSrcPrefix)})`);
-  }
-  return styles.join(';');
+	const styles = [];
+	const { icon } = getExtInfo(item);
+	if (icon) {
+		styles.push(`background-image:url(${getImgUrl(icon, imgSrcPrefix)})`);
+	}
+	return styles.join(";");
 };
 
 /*
-* 获取二级标题
-* */
+ * 获取二级标题
+ * */
 const getSubTitle = (item) => {
-  const { desc } = getExtInfo(item);
-  return desc || '了解本院特色';
+	const { desc } = getExtInfo(item);
+	return desc || "了解本院特色";
 };
 
 const getTitle = (item) => {
-  const { title } = getExtInfo(item);
-  return title || '首页';
+	const { title } = getExtInfo(item);
+	return title || "";
 };
 
 export default {
-  msgClass,
-  getTitle,
-  getBgStyle,
-  getExtInfo,
-  getStyleMode,
-  getNotifyList,
-  getSubTitle,
+	msgClass,
+	getTitle,
+	getBgStyle,
+	getExtInfo,
+	getStyleMode,
+	getNotifyList,
+	getSubTitle,
 };

+ 3 - 2
antbuilder/industry/hospitalV2/components/pay-result/index.axml

@@ -28,9 +28,10 @@
     <view class="close">
       <text>订阅押金缴纳提醒</text><text onTap="showSubscrible"><am-icon type="close" color="#ccc" size="16"/></text>
     </view>
-    <view class="go-subscribe">
+    <!-- 押金暂时不做消息推送 -->
+    <!-- <view class="go-subscribe">
       <text class="go-label">当押金不足时支付宝为您发送消息提醒</text> <view onTap="gotoSubscrible" class="subButton">去订阅</view>
-    </view>
+    </view> -->
   </view>
   <component is="dynamic-plugin://2021001155639035/subscribe-msg" a:if="{{isReady}}" />
 </view>

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

@@ -1,6 +1,6 @@
 import { getDepositDetails, getsubscribeID } from "./service";
 import { reportApi } from "../../utils/cloudMonitorHelper";
-import { getAuthUser } from "../../../../core/utils/jsapi";
+// import { getAuthUser } from "../../../../core/utils/jsapi";
 Component({
 	data: {
 		showSubscrible: true,
@@ -68,13 +68,13 @@ Component({
 				// 		console.log("authCode ===>", res.authCode);
 				// 	},
 				// });
-				const [err, authResult] = await getAuthUser([
-					"auth_user",
-					"hospital_order",
-				]);
-				console.log("authResult ===>", authResult.authCode);
-				const subscribeID = await getsubscribeID();
-				await this.requestSubscribeMessageFn(subscribeID.depositTemplateId);
+				// const [err, authResult] = await getAuthUser([
+				// 	"auth_user",
+				// 	"hospital_order",
+				// ]);
+				// console.log("authResult ===>", authResult.authCode);
+				// const subscribeID = await getsubscribeID();
+				// await this.requestSubscribeMessageFn(subscribeID.depositTemplateId);
 			} catch (error) {
 				console.log(error, "error");
 			}

+ 24 - 27
antbuilder/industry/hospitalV2/components/subscribe-record/record-item/index.js

@@ -1,30 +1,27 @@
-import history from '../../../utils/history';
+import history from "../../../utils/history";
 Component({
-  props: {
-    item: {}
-  },
-  data: {},
+	props: {
+		item: {},
+	},
+	data: {},
 
-  didMount() {},
+	didMount() {},
 
-  methods: {
-    onItemTap({
-      target
-    }) {
-      const {
-        item: {
-          orderId,
-          type
-        }
-      } = target.dataset;
-      history.push({
-        title: '预约详情',
-        query: {
-          orderId
-        },
-        pageType: type !== 'nucleic' ? 'appointment-result' : 'booking-detail'
-      });
-    }
-
-  }
-});
+	methods: {
+		onItemTap({ target }) {
+			const {
+				item: { orderId, type, deptCode = "" },
+			} = target.dataset;
+			history.push({
+				title: "预约详情",
+				query: {
+					orderId,
+				},
+				pageType:
+					deptCode == "500" || deptCode == "400"
+						? "booking-detail"
+						: "appointment-result",
+			});
+		},
+	},
+});