Sfoglia il codice sorgente

个人信息修改】增加【联系电话(非公开)】、【联系邮箱(非公开)】两个字段。

jack 8 anni fa
parent
commit
286baf1554
2 ha cambiato i file con 74 aggiunte e 34 eliminazioni
  1. 8 0
      information.html
  2. 66 34
      js/information.js

+ 8 - 0
information.html

@ -63,6 +63,8 @@
63 63
							<div class="position proPosition"><span id="office"></span ><span id="titleS"></span ></div>				
64 64
		                    <div class="science proScience"><span id="industryS"></span ><span id="orgNameS"></span ></div>			
65 65
		                    <div class="address proAddress" id="address"></div>
66
		                    <div style="font-size:16px;color:#999" id="phone"></div>
67
		                    <div style="font-size:16px;color:#999;line-height:30px;" id="mail"></div>
66 68
	                    </div>
67 69
	                   <!--个人信息修改-->
68 70
	                   <div class="modifybox" style="margin:0;padding:10px;">
@ -114,6 +116,12 @@
114 116
									</form>
115 117
								</div>
116 118
							</div>
119
							<div class="infor">
120
								<span class="txtType"><a>联系电话(非公开</a></span>
121
								<input type="text" class="input-txt" id="mobilePhone">
122
								<span>联系邮箱(非公开)</span>
123
								<input type="text" class="input-txt" id="moileMail">
124
							</div>
117 125
							<div class="btnbox" style="padding:4px 16px;">
118 126
								<input id="saveProfessor" type="button" value="保存" class="infor-save btn">
119 127
								<input type="button" value="取消" class="close btn">

+ 66 - 34
js/information.js

@ -562,7 +562,14 @@ $(function() {
562 562
					if($info.address) {
563 563
						$("#address").text($info.address);
564 564
					}
565

565
					if($info.email) {
566
						$("#mail").text("联系邮箱(非公开):" + $info.email);
567
						$("#moileMail").val($info.email);
568
					}
569
					if($info.phone) {
570
						$("#phone").text("联系电话(非公开):" + $info.phone);
571
						$("#mobilePhone").val($info.phone);
572
					}
566 573
					$("#headImage").attr("src", "/images/head/" + userid + "_l.jpg");
567 574
					$("#headImage").load(function() {})
568 575
						.error(function() {
@ -690,8 +697,7 @@ $(function() {
690 697
		location.href = "login.html";
691 698
		return;
692 699
	}
693

694
	//搜索框
700
		//搜索框
695 701
	$("#hsearch").on("click", function() {
696 702
		var searchContent = $("#hsearchContent").val();
697 703
		location.href = "search.html?searchContent=" + searchContent;
@ -705,6 +711,22 @@ $(function() {
705 711
		var length1 = trim($("#name").val());
706 712
		console.log(length1)
707 713
		var length2 = trim($("#orgName").val());
714
		var loginName=$("#mobilePhone").val();
715
		if(trim(loginName)){
716
			var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
717
			if(!hunPhone.test(loginName.trim())) {			
718
				$.MsgBox.Alert("消息提醒", "联系电话格式不对,请输入正确的格式");
719
				return;
720
			}	
721
		}
722
		var mail=$("#moileMail").val();
723
		if(trim(mail)){
724
		var gunf = /^\w+@\w+\.((cn)|(com)|(com\.cn))$/;
725
			if(!gunf.test(mail.trim())) {
726
				$.MsgBox.Alert("消息提醒", "请输入正确的邮箱格式");
727
				return;
728
			}
729
		}
708 730
		if(!length1 && length2) {
709 731
			$.MsgBox.Alert("消息提醒", "姓名不能为空");
710 732
			return;
@ -780,6 +802,8 @@ $(function() {
780 802
		$data.orgName = $("#orgName").val();
781 803
		$data.title = $("#title").val();
782 804
		$data.department = $("#department").val();
805
		$data.phone=$("#mobilePhone").val();
806
		$data.email=$("#moileMail").val();
783 807
		if($("#Province input[name=cho_Province]").val() != "请选择省份") {
784 808
			$data.province = $("#Province input[name=cho_Province]").val(); //省
785 809
		}
@ -820,6 +844,20 @@ $(function() {
820 844
									$("#orgNameS").text("");
821 845
									$("#address").text("");
822 846
									$("#nameS").text($info.name);
847
									if($info.phone){
848
										$("#phone").text("联系电话(非公开):" +$info.phone);
849
										$("#mobilePhone").val($info.phone);
850
									}else{
851
										$("#phone").text("");
852
										$("#mobilePhone").val("");
853
									}
854
									if($info.email){
855
										$("#mail").text("联系邮箱(非公开):" +$info.email);
856
										$("#moileMail").val($info.email);
857
									}else{
858
										$("#mail").text("");
859
										$("#moileMail").val("");
860
									}
823 861
									if($info.office) {
824 862
										if($info.title) {
825 863
											$("#office").text($info.office + ",");
@ -881,23 +919,23 @@ $(function() {
881 919
	}
882 920
	//上传图像的hover
883 921
	$(".head-left").hover(function() {
884
			$(".replace-photo").animate({
885
				"bottom": "0px"
886
			});
887
		}, function() {
888
			$(".replace-photo").animate({
889
				"bottom": "-50px"
890
			});
891
		})
892
	
922
		$(".replace-photo").animate({
923
			"bottom": "0px"
924
		});
925
	}, function() {
926
		$(".replace-photo").animate({
927
			"bottom": "-50px"
928
		});
929
	})
930

893 931
	//拿到点击的顺序,然后求出局文档的距离
894
	$(".subsidebar").mouseenter(function(){
895
		var dd=$(this)[0].className;
896
		if(dd!="subsidebar subcolor"){
897
			$(this).css("background","#efefef");
932
	$(".subsidebar").mouseenter(function() {
933
		var dd = $(this)[0].className;
934
		if(dd != "subsidebar subcolor") {
935
			$(this).css("background", "#efefef");
898 936
		}
899
	}).mouseleave(function(){
900
		$(this).css("background","")
937
	}).mouseleave(function() {
938
		$(this).css("background", "")
901 939
	});
902 940
	//专家信息点击换背景颜色
903 941
	$(".subsidebar").click(function() {
@ -905,14 +943,14 @@ $(function() {
905 943
		$(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
906 944
	});
907 945
	$(".subsidebar").click(function() {
908
		var index = $(".subsidebar").index(this)+1;
909
        //console.log(index)
946
		var index = $(".subsidebar").index(this) + 1;
947
		//console.log(index)
910 948
		var offset = $(".introduction").eq(index).offset();
911 949
		$("body,html").animate({
912 950
			scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹��� 
913 951
		}, 1000);
914
	}).mousedown(function(){
915
	  	$(this).css("background","");
952
	}).mousedown(function() {
953
		$(this).css("background", "");
916 954
	});
917 955

918 956
	//获取点击那个编辑,及
@ -1260,8 +1298,7 @@ $(function() {
1260 1298
				"url": "/ajax/edu",
1261 1299
				"type": $id ? "PUT" : "POST",
1262 1300
				"data": $id ? JSON.stringify($data) : $data,
1263
				"contentType": $id ? "application/json" :
1264
					"application/x-www-form-urlencoded",
1301
				"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
1265 1302
				"success": function($data) {
1266 1303
					if($data.success) {
1267 1304
						$.get("/ajax/professor/info/" + userid, function($data) {
@ -1430,8 +1467,7 @@ $(function() {
1430 1467
				"url": "/ajax/job",
1431 1468
				"type": $id ? "PUT" : "POST",
1432 1469
				"data": $id ? JSON.stringify($data) : $data,
1433
				"contentType": $id ? "application/json" :
1434
					"application/x-www-form-urlencoded",
1470
				"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
1435 1471
				beforeSend: function() {
1436 1472
					console.log(this.data)
1437 1473
				},
@ -1590,8 +1626,7 @@ $(function() {
1590 1626
				"url": "../ajax/project",
1591 1627
				"type": $id ? "PUT" : "POST",
1592 1628
				"data": $id ? JSON.stringify($data) : $data,
1593
				"contentType": $id ? "application/json" :
1594
					"application/x-www-form-urlencoded",
1629
				"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
1595 1630
				"success": function($data) {
1596 1631
					if($data.success) {
1597 1632
						$.get("/ajax/professor/info/" + userid, function($data) {
@ -1712,8 +1747,7 @@ $(function() {
1712 1747
			"url": "../ajax/paper",
1713 1748
			"type": $id ? "PUT" : "POST",
1714 1749
			"data": $id ? JSON.stringify($data) : $data,
1715
			"contentType": $id ? "application/json" :
1716
				"application/x-www-form-urlencoded",
1750
			"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
1717 1751
			"success": function($data) {
1718 1752
				if($data.success) {
1719 1753
					$.get("/ajax/professor/info/" + userid, function($data) {
@ -1839,8 +1873,7 @@ $(function() {
1839 1873
				"url": "../ajax/patent",
1840 1874
				"type": $id ? "PUT" : "POST",
1841 1875
				"data": $id ? JSON.stringify($data) : $data,
1842
				"contentType": $id ? "application/json" :
1843
					"application/x-www-form-urlencoded",
1876
				"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
1844 1877
				"success": function($data) {
1845 1878
					if($data.success) {
1846 1879

@ -1971,8 +2004,7 @@ $(function() {
1971 2004
				"url": "../ajax/honor",
1972 2005
				"type": $id ? "PUT" : "POST",
1973 2006
				"data": $id ? JSON.stringify($data) : $data,
1974
				"contentType": $id ? "application/json" :
1975
					"application/x-www-form-urlencoded",
2007
				"contentType": $id ? "application/json" : "application/x-www-form-urlencoded",
1976 2008
				"success": function($data) {
1977 2009
					if($data.success) {
1978 2010
						$.get("/ajax/professor/info/" + userid, function($data) {