Prechádzať zdrojové kódy

fix: 设置scheme链接适配

carver 2 rokov pred
rodič
commit
641ec7e8da

+ 30 - 7
.mini-ide/compileMode.json

@@ -1,22 +1,45 @@
 {
   "modes": [
     {
+      "title": "线下挂号",
+      "page": "antbuilder/core/pages/one/index",
+      "pageQuery": "pageUuid=E1164483A3294302925DE7FD2088ED36&serviceCode=",
+      "query": ""
+    },
+    {
+      "title": "门诊缴费",
+      "page": "antbuilder/industry/hospitalV2/pages/page-no-pull/index",
+      "pageQuery": "pageType=hospital-payment&title=门诊缴费",
+      "query": ""
+    },
+    {
+      "title": "挂号记录",
+      "page": "antbuilder/industry/hospitalV2/pages/page-no-pull/index",
+      "pageQuery": "pageType=subscribe-record&title=预约挂号记录&serviceCode=",
+      "query": ""
+    },
+    {
+      "title": "报告查询",
+      "page": "antbuilder/industry/hospitalV2/pages/page-no-pull/index",
+      "pageQuery": "pageType=report-list&title=检验检查&serviceCode=",
+      "query": ""
+    },
+    {
       "title": "住院押金缴纳",
       "page": "antbuilder/industry/hospitalV2/pages/page-no-pull/index",
-      "pageQuery": "",
-      "query": "pageType=deposit&title=%E4%BD%8F%E9%99%A2%E6%8A%BC%E9%87%91&backBtnColor=%23000&background=%23fff&color=%23000&header=show",
-      "update": false
+      "pageQuery": "pageType=deposit&title=住院押金&backBtnColor=#000&background=#fff&color=#000&header=show",
+      "query": ""
     },
     {
-      "title": "门诊2",
+      "title": "日清单",
       "page": "antbuilder/industry/hospitalV2/pages/page-no-pull/index",
-      "pageQuery": "pageType=hospital-payment&title=门诊缴费&serviceCode=",
+      "pageQuery": "pageType=inventory-day&title=日清单&serviceCode=&backBtnColor=#000&background=#fff&color=#000&header=show",
       "query": ""
     },
     {
-      "title": "线下挂号",
+      "title": "核酸检测",
       "page": "antbuilder/core/pages/one/index",
-      "pageQuery": "pageUuid=E1164483A3294302925DE7FD2088ED36&serviceCode=",
+      "pageQuery": "nucleic-acid-campus=&pageUuid=B8628CFD95D5478DB4259B6B30FEE7FF&serviceCode=",
       "query": ""
     }
   ]

+ 2 - 0
README.md

@@ -39,3 +39,5 @@ master
 整体入驻:alipays://platformapi/startapp?appId=2021003141662056&page=antbuilder/core/pages/one/index
 
 停车缴费: alipays://platformapi/startapp?appId=2021003141662056&page=pages/index/index&t=1478736838922
+
+// 通过 scheme 链接进入的页面标题不显示的问题

+ 51 - 66
antbuilder/industry/abMall/utils/page.js

@@ -1,73 +1,58 @@
-import { createPublish } from 'applet-page-component';
-import { queryToUrl } from './index';
+import { createPublish } from "applet-page-component";
+import { queryToUrl } from "./index";
 
-const getOptions = () => ({ ...createPublish(),
-  data: {
-    pageType: undefined,
-    componentData: undefined,
-    query: {},
-    title: '',
-    header: ''
-  },
+const getOptions = () => ({
+	...createPublish(),
+	data: {
+		pageType: undefined,
+		componentData: undefined,
+		query: {},
+		title: "",
+		header: "",
+	},
 
-  onReadyHeader({
-    height
-  }) {
-    const {
-      componentData = {}
-    } = this.data;
-    componentData.headerHeight = height;
-    this.setData({
-      componentData: { ...componentData
-      }
-    });
-  },
+	onReadyHeader({ height }) {
+		const { componentData = {} } = this.data;
+		componentData.headerHeight = height;
+		this.setData({
+			componentData: { ...componentData },
+		});
+	},
 
-  onLoad(query) {
-    const {
-      title,
-      pageType,
-      header = '',
-      ...other
-    } = query;
-    title && my.setNavigationBar({
-      title
-    });
-    const {
-      globalData
-    } = getApp();
-    const {
-      pageTemp = {}
-    } = globalData;
-    const componentData = pageTemp[pageType] || {};
-    this.setData({
-      title,
-      header,
-      pageType,
-      componentData,
-      query: other
-    });
-  },
+	onLoad(query) {
+		const { title, pageType, header = "", ...other } = query;
+		title &&
+			my.setNavigationBar({
+				title,
+			});
+		const { globalData } = getApp();
+		const { pageTemp = {} } = globalData;
+		const componentData = pageTemp[pageType] || {};
+		this.setData({
+			title,
+			header,
+			pageType,
+			componentData,
+			query: other,
+		});
+	},
 
-  onUnload() {
-    if (getApp().globalData.pageTemp) {
-      delete getApp().globalData.pageTemp[this.data.pageType];
-    }
-  },
-
-  // 分享
-  onShareAppMessage() {
-    const {
-      pageType,
-      query,
-      title
-    } = this.data;
-    return {
-      title,
-      path: `${this.route}?pageType=${pageType}&title=${title}${queryToUrl(query)}`
-    };
-  }
+	onUnload() {
+		if (getApp().globalData.pageTemp) {
+			delete getApp().globalData.pageTemp[this.data.pageType];
+		}
+	},
 
+	// 分享
+	onShareAppMessage() {
+		const { pageType, query, title } = this.data;
+		return {
+			title,
+			path: `${this.route}?pageType=${pageType}&title=${title}${queryToUrl(
+				query
+			)}`,
+		};
+	},
 });
 
-export default getOptions;
+export default getOptions;

+ 107 - 97
antbuilder/industry/hospitalV2/components/deposit/components/chooseHospital/index.js

@@ -1,105 +1,115 @@
-import { queryList } from '../../service';
-import { createSubscribe } from 'applet-page-component';
-Component(createSubscribe({
-  onShow() {
-    this.getHospitalPersonLists();
-  }
+import { queryList } from "../../service";
+import { createSubscribe } from "applet-page-component";
+Component(
+	createSubscribe({
+		onShow() {
+			this.getHospitalPersonLists();
+		},
+	})({
+		props: {
+			classStyleName: "",
+			// 样式名称
+			selectIndex: 0,
+			hospitalDistrictId: "",
+			onChange: () => null,
+		},
+		data: {
+			popUpOpened: false,
+			// 弹出框是否显示
+			title: "请选择住院人",
+			// 标题
+			onChoosePatient: null,
+			// 选择就诊人
+			onButtonClose: null,
+			// 关闭莫态框
+			popupPosition: "bottom",
+			// 弹出方向
+			hospitalizationRecordList: null, // 就诊人列表数据
+		},
 
-})({
-  props: {
-    classStyleName: '',
-    // 样式名称
-    selectIndex: 0,
-    hospitalDistrictId: '',
-    onChange: () => null
-  },
-  data: {
-    popUpOpened: false,
-    // 弹出框是否显示
-    title: '请选择住院人',
-    // 标题
-    onChoosePatient: null,
-    // 选择就诊人
-    onButtonClose: null,
-    // 关闭莫态框
-    popupPosition: 'bottom',
-    // 弹出方向
-    hospitalizationRecordList: null // 就诊人列表数据
+		didMount() {
+			// 将当前实例赋值给父组件
+			this.$page.$popModal = this; // 获取就诊人列表
+			let timeLimit = 0;
+			this.getHospitalPersonLists();
+			const _this = this;
+			// 当用户使用链接或者二维码进入时,此时未进行授权,需要进行就诊人列表轮询查找
+			let myInterval = setInterval(() => {
+				const { hospitalizationRecordList } = _this.data;
+				if (
+					timeLimit >= 2 ||
+					hospitalizationRecordList ||
+					(hospitalizationRecordList && hospitalizationRecordList.length > 0)
+				) {
+					clearInterval(myInterval);
+					myInterval = null;
+					return;
+				}
+				_this.getHospitalPersonLists();
+				timeLimit += 1;
+			}, 1500);
+		},
 
-  },
+		didUnmount() {
+			this.$page.$popModal = null;
+		},
 
-  didMount() {
-    // 将当前实例赋值给父组件
-    this.$page.$popModal = this; // 获取就诊人列表
+		methods: {
+			/**
+			 * 获取就诊人列表
+			 */
+			async getHospitalPersonLists() {
+				// 调用接口 - 获取就诊人列表
+				const patientList = await queryList();
 
-    this.getHospitalPersonLists();
-  },
+				if (Array.isArray(patientList) && patientList.length > 0) {
+					// 处理枚举类型数据展示 , 性别gender
+					const arr = patientList.map((item) => ({ ...item }));
+					this.setData({
+						hospitalizationRecordList: arr,
+					});
+					this.props.onGetDatas(arr);
+				} else {
+					this.props.onGetDatas([]);
+				}
+			},
 
-  didUnmount() {
-    this.$page.$popModal = null;
-  },
+			/**
+			 * 点击关闭事件
+			 */
+			onClose() {
+				this.data.onButtonClose();
+			},
 
-  methods: {
-    /**
-     * 获取就诊人列表
-     */
-    async getHospitalPersonLists() {
-      // 调用接口 - 获取就诊人列表
-      const patientList = await queryList();
+			/**
+			 * 选择就诊人,调用父组件传来的函数
+			 */
+			onChoosePatient(e) {
+				// 获取当前选中项信息
+				const {
+					target: {
+						dataset: { info },
+					},
+				} = e;
+				this.data.onChoosePatient(info);
+			},
 
-      if (Array.isArray(patientList) && patientList.length > 0) {
-        // 处理枚举类型数据展示 , 性别gender
-        const arr = patientList.map(item => ({ ...item
-        }));
-        this.setData({
-          hospitalizationRecordList: arr
-        });
-        this.props.onGetDatas(arr);
-      } else {
-        this.props.onGetDatas([]);
-      }
-    },
+			/**
+			 * 打开弹出框
+			 * @param {*} options 父组件向弹出框传来的参数
+			 */
+			showPopover(options) {
+				this.setData({ ...options, popUpOpened: true });
+			},
 
-    /**
-     * 点击关闭事件
-     */
-    onClose() {
-      this.data.onButtonClose();
-    },
-
-    /**
-     * 选择就诊人,调用父组件传来的函数
-     */
-    onChoosePatient(e) {
-      // 获取当前选中项信息
-      const {
-        target: {
-          dataset: {
-            info
-          }
-        }
-      } = e;
-      this.data.onChoosePatient(info);
-    },
-
-    /**
-    * 打开弹出框
-    * @param {*} options 父组件向弹出框传来的参数
-    */
-    showPopover(options) {
-      this.setData({ ...options,
-        popUpOpened: true
-      });
-    },
-
-    /**
-    * 关闭弹出框
-    */
-    hidePopover() {
-      this.setData({
-        popUpOpened: false
-      });
-    }
-
-  }
-}));
+			/**
+			 * 关闭弹出框
+			 */
+			hidePopover() {
+				this.setData({
+					popUpOpened: false,
+				});
+			},
+		},
+	})
+);

+ 4 - 4
antbuilder/industry/hospitalV2/components/deposit/index.js

@@ -98,13 +98,13 @@ Component({
 
 		onGetDatas(info) {
 			if (!info || info.length === 0) {
-				my.alert({
+				my.showToast({
 					content: this.data.attention || "请绑定住院人",
-					success: () => {
-						my.navigateBack();
-					},
+					duration: 1500,
 				});
 				return false;
+			} else {
+				my.hideToast();
 			}
 
 			this.getJsonData(info);

+ 4 - 4
antbuilder/industry/hospitalV2/components/inventory-day/index.js

@@ -131,13 +131,13 @@ Component({
 
 		getJsonDataFn(info) {
 			if (!info || info.length === 0) {
-				my.alert({
+				my.showToast({
 					content: this.data.attention || "请绑定住院人",
-					success: () => {
-						my.navigateBack();
-					},
+					duration: 1500,
 				});
 				return false;
+			} else {
+				my.hideToast();
 			}
 
 			this.getJsonData(info);

+ 18 - 4
antbuilder/industry/hospitalV2/pages/page-no-pull/store/index.js

@@ -1,5 +1,19 @@
-import Store from 'herculex';
+import Store from "herculex";
+// 修改
+import actions from "../../../../../core/pages/one/store/actions/index";
+import state from "../../../../../core/pages/one/store/state";
+import mutations from "../../../../../core/pages/one/store/mutations";
+import getters from "../../../../../core/pages/one/store/getters";
+
 export default new Store({
-  connectGlobal: true,
-  state: {}
-});
+	connectGlobal: true,
+	state,
+	mutations,
+	getters,
+	actions: {
+		async init({ dispatch }, payload) {
+			await dispatch("start", payload);
+		},
+		...actions,
+	},
+});

+ 8 - 2
antbuilder/industry/hospitalV2/utils/page.js

@@ -22,7 +22,7 @@ const getOptions = () => ({
 		});
 	},
 
-	onLoad(query) {
+	async onLoad(query) {
 		const {
 			title,
 			pageType,
@@ -32,12 +32,14 @@ const getOptions = () => ({
 			backBtnColor,
 			...other
 		} = query;
+		console.log("title ===>", title);
 		title &&
 			my.setNavigationBar({
 				title,
 				backgroundColor: background || "#1677FF",
 			});
-		const { globalData } = getApp();
+		const app = getApp();
+		const { globalData } = app;
 		const { pageTemp = {} } = globalData;
 		const componentData = pageTemp[pageType] || {};
 		this.setData({
@@ -50,6 +52,10 @@ const getOptions = () => ({
 			color: color || "#fff",
 			backBtnColor: backBtnColor || false,
 		});
+		if (!app.globalData.templateUUID) {
+			// 如果没有页面配置,需要获取页面配置,否则下面bind的时候没有templateUUID
+			await this.dispatch("init", query);
+		}
 	},
 
 	onUnload() {