Explorar o código

fix: 修复编辑就诊人-修改手机号-“电话簿”按钮

carver %!s(int64=2) %!d(string=hai) anos
pai
achega
8bbea9ce6c

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

@@ -5,6 +5,7 @@
       <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>
 

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

@@ -16,10 +16,21 @@ Component({
 			});
 		},
 
+		choosePhoneContact() {
+			my.choosePhoneContact({
+				success: ({ mobile }) => {
+					this.setData({
+						phone: mobile.replace(/(\s|-|\+)/g, ""),
+					});
+				},
+			});
+		},
+
 		async onSave() {
 			const {
 				query = {
-					id: "", relationShip: "",
+					id: "",
+					relationShip: "",
 				},
 			} = this.$page.data;
 			const phoneNumber = this.data.phone;
@@ -27,7 +38,7 @@ Component({
 			if (/^[1]([3-9])[0-9]{9}$/.test(phoneNumber)) {
 				patientUpdate({
 					id: query.id,
-          // relationShip: query.relationShip,
+					// relationShip: query.relationShip,
 					phoneNumber: await getEncryptStr(this.data.phone),
 				}).then(() => {
 					EventHub.dispatchEvent("onPatienDetailUpdate", true);