zizhong.wang %!s(int64=3) %!d(string=hai) anos
pai
achega
12fac45804
Modificáronse 1 ficheiros con 81 adicións e 8 borrados
  1. 81 8
      pages/index/self_info.vue

+ 81 - 8
pages/index/self_info.vue

@@ -27,13 +27,13 @@
 				<input type="tel" placeholder="请输入手机号" name="selfTel" :value="userPhone" disabled="true">
 			</view>		
 		</view>
-		<view class="info-box">
+			<!-- <view class="info-box">
 			<view class="info-title-box">
-				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
+				<image src="/static/require-icon.png" mode="aspectFill"></image>
 				<text>个人照片</text>
 			</view>
 			<view class="info-value-box">
-				<!-- <image :src="userHeadImg" mode="aspectFit" style="width: 120rpx;height: 120rpx;border-radius: 10rpx;" @click="showLarge(userHeadImg)"></image> -->
+			<image :src="userHeadImg" mode="aspectFit" style="width: 120rpx;height: 120rpx;border-radius: 10rpx;" @click="showLarge(userHeadImg)"></image>
 			<view class="update_button display-flex">
 				  <view class="upload-box" @click="getImage('album')">
 				    <view class="img">
@@ -47,6 +47,24 @@
 				  </view>
 				</view>
 			</view>		
+		</view>  -->
+		<view class="img-container">
+			<label for="img">个人照片</label>
+			 <view class="note-image-box">
+				<view class="note-image-item" v-for="(item,index) in uploadList" :key="index">
+					<view class="close-icon" @click="delPhoto(index)">
+						<uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
+					</view>
+					<view class="image-box" @click="showLarge(item)">
+						<image :src="item" mode="aspectFill"></image>
+					</view>
+				</view>
+				<view v-if="uploadList.length < 1" class="note-image-item" @click="getImage('album')">
+					<view class="image-box">
+						<uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
+					</view>
+				</view>
+			 </view>
 		</view>
 		<view class="info-box">
 			<view class="info-title-box">
@@ -126,7 +144,7 @@
 				<text>工作单位</text>
 			</view>
 			<view class="info-value-box">
-				<input type="text" placeholder="" name="selfOffice" :value="userOffice" >
+				<input type="text"  name="selfOffice" :value="userOffice" >
 			</view>		
 		</view>
 		<view class="info-box">
@@ -135,7 +153,7 @@
 				<text>职务</text>
 			</view>
 			<view class="info-value-box">
-				<input type="text" placeholder="无" name="selfPosition" :value="userPosition">
+				<input type="text"  name="selfPosition" :value="userPosition">
 			</view>		
 		</view>
 		<view class="info-box">
@@ -144,7 +162,7 @@
 				<text>职称</text>
 			</view>
 			<view class="info-value-box">
-				<input type="text" placeholder="" :value="userTitle" name="selfTitle">
+				<input type="text"  :value="userTitle" name="selfTitle">
 			</view>		
 		</view>
 		<view style="display: flex;justify-content: space-evenly;">
@@ -258,7 +276,9 @@
 					  this.dateMonth = userInfoObj.jion_month;
 					  this.userNation = userInfoObj.nation;
 					  this.userSex = userInfoObj.sex;
-					  this.userBorn = (userInfoObj.birth_day).substr(0,4) + '-' + (userInfoObj.birth_day).substr(4,2) + '-' + (userInfoObj.birth_day).substr(6);
+					  if(userInfoObj.birth_day){
+						  this.userBorn = (userInfoObj.birth_day).substr(0,4) + '-' + (userInfoObj.birth_day).substr(4,2) + '-' + (userInfoObj.birth_day).substr(6);
+					  }
 					  this.educationValue = this.educationObj[userInfoObj.education_level];
 					  this.userOffice = userInfoObj.office;
 					  this.userPosition = userInfoObj.position;
@@ -431,8 +451,9 @@
 						uni.showToast({
 							title:'修改成功',
 							duration:2500,
-							icon:'none'
+							icon:'none',
 						})
+						setTimeout(()=>{uni.navigateBack({delta:1})},500)
 				    }
 				  },
 				  fail: () => {
@@ -649,4 +670,56 @@
 		margin: 0 0 5% 0;
 		color: #fff;
 	}
+	.img-container{
+		display: flex;
+		width: 90%;
+		margin: 3% auto;
+		font-size: 26rpx;
+		label {
+			width: 20%;
+		}
+		.note-image-box{
+			width: 75%;
+			display: flex;
+			flex-wrap: wrap;
+			.note-image-item{
+				position: relative;
+				//这两个百分比很关键
+				width: 33.33%;
+				height: 0;
+				padding-top: 33.33%;
+				box-sizing: border-box;
+				.close-icon{
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					position: absolute;
+					right: 0;
+					top: 0;
+					width: 22px;
+					height: 22px;
+					border-radius: 50%;
+					background-color: #d5d5d5;
+					z-index: 2;
+				}
+				.image-box{
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					position: absolute;
+					top: 5px;
+					right: 5px;
+					bottom: 5px;
+					left: 5px;
+					border: 1px #eee solid;
+					border-radius: 5px;
+					overflow: hidden;
+					image{
+						width: 100%;
+						height: 100%;
+					}
+				}
+			}
+		}
+	}
 </style>