فهرست منبع

疗法选择就诊人修改

XSLu08042 3 هفته پیش
والد
کامیت
7129d5a931
2فایلهای تغییر یافته به همراه29 افزوده شده و 36 حذف شده
  1. 8 16
      pages_index/components/choosePatient/choosePatient.vue
  2. 21 20
      pages_index/packageForm.vue

+ 8 - 16
pages_index/components/choosePatient/choosePatient.vue

@@ -3,7 +3,7 @@
 		<view class="patient-box">
 			<view class="patient-head">
 				<view class="patient-title">选择就诊人</view>
-				<view class="x-f" @click="addPatient()"><u-icon name="plus-circle" size="36rpx" color="#222"></u-icon>添加</view>
+				<view class="x-f" @click="addPatient()"><uni-icons type="plus" size="36rpx" color="#222"></uni-icons>添加</view>
 			</view>
 			<scroll-view scroll-x :scroll-into-view="scrollIntoView" :scroll-with-animation="true" class="patient-list" v-if="patientList&&patientList.length>0">
 				<view :id="'patient_'+i" :class="current == i ? 'patient-item patient-active':'patient-item'" v-for="(item,i) in patientList" :key="item.patientId" @click="handlePatient(item,i)">
@@ -13,9 +13,7 @@
 						<text class="text" v-if="item.sex==2">女</text>
 						<text class="text">{{$getAge(item.birthday)}}岁</text>
 					</view>
-					<view class="checkmarkempty" v-show="current == i">
-						<u-icon name="checkmark" size="28rpx" color="#fff"></u-icon>
-					</view>
+					<uni-icons v-show="current == i" class="checkmarkempty" type="checkmarkempty" size="28rpx" color="#fff"></uni-icons>
 				</view>
 			</scroll-view>
 		</view>
@@ -33,18 +31,6 @@
 				patientList: [],
 			}
 		},
-		mounted() {
-			this.getPatientList()
-		},
-		watch: {
-			patient(newVal) {
-				const index = this.patientList.findIndex(item=>item.patientId == newVal.patientId)
-				this.current = index > -1 ? index : 0
-				setTimeout(()=>{
-					this.scrollIntoView = `patient_${this.current}`
-				},100)
-			}
-		},
 		methods: {
 			getPatientList(){
 				uni.showLoading({
@@ -55,6 +41,12 @@
 						uni.hideLoading()
 						if(res.code==200){
 							this.patientList=res.data;
+							if(this.patient&&this.patient.patientId) {
+								const index = this.patientList.findIndex(item=>item.patientId == this.patient.patientId)
+								this.current = index > -1 ? index : 0
+							} else {
+								this.current = 0
+							}
 							const patient = this.patientList&&this.patientList.length> 0 ? this.patientList[this.current] : null
 							uni.$emit('refreshOrderPatient',patient)
 						}else{

+ 21 - 20
pages_index/packageForm.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view class="content">
-			<choosePatient class="patient" :patient="patient" @addPatient="addPatient"></choosePatient>
+			<choosePatient ref="choosePatient" class="patient" :patient="patient" @addPatient="addPatient"></choosePatient>
 			<!-- <view class="patient-cont">
 				<view class="chose-patient">
 					<view class="patient-box" @click="addPatient()" v-if="patient==null">
@@ -152,13 +152,13 @@
 				},100)
 			})
 			this.item=this.items[0];
-			setTimeout(()=>{
-				this.addMsg(1,this.item.title);
-			},100)
+			this.addMsg(1,this.item.title);
 			this.getAgreement()
 		},
 		onShow() {
-			
+			this.$nextTick(()=>{
+				this.$refs.choosePatient.getPatientList()
+			})
 		},
 		methods:{
 			getpaddingTop() {
@@ -196,18 +196,18 @@
 				var msg={type:type,content:content}
 				this.msgs.push(msg)
 				var that=this;
-				uni
-				  .createSelectorQuery()
-				  .select(".msgs")
-				  .boundingClientRect((res) => {
-				    const scrollH = res.height;
-					that.scrollTop = scrollH;
-					console.log(that.scrollTop)
-				    
-				  })
-				  .exec();
-				 
-				
+				setTimeout(()=>{
+					uni
+					  .createSelectorQuery()
+					  .select(".msgs")
+					  .boundingClientRect((res) => {
+						   if(res) {
+								const scrollH = res.height;
+								that.scrollTop = scrollH;
+						   }
+					  })
+					  .exec();
+				},100)
 			},
 			optionClick(item,option){
 				if(this.patient==null){
@@ -364,6 +364,7 @@
 				height: 100%;
 				.msgs{
 					width: 100%;
+					padding: 6rpx 0;
 					.msg-item{
 						padding: 10rpx 15rpx;
 						display: flex;
@@ -434,11 +435,11 @@
 			// position: fixed;
 			// bottom: 0rpx;
 			// #ifndef APP-PLUS
-			max-height: 380rpx;
+			max-height: 90vh;
 			overflow-y: auto;
 			// #endif
 			// #ifdef APP-PLUS
-			height: 380rpx;
+			// height: 380rpx;
 			// #endif
 			width: 100%;
 			background-color: #fff;
@@ -466,7 +467,7 @@
 					justify-content: center;
 					width: 100%;
 					border: 1rpx solid #eee;
-					margin-bottom: 30rpx;
+					margin-bottom: 20rpx;
 					padding: 15rpx;
 					border-radius: 5rpx;
 					color: #ffffff;