Explorar el Código

fix: 隐藏通讯录选择和相机

carver hace 2 años
padre
commit
9241eb16a2

+ 0 - 12
antbuilder/industry/hospitalV2/components/edit-patient/index.axml

@@ -45,12 +45,6 @@
           placeholder-class="placeholder"
           disabled="{{ isAuthSuccess && !editForm.id }}"
         />
-        <image
-          class="icon-ca"
-          src="{{ caIcon }}"
-          onTap="onLaunchOcr"
-          a:if="{{ !isAuthSuccess }}"
-        />
       </view>
     </form-row>
     <form-row title="手机号码">
@@ -63,12 +57,6 @@
           placeholder="用于就诊人接收就诊短信通知"
           disabled="{{ isAuthSuccess && !editForm.id }}"
         />
-        <image
-          class="icon-book"
-          src="{{ bookIcon }}"
-          onTap="choosePhoneContact"
-          a:if="{{ !isAuthSuccess }}"
-        />
       </view>
     </form-row>
     <view class="footer">

+ 65 - 83
antbuilder/industry/hospitalV2/components/patient-detail-edit/index.js

@@ -1,96 +1,78 @@
 import { querySingle, patientUpdate } from "../patient-detail/service";
+import { createSubscribe } from "applet-page-component";
 import history from "../../utils/history";
-import EventHub from "../../../abMall/utils/eventEmitter";
+Component(
+	createSubscribe({
+		async onShow() {
+			await this.querySingle();
+		},
+	})({
+		props: {},
+		data: {
+			patient: {
+				balance: 0,
+				id: "",
+				name: "",
+				age: "",
+				sex: "",
+				phoneNumber: "",
+				birthDay: "",
+				idCardNo: "",
+				relationShip: "",
+				bindCardNum: "",
+				medicCards: [],
+			},
+		},
 
-Component({
-	props: {},
-	data: {
-		patient: {
-			balance: 0,
-			id: "",
-			name: "",
-			age: "",
-			sex: "",
-			phoneNumber: "",
-			birthDay: "",
-			idCardNo: "",
-			relationShip: "",
-			bindCardNum: "",
-			medicCards: [],
+		didMount() {
+			this.querySingle();
 		},
-	},
 
-	didMount() {
-		this.querySingle();
-		this.onEventChange();
-		// this.$page.updatePatient = this;
-		// const page = getCurrentPages();
-		// console.log("page", this.$page);
-		// console.log("page ===>", page);
-	},
+		didUnmount() {},
 
-	didUnmount() {
-		this.onEventRemove();
-	},
+		methods: {
+			querySingle() {
+				const {
+					query = {
+						id: "",
+					},
+				} = this.$page.data;
+				my.showLoading();
+				querySingle({
+					id: query.id,
+				}).then((data) => {
+					this.setData({
+						patient: data,
+					});
+					my.hideLoading();
+				});
+			},
 
-	methods: {
-		onEventChange() {
-			const _this = this;
-			EventHub.addEventListener("onPatienDetailUpdate", (payload) => {
-				if (payload) {
-					_this.querySingle();
-				}
-			});
-		},
-		onEventRemove() {
-			const _this = this;
-			EventHub.removeEventListener("onPatienDetailUpdate", (payload) => {
-				if (payload) {
-					_this.querySingle();
-				}
-			});
-		},
-		querySingle() {
-			const {
-				query = {
-					id: "",
-				},
-			} = this.$page.data;
-			my.showLoading();
-			querySingle({
-				id: query.id,
-			}).then((data) => {
+			// 修改关系
+			onChange(e) {
 				this.setData({
-					patient: data,
+					"patient.relationShip": e.name,
 				});
-				my.hideLoading();
-			});
-		},
+			},
 
-		// 修改关系
-		onChange(e) {
-			this.setData({
-				"patient.relationShip": e.name,
-			});
-		},
+			onChangePhone() {
+				history.push({
+					query: {
+						id: this.data.patient.id,
+						relationShip: this.data.patient.relationShip,
+					},
+					title: "修改手机号",
+					pageType: "patient-detail-phone",
+				});
+			},
 
-		onChangePhone() {
-			history.push({
-				query: {
+			onSubmit() {
+				patientUpdate({
 					id: this.data.patient.id,
-          relationShip: this.data.patient.relationShip,
-				},
-				title: "修改手机号",
-				pageType: "patient-detail-phone",
-			});
-		},
-
-		onSubmit() {
-			patientUpdate({
-				id: this.data.patient.id,
-				name: this.data.patient.name,
-				relationShip: this.data.patient.relationShip,
-			}).then(my.navigateBack);
+					name: this.data.patient.name,
+					relationShip: this.data.patient.relationShip,
+				}).then(my.navigateBack);
+			},
 		},
-	},
-});
+	})
+);

+ 0 - 1
antbuilder/industry/hospitalV2/components/patient-detail-phone/index.axml

@@ -5,7 +5,6 @@
       <view class="patient-name">请输入新手机号</view>
       <view class="patient-flex">
         <input class="input" placeholder-class="patient-place" type="number" value="{{ phone }}" onInput="onInput" placeholder="请输入手机号" />
-        <image class="patient-icon" mode="aspectFit" onTap="choosePhoneContact" src="https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*EEyRS4pqNQwAAAAAAAAAAAAAARQnAQ" />
       </view>
     </view>
 

+ 2 - 3
antbuilder/industry/hospitalV2/components/patient-detail-phone/index.js

@@ -1,6 +1,5 @@
 import { patientUpdate } from "../patient-detail/service";
 import getEncryptStr from "../../utils/getEncryptStr";
-import EventHub from "../../../abMall/utils/eventEmitter";
 Component({
 	props: {},
 	data: {
@@ -18,7 +17,8 @@ Component({
 
 		choosePhoneContact() {
 			my.choosePhoneContact({
-				success: ({ mobile }) => {
+				success: (result) => {
+					const { mobile } = result;
 					this.setData({
 						phone: mobile.replace(/(\s|-|\+)/g, ""),
 					});
@@ -41,7 +41,6 @@ Component({
 					// relationShip: query.relationShip,
 					phoneNumber: await getEncryptStr(this.data.phone),
 				}).then(() => {
-					EventHub.dispatchEvent("onPatienDetailUpdate", true);
 					my.navigateBack();
 				});
 			} else {