zizhong.wang 2 yıl önce
ebeveyn
işleme
5fc6490856
1 değiştirilmiş dosya ile 180 ekleme ve 1 silme
  1. 180 1
      pages/index/self_info.vue

+ 180 - 1
pages/index/self_info.vue

@@ -152,6 +152,42 @@
 		<view class="info-box">
 			<view class="info-title-box">
 				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
+				<text>学位</text>
+			</view>
+			<view class="info-value-box">
+				  <picker @change="this.degreeValue=getArrayValueByOrder(this.degreeArray,$event.target.value)"  :range="getArrayValues(this.degreeArray)" class="select-box" >
+				        <view class="uni-input">{{degreeValue}}</view>
+						<image src="/static/arrow_down.svg" mode="aspectFill"></image>
+				  </picker>
+			</view>		
+		</view>
+		<view class="info-box">
+			<view class="info-title-box">
+				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
+				<text>在职学历</text>
+			</view>
+			<view class="info-value-box">
+				  <picker @change="this.jobEducationValue=getArrayValueByOrder(this.jobEducatioinArray,$event.target.value)"  :range="getArrayValues(this.jobEducatioinArray)" class="select-box" >
+				        <view class="uni-input">{{jobEducationValue}}</view>
+						<image src="/static/arrow_down.svg" mode="aspectFill"></image>
+				  </picker>
+			</view>		
+		</view>
+		<view class="info-box">
+			<view class="info-title-box">
+				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
+				<text>在职学位</text>
+			</view>
+			<view class="info-value-box">
+				  <picker @change="this.jobDegreeValue=getArrayValueByOrder(this.degreeArray,$event.target.value)"  :range="getArrayValues(this.degreeArray)" class="select-box" >
+				        <view class="uni-input">{{jobDegreeValue}}</view>
+						<image src="/static/arrow_down.svg" mode="aspectFill"></image>
+				  </picker>
+			</view>		
+		</view>
+		<view class="info-box">
+			<view class="info-title-box">
+				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
 				<text>工作单位</text>
 			</view>
 			<view class="info-value-box">
@@ -176,6 +212,38 @@
 				<input type="text"  :value="userTitle" name="selfTitle">
 			</view>		
 		</view>
+		<view class="info-box">
+			<view class="info-title-box">
+				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
+				<text>现任职级</text>
+			</view>
+			<view class="info-value-box">
+				  <picker @change="bindRankChange($event)"  :range="getArrayValues(this.rankArray)" class="select-box" >
+				        <view class="uni-input">{{rankValue}}</view>
+						<image src="/static/arrow_down.svg" mode="aspectFill"></image>
+				  </picker>
+			</view>		
+		</view>
+		<view class="info-box">
+			<view class="info-title-box">
+				<!-- <image src="/static/require-icon.png" mode="aspectFill"></image> -->
+				<text>任职年月</text>
+			</view>
+			<view class="info-value-box">
+				<view class="uni-list title-date-box">
+					<view class="uni-list-cell">
+						<view class="uni-list-cell-db display-flex-start">
+							<picker mode="date" fields="year"  @change="bindRankDateChange" class="picker-class">
+								<view class="uni-input display-between items-center">{{rankYear}}年<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image></view>
+							</picker>
+							<picker :range="arrayMonth" :value="dateMonth"  @change="bindRankDateMonthChange" class="picker-class" style="margin-left: 2%;">
+								<view class="uni-input display-between items-center" style="color: #707070;">{{rankMonth}}月<image src="/static/calendar_icon.svg" mode="aspectFit" style="top: 18rpx;"></image></view>
+							</picker>
+						</view>
+					</view>
+				</view>
+			</view>		
+		</view>
 		<view style="display: flex;justify-content: space-evenly;">
 			<!-- <button type="default" class="submit-bth" style="background-color: #aaaaaa;">清空</button> -->
 			<button type="primary" class="submit-bth" style="background-color: #169bd5;" formType="submit">提交</button>
@@ -195,6 +263,8 @@
 			return {
 				dateYear:new Date().getFullYear(),
 				dateMonth:new Date().getMonth() + 1,
+				rankYear:new Date().getFullYear(),
+				rankMonth:new Date().getMonth() + 1,
 				arrayMonth:["1", "2","3", "4","5", "6","7", "8","9", "10","11", "12"],
 				title: 'Hello',
 				userName:'',
@@ -214,7 +284,12 @@
 				userTitle:'',
 				txt: '请选择',
 				educationValue:'请选择',
+				degreeValue:'',
+				jobEducationValue:'',
+				jobDegreeValue:',',
+				
 				educationArray: ['博士研究生','硕士研究生','本科','大专','中专'],
+				rankValue:'',
 				professionValue:'请选择',
 				professionArray:[],
 				endsValue:'请选择',
@@ -246,7 +321,37 @@
 					'本科':'3',
 					'硕士研究生':'4',
 					'博士研究生':'5'
-				}
+				},
+				jobEducatioinArray:{
+					'0':'',
+					'2':'大专',
+					'3':'本科',
+					'4':'硕士研究生',
+					'5':'博士研究生'
+				},
+				degreeArray:{
+					'0':'',
+					'1':'学士',
+					'2':'硕士',
+					'3':'博士'
+				},
+				rankArray:{
+					'0':'',
+					'1':'正厅',
+					'2':'副厅(正局)',
+					'3':'副局',
+					'4':'正处',
+					'5':'副处',
+					'6':'正科',
+					'7':'一级巡视员',
+					'8':'二级巡视员',
+					'9':'一级调研员',
+					'10':'二级调研员',
+					'11':'三级调研员',
+					'12':'四级调研员'
+				},
+				
+				
 			}
 		},
 		onLoad() {
@@ -261,6 +366,43 @@
 		// 	    }
 		// },
 		methods: {
+			getArrayValues(list){
+				var values = [];
+				for (var i in list){
+					values.push(list[i]);
+				}
+				return values;
+			},
+			getArrayKeyByValue(list, value){
+				for (var i in list){
+					if (value == list[i]){
+						return i;
+					}
+				}
+			},
+			getArrayValueByOrder(list, order){
+				var n = 0;
+				for (var i in list){
+					if (order == n){
+						return list[i];
+					}
+					n++;
+				}
+			},
+			getArrayValueByKey(list, key){
+				return list[key];
+			},
+			getListData(list, type, value){
+				if (type == 1){
+					//输出value数组
+					var values = [];
+					for (var i in list){
+						values.push(list[i]);
+					}
+					return values;
+				}
+			},
+			
 			getMemberInfo() {
 			  let md5Sign = md5(
 			    "method=" +"member" + "&timestamp=" + getApp().globalData.globalTimestamp +
@@ -286,9 +428,22 @@
 					  this.userName = userInfoObj.name;
 					  this.dateYear = userInfoObj.jion_year;
 					  this.dateMonth = userInfoObj.jion_month;
+					  this.rankYear = userInfoObj.rank_year;
+					  this.rankMonth = userInfoObj.rank_month;
+					  if (this.rankYear == '0'){
+						  this.rankYear = '';
+					  }
+					  if (this.rankMonth == '0'){
+						  this.rankMonth = '';
+					  }
+					  
 					  this.userNation = userInfoObj.nation;
 					  this.userNative = userInfoObj.native;
 					  this.userSex = userInfoObj.sex;
+					  this.rankValue = this.getArrayValueByKey(this.rankArray, userInfoObj.rank);
+					  this.degreeValue = this.getArrayValueByKey(this.degreeArray,userInfoObj.degree);
+					  this.jobDegreeValue = this.getArrayValueByKey(this.degreeArray,userInfoObj.job_degree);
+					  this.jobEducationValue = this.getArrayValueByKey(this.jobEducatioinArray,userInfoObj.job_education_level);
 					  if (this.userSex == '0')
 					  {
 						  this.userSex = '2';
@@ -312,12 +467,21 @@
 			    },
 			  });
 			},
+			bindRankChange(e){
+				this.rankValue = this.getArrayValueByOrder(this.rankArray,e.target.value);
+			},
 			bindDateChange(e){
 				this.dateYear = e.target.value
 			},
+			bindRankDateChange(e){
+				this.rankYear = e.target.value
+			},
 			bindDateMonthChange(e){
 				this.dateMonth = this.arrayMonth[e.target.value]
 			},
+			bindRankDateMonthChange(e){
+				this.rankMonth = this.arrayMonth[e.target.value]
+			},
 			change(e) {
 			  console.log('show')
 			  this.userBorn = e;
@@ -444,23 +608,38 @@
 				  getApp().globalData.globalTimestamp +
 				  "&sign=" +
 				  md5Sign;
+				let ry = this.rankYear;
+				if (ry == ''){
+					ry = '0';
+				}
+				var rm = this.rankMonth;
+				if (rm == ''){
+					rm = '0';
+				}
 				uni.request({
 				  url: url,
 				  method: "POST",
 				  header: {
 				    "content-type": "application/x-www-form-urlencoded",
 				  },
+				  
 				  data: {
 				    openid: getApp().globalData.open_id,
 					name:params.selfName,
 					jion_year :this.dateYear,
 					jion_month :this.dateMonth,
+					rank_year :ry,
+					rank_month :rm,
 					sex : this.userSex,
 					birth_day: this.userBorn,
 					office :params.selfOffice,
 					position:params.selfPosition,
 					nation:params.selfNation,
 					native:params.selfNative,
+					rank:this.getArrayKeyByValue(this.rankArray,this.rankValue),
+					degree:this.getArrayKeyByValue(this.degreeArray,this.degreeValue),
+					job_degree:this.getArrayKeyByValue(this.degreeArray,this.jobDegreeValue),
+					job_education_level:this.getArrayKeyByValue(this.jobEducatioinArray,this.jobEducationValue),
 					technical_title:params.selfTitle,
 					education_level:this.educationObjEdit[this.educationValue],
 					photo_attach_id:this.headImgId,