Browse Source

添加学生,企业专家,专家的模块,加上认证标示

lipengtao 8 years ago
parent
commit
3c4fd4d120

+ 4 - 3
app/css/app.css

@ -106,9 +106,9 @@ body{ color: #666666; font-size:14px;}
106 106
.authicon-cu{color:#FF9900;}/*认证科研型专家*/
107 107
.authicon-com{/*color:#00aaee;*/ color:#2082fb;}/*认证企业型专家*/
108 108
/*普通用户认证标识 icon-renzheng*/
109
em.icon-renzheng{border:1px solid;border-radius:8px;font-size:12px;line-height:10px;}
110
em.icon-renzheng span{ font-size:10px;margin-right:4px;vertical-align:middle;}
111
.authicon-mana{color:##ff9900;}/*认证在企高管*/
109
em.icon-renzheng{border:1px solid;border-radius:10px;font-size:16px;line-height:14px;}
110
em.icon-renzheng span{ font-size:12px;margin-right:6px;vertical-align:middle;}
111
.authicon-mana{color:#ff9900;}/*认证在企高管*/
112 112
.authicon-staff{color:#007AFF;}/*认证在企职员*/
113 113
.authicon-stu{color:#00b38a;}/*认证在读学生*/
114 114
@ -193,6 +193,7 @@ ul.boxnav li.set:nth-child(3) span{border:1px solid #66cc00; color: #fff; backgr
193 193
/*.maincon .basicinfo>li:not(.basicfrm){ font-size: 13px; line-height: 42px;}*/
194 194
.maincon ul li.basicfrm{list-style: none; position: relative; overflow: hidden; line-height: 20px;border-bottom:1px #F0F0F0 solid;margin-left: 2%;padding-left:0; }
195 195
.maincon ul li.basicfrm .frmtype{ height: 26px; padding:0; padding-right:2%;line-height:20px;font-size: 14px; }
196
.maincon ul li.basicfrm .authu{position:absolute;left:60%;color:burlywood}
196 197
.maincon ul li label{ position: relative; color: #888888; line-height:30px;}
197 198
.maincon ul li small{ color:#AAAAAA;}
198 199
.maincon ul.set2{ display: block;}

+ 119 - 0
app/html/companyUpdata.html

@ -0,0 +1,119 @@
1
<!doctype html>
2
<html>
3
4
	<head>
5
		<meta charset="UTF-8">
6
		<title></title>
7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link href="../css/iconfont.css" rel="stylesheet" />
10
		<link href="../css/app.css" rel="stylesheet" />
11
	</head>
12
13
	<body>
14
		<header class="mui-bar mui-bar-nav toptitbox">
15
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
16
			<h1 class="mui-title toptit">修改资料</h1>
17
		</header>
18
19
		<!-- 主页面内容容器 -->
20
		<div class="mui-content">
21
			<!-- 主界面具体展示内容 -->
22
			<div class="mui-input-group mainbox">
23
				<div class="maincon personinfo">
24
					<div class="headbox">
25
						<a href="javascript:;">
26
							<img class="headimg headRadius" src="../images/default-photo.jpg" id="userimg" flag="0" headFlag="1"/>
27
							<div class="pinfor">点击更换头像</div>
28
						</a>
29
					</div>
30
				</div>
31
			</div>
32
			<div class="mui-input-group mainbox">
33
				<div class="maincon">
34
					<div class="infocontit">基本信息
35
						<a class="updatebox mui-clearfix"><em class="mui-icon mui-icon-compose updatebtn mui-pull-left"></em><span class="mui-pull-left">点击修改</span></a>
36
					</div>
37
					<div class="infocon">
38
						<ul class="generalinfo">
39
							<li class="ginfolist">
40
								<span class="infotype"><i class="letspace">姓</i>名:</span>
41
								<span class="personalMaterial"></span><!--<span class="authword authed">认证专家</span>-->
42
							</li>
43
							<li class="ginfolist">
44
								<span class="infotype"><i class="letspace">职</i>位:</span>
45
								<span class="personalMaterial"></span>
46
							</li>
47
							<li class="ginfolist">
48
								<span class="infotype"><i class="letspace">职</i>称:</span>
49
								<span class="personalMaterial"></span>
50
							</li>
51
							<li class="ginfolist">
52
								<span class="infotype">所属部门:</span>
53
								<span class="personalMaterial"></span>
54
							</li>
55
							<li class="ginfolist">
56
								<span class="infotype">所在企业:</span>
57
								<span class="personalMaterial"></span>
58
							</li>
59
							<li class="ginfolist">
60
								<span class="infotype">所在城市:</span>
61
								<span class="personalMaterial"></span>
62
							</li>
63
							<li class="ginfolist">
64
				       			<span class="infotype">联系电话:</span>
65
				       			<span class="personalMaterial"></span>
66
				       		</li>
67
				       		<li class="ginfolist">
68
				       			<span class="infotype">邮箱地址:</span>
69
				       			<span class="personalMaterial"></span>
70
				       		</li>
71
						</ul>
72
					</div>
73
				</div>
74
			</div>
75
			<div class="mui-input-group mainbox">
76
				<div class="maincon">
77
					<div class="infocontit">研发资源
78
						<a class="addinfobox mui-clearfix" style="right:1% ;"><em class="mui-icon mui-icon-plus addinfobtn mui-pull-left"></em><span class="mui-pull-left">点击添加</span></a>
79
					</div>
80
					<div class="infocon">
81
						<ul class="mui-table-view resinfo" id="resourceList">
82
83
						</ul>
84
85
					</div>
86
				</div>
87
			</div>
88
			<div class="mui-input-group mainbox">
89
				<div class="maincon">
90
					<div class="infocontit">个人简介
91
						<a class="updatebox mui-clearfix" "><em class="mui-icon mui-icon-compose updatebtn mui-pull-left "></em><span class="mui-pull-left ">点击修改</span></a></div> 
92
			       <div class="infocon ">
93
				       	<span class="breifinfo ">
94
				       		
95
				        </span>
96
			       </div>
97
		       </div>
98
		    </div>
99
		    
100
		    <div class="mui-input-group mainbox ">
101
				<div class="maincon ">
102
					<a >
103
						<div class="gotonext gotonext2 ">
104
							<span class="mui-pull-left ">修改详细信息</span>
105
				       		<em class="mui-iocn iconfont icon-pullright mui-pull-left "></em>
106
						</div>
107
					</a>
108
		       </div>
109
		    </div>
110
        </div>
111
		
112
		
113
		<script src="../js/public/mui.min.js "></script>
114
		<script src="../js/public/base.js "></script>
115
		<script src="../js/public/upload-avatar.js "></script>
116
		<script type="text/javascript" src="../js/companyUpdata.js"></script>		
117
	</body>
118
119
</html>

+ 59 - 0
app/html/companyUpdata1.html

@ -0,0 +1,59 @@
1
<!doctype html>
2
<html>
3

4
	<head>
5
		<meta charset="UTF-8">
6
		<title></title>
7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link href="../css/mui.picker.min.css" rel="stylesheet" />
10
		<link href="../css/app.css" rel="stylesheet" />
11
	</head>
12

13
	<body>
14
		<header class="mui-bar mui-bar-nav toptitbox">
15
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
16
		    <h1 class="mui-title toptit">基本信息</h1>
17
		    <span class="mui-pull-right topsave">保存</span>
18
		</header>
19
		<div class="mui-content">
20
			
21
		    <div class="mui-input-group marginbox">
22
				<div class="maincon">
23
					<ul class="basicinfo">
24
						<li><label>姓名<em class="requiredcon"></em></label></li>
25
						<li class="basicfrm"><input type="text" name="name" class="mui-input-clear frmtype"></li>
26
						<li><label>所在企业(高校/科研机构/企业名称)<em class="requiredcon"></em></label></li>
27
						<li class="basicfrm"><input type="text" name="organization" class="mui-input-clear frmtype"><span class="authu"></span></li>
28
						<li><label>所属部门(院系/科研室/部门名称)</label></li>
29
						<li class="basicfrm"><input type="text" name="department" class="mui-input-clear frmtype"></li>
30
						<li><label>职位</label></li>
31
						<li class="basicfrm"><input type="text" name="position" class="mui-input-clear frmtype"></li>
32
						<li><label>职称</label></li>
33
						<li class="basicfrm"><input type="text" name="title" class="mui-input-clear frmtype"></li>
34
						<li><label>所在城市</label></li>
35
						<li class="basicfrm">
36
							<span  name="city" class="mui-input-clear frmtype" id="addressa"></span>
37
							<span class="mui-icon mui-icon-arrowdown downarrow" id ="showCityPicker"></span>
38
							<input type="hidden"  class="mui-input-clear frmtype" id="data-province">
39
					    	<input type="hidden"  class="mui-input-clear frmtype" id="data-address">
40
						</li>
41
						<li><label>联系电话(非公开)</label></li>
42
						<li class="basicfrm"><input type="tel" name="tel" class="mui-input-clear frmtype" id="telePhone"></li>
43
						<li><label>邮箱地址(非公开)</label></li>
44
						<li class="basicfrm"><input type="email" name="email" class="mui-input-clear frmtype" id="mail"></li>
45
					</ul>
46
			        
47
		        </div>
48
		    </div>
49
		    
50
		</div>
51
		<script src="../js/public/mui.min.js"></script>
52
		<script src="../js/public/zepto.min.js"></script>
53
		<script src="../js/public/mui.picker.min.js"></script>
54
		<script src="../js/public/city.data.js"></script>
55
		<script src="../js/public/base.js"></script>
56
		<script type="text/javascript" src="../js/companyUpdata1.js"></script>				
57
	</body>
58

59
</html>

+ 146 - 0
app/html/companybrowse.html

@ -0,0 +1,146 @@
1
<!DOCTYPE html>
2
<html>
3
	<head>
4
		<meta charset="UTF-8">
5
		<title></title>
6
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
7
		<link href="../css/mui.min.css" rel="stylesheet" />
8
		<link href="../css/iconfont.css" rel="stylesheet" />
9
		<link href="../css/app.css" rel="stylesheet" />
10
	</head>
11

12
	<body>
13
		<header class="mui-bar mui-bar-nav toptitbox">
14
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>		   
15
		    <!--<a class="mui-icon iconfont icon-moreandroid mui-pull-right topmore"></a>-->
16
		    <!--<a class="mui-icon iconfont icon-share mui-pull-right topmore" id="shareBtn">
17
		    	<ul class="sharebox" id="shareBox" style="display:none; color: #000000;">
18
		    		<li>
19
		    			<span class="mui-icon mui-icon-weixin"></span>
20
		    		</li>
21
		    		<li>
22
		    			<span class="mui-icon mui-icon-weibo"></span>
23
		    		</li>
24
		    		<li>
25
		    			<span class="mui-icon mui-icon-qq"></span>
26
		    		</li>
27
		    		
28
		    	</ul>
29
		    </a>-->
30
		</header>
31
		
32
		<!--主页面底部菜单-->
33
	    <nav class="mui-bar mui-bar-tab mui-clearfix footbox">
34
		    <div class="dialogbtn mui-pull-left btnactive" style="background:#FF9900; color: #FFFFFF;" id="zixun">
35
		    	<div>
36
			    	<em class="mui-iocn iconfont icon-community mui-pull-left"></em>
37
					<span class="mui-pull-left" id="consultBtn">咨询</span>
38
				</div>
39
			</div>
40
			<div class="attentbtn mui-pull-left" >
41
				<em class="mui-iocn iconfont icon-favor" id="yesExpert"></em>
42
				<em class="mui-iocn iconfont icon-favorfill" style="display:none;" id="noExpert"></em>	
43
				<!--已经关注icon-favorfill-->
44
			</div>
45
		</nav>
46
		<!-- 主页面内容容器 -->
47
    	<div class="mui-content">
48
    		<!-- 主界面具体展示内容 -->
49
    		<div class="mui-input-group mainbox">
50
				<div class="maincon personinfo">
51
					<div class="headbox">
52
				        <a href="javascript:;">
53
				        	<img class="headimg headRadius" src="" />
54
				        	<div class="listtit "><span class="personalMaterial"></span><em class="mui-icon iconfont" id="nameli"></em></div>	
55
		                    <p class="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span></p>
56
		                    <p cauthwordlass="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span> <span class="personalMaterial"></span></p>
57
				        </a>
58
			        </div>
59
		        </div>
60
		        <ul class="mui-table-view">
61
				    <li class="mui-table-view-cell">
62
				        <a class="mui-navigate-right mui-clearfix peolevelbox " id="accessHistory">
63
				        	<div class="mui-pull-left peocountbox">
64
				        		<div class="peocount mui-clearfix">
65
				        			<em class="mui-icon iconfont icon-community actionicon dialogicon mui-pull-left "></em>
66
				        			<span class="mui-pull-left">已完成咨询<em class="consultCount"></em>人次</span>
67
				        		</div>
68
				        	</div>
69
				        	<div class="rightword levelbox ">
70
				        		<span class="mui-icon iconfont icon-favor start"></span> <!--无色星星icon-favor  黄色星icon-favorfill-->
71
				        		<span class="mui-icon iconfont icon-favor start"></span>
72
				        		<span class="mui-icon iconfont icon-favor start"></span>
73
				        		<span class="mui-icon iconfont icon-favor start"></span>
74
				        		<span class="mui-icon iconfont icon-favor start"></span>
75
				        	</div>
76
				        	
77
				        </a>
78
				    </li>
79
				</ul>
80
		        
81
		    </div>
82
		    <div class="mui-input-group mainbox" id="professorresourceList">
83
				<div class="maincon">
84
			       <div class="infocontit">合作资源</div> 
85
			       <div class="infocon">
86
				       <ul class="mui-table-view listitembox resinfo" id="resourceList">
87
				            <!--<li class="mui-table-view-cell mui-media listitem">
88
				                <a class="proinfor" href="resinforbrow.html">
89
				                    <img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">
90
				                    <div class="mui-media-body">
91
				                        <span class="listtit">资源名称</span>	
92
				                        <p class="listtit2">应用用途XXXXXXX</p>
93
				                    	<p class="listtit3 resbrief">
94
				                    		Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan
95
				                    	</p>
96
				                    	
97
				                    </div>
98
				                </a>
99
				            </li>
100
				            <li class="mui-table-view-cell mui-media listitem">
101
				                <a class="proinfor" href="resinforbrow.html">
102
				                    <img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">
103
				                    <div class="mui-media-body">
104
				                        <span class="listtit">资源名称</span>	
105
				                        <p class="listtit2">应用用途XXXXXXX</p>
106
				                    	<p class="listtit3 resbrief">
107
				                    		Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan
108
				                    	</p>
109
				                    	
110
				                    </div>
111
				                </a>
112
				            </li>	-->
113
		                </ul>    
114
		              
115
			       </div>
116
		       </div>
117
		    </div>
118
		    <div class="mui-input-group mainbox" id="professorBreifinfo">
119
				<div class="maincon">
120
			       <div class="infocontit">个人简介</div> 
121
			       <div class="infocon">
122
				       	<span class="breifinfo">
123
				       		 
124
				        </span>
125
			       </div>
126
		       </div>
127
		    </div>		    
128
		    <div class="mui-input-group mainbox"id="detailProfessor">
129
				<div class="maincon">
130
					<a >
131
						<div class="gotonext">
132
							<span class="mui-pull-left">查看专家详细信息</span>
133
				       		<em class="mui-iocn iconfont icon-pullright mui-pull-left"></em>
134
						</div>
135
					</a>
136
		       </div>
137
		    </div>
138
        </div>
139
		
140
		
141
		<script src="../js/public/mui.min.js"></script>
142
		<script src="../js/public/base.js"></script>
143
		<script src="../js/companybrowse.js"></script>
144
	</body>
145

146
</html>

+ 1 - 2
app/html/myaccount.html

@ -24,8 +24,7 @@
24 24
		                    <div class="mui-pull-left infobasic">
25 25
		                        <span class="listtit">
26 26
		                        	<span id="userName"></span>
27
		                        	<em class="mui-icon iconfont icon-vip authicon" style="display:none;" ></em>
28
		                        	<em class="mui-icon iconfont icon-vip unauthicon" style="display:none;" ></em>
27
		                        	<em class="mui-icon iconfont" id="nameli"></em>
29 28
		                        </span>	
30 29
		                        <p class="listtit2"><span id="userTitle"></span><span id="userPosition"></span></p>
31 30
		                    	<p class="listtit3"><span id="userDepartment"></span><span id="userMechanism"></span><span id="userCity"></span></p>

+ 1 - 1
app/html/proinforbrow.html

@ -51,7 +51,7 @@
51 51
					<div class="headbox">
52 52
				        <a href="javascript:;">
53 53
				        	<img class="headimg headRadius" src="" />
54
				        	<div class="listtit "><span class="personalMaterial"></span><em class="mui-icon iconfont icon-vip authicon" style="font-size:16px;"></em></div>	
54
				        	<div class="listtit "><span class="personalMaterial"></span><em class="mui-icon iconfont" id="nameli"></em></div>	
55 55
		                    <p class="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span></p>
56 56
		                    <p cauthwordlass="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span> <span class="personalMaterial"></span></p>
57 57
				        </a>

+ 9 - 6
app/html/proinforupdate.html

@ -18,11 +18,14 @@
18 18
		<!-- 主页面内容容器 -->
19 19
    	<div class="mui-content">
20 20
    		<!-- 主界面具体展示内容 -->
21
    		<!--<div class="mui-input-group mainbox">
22
    			<div style="background-color: #EEEEEE;">完善信息 —>认证身份—>通过审核,成为科袖认证专家!</div>
23
    		</div>-->
21 24
    		<div class="mui-input-group mainbox">
22 25
				<div class="maincon personinfo">
23 26
					<div class="headbox">
24 27
				        <a href="javascript:;">
25
				        	<img class="headimg headRadius" src="../images/default-photo.jpg" id="userimg"/>
28
				        	<img class="headimg headRadius" src="../images/default-photo.jpg" id="userimg" flag="0" headFlag="0"/>
26 29
				        	<div class="pinfor">点击更换头像</div>
27 30
				        </a>
28 31
			        </div>
@ -35,7 +38,7 @@
35 38
				       <ul class="generalinfo">
36 39
				       		<li class="ginfolist">
37 40
				       			<span class="infotype"><i class="letspace">姓</i>名:</span>
38
				       			<span class="personalMaterial"></span><span class="authword authed">认证</span>
41
				       			<span class="personalMaterial"></span><!--<span class="authword authed">认证专家</span>-->
39 42
				       		</li>
40 43
				       		<li class="ginfolist">
41 44
				       			<span class="infotype"><i class="letspace">职</i>称:</span>
@ -57,14 +60,14 @@
57 60
				       			<span class="infotype">所在城市:</span>
58 61
				       			<span class="personalMaterial"></span>
59 62
				       		</li>
60
				       		<!--<li class="ginfolist">
63
				       		<li class="ginfolist">
61 64
				       			<span class="infotype">联系电话:</span>
62
				       			<span>XXXXXXXXXXX</span>
65
				       			<span class="personalMaterial"></span>
63 66
				       		</li>
64 67
				       		<li class="ginfolist">
65 68
				       			<span class="infotype">邮箱地址:</span>
66
				       			<span>XXXXXXXXXXX</span>
67
				       		</li>-->
69
				       			<span class="personalMaterial"></span>
70
				       		</li>
68 71
				       </ul>	
69 72
			       </div>
70 73
		       </div>

+ 1 - 1
app/html/resinforbrow.html

@ -49,7 +49,7 @@
49 49
    			<div class="resouimgbox mui-pull-left">
50 50
					<img class="headRadius" src="../images/default-resource.jpg"/ id="ziyuanimg">
51 51
				</div>
52
				<div class="personblock mui-pull-left">
52
				<div class="personblock mui-pull-left" id="fess">
53 53
                    <img class="headimg headRadius" src="" id="proimg">
54 54
                    <p class="listtit" id="proname"><em class="mui-icon iconfont icon-vip " style="font-size:16px;" id="promodify"></em></p>	
55 55
                    <p class="listtit2" ><span id="protitle"></span><span id="prooffice"></span></p>

+ 1 - 1
app/html/resinforupdate.html

@ -34,7 +34,7 @@
34 34
    		<!-- 主界面具体展示内容 -->
35 35
    		<div class="mui-input-group mainbox restopblock">
36 36
    			<div class="resouimgbox" style="margin: auto;text-align: center;" >
37
					<img class="headRadius" src="../images/default-resource.jpg" id="userimg"/>
37
					<img class="headRadius" src="../images/default-resource.jpg" id="userimg" flag="1"/>
38 38
					<span style="font-size:13px; color:#999999;">点击上传资源图片</span>
39 39
				</div>
40 40
    		</div>

+ 111 - 0
app/html/studentUpdata.html

@ -0,0 +1,111 @@
1
<!doctype html>
2
<html>
3

4
	<head>
5
		<meta charset="UTF-8">
6
		<title></title>
7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link href="../css/iconfont.css" rel="stylesheet" />
10
		<link href="../css/app.css" rel="stylesheet" />
11
	</head>
12

13
	<body>
14
		<header class="mui-bar mui-bar-nav toptitbox">
15
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
16
			<h1 class="mui-title toptit">修改资料</h1>
17
		</header>
18

19
		<!-- 主页面内容容器 -->
20
		<div class="mui-content">
21
			<!-- 主界面具体展示内容 -->
22
			<div class="mui-input-group mainbox">
23
				<div class="maincon personinfo">
24
					<div class="headbox">
25
						<a href="javascript:;">
26
							<img class="headimg headRadius" src="../images/default-photo.jpg" id="userimg" flag="0" headFlag="2"/>
27
							<div class="pinfor">点击更换头像</div>
28
						</a>
29
					</div>
30
				</div>
31
			</div>
32
			<div class="mui-input-group mainbox">
33
				<div class="maincon">
34
					<div class="infocontit">基本信息
35
						<a class="updatebox mui-clearfix"><em class="mui-icon mui-icon-compose updatebtn mui-pull-left"></em><span class="mui-pull-left">点击修改</span></a>
36
					</div>
37
					<div class="infocon">
38
						<ul class="generalinfo">
39
							<li class="ginfolist">
40
								<span class="infotype"><i class="letspace">姓</i>名:</span>
41
								<span class="personalMaterial"></span><!--<span class="authword authed">认证专家</span>-->
42
							</li>
43
							
44
							<li class="ginfolist">
45
								<span class="infotype">所属院系:</span>
46
								<span class="personalMaterial"></span>
47
							</li>
48
							<li class="ginfolist">
49
								<span class="infotype">所在高校:</span>
50
								<span class="personalMaterial"></span>
51
							</li>
52
							<li class="ginfolist">
53
								<span class="infotype">所在城市:</span>
54
								<span class="personalMaterial"></span>
55
							</li>
56
							<li class="ginfolist">
57
				       			<span class="infotype">联系电话:</span>
58
				       			<span class="personalMaterial"></span>
59
				       		</li>
60
				       		<li class="ginfolist">
61
				       			<span class="infotype">邮箱地址:</span>
62
				       			<span class="personalMaterial"></span>
63
				       		</li>
64
						</ul>
65
					</div>
66
				</div>
67
			</div>
68
			<div class="mui-input-group mainbox">
69
				<div class="maincon">
70
					<div class="infocontit">合作资源
71
						<a class="addinfobox mui-clearfix" style="right:1% ;"><em class="mui-icon mui-icon-plus addinfobtn mui-pull-left"></em><span class="mui-pull-left">点击添加</span></a>
72
					</div>
73
					<div class="infocon">
74
						<ul class="mui-table-view resinfo" id="resourceList">
75

76
						</ul>
77

78
					</div>
79
				</div>
80
			</div>
81
			<div class="mui-input-group mainbox">
82
				<div class="maincon">
83
					<div class="infocontit">个人简介
84
						<a class="updatebox mui-clearfix" "><em class="mui-icon mui-icon-compose updatebtn mui-pull-left "></em><span class="mui-pull-left ">点击修改</span></a></div> 
85
			       <div class="infocon ">
86
				       	<span class="breifinfo ">
87
				       		
88
				        </span>
89
			       </div>
90
		       </div>
91
		   </div>
92
		    <div class="mui-input-group mainbox ">
93
				<div class="maincon ">
94
					<a >
95
						<div class="gotonext gotonext2 ">
96
							<span class="mui-pull-left ">修改详细信息</span>
97
				       		<em class="mui-iocn iconfont icon-pullright mui-pull-left "></em>
98
						</div>
99
					</a>
100
		       </div>
101
		    </div>
102
        </div>
103
		
104
		
105
		<script src="../js/public/mui.min.js "></script>
106
		<script src="../js/public/base.js "></script>
107
		<script src="../js/public/upload-avatar.js "></script>
108
		<script type="text/javascript " src="../js/studentUpdata.js"></script>		
109
	</body>
110

111
</html>

+ 55 - 0
app/html/studentUpdate1.html

@ -0,0 +1,55 @@
1
<!doctype html>
2
<html>
3

4
	<head>
5
		<meta charset="UTF-8">
6
		<title></title>
7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link href="../css/mui.picker.min.css" rel="stylesheet" />
10
		<link href="../css/app.css" rel="stylesheet" />
11
	</head>
12

13
	<body>
14
		<header class="mui-bar mui-bar-nav toptitbox">
15
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
16
		    <h1 class="mui-title toptit">基本信息</h1>
17
		    <span class="mui-pull-right topsave">保存</span>
18
		</header>
19
		<div class="mui-content">
20
			
21
		    <div class="mui-input-group marginbox">
22
				<div class="maincon">
23
					<ul class="basicinfo">
24
						<li><label>姓名<em class="requiredcon"></em></label></li>
25
						<li class="basicfrm"><input type="text" name="name" class="mui-input-clear frmtype"></li>
26
						<li><label>所在高校(高校/科研机构/企业名称)<em class="requiredcon"></em></label></li>
27
						<li class="basicfrm"><input type="text" name="organization" class="mui-input-clear frmtype"><span class="authu"></span></li>
28
						<li><label>所属院系(院系/科研室/部门名称)</label></li>
29
						<li class="basicfrm"><input type="text" name="department" class="mui-input-clear frmtype"></li>						
30
						<li><label>所在城市</label></li>
31
						<li class="basicfrm">
32
							<span  name="city" class="mui-input-clear frmtype" id="addressa"></span>
33
							<span class="mui-icon mui-icon-arrowdown downarrow" id ="showCityPicker"></span>
34
							<input type="hidden"  class="mui-input-clear frmtype" id="data-province">
35
					    	<input type="hidden"  class="mui-input-clear frmtype" id="data-address">
36
						</li>
37
						<li><label>联系电话(非公开)</label></li>
38
						<li class="basicfrm"><input type="tel" name="tel" class="mui-input-clear frmtype" id="telePhone"></li>
39
						<li><label>邮箱地址(非公开)</label></li>
40
						<li class="basicfrm"><input type="email" name="email" class="mui-input-clear frmtype" id="mail"></li>
41
					</ul>
42
			        
43
		        </div>
44
		    </div>
45
		    
46
		</div>
47
		<script src="../js/public/mui.min.js"></script>
48
		<script src="../js/public/zepto.min.js"></script>
49
		<script src="../js/public/mui.picker.min.js"></script>
50
		<script src="../js/public/city.data.js"></script>
51
		<script src="../js/public/base.js"></script>
52
		<script type="text/javascript" src="../js/studentUpdate1.js"></script>				
53
	</body>
54

55
</html>

+ 145 - 0
app/html/studentbrowse.html

@ -0,0 +1,145 @@
1
<!DOCTYPE html>
2
<html>
3
	<head>
4
		<meta charset="UTF-8">
5
		<title></title>
6
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
7
		<link href="../css/mui.min.css" rel="stylesheet" />
8
		<link href="../css/iconfont.css" rel="stylesheet" />
9
		<link href="../css/app.css" rel="stylesheet" />
10
	</head>
11

12
	<body>
13
		<header class="mui-bar mui-bar-nav toptitbox">
14
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>		   
15
		    <!--<a class="mui-icon iconfont icon-moreandroid mui-pull-right topmore"></a>-->
16
		    <!--<a class="mui-icon iconfont icon-share mui-pull-right topmore" id="shareBtn">
17
		    	<ul class="sharebox" id="shareBox" style="display:none; color: #000000;">
18
		    		<li>
19
		    			<span class="mui-icon mui-icon-weixin"></span>
20
		    		</li>
21
		    		<li>
22
		    			<span class="mui-icon mui-icon-weibo"></span>
23
		    		</li>
24
		    		<li>
25
		    			<span class="mui-icon mui-icon-qq"></span>
26
		    		</li>
27
		    		
28
		    	</ul>
29
		    </a>-->
30
		</header>
31
		
32
		<!--主页面底部菜单-->
33
	    <nav class="mui-bar mui-bar-tab mui-clearfix footbox">
34
		    <div class="dialogbtn mui-pull-left btnactive" style="background:#FF9900; color: #FFFFFF;" id="zixun">
35
		    	<div>
36
			    	<em class="mui-iocn iconfont icon-community mui-pull-left"></em>
37
					<span class="mui-pull-left" id="consultBtn">咨询</span>
38
				</div>
39
			</div>
40
			<div class="attentbtn mui-pull-left" >
41
				<em class="mui-iocn iconfont icon-favor" id="yesExpert"></em>
42
				<em class="mui-iocn iconfont icon-favorfill" style="display:none;" id="noExpert"></em>	
43
				<!--已经关注icon-favorfill-->
44
			</div>
45
		</nav>
46
		<!-- 主页面内容容器 -->
47
    	<div class="mui-content">
48
    		<!-- 主界面具体展示内容 -->
49
    		<div class="mui-input-group mainbox">
50
				<div class="maincon personinfo">
51
					<div class="headbox">
52
				        <a href="javascript:;">
53
				        	<img class="headimg headRadius" src="" />
54
				        	<div class="listtit "><span class="personalMaterial"></span><em class="mui-icon iconfont" id="nameli"></em></div>			        
55
		                    <p cauthwordlass="listtit3"><span class="personalMaterial"></span><span class="personalMaterial"></span> <span class="personalMaterial"></span></p>
56
				        </a>
57
			        </div>
58
		        </div>
59
		        <ul class="mui-table-view">
60
				    <li class="mui-table-view-cell">
61
				        <a class="mui-navigate-right mui-clearfix peolevelbox " id="accessHistory">
62
				        	<div class="mui-pull-left peocountbox">
63
				        		<div class="peocount mui-clearfix">
64
				        			<em class="mui-icon iconfont icon-community actionicon dialogicon mui-pull-left "></em>
65
				        			<span class="mui-pull-left">已完成咨询<em class="consultCount"></em>人次</span>
66
				        		</div>
67
				        	</div>
68
				        	<div class="rightword levelbox ">
69
				        		<span class="mui-icon iconfont icon-favor start"></span> <!--无色星星icon-favor  黄色星icon-favorfill-->
70
				        		<span class="mui-icon iconfont icon-favor start"></span>
71
				        		<span class="mui-icon iconfont icon-favor start"></span>
72
				        		<span class="mui-icon iconfont icon-favor start"></span>
73
				        		<span class="mui-icon iconfont icon-favor start"></span>
74
				        	</div>
75
				        	
76
				        </a>
77
				    </li>
78
				</ul>
79
		        
80
		    </div>
81
		    <div class="mui-input-group mainbox" id="professorresourceList">
82
				<div class="maincon">
83
			       <div class="infocontit">合作资源</div> 
84
			       <div class="infocon">
85
				       <ul class="mui-table-view listitembox resinfo" id="resourceList">
86
				            <!--<li class="mui-table-view-cell mui-media listitem">
87
				                <a class="proinfor" href="resinforbrow.html">
88
				                    <img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">
89
				                    <div class="mui-media-body">
90
				                        <span class="listtit">资源名称</span>	
91
				                        <p class="listtit2">应用用途XXXXXXX</p>
92
				                    	<p class="listtit3 resbrief">
93
				                    		Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan
94
				                    	</p>
95
				                    	
96
				                    </div>
97
				                </a>
98
				            </li>
99
				            <li class="mui-table-view-cell mui-media listitem">
100
				                <a class="proinfor" href="resinforbrow.html">
101
				                    <img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">
102
				                    <div class="mui-media-body">
103
				                        <span class="listtit">资源名称</span>	
104
				                        <p class="listtit2">应用用途XXXXXXX</p>
105
				                    	<p class="listtit3 resbrief">
106
				                    		Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan
107
				                    	</p>
108
				                    	
109
				                    </div>
110
				                </a>
111
				            </li>	-->
112
		                </ul>    
113
		              
114
			       </div>
115
		       </div>
116
		    </div>
117
		    <div class="mui-input-group mainbox" id="professorBreifinfo">
118
				<div class="maincon">
119
			       <div class="infocontit">个人简介</div> 
120
			       <div class="infocon">
121
				       	<span class="breifinfo">
122
				       		 
123
				        </span>
124
			       </div>
125
		       </div>
126
		    </div>
127
		    <div class="mui-input-group mainbox"id="detailProfessor">
128
				<div class="maincon">
129
					<a >
130
						<div class="gotonext">
131
							<span class="mui-pull-left">查看专家详细信息</span>
132
				       		<em class="mui-iocn iconfont icon-pullright mui-pull-left"></em>
133
						</div>
134
					</a>
135
		       </div>
136
		    </div>
137
        </div>
138
		
139
		
140
		<script src="../js/public/mui.min.js"></script>
141
		<script src="../js/public/base.js"></script>
142
		<script src="../js/studentbrowse.js"></script>
143
	</body>
144

145
</html>

+ 6 - 6
app/html/updateinfo1.html

@ -24,12 +24,12 @@
24 24
						<li><label>姓名<em class="requiredcon"></em></label></li>
25 25
						<li class="basicfrm"><input type="text" name="name" class="mui-input-clear frmtype"></li>
26 26
						<li><label>所在机构(高校/科研机构/企业名称)<em class="requiredcon"></em></label></li>
27
						<li class="basicfrm"><input type="text" name="organization" class="mui-input-clear frmtype"></li>
27
						<li class="basicfrm"><input type="text" name="organization" class="mui-input-clear frmtype"><span class="authu"></span></li>
28 28
						<li><label>所属部门(院系/科研室/部门名称)</label></li>
29 29
						<li class="basicfrm"><input type="text" name="department" class="mui-input-clear frmtype"></li>
30
						<li><label>职位</label></li>
31
						<li class="basicfrm"><input type="text" name="position" class="mui-input-clear frmtype"></li>
32 30
						<li><label>职称</label></li>
31
						<li class="basicfrm"><input type="text" name="position" class="mui-input-clear frmtype"></li>
32
						<li><label>职位</label></li>
33 33
						<li class="basicfrm"><input type="text" name="title" class="mui-input-clear frmtype"></li>
34 34
						<li><label>所在城市</label></li>
35 35
						<li class="basicfrm">
@ -38,10 +38,10 @@
38 38
							<input type="hidden"  class="mui-input-clear frmtype" id="data-province">
39 39
					    	<input type="hidden"  class="mui-input-clear frmtype" id="data-address">
40 40
						</li>
41
						<!--<li><label>联系电话(非公开)</label></li>
42
						<li class="basicfrm"><input type="tel" name="tel" class="mui-input-clear frmtype"></li>
41
						<li><label>联系电话(非公开)</label></li>
42
						<li class="basicfrm"><input type="tel" name="tel" class="mui-input-clear frmtype" id="telePhone"></li>
43 43
						<li><label>邮箱地址(非公开)</label></li>
44
						<li class="basicfrm"><input type="email" name="email" class="mui-input-clear frmtype"></li>-->
44
						<li class="basicfrm"><input type="email" name="email" class="mui-input-clear frmtype" id="mail"></li>
45 45
					</ul>
46 46
			        
47 47
		        </div>

+ 180 - 0
app/js/companyUpdata.js

@ -0,0 +1,180 @@
1
mui.ready(function() {		
2
	mui.plusReady(function() {
3
		var userid = plus.storage.getItem('userid');
4
		var oImg=document.getElementsByTagName("img")[0];
5
		var personalMaterial=document.getElementsByClassName('personalMaterial');
6
		var personSummary=document.getElementsByClassName("breifinfo")[0];
7
		var fl;
8
		window.addEventListener("newId",function(event){
9
			fl=event.detail.rd;
10
			personalMaterial[1].parentNode.style.display = "block";
11
			personalMaterial[2].parentNode.style.display = "block";
12
			personalMaterial[3].parentNode.style.display = "block";
13
			personalMaterial[4].parentNode.style.display = "block";
14
			personalMaterial[5].parentNode.style.display = "block";	
15
			personalMaterial[6].parentNode.style.display = "block";
16
			personalMaterial[7].parentNode.style.display = "block";
17
			personalMessage();
18
		})
19
		//获取个人的信息
20
		function personalMessage() {
21
			mui.ajax(baseUrl + "/ajax/professor/info/" + userid, {
22
				dataType: 'json', //数据格式类型
23
				type: 'GET', //http请求类型
24
				timeout: 10000, //超时设置
25
				success: function(data) {
26
					
27
					if(!fl){
28
						plus.nativeUI.closeWaiting(); 
29
					plus.webview.currentWebview().show("slide-in-right", 150);
30
					}
31
					var $data = data.data;
32
					personalMaterial[0].innerText = $data.name;
33
					//头像					
34
					if($data.hasHeadImage) {						
35
						oImg.src = baseUrl + "/images/head/" + $data.id + "_l.jpg";						
36
					}
37
					//基本信息
38
//					if(!$data.authType) {						
39
//						document.getElementsByClassName('authword')[0].innerText = "未认证";
40
//						document.getElementsByClassName('authword')[0].style.backgroundColor = "#cccccc";
41
//					}
42
					if($data.office) {
43
						personalMaterial[2].innerText = $data.office;
44
					} else {
45
						personalMaterial[2].parentNode.style.display = "none";
46
					}
47
					if($data.title) {
48
						personalMaterial[1].innerText = $data.title;
49
					} else {
50
						personalMaterial[1].parentNode.style.display = "none";
51
					}
52
					if($data.orgName) {
53
						personalMaterial[3].innerText = $data.orgName;
54
					} else {
55
						personalMaterial[3].parentNode.style.display = "none";
56
					}
57
					if($data.department) {
58
						personalMaterial[4].innerText = $data.department;
59
					} else {
60
						personalMaterial[4].parentNode.style.display = "none";
61
					}
62
					if($data.address) {
63
						personalMaterial[5].innerText =$data.province+" "+$data.address;
64
					} else {
65
						personalMaterial[5].parentNode.style.display = "none";
66
					}
67
					if($data.phone) {
68
						personalMaterial[6].innerText = $data.phone;
69
					} else {
70
						personalMaterial[6].parentNode.style.display = "none";
71
					}
72
					if($data.email) {
73
						personalMaterial[7].innerText = $data.email;
74
					} else {
75
						personalMaterial[7].parentNode.style.display = "none";
76
					}
77
					//个人简介
78

79
						if($data.descp) {
80
							personSummary.innerHTML = $data.descp;
81
						}						
82
						//我的资源
83
						if($data.resources.length) {
84
						resource($data.resources, $data.resources.length);
85
						}
86
					},
87
					error: function() {
88
						plus.nativeUI.toast("服务器链接超时", toastStyle);
89
						return;
90
					}
91
				});
92
			}
93
			//我的所有资源、
94
		function resource(oDa, n) {
95
			var $data = oDa;
96
			var html = [];
97
			for(var i = 0; i < n; i++) {
98
				var string = '<li class="mui-table-view-cell mui-media" resouId=' + $data[i].resourceId + '>'
99
				string += '<a class="proinfor" href="resinforupdate.html">'
100
				if($data[i].images.length) {
101
					string += '<img class="mui-media-object mui-pull-left resimg" src="'+baseUrl+'/images/resource/' + $data[i].resourceId + '.jpg">'					
102
				} else {
103

104
						string += '<img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">'
105
					}
106
					string += '<div class="mui-media-body">'
107
					string += '<span class="listtit">' + $data[i].resourceName + '<div class="updatebox updatebox2" style="top:6px;right:6px;"><em class="mui-icon mui-icon-compose updatebtn"></em></div></span>'
108
					string += '<p class="listtit2">' + $data[i].supportedServices + '</p>'
109
					string += '<p class="listtit3 resbrief">'
110
					if($data[i].descp) {
111
						string += $data[i].descp;
112
					}
113
					string += '</p></div></a></li>'
114
					html.push(string);
115
				}
116
				document.getElementById("resourceList").innerHTML = html.join('');
117
			
118
		}
119
		//个人信息修改
120
		document.getElementsByClassName("updatebox")[0].addEventListener("tap", function() {
121
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框  
122
			var arr = {
123
				name: personalMaterial[0].innerText,
124
				office: personalMaterial[1].innerText,
125
				title: personalMaterial[2].innerText,
126
				orgName: personalMaterial[3].innerText,
127
				department: personalMaterial[4].innerText,
128
				address: personalMaterial[5].innerText
129
			}
130
			webviewShow = plus.webview.create("../html/companyUpdata1.html", "../html/companyUpdata1.html", {}, arr); //后台创建webview并打开show.html   	    	
131
			webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件
132
//				nwaiting.close(); //新webview的载入完毕后关闭等待框
133
//				webviewShow.show("slide-in-right", 150); //把新webview窗体显示出来,显示动画效果为速度150毫秒的右侧移入动画         
134
			}, false);
135
		});
136
		document.getElementsByClassName("updatebox")[1].addEventListener("tap", function() {
137
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框  
138
			var arr = {
139
				descp: personSummary.innerText,
140
				flag:1
141
			}
142
			webviewShow = plus.webview.create("../html/updateinfo2.html", "updateinfo2.html", {}, arr); //后台创建webview并打开show.html   	    	
143
			webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件
144
				nwaiting.close(); //新webview的载入完毕后关闭等待框
145
				webviewShow.show("slide-in-right", 150); //把新webview窗体显示出来,显示动画效果为速度150毫秒的右侧移入动画         
146
			}, false);
147
		});
148
		
149
		//添加我的资源
150
		document.getElementsByClassName("addinfobox")[0].addEventListener("tap", function() {
151
			var nwaiting = plus.nativeUI.showWaiting();
152
			var web = plus.webview.create("../html/updateinfo-res01.html", "updateinfo-res01.html",{},{reFlag:1}); //后台创建webview并打开show.html   	    	
153
			web.addEventListener("loaded", function() {
154
				plus.nativeUI.closeWaiting();
155
				web.show("slide-in-right", 150);
156
			}, false);
157
		});
158
		//修改我的资源
159
		mui("#resourceList").on("tap", "li", function() {
160
				var resouId = this.getAttribute("resouId");
161
				var nwaiting = plus.nativeUI.showWaiting();
162
				var web = plus.webview.create("../html/resinforupdate.html", "resinforupdate.html", {}, {
163
					resourceId: resouId,
164
					reFlag:1
165
				}); //后台创建webview并打开show.html   	    	
166
				web.addEventListener("loaded", function() {
167

168
				}, false);
169
			})
170
			//修改详细页面
171
		document.getElementsByClassName("gotonext2")[0].addEventListener("tap", function() {
172
			var nwaiting = plus.nativeUI.showWaiting();
173
			var web = plus.webview.create("../html/proinforupdate-more.html", "proinforupdate-more.html"); //后台创建webview并打开show.html   	    	
174
			web.addEventListener("loaded", function() {}, false);
175
		});
176
		personalMessage();		
177
	});
178
});
179

180
  

+ 206 - 0
app/js/companyUpdata1.js

@ -0,0 +1,206 @@
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		var userid = plus.storage.getItem('userid');
4
		var ws = plus.webview.currentWebview();
5
		var str = JSON.stringify(ws);
6
		var oDt = document.getElementsByClassName("frmtype");
7
		var dataProvince = document.getElementById("data-province");
8
		var dataAddress = document.getElementById("data-address");
9
		var oAddress = document.getElementById("addressa")
10
		var telePhone = document.getElementById("telePhone");
11
		var mail = document.getElementById("mail");
12
		var authu = document.getElementsByClassName("authu");
13
		var authStatus;
14
		var name;
15
		var org;
16
		function personalMessage() {
17
			mui.ajax(baseUrl + "/ajax/professor/info/" + userid, {
18
				dataType: 'json', //数据格式类型
19
				type: 'GET', //http请求类型
20
				timeout: 10000, //超时设置
21
				success: function(data) {
22
					plus.nativeUI.closeWaiting();; //新webview的载入完毕后关闭等待框
23
					ws.show("slide-in-right", 150);
24
					var $data = data.data;
25
					if($data.authStatus == 0) {
26
						authu[0].innerText = "未认证"
27
					} else if($data.authStatus == 1) {
28
						authu[0].innerText = "已认证"
29
					} 
30
					authStatus = $data.authStatus;
31
					name = $data.name;
32
					org = $data.orgName;
33
					//学术领域
34
					oDt[0].value = $data.name
35
					oDt[1].value = $data.orgName;
36
					oDt[2].value = $data.department;
37
					oDt[3].value = $data.title;
38
					oDt[4].value = $data.office;
39
					oAddress.innerText = $data.province + " " + $data.address;
40
					dataProvince.value = $data.province;
41
					dataAddress.value = $data.address;
42
					if($data.email) {
43
						mail.value = $data.email
44
					}
45
					if($data.phone) {
46
						telePhone.value = $data.phone
47
					}
48
				},
49
				error: function() {
50
					plus.nativeUI.toast("服务器链接超时", toastStyle);
51
					return;
52
				}
53
			});
54
		}
55

56
		function trim(str) { //删除左右两端的空格
57
			  
58
			return str.replace(/(^\s*)|(\s*$)/g, "");  
59
		}
60
		oDt[0].addEventListener("focus", function() {
61
			if(authStatus == 1) {
62
				plus.nativeUI.toast("修改姓名后,身份认证失效,需重新认证");
63
			} else {
64
				var length = trim(oDt[0].value);
65
				if(!length)
66
					plus.nativeUI.toast("姓名不能为空");
67
			}
68
		});
69
		oDt[1].addEventListener("focus", function() {
70
			if(authStatus == 1) {
71
				plus.nativeUI.toast("修改所在企业后,身份认证失效,需重新认证");
72
			} else {
73
				var length = trim(oDt[1].value);
74
				if(!length)
75
					plus.nativeUI.toast("所在企业不能为空");
76
			}
77

78
		});
79
		/*选择地址*/
80
		var cityPicker = new mui.PopPicker({
81
			layer: 2
82
		});
83
		cityPicker.setData(cityData);
84
		var showCityPickerButton = document.getElementById('showCityPicker');
85
		showCityPickerButton.addEventListener('tap', function(event) {
86
			cityPicker.show(function(items) {
87
				oAddress.innerText = items[0].text + " " + items[1].text;
88
				dataProvince.value = items[0].text;
89
				dataAddress.value = items[1].text;
90
				//返回 false 可以阻止选择框的关闭  
91
				//return false;
92
			});
93
		}, false);
94
		//更新认证状态函数
95
		var upStatus = function() {		
96
			mui.ajax(baseUrl + "/ajax/professor/authStatus", {
97
				dataType: 'json', //数据格式类型
98
				type: 'post', //http请求类型
99
				data: {
100
					authStatus: 0,
101
					id: userid
102
				},
103
				timeout: 10000, //超时设置				
104
				success: function(data) {
105
					if(data.success) {						
106
					}else{
107
						
108
					}
109
				}
110
			})
111
		}
112
		function savePro() {
113
			var mess = {};
114
			mess.name = oDt[0].value;
115
			mess.orgName = oDt[1].value;
116
			mess.department = oDt[2].value;
117
			mess.office =oDt[4].value ;
118
			mess.title = oDt[3].value;
119
			mess.province = dataProvince.value;
120
			mess.address = dataAddress.value;
121
			mess.email = trim(mail.value);
122
			mess.phone = trim(telePhone.value);
123
			mess.id = userid;
124
			var mess1 = JSON.stringify(mess);
125
			$.ajax({
126
				"url": baseUrl + '/ajax/professor',
127
				"type": "PUT",
128
				"async": true,
129
				"data": mess1,
130
				"contentType": "application/json",
131
				"success": function(data) {
132
					if(data.success) {
133
						var web = plus.webview.getWebviewById('html/companyUpdata.html');
134
						mui.fire(web, "newId");
135
						mui.back();
136
					} else {
137
						plus.nativeUI.toast("服务器链接超时", toastStyle);
138
						return;
139
					}
140
				}
141
			});
142
		}
143
		/*校验手机号*/
144
		function phoneVal() {
145
			var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
146
			if(!hunPhone.test(trim(telePhone.value))) {
147
				plus.nativeUI.toast("请输入正确的手机号码", toastStyle);
148
				return 0;
149
			}
150
		}
151
		telePhone.addEventListener("blur", function() {
152
				phoneVal()
153
			})
154
			/*校验用户账号*/
155
		function userEmail() {
156
			var gunf = /^\w+@\w+\.((cn)|(com)|(com\.cn))$/;
157
			if(!gunf.test(trim(mail.value))) {
158
				plus.nativeUI.toast("请输入正确的邮箱", toastStyle);
159
				return 0;
160
			}
161
		}
162
		mail.addEventListener("blur", function() {
163
			userEmail();
164
		})
165
		var save = function() {
166
			if(trim(telePhone.value)) {
167
				var t = phoneVal();
168
				if(t == 0) {
169
					return;
170
				}
171
			}
172
			if(trim(mail.value)) {
173
				var mt = userEmail();
174
				if(mt == 0) {
175
					return;
176
				}
177
			}
178
			var length1 = trim(oDt[0].value);
179
			var length2 = trim(oDt[1].value);
180
			if(length1 && length2) {
181
				savePro();
182
			} else if(!length1 && length2) {
183
				plus.nativeUI.toast("姓名不能为空");
184
			} else if(length1 && !length2) {
185
				plus.nativeUI.toast("所在企业不能为空");
186
			} else if(!length1 && !length2) {
187
				plus.nativeUI.toast("姓名不能为空&&所在企业不能为空");
188
			}
189
		}
190
		document.getElementsByClassName("topsave")[0].addEventListener("click", function() {
191

192
			if(authStatus == 1 && (name != oDt[0].value || org != oDt[1].value)) {
193
				plus.nativeUI.confirm("确认修改?", function(e) {
194
					if(e.index == 0) {
195
						upStatus();
196
						save();
197
					}
198
				}, "修改姓名或所在企业后,身份认证失效,需重新认证", ["确认", "取消"]);
199
			} else {
200
				save();
201
			}
202

203
		});
204
		personalMessage();
205
	});
206
})

+ 307 - 0
app/js/companybrowse.js

@ -0,0 +1,307 @@
1
var ozixun = document.getElementById("zixun");
2
var yesExpert = document.getElementById("yesExpert");
3
var noExpert = document.getElementById("noExpert");
4
var personalMaterial = document.getElementsByClassName('personalMaterial');
5
var personSummary = document.getElementsByClassName("breifinfo")[0];
6

7
mui.plusReady(function() {
8
	var userid = plus.storage.getItem('userid');
9
	var self = plus.webview.currentWebview();
10
	var proId = self.proid;
11
	console.log(userid);
12
	/*点击咨询*/
13
	if(userid) {
14
		ozixun.addEventListener('tap', function() {
15
			var flag = 'professor';
16
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
17
			webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
18
				'proId': proId,
19
				'flag': flag
20
			});
21

22
			webviewShow.addEventListener("loaded", function() {
23

24
			}, false);
25
		});
26
	} else if(userid == '' || userid == undefined) {
27
		ozixun.addEventListener('tap', function() {
28
			/*mui.alert('请登录', '' ,function(){
29
				mui.openWindow({
30
					url: '../html/login.html',
31
					id: 'html/login.html',
32
					show: {
33
						aniShow: "slide-in-left"
34
					}
35
				});
36
			});*/
37
			plus.nativeUI.toast("请先登录");
38
		});
39
	}
40

41
	
42
	var professorResource = function(odata) {
43
			var $data = odata;
44
			var html = [];
45
			for(var i = 0; i < odata.length; i++) {
46
				var string = '<li class="mui-table-view-cell mui-media" resouseId=' + $data[i].resourceId + '>'
47
				string += '<a class="proinfor">'
48
				if($data[i].images.length) {
49
					string += '<img class="mui-media-object mui-pull-left resimg" src="' + baseUrl + '/images/resource/' + $data[i].resourceId + '.jpg">'
50

51
				} else {
52

53
					string += '<img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">'
54
				}
55
				string += '<div class="mui-media-body">'
56
				string += '<span class="listtit">' + $data[i].resourceName + '</span>'
57
				string += '<p class="listtit2">' + $data[i].supportedServices + '</p>'
58
				string += '<p class="listtit3 resbrief">'
59
				if($data[i].descp) {
60
					string += $data[i].descp;
61
				}
62
				string += '</p></div></a></li>'
63
				html.push(string);
64
			}
65
			document.getElementById("resourceList").innerHTML = html.join('');
66

67
		}
68
		/*获取个人信息*/
69
	function personalMessage() {
70
		mui.ajax(baseUrl + "/ajax/professor/info/" + proId, {
71
			dataType: 'json', //数据格式类型
72
			type: 'GET', //http请求类型
73
			timeout: 10000, //超时设置
74
			success: function(data) {
75
				plus.nativeUI.closeWaiting();
76
				plus.webview.currentWebview().show("slide-in-right", 150);
77
				var $data = data.data;
78
				personalMaterial[0].innerText = $data.name;
79
				//基本信息
80
				if($data.consultCount){
81
					document.getElementsByClassName("consultCount")[0].innerText = $data.consultCount;
82
				}else{
83
					document.getElementById("accessHistory").style.display="none";
84
				}
85
				var startLeval = parseInt($data.starLevel);
86
				var start = document.getElementsByClassName("start");
87
				for(var i = 0; i < startLeval; i++) {
88
					start[i].classList.add("icon-favorfill");
89
					start[i].classList.remove("icon-favor");
90
				}
91
				if($data.hasHeadImage) {
92
					document.getElementsByClassName("headimg")[0].src = baseUrl + "/images/head/" + $data.id + "_l.jpg";
93
				} else {
94
					document.getElementsByClassName("headimg")[0].src = "../images/default-photo.jpg";
95
				}
96
				if($data.authType) {
97
							nameli.classList.add('icon-vip');
98
							nameli.classList.add('authicon-cu');
99
						} else {
100
							if($data.authStatus){
101
								if($data.authentication==1){
102
									nameli.classList.add('icon-renzheng');
103
									nameli.classList.add('authicon-mana');
104
									nameli.innerHTML="<span>科研</span>";
105
							   }else if($data.authentication==2){
106
							    	nameli.classList.add('icon-renzheng');
107
									nameli.classList.add('authicon-staff');
108
									nameli.innerHTML="<span>企业</span>";
109
							    }else{
110
							    	nameli.classList.add('icon-renzheng');
111
									nameli.classList.add('authicon-stu');
112
									nameli.innerHTML="<span>学生</span>";
113
							    }
114
							}
115
						}	
116
				if($data.office) {
117
					if($data.title) {
118
						personalMaterial[1].innerText = $data.office + ",";
119
					} else {
120
						personalMaterial[1].innerText = $data.office;
121
					}
122
				}
123
				if($data.title) {
124
					personalMaterial[2].innerText = $data.title;
125
				}
126
				if($data.orgName) {
127
					if($data.department) {
128
						personalMaterial[3].innerText = $data.orgName + " , ";
129
					} else {
130
						personalMaterial[3].innerText = $data.orgName;
131
					}
132

133
				}
134
				if($data.department) {
135
					if($data.address) {
136
						personalMaterial[4].innerText = $data.department + " | ";
137
					} else {
138
						personalMaterial[4].innerText = $data.department;
139
					}
140

141
				}
142
				if($data.address) {
143
					personalMaterial[5].innerText = $data.address;
144
				}
145
				//个人简介
146

147
				if($data.descp) {
148
					personSummary.innerHTML = $data.descp;
149
				} else {
150
					document.getElementById("professorBreifinfo").style.display = "none";
151
				}
152
				//专家资源
153
				if($data.resources.length) {
154
					professorResource($data.resources);
155
				} else {
156
					document.getElementById("professorresourceList").style.display = "none";
157
				}
158
				//如无详细内容数据,隐藏详细点击的按钮
159
				if(!$data.edus.length && !$data.jobs.length && !$data.projects.length && !$data.papers.length && !$data.patents.length && !$data.honors.length) {
160
					document.getElementById("detailProfessor").style.display = "none";
161
				}
162
			},
163
			error: function() {
164
				plus.nativeUI.toast("服务器链接超时", toastStyle);
165
				return;
166
			}
167
		});
168
	}
169
	//修改详细页面
170
	document.getElementsByClassName("gotonext")[0].addEventListener("tap", function() {
171
		var nwaiting = plus.nativeUI.showWaiting();
172
		var web = plus.webview.create("../html/proinforbrow-more.html", "proinforbrow-more.html", {}, {
173
			pro: proId
174
		}); //后台创建webview并打开show.html   	    	
175
		web.addEventListener("loaded", function() {}, false);
176
	});
177
	
178

179
	personalMessage();
180
	/*进入资源详细页面*/
181
	mui("#resourceList").on('tap', 'li', function() {
182
		var resouId = this.getAttribute("resouseId");
183
		plus.nativeUI.showWaiting();
184
		plus.webview.create("../html/resinforbrow.html", 'resinforbrow.html', {}, {
185
			resourceId: resouId
186
		});
187
	});
188
	/*咨询成功,返回专家信息*/
189
	window.addEventListener('backproinfo', function(event) {
190
		var proid = event.detail.proId;
191
		console.log(proid);
192
		/*ozixun.classList.add('displayNone');*/
193
	});
194

195
	ifCollection();
196

197
	yesExpert.addEventListener('tap', function() {
198
		var $this = this;
199
		if(userid && userid != null && userid != "null") {
200
			collectionExpert($this);
201
		} else {
202
			plus.nativeUI.toast("请先登录");
203
		}
204
	});
205

206
	noExpert.addEventListener('tap', function() {
207
		var $this = this;
208
		cancelCollectionExpert($this);
209
	});
210

211
	/*判断是非收藏专家*/
212
	function ifCollection() {
213
		mui.ajax(baseUrl + '/ajax/watch/hasWatch', {
214
			data: {
215
				"professorId": userid,
216
				"watchObject": proId
217
			},
218
			dataType: 'json', //数据格式类型
219
			type: 'get', //http请求类型
220
			timeout: 10000,
221
			async: false,
222
			success: function(data) {
223
				if(data.success && data.data != null) {
224
					yesExpert.style.display = "none";
225
					noExpert.style.display = "block";
226
					returnId = data.data.watchObject;
227
				} else {
228
					yesExpert.style.display = "block";
229
					noExpert.style.display = "none";
230
				}
231
			},
232
			error: function() {
233
				plus.nativeUI.toast("服务器链接超时", toastStyle);
234
			}
235
		});
236
	}
237

238
	/*收藏专家*/
239
	function collectionExpert($this) {
240
		mui.ajax(baseUrl + '/ajax/watch', {
241
			data: {
242
				"professorId": userid,
243
				"watchObject": proId,
244
				"watchType": 1
245
			},
246
			dataType: 'json', //数据格式类型
247
			type: 'POST', //http请求类型
248
			timeout: 10000,
249
			async: false,
250
			success: function(data) {
251
				console.log(data.success)
252
				if(data.success) {
253
					$this.style.display = "none";
254
					noExpert.style.display = "block";
255
					returnId = data.data;
256
					//console.log(returnId)
257
					plus.nativeUI.toast("专家关注成功", toastStyle);
258
				}
259
			},
260
			error: function() {
261
				plus.nativeUI.toast("服务器链接超时", toastStyle);
262
			}
263
		});
264
	}
265

266
	/*取消收藏专家*/
267
	function cancelCollectionExpert($this) {
268
		//console.log(returnId)
269
		// console.log(userid)
270
		mui.ajax({
271
			url: baseUrl + '/ajax/watch/delete',
272
			data: {
273
				professorId: userid,
274
				watchObject: returnId
275
			},
276
			dataType: 'json', //数据格式类型
277
			type: 'post', //http请求类型
278
			timeout: 10000,
279
			async: true,
280
			success: function(data) {
281
				console.log(data.success)
282
				if(data.success) {
283
					$this.style.display = "none";
284
					yesExpert.style.display = "block";
285
					plus.nativeUI.toast("取消关注成功", toastStyle);
286
				}
287
			},
288
			error: function(data) {
289
				plus.nativeUI.toast("服务器链接超时", toastStyle);
290
			}
291
		});
292

293
	}
294
	/*专家的历史和评价*/
295
	document.getElementById("accessHistory").addEventListener('tap', function() {
296
		mui.openWindow({
297
			url: '../html/coophistory-other.html',
298
			id: 'html/coophistory-other.html',
299
			show: {
300
				autoShow: false,
301
			},
302
			extras: {
303
				professorId: proId
304
			}
305
		});
306
	})
307
});

+ 2 - 1
app/js/coophistory-other.js

@ -13,6 +13,7 @@ mui.ready(function() {
13 13
				timeout: 10000, //超时设置
14 14
				success: function(data) {
15 15
					var str = JSON.stringify(data);
16
					console.log(str)
16 17
					var $info = data.data.data || {}
17 18
					if(data.success) {
18 19
						plus.nativeUI.closeWaiting();
@ -26,7 +27,7 @@ mui.ready(function() {
26 27
							string += '<a class="proinfor" href="../html/proinforbrow.html">'
27 28
							string += '<div class="mui-pull-left lefthead">'
28 29
							if($info[i].professor.hasHeadImage) {
29
								string += '<img class="mui-media-object headimg headRadius" src="/images/head/' + userid + '_l.jpg">'
30
								string += '<img class="mui-media-object headimg headRadius" src="/images/head/' + $info[i].professor.id + '_l.jpg">'
30 31
							} else {
31 32
								string += '<img class="mui-media-object headimg headRadius" src="../images/default-photo.jpg">'
32 33
							}

+ 58 - 30
app/js/coophistory.js

@ -18,36 +18,64 @@ function userInformation() {
18 18
			for(var i=0;i<data.data.data.length;i++) {
19 19
				  var assessTime=$info[i]["assessTime"].substr(0,4) + "年" +  $info[i].assessTime.substr(4,2) + "月" +  $info[i].assessTime.substr(6,2) + "日"
20 20
				+  $info[i].assessTime.substr(8,2)+ ":" + $info[i].assessTime.substr(10,2);
21
				
22
					var string='<li class="mui-table-view-cell mui-media">'
23
	                string+='<a class="proinfor" href="../html/proinforbrow.html">'
24
	                	string+='<div class="mui-pull-left lefthead">'
25
	                	if($info[i].professor.hasHeadImage) {
26
	                		string+='<img class="mui-media-object headimg headRadius" src="/images/head/'+userid+'_l.jpg">'
27
	                	}else {
28
	                		string+='<img class="mui-media-object headimg headRadius" src="../images/default-photo.jpg">'
29
	                	}
30
	                    	
31
	                    	string+='<p class="listtit0">'+$info[i].professor.name+'</p>'
32
	                	string+='</div>'
33
	                    string+='<div class="mui-media-body">'
34
	                    	string+='<div class="contit">'
35
	                        	string+='<span class="mui-ellipsis listtit">关于'+$info[i].consultTitle+'的咨询</span>'
36
	                        	string+='<div class="conresoult">'
37
	                        		string+='<div class="levelbox">'
38
						        		string+='<span class="mui-icon iconfont icon-favorfill star"></span>' 
39
						        		string+='<span class="mui-icon iconfont icon-favorfill star"></span>'
40
						        		string+='<span class="mui-icon iconfont icon-favorfill star"></span>'
41
						        		string+='<span class="mui-icon iconfont icon-favor star"></span>'
42
						        		string+='<span class="mui-icon iconfont icon-favor star"></span>'
43
						        	string+='</div>'
44
	                        	string+='</div>'
45
	                        string+='</div>'
46
	                    	string+='<p class="listtit2 conbrief">'
47
	                    		if($info[i].assessContant) string+=$info[i].assessContant;
48
	                    	string+='</p>'
49
	                    	string+='<p class="listtit3">'+assessTime+'</p>'
50
	                    string+='</div></a></li>'
21
						var string = '<li class="mui-table-view-cell mui-media">'
22
							string += '<a class="proinfor" >'
23
							string += '<div class="mui-pull-left lefthead">'
24
							if($info[i].professor.hasHeadImage) {
25
								string += '<img class="mui-media-object headimg headRadius" src="/images/head/' + $info[i].professor.id + '_l.jpg">'
26
							} else {
27
								string += '<img class="mui-media-object headimg headRadius" src="../images/default-photo.jpg">'
28
							}
29
							
30
							string += '<p class="listtit0">' + $info[i].professor.name + '</p>'
31
							string += '</div>'
32
							string += '<div class="mui-media-body">'
33
							string+='<p class="listtit0"><span class="mui-ellipsis listtit">关于'+$info[i].consultTitle+'的咨询</span></p>'
34
							string += '<div class="contit">'
35
							string += '<span class="mui-ellipsis listtit">' + assessTime + '</span>'
36
							string += '<div class="conresoult">'
37
							string += '<div class="levelbox">'
38
							string += '<span class="mui-icon iconfont icon-favorfill star"></span>'
39
							string += '<span class="mui-icon iconfont icon-favorfill star"></span>'
40
							string += '<span class="mui-icon iconfont icon-favorfill star"></span>'
41
							string += '<span class="mui-icon iconfont icon-favor star"></span>'
42
							string += '<span class="mui-icon iconfont icon-favor star"></span>'
43
							string += '</div>'
44
							string += '</div>'
45
							string += '</div>'
46
							string += '<p class="listtit2 conbrief">'
47
							if($info[i].assessContant) string += $info[i].assessContant;
48
							string += '</p>'
49
							string += '</div></a></li>'
50
//					var string='<li class="mui-table-view-cell mui-media">'
51
//	                string+='<a class="proinfor" href="../html/proinforbrow.html">'
52
//	                	string+='<div class="mui-pull-left lefthead">'
53
//	                	if($info[i].professor.hasHeadImage) {
54
//	                		string+='<img class="mui-media-object headimg headRadius" src="/images/head/'+$info[i].professor.id+'_l.jpg">'
55
//	                	}else {
56
//	                		string+='<img class="mui-media-object headimg headRadius" src="../images/default-photo.jpg">'
57
//	                	}
58
//	                    	
59
//	                    	string+='<p class="listtit0">'+$info[i].professor.name+'</p>'
60
//	                	string+='</div>'
61
//	                    string+='<div class="mui-media-body">'
62
//	                    	string+='<div class="contit">'
63
//	                        	string+='<span class="mui-ellipsis listtit">关于'+$info[i].consultTitle+'的咨询</span>'
64
//	                        	string+='<div class="conresoult">'
65
//	                        		string+='<div class="levelbox">'
66
//						        		string+='<span class="mui-icon iconfont icon-favorfill star"></span>' 
67
//						        		string+='<span class="mui-icon iconfont icon-favorfill star"></span>'
68
//						        		string+='<span class="mui-icon iconfont icon-favorfill star"></span>'
69
//						        		string+='<span class="mui-icon iconfont icon-favor star"></span>'
70
//						        		string+='<span class="mui-icon iconfont icon-favor star"></span>'
71
//						        	string+='</div>'
72
//	                        	string+='</div>'
73
//	                        string+='</div>'
74
//	                    	string+='<p class="listtit2 conbrief">'
75
//	                    		if($info[i].assessContant) string+=$info[i].assessContant;
76
//	                    	string+='</p>'
77
//	                    	string+='<p class="listtit3">'+assessTime+'</p>'
78
//	                    string+='</div></a></li>'
51 79
	                    html.push(string);
52 80
	                    var startLeval=parseInt($info[i].starLevel);
53 81
	                var start=document.getElementsByClassName("star");

+ 77 - 36
app/js/myaccount.js

@ -10,8 +10,10 @@ mui.ready(function() {
10 10
	var goZixun = document.getElementById("goZixun");
11 11
	var oEdit = document.getElementById("editbox");
12 12
	var goFollow = document.getElementById("goFollow");
13
	var userImg= document.getElementById("userImg");
13
	var userImg = document.getElementById("userImg");
14
	var nameli = document.getElementById("nameli");
14 15
	
16
	var oFlag;
15 17
	mui.plusReady(function() {
16 18

17 19
		var userId = plus.storage.getItem('userid');
@ -24,7 +26,7 @@ mui.ready(function() {
24 26

25 27
		/*登录按钮*/
26 28
		goLogin.addEventListener('tap', function() {
27
			goLoginFun();
29
			goLoginFun(); 
28 30
		})
29 31

30 32
		/*注册按钮*/
@ -40,9 +42,10 @@ mui.ready(function() {
40 42
			userInformation();
41 43
		});
42 44
		//在修改上传图片触发的事件
43
		window.addEventListener('photoUser', function(event) {			
45
		window.addEventListener('photoUser', function(event) {
44 46
			userInformation();
45 47
		});
48

46 49
		function loginStatus() {
47 50
			console.log(userId);
48 51
			if(userId && userId != "null" && userId != null) {
@ -72,19 +75,43 @@ mui.ready(function() {
72 75
					});
73 76
				})
74 77

75
				/*我的修改*/
78
				/*我的修改专家*/
76 79
				oEdit.addEventListener('tap', function() {
77
					mui.openWindow({
78
						url: '../html/proinforupdate.html',
79
						id: 'html/proinforupdate.html',
80
						show: {
81
							autoShow: false,
82
							aniShow: "slide-in-left"
83
						},
84

85
					});
80
					if(oFlag == 1) {
81
						mui.openWindow({
82
							url: '../html/proinforupdate.html',
83
							id: 'html/proinforupdate.html',
84
							show: {
85
								autoShow: false,
86
								aniShow: "slide-in-left"
87
							},
88

89
						});
90
					} else if(oFlag == 2) {
91
						/*我的修改企业工作者*/
92
						mui.openWindow({
93
							url: '../html/companyUpdata.html',
94
							id: 'html/companyUpdata.html',
95
							show: {
96
								autoShow: false,
97
								aniShow: "slide-in-left"
98
							},
99

100
						});
101
					} else if(oFlag == 3) {
102
						/*我的修改学生*/
103
						mui.openWindow({
104
							url: '../html/studentUpdata.html',
105
							id: 'html/studentUpdata.html',
106
							show: {
107
								autoShow: false,
108
								aniShow: "slide-in-left"
109
							},
110

111
						});
112
					}
86 113
				})
87
				
114

88 115
				/*我的历史和评价*/
89 116
				goZixun.addEventListener('tap', function() {
90 117
					mui.openWindow({
@ -108,15 +135,14 @@ mui.ready(function() {
108 135
		}
109 136

110 137
		function userInformation() {
111
			console.log(userId);
112 138
			mui.ajax(baseUrl + "/ajax/professor/editBaseInfo/" + userId, {
113 139
				dataType: 'json', //数据格式类型
114 140
				type: 'GET', //http请求类型
115 141
				timeout: 10000, //超时设置
116
				async:false,
117
				success: function(data) {
118
					
119
					var $info = data.data || {}
142
				async: false,
143
				success: function(data) {					
144
					var $info = data.data || {};
145
					oFlag = $info.authentication;					
120 146
					if(data.success && data.data) {
121 147
						document.getElementById("userName").innerText = $info.name || '';
122 148
						var userTitle = document.getElementById("userTitle");
@ -125,14 +151,14 @@ mui.ready(function() {
125 151
						var userMechanism = document.getElementById("userMechanism");
126 152
						var userCity = document.getElementById("userCity");
127 153
						var zixunOk = document.getElementById("zixunOk");
128
					
129
						($info.title != '') ? userTitle.innerText = $info.title : userTitle.innerText = '';
130
						($info.office != '') ? userPosition.innerText = " , " +  $info.office  : userPosition.innerText = '';
131
						($info.department != '') ? userDepartment.innerText = $info.department : userDepartment.innerText = '';
132
						($info.orgName != '') ? userMechanism.innerText = " , " +  $info.orgName  : userMechanism.innerText = '';
133
						($info.address != '') ? userCity.innerText = " | " +  $info.address  : userCity.innerText = '';
134
						($info.consultCount != '') ? zixunOk.innerText = $info.consultCount  : zixunOk.innerText = '0';
135
						
154

155
						($info.title) ? userTitle.innerText = $info.title: userTitle.innerText = '';
156
						($info.office) ? userPosition.innerText = " , " + $info.office: userPosition.innerText = '';
157
						($info.department != '') ? userDepartment.innerText = $info.department: userDepartment.innerText = '';
158
						($info.orgName != '') ? userMechanism.innerText = " , " + $info.orgName: userMechanism.innerText = '';
159
						($info.address != '') ? userCity.innerText = " | " + $info.address: userCity.innerText = '';
160
						($info.consultCount != '') ? zixunOk.innerText = $info.consultCount: zixunOk.innerText = '0';
161

136 162
						var startLeval = parseInt($info.starLevel);
137 163
						var start = document.getElementsByClassName("star");
138 164
						for(var i = 0; i < startLeval; i++) {
@ -140,16 +166,33 @@ mui.ready(function() {
140 166
							start[i].classList.remove("icon-favor");
141 167
						}
142 168
						if($info.hasHeadImage == 1) {
143
							userImg.setAttribute("src",baseUrl + "/images/head/" + $info.id + "_l.jpg");
169
							userImg.setAttribute("src", baseUrl + "/images/head/" + $info.id + "_l.jpg");
144 170
						} else {
145
							userImg.setAttribute("src", baseUrl +  "/images/default-photo.jpg");
171
							userImg.setAttribute("src", baseUrl + "/images/default-photo.jpg");
146 172
						}
147
						if($info.authentication) {
148
							document.querySelector('.authicon').style.display = "inline";
173
console.log(JSON.stringify(nameli.classList));
174
						if($info.authType) {
175
							nameli.classList.add('icon-vip');
176
							nameli.classList.add('authicon-cu');
149 177
						} else {
150
							document.querySelector('.unauthicon').style.display = "inline";
178
							if($info.authStatus){
179
								if($info.authentication==1){
180
									nameli.classList.add('icon-renzheng');
181
									nameli.classList.add('authicon-mana');
182
									nameli.innerHTML="<span>科研</span>";
183
							   }else if($info.authentication==2){
184
							    	nameli.classList.add('icon-renzheng');
185
									nameli.classList.add('authicon-staff');
186
									nameli.innerHTML="<span>企业</span>";
187
							    }else{
188
							    	alert(3);
189
							    	nameli.classList.add('icon-renzheng');
190
									nameli.classList.add('authicon-stu');
191
									nameli.innerHTML="<span>学生</span>";
192
							    }
193
							}
151 194
						}
152
							
195

153 196
					}
154 197
				},
155 198
				error: function() {
@ -161,6 +204,4 @@ mui.ready(function() {
161 204

162 205
	});
163 206

164
});
165

166

207
});

+ 216 - 204
app/js/picture-upload.js

@ -3,11 +3,13 @@ mui.plusReady(function() {
3 3
	var canvas_ok = document.querySelector("#canvas_ok");
4 4
	var list = plus.webview.currentWebview();
5 5
	var userId = plus.storage.getItem('userid');
6
	var Orientation; 
7
	var angle=0;
6
	var Orientation;
7
	var angle = 0;
8 8
	var flag = list.flag;
9
	var headFlag = list.headFlag;
10
	var resouFlag = list.resouFlag;
11
	console.log(resouFlag)
9 12
	img_obj.setAttribute("src", list.imgurl);
10

11 13
	canvas_ok.addEventListener("tap", function() {
12 14
		save_img();
13 15
		imgOk = document.querySelector("#img_base64").value;
@ -15,19 +17,19 @@ mui.plusReady(function() {
15 17
		console.log(flag);
16 18
		console.log(list.resourceId);
17 19
		//alert(angle)
18
		if(flag==1) {
19
			var urlAdd=baseUrl+"/ajax/images/saveResImg";
20
			var $data={
21
				"resourceId":list.resourceId ,
20
		if(flag == 1) {
21
			var urlAdd = baseUrl + "/ajax/images/saveResImg";
22
			var $data = {
23
				"resourceId": list.resourceId,
22 24
				"base64": imgOk,
23
				"angle":angle,
25
				"angle": angle,
24 26
			}
25
		}else {
26
			var urlAdd=baseUrl + '/ajax/image/saveHead';
27
			var $data={
27
		} else {
28
			var urlAdd = baseUrl + '/ajax/image/saveHead';
29
			var $data = {
28 30
				"id": userId,
29 31
				"base64": imgOk,
30
				"angle":angle,
32
				"angle": angle,
31 33
			}
32 34
		}
33 35
		mui.ajax(urlAdd, {
@ -36,24 +38,37 @@ mui.plusReady(function() {
36 38
			type: 'post', //http请求类型
37 39
			timeout: 10000,
38 40
			success: function(data) {
39
				console.log(JSON.stringify(data));
40
				console.log(data.success);
41 41
				if(data.success) {
42 42
					plus.nativeUI.toast("图片上传成功", toastStyle);
43
					mui.currentWebview.close();
44
					mui.back();					
45 43
					if(flag == 0) {
46
						var Page = plus.webview.getWebviewById('html/proinforupdate.html');
47
						mui.fire(Page, 'newId');
44
						if(headFlag == 2) {
45
							var Page = plus.webview.getWebviewById('html/studentUpdata.html');
46
							mui.fire(Page, 'newId');
47
						} else if(headFlag == 1) {
48
							var Page = plus.webview.getWebviewById('html/companyUpdata.html');
49
							mui.fire(Page, 'newId');
50
						} else if(headFlag == 0) {
51
							var Page = plus.webview.getWebviewById('html/proinforupdate.html');
52
							mui.fire(Page, 'newId');
53
						}
48 54
						var Pa = plus.webview.getWebviewById('html/myaccount.html');
49 55
						mui.fire(Pa, 'photoUser');
50

51
					} else if(flag==1){
52
					   	var Page = plus.webview.getWebviewById('html/proinforupdate.html');
53
						mui.fire(Page, 'newId');
56
					} else if(flag == 1) {
57
						if(resouFlag == 0) {
58
							var Page = plus.webview.getWebviewById('html/proinforupdate.html');
59
							mui.fire(Page, 'newId');
60
						} else if(resouFlag == 1) {
61
							var Page = plus.webview.getWebviewById('html/companyUpdata.html');
62
							mui.fire(Page, 'newId');
63
						} else if(resouFlag == 2) {
64
							var Page = plus.webview.getWebviewById('html/studentUpdata.html');
65
							mui.fire(Page, 'newId');
66
						}
54 67
						var Pa = plus.webview.getWebviewById('resinforupdate.html');
55 68
						mui.fire(Pa, 'resourceMess');
56 69
					}
70
					mui.currentWebview.close();
71
					mui.back();
57 72
				} else {
58 73
					plus.nativeUI.toast("图片上传失败", toastStyle);
59 74

@ -67,124 +82,121 @@ mui.plusReady(function() {
67 82

68 83
	})
69 84

85
	//获取手机屏幕宽高
86
	var c_w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
87
	var c_h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
70 88

89
	var can_obj = document.querySelector("#canvas");
90
	var img_obj = document.querySelector("#canvas_img");
91
	var div_obj = document.querySelector("#canvas_div");
71 92

72
//获取手机屏幕宽高
73
var c_w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
74
var c_h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
93
	var posX = 0,
94
		posY = 0; //相对坐标
95
	var scale = 0; //记录在缩放动作执行前的 缩放值
96
	var start_X1 = 0,
97
		start_Y1 = 0,
98
		start_X2 = 0,
99
		start_Y2 = 0;
100
	var start_sqrt = 0; //开始缩放比例
101
	var sqrt = 1;
102
	var left_x = 0,
103
		left_y = 0; //计算 偏移量 设置画布中的X,Y轴 (加偏移量)
75 104

76
var can_obj = document.querySelector("#canvas");
77
var img_obj = document.querySelector("#canvas_img");
78
var div_obj = document.querySelector("#canvas_div");
105
	img_obj.onload = function() {
79 106

107
		EXIF.getData(img_obj, function() {
108
			//alert(EXIF.pretty(this));
109
			EXIF.getAllTags(this);
110
			//alert(EXIF.getTag(this, 'Orientation'));
111
			Orientation = EXIF.getTag(this, 'Orientation');
112
			//return;
113
			if(Orientation == 6) {
114
				//alert('需要顺时针(向左)90度旋转');
115
				angle = 90;
116
				var current = 0;
117
				//alert(angle);
118
				//objImg.rotate(degree); 
119
				current = (current + 90) % 360;
120
				img_obj.style.transform = 'rotate(' + current + 'deg)';
121
				can_obj.style.transform = 'rotate(' + current + 'deg)';
122
			}
80 123

81
var posX = 0,
82
	posY = 0; //相对坐标
83
var scale = 0; //记录在缩放动作执行前的 缩放值
84
var start_X1 = 0,
85
	start_Y1 = 0,
86
	start_X2 = 0,
87
	start_Y2 = 0;
88
var start_sqrt = 0; //开始缩放比例
89
var sqrt = 1;
90
var left_x = 0,
91
	left_y = 0; //计算 偏移量 设置画布中的X,Y轴 (加偏移量)
124
			if(Orientation == 3) {
125
				//alert('需要顺时针(向左)90度旋转');
126
				angle = 180;
127
				var current = 0;
128
				//objImg.rotate(degree); 
129
				current = (current + 180) % 360;
130
				img_obj.style.transform = 'rotate(' + current + 'deg)';
131
				can_obj.style.transform = 'rotate(' + current + 'deg)';
132
			}
92 133

93
img_obj.onload = function() {
134
			if(Orientation == 8) {
135
				//alert('需要顺时针(向左)90度旋转');
136
				angle = -90;
137
				var current = 0;
138
				//objImg.rotate(degree); 
139
				current = (current - 90) % 360;
140
				img_obj.style.transform = 'rotate(' + current + 'deg)';
141
				can_obj.style.transform = 'rotate(' + current + 'deg)';
142
			}
94 143

95
	EXIF.getData(img_obj, function() {
96
		//alert(EXIF.pretty(this));
97
		EXIF.getAllTags(this);
98
		//alert(EXIF.getTag(this, 'Orientation'));
99
		Orientation = EXIF.getTag(this, 'Orientation');
100
		//return;
101
		if(Orientation == 6) {
102
			//alert('需要顺时针(向左)90度旋转');
103
			angle=90;
104
			var current = 0;
105
			//alert(angle);
106
			//objImg.rotate(degree); 
107
			current = (current + 90) % 360;
108
			img_obj.style.transform = 'rotate(' + current + 'deg)';
109
			can_obj.style.transform = 'rotate(' + current + 'deg)';
110
		}
111
		
112
		if(Orientation == 3) {
113
			//alert('需要顺时针(向左)90度旋转');
114
			angle=180;
115
			var current = 0;
116
			//objImg.rotate(degree); 
117
			current = (current + 180) % 360;
118
			img_obj.style.transform = 'rotate(' + current + 'deg)';
119
			can_obj.style.transform = 'rotate(' + current + 'deg)';
120
		}
121
		
122
		if(Orientation == 8) {
123
			//alert('需要顺时针(向左)90度旋转');
124
			angle=-90;
125
			var current = 0;
126
			//objImg.rotate(degree); 
127
			current = (current - 90) % 360;
128
			img_obj.style.transform = 'rotate(' + current + 'deg)';
129
			can_obj.style.transform = 'rotate(' + current + 'deg)';
130
		}
131
		
132
	});
144
		});
133 145

134
	load();
146
		load();
135 147

136
}
148
	}
137 149

138
function load() {
150
	function load() {
139 151

140
	//设置canvas 宽度(全屏显示),高度,上下居中显示
141
	can_obj.width = c_w - 50;
142
	can_obj.height = c_w - 50;
143
	can_obj.style.top = (c_h - c_w - 2) / 2 + "px";
144
	// can_obj.style.left ="25px";
152
		//设置canvas 宽度(全屏显示),高度,上下居中显示
153
		can_obj.width = c_w - 50;
154
		can_obj.height = c_w - 50;
155
		can_obj.style.top = (c_h - c_w - 2) / 2 + "px";
156
		// can_obj.style.left ="25px";
145 157

146
	//设置图片自适应大小及图片的居中显示
147
	autoResizeImage(c_w, c_h, img_obj);
148
	//img_obj.width=c_w - 50;
149
	img_obj.style.top = (c_h - img_obj.height - 50) / 2 + "px";
150
	img_obj.style.left = (c_w - img_obj.width) / 2 + "px";
151
	
152
	document.querySelector("#canvas_div").addEventListener('touchstart', touch, false);
153
	document.querySelector("#canvas_div").addEventListener('touchmove', touch, false);
154
	document.querySelector("#canvas_div").addEventListener('touchend', touch, false);
155
	ctx_img = can_obj.getContext("2d");
156
	var ctx_X = (can_obj.width - img_obj.width) / 2,
157
		ctx_Y = (can_obj.height - img_obj.height) / 2;
158
		
159
	    ctx_img.drawImage(img_obj, ctx_X, ctx_Y, img_obj.width, img_obj.height); //初始化 canvas 加入图片
160
    
161
	
162
	function touch(event) {
163
		var event = event || window.event;
164
		event.preventDefault(); //阻止浏览器或body 其他冒泡事件
165
		var mv_x1 = event.changedTouches[0].clientX,
166
			mv_y1 = event.changedTouches[0].clientY; //手指坐标
167
		var img_left = img_obj.left,
168
			img_top = img_obj.top; //图片坐标
169
		if(event.touches.length == 1) { //单指操作
170
			if(event.type == "touchstart") { //开始移动
171
				posX = mv_x1 - img_obj.offsetLeft; //获取img相对坐标
172
				//posd = mv_x1 - img_obj.offsetRight; //获取img相对坐标
173
				posY = mv_y1 - img_obj.offsetTop;
174
			} else if(event.type == "touchmove") { //移动
175
				var _x = mv_x1 - posX; //移动坐标
176
				var _y = mv_y1 - posY;
177
				img_obj.style.left = _x + "px";
178
				img_obj.style.top = _y + "px";
179
				ctx_img.clearRect(0, 0, can_obj.width, can_obj.height); //清除画布
180
				console.log(Orientation);
181
				if(Orientation == 6) {
182
					ctx_img.drawImage(img_obj, _y - parseFloat(can_obj.style.top) + left_y-120 / 2, -(_x + left_x / 2 + 32), img_obj.width * sqrt, img_obj.height * sqrt); //画布内图片移动		
183
				} else {
184
					ctx_img.drawImage(img_obj, _x + left_x / 2 - 25, _y - parseFloat(can_obj.style.top) + left_y / 2, img_obj.width * sqrt, img_obj.height * sqrt); //画布内图片移动
158
		//设置图片自适应大小及图片的居中显示
159
		autoResizeImage(c_w, c_h, img_obj);
160
		//img_obj.width=c_w - 50;
161
		img_obj.style.top = (c_h - img_obj.height - 50) / 2 + "px";
162
		img_obj.style.left = (c_w - img_obj.width) / 2 + "px";
163

164
		document.querySelector("#canvas_div").addEventListener('touchstart', touch, false);
165
		document.querySelector("#canvas_div").addEventListener('touchmove', touch, false);
166
		document.querySelector("#canvas_div").addEventListener('touchend', touch, false);
167
		ctx_img = can_obj.getContext("2d");
168
		var ctx_X = (can_obj.width - img_obj.width) / 2,
169
			ctx_Y = (can_obj.height - img_obj.height) / 2;
170

171
		ctx_img.drawImage(img_obj, ctx_X, ctx_Y, img_obj.width, img_obj.height); //初始化 canvas 加入图片
172

173
		function touch(event) {
174
			var event = event || window.event;
175
			event.preventDefault(); //阻止浏览器或body 其他冒泡事件
176
			var mv_x1 = event.changedTouches[0].clientX,
177
				mv_y1 = event.changedTouches[0].clientY; //手指坐标
178
			var img_left = img_obj.left,
179
				img_top = img_obj.top; //图片坐标
180
			if(event.touches.length == 1) { //单指操作
181
				if(event.type == "touchstart") { //开始移动
182
					posX = mv_x1 - img_obj.offsetLeft; //获取img相对坐标
183
					//posd = mv_x1 - img_obj.offsetRight; //获取img相对坐标
184
					posY = mv_y1 - img_obj.offsetTop;
185
				} else if(event.type == "touchmove") { //移动中
186
					var _x = mv_x1 - posX; //移动坐标
187
					var _y = mv_y1 - posY;
188
					img_obj.style.left = _x + "px";
189
					img_obj.style.top = _y + "px";
190
					ctx_img.clearRect(0, 0, can_obj.width, can_obj.height); //清除画布
191
					console.log(Orientation);
192
					if(Orientation == 6) {
193
						ctx_img.drawImage(img_obj, _y - parseFloat(can_obj.style.top) + left_y - 120 / 2, -(_x + left_x / 2 + 32), img_obj.width * sqrt, img_obj.height * sqrt); //画布内图片移动		
194
					} else {
195
						ctx_img.drawImage(img_obj, _x + left_x / 2 - 25, _y - parseFloat(can_obj.style.top) + left_y / 2, img_obj.width * sqrt, img_obj.height * sqrt); //画布内图片移动
196
					}
185 197
				}
186 198
			}
187
		} /*else if(event.touches.length == 2) { //双指操作
199
			/*else if(event.touches.length == 2) { //双指操作
188 200
			if(event.type == "touchstart") {
189 201
				scale = img_obj.style.Transform == undefined ? 1 : parseFloat(img_obj.style.Transform.replace(/[^0-9^\.]/g, "")); //获取在手指按下瞬间的放大缩小值(scale),作用,在移动时,记录上次移动的放大缩小值
190 202
				start_X1 = event.touches[0].clientX; //记录开始的坐标值,作用:在下次放大缩小后,去掉上次放大或缩小的值
@ -213,92 +225,92 @@ function load() {
213 225
				ctx_img.drawImage(img_obj, dImg_left + left_x / 2 - 25, dImg_top - parseFloat(can_obj.style.top.replace("px", "")) + left_y / 2, sw, sh); //画布内图片重置
214 226
			}
215 227
		}*/
228
		}
216 229
	}
217
}
218 230

219
//window.addEventListener('load', load, false);
231
	//window.addEventListener('load', load, false);
220 232

221
//裁图
222
function save_img() {
223
    var base64 = can_obj.toDataURL("image/jpeg", 1);
224
    var subbase = base64.substring(22);
225
    document.querySelector("#img_base64").value = subbase;
226
}
233
	//裁图
234
	function save_img() {
235
		var base64 = can_obj.toDataURL("image/jpeg", 1);
236
		var subbase = base64.substring(22);
237
		document.querySelector("#img_base64").value = subbase;
238
	}
227 239

228
//图片自适应
229
function autoResizeImage(maxWidth, maxHeight, objImg) {
230
	//var img = new Image();
231
	//img.src = objImg.src;
232
	//var hRatio;
233
	//var wRatio;
234
	//var ratio = 1;
235
	var w = objImg.width;
236
	var h = objImg.height;
240
	//图片自适应
241
	function autoResizeImage(maxWidth, maxHeight, objImg) {
242
		//var img = new Image();
243
		//img.src = objImg.src;
244
		//var hRatio;
245
		//var wRatio;
246
		//var ratio = 1;
247
		var w = objImg.width;
248
		var h = objImg.height;
237 249

238
	//alert(w);
239
	//alert(h);
240
	wRatio = maxWidth / w;
241
	hRatio = maxHeight / h;
250
		//alert(w);
251
		//alert(h);
252
		wRatio = maxWidth / w;
253
		hRatio = maxHeight / h;
242 254

243
	if(w > maxWidth) {
244
		if(w > h) {
245
			objImg.height = maxWidth - 50;
246
			//alert('1')
255
		if(w > maxWidth) {
256
			if(w > h) {
257
				objImg.height = maxWidth - 50;
258
				//alert('1')
259
			} else {
260
				objImg.width = c_w - 46;
261
				//objImg.height=maxHeight;
262
				// alert('2')
263
			}
247 264
		} else {
248
			objImg.width = c_w - 46;
249
			//objImg.height=maxHeight;
250
			// alert('2')
265
			objImg.width = maxWidth - 50;
266
			objImg.height = maxWidth - 50;
251 267
		}
252
	} else {
253
		objImg.width = maxWidth - 50;
254
		objImg.height = maxWidth - 50;
268
		/* if(w < maxWidth && h < maxHeight){
269
		 	objImg.width=maxWidth-50;
270
		 	objImg.height=maxWidth-50;
271
		 	alert('2')
272
		 }
273
		 if(w > maxWidth && h < maxHeight){
274
		 	objImg.width=maxWidth-50;
275
		 	objImg.height=maxWidth-50;
276
		 	alert('3')
277
		 }*/
278
		/*if (w < maxWidth && h < maxHeight) {
279
		      return;
280
		      alert('1')
281
		  }
282
		  if (maxWidth == 0 && maxHeight == 0) {
283
		      ratio = 1;
284
		      alert('2')
285
		  } else if (maxWidth == 0) {
286
		      if (hRatio < 1) {
287
		          ratio = hRatio;
288
		          alert('3')
289
		      }
290
		  } else if (maxHeight == 0) {
291
		      if (wRatio < 1) {
292
		          ratio = wRatio;
293
		          alert('4')
294
		      }
295
		  } else if (wRatio < 1 || hRatio < 1) {
296
		      ratio = (wRatio <= hRatio ? wRatio : hRatio);
297
		      alert('5')
298
		  } else {
299
		      ratio = (wRatio <= hRatio ? wRatio : hRatio) - Math.floor(wRatio <= hRatio ? wRatio : hRatio);
300
		      alert('6')
301
		  }
302
		  if (ratio < 1) {
303
		      if (ratio < 0.5 && w < maxWidth && h < maxHeight) {
304
		          ratio = 1 - ratio;
305
		      }
306
		      w = w * ratio;
307
		      h = h * ratio;
308
		      alert('7')
309
		      objImg.width=maxWidth-45;
310
		  	objImg.height=maxHeight;
311
		  }*/
312
		// objImg.height = h+50;
313
		//objImg.width = w;
255 314
	}
256
	/* if(w < maxWidth && h < maxHeight){
257
	 	objImg.width=maxWidth-50;
258
	 	objImg.height=maxWidth-50;
259
	 	alert('2')
260
	 }
261
	 if(w > maxWidth && h < maxHeight){
262
	 	objImg.width=maxWidth-50;
263
	 	objImg.height=maxWidth-50;
264
	 	alert('3')
265
	 }*/
266
	/*if (w < maxWidth && h < maxHeight) {
267
	      return;
268
	      alert('1')
269
	  }
270
	  if (maxWidth == 0 && maxHeight == 0) {
271
	      ratio = 1;
272
	      alert('2')
273
	  } else if (maxWidth == 0) {
274
	      if (hRatio < 1) {
275
	          ratio = hRatio;
276
	          alert('3')
277
	      }
278
	  } else if (maxHeight == 0) {
279
	      if (wRatio < 1) {
280
	          ratio = wRatio;
281
	          alert('4')
282
	      }
283
	  } else if (wRatio < 1 || hRatio < 1) {
284
	      ratio = (wRatio <= hRatio ? wRatio : hRatio);
285
	      alert('5')
286
	  } else {
287
	      ratio = (wRatio <= hRatio ? wRatio : hRatio) - Math.floor(wRatio <= hRatio ? wRatio : hRatio);
288
	      alert('6')
289
	  }
290
	  if (ratio < 1) {
291
	      if (ratio < 0.5 && w < maxWidth && h < maxHeight) {
292
	          ratio = 1 - ratio;
293
	      }
294
	      w = w * ratio;
295
	      h = h * ratio;
296
	      alert('7')
297
	      objImg.width=maxWidth-45;
298
	  	objImg.height=maxHeight;
299
	  }*/
300
	// objImg.height = h+50;
301
	//objImg.width = w;
302
}
303 315

304 316
})

+ 25 - 6
app/js/proinfobrow.js

@ -171,7 +171,11 @@ mui.plusReady(function() {
171 171
				var $data = data.data;
172 172
				personalMaterial[0].innerText = $data.name;
173 173
				//基本信息
174
				document.getElementsByClassName("consultCount")[0].innerText = $data.consultCount;
174
				if($data.consultCount){
175
					document.getElementsByClassName("consultCount")[0].innerText = $data.consultCount;
176
				}else{
177
					document.getElementById("accessHistory").style.display="none";
178
				}
175 179
				var startLeval = parseInt($data.starLevel);
176 180
				var start = document.getElementsByClassName("start");
177 181
				for(var i = 0; i < startLeval; i++) {
@ -183,11 +187,26 @@ mui.plusReady(function() {
183 187
				} else {
184 188
					document.getElementsByClassName("headimg")[0].src = "../images/default-photo.jpg";
185 189
				}
186
				if(!$data.authentication) {
187
188
					document.getElementsByClassName('icon-vip')[0].classList.remove("authicon");
189
					document.getElementsByClassName('icon-vip')[0].classList.add("unauthicon");
190
				}
190
				if($data.authType) {
191
							nameli.classList.add('icon-vip');
192
							nameli.classList.add('authicon-cu');
193
						} else {
194
							if($data.authStatus){
195
								if($data.authentication==1){
196
									nameli.classList.add('icon-renzheng');
197
									nameli.classList.add('authicon-mana');
198
									nameli.innerHTML="<span>科研</span>";
199
							   }else if($data.authentication==2){
200
							    	nameli.classList.add('icon-renzheng');
201
									nameli.classList.add('authicon-staff');
202
									nameli.innerHTML="<span>企业</span>";
203
							    }else{
204
							    	nameli.classList.add('icon-renzheng');
205
									nameli.classList.add('authicon-stu');
206
									nameli.innerHTML="<span>学生</span>";
207
							    }
208
							}
209
						}	
191 210
				if($data.office) {
192 211
					if($data.title) {
193 212
						personalMaterial[1].innerText = $data.office + ",";

+ 23 - 8
app/js/proinforupdate.js

@ -11,7 +11,9 @@ mui.ready(function() {
11 11
			personalMaterial[2].parentNode.style.display = "block";
12 12
			personalMaterial[3].parentNode.style.display = "block";
13 13
			personalMaterial[4].parentNode.style.display = "block";
14
			personalMaterial[5].parentNode.style.display = "block";			
14
			personalMaterial[5].parentNode.style.display = "block";	
15
			personalMaterial[6].parentNode.style.display = "block";
16
			personalMaterial[7].parentNode.style.display = "block";	
15 17
			personalMessage();
16 18
		})
17 19
		
@ -113,6 +115,7 @@ mui.ready(function() {
113 115
				type: 'GET', //http请求类型
114 116
				timeout: 10000, //超时设置
115 117
				success: function(data) {
118
				
116 119
					if(!fl){
117 120
						plus.nativeUI.closeWaiting(); 
118 121
					plus.webview.currentWebview().show("slide-in-right", 150);
@ -124,10 +127,10 @@ mui.ready(function() {
124 127
						oImg.src = baseUrl + "/images/head/" + $data.id + "_l.jpg";						
125 128
					}
126 129
					//基本信息
127
					if(!$data.authentication) {
128
						document.getElementsByClassName('authword')[0].innerText = "未认证";
129
						document.getElementsByClassName('authword')[0].style.backgroundColor = "#cccccc";
130
					}
130
//					if(!$data.authType) {						
131
//						document.getElementsByClassName('authword')[0].innerText = "未认证";
132
//						document.getElementsByClassName('authword')[0].style.backgroundColor = "#cccccc";
133
//					}
131 134
					if($data.office) {
132 135
						personalMaterial[1].innerText = $data.office;
133 136
					} else {
@ -153,6 +156,16 @@ mui.ready(function() {
153 156
					} else {
154 157
						personalMaterial[5].parentNode.style.display = "none";
155 158
					}
159
					if($data.phone) {
160
						personalMaterial[6].innerText = $data.phone;
161
					} else {
162
						personalMaterial[6].parentNode.style.display = "none";
163
					}
164
					if($data.email) {
165
						personalMaterial[7].innerText = $data.email;
166
					} else {
167
						personalMaterial[7].parentNode.style.display = "none";
168
					}
156 169
					//个人简介
157 170

158 171
						if($data.descp) {
@ -227,7 +240,8 @@ mui.ready(function() {
227 240
		document.getElementsByClassName("updatebox")[1].addEventListener("tap", function() {
228 241
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框  
229 242
			var arr = {
230
				descp: personSummary.innerText
243
				descp: personSummary.innerText,
244
				flag:2
231 245
			}
232 246
			webviewShow = plus.webview.create("../html/updateinfo2.html", "updateinfo2.html", {}, arr); //后台创建webview并打开show.html   	    	
233 247
			webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件
@ -259,7 +273,7 @@ mui.ready(function() {
259 273
		//添加我的资源
260 274
		document.getElementsByClassName("addinfobox")[0].addEventListener("tap", function() {
261 275
			var nwaiting = plus.nativeUI.showWaiting();
262
			var web = plus.webview.create("../html/updateinfo-res01.html", "updateinfo-res01.html"); //后台创建webview并打开show.html   	    	
276
			var web = plus.webview.create("../html/updateinfo-res01.html", "updateinfo-res01.html",{},{reFlag:0}); //后台创建webview并打开show.html   	    	
263 277
			web.addEventListener("loaded", function() {
264 278
				plus.nativeUI.closeWaiting();
265 279
				web.show("slide-in-right", 150);
@ -270,7 +284,8 @@ mui.ready(function() {
270 284
				var resouId = this.getAttribute("resouId");
271 285
				var nwaiting = plus.nativeUI.showWaiting();
272 286
				var web = plus.webview.create("../html/resinforupdate.html", "resinforupdate.html", {}, {
273
					resourceId: resouId
287
					resourceId: resouId,
288
					reFlag:0
274 289
				}); //后台创建webview并打开show.html   	    	
275 290
				web.addEventListener("loaded", function() {
276 291


+ 21 - 17
app/js/public/upload-avatar.js

@ -1,20 +1,20 @@
1 1
/*头像上传*/
2 2
var userimg = document.getElementById("userimg");
3 3
var flag;
4

4
var headFlag;
5
var resouFlag;
5 6
mui.plusReady(function() {
6 7
	var ws = plus.webview.currentWebview();
7 8
	var resourceId = ws.resourceId;
8
	console.log(resourceId)
9 9
	var web = plus.webview.getWebviewById("html/proinforupdate.html");
10 10
	var web1 = plus.webview.getWebviewById("resinforupdate.html");
11
	if(ws == web) {
12
		flag = 0;
13
	}
14
	if(ws == web1) {
15
		flag = 1;
16
	}
17 11
	userimg.addEventListener("click", function() {
12
		flag = this.getAttribute("flag");
13
		headF = this.getAttribute("headFlag");
14
		resouF = this.getAttribute("resouFlag");
15
		console.log(resouFlag)
16
		console.log(headF);
17
		console.log(flag);
18 18
		if(mui.os.plus) {
19 19
			var a = [{
20 20
				title: "拍照"
@ -47,13 +47,13 @@ mui.plusReady(function() {
47 47
		var c = plus.camera.getCamera();
48 48
		c.captureImage(function(e) {
49 49
			plus.io.resolveLocalFileSystemURL(e, function(entry) {
50
			var filPage = plus.webview.getWebviewById('../html/fillinfo.html');
51
			var dyPage = plus.webview.currentWebview();
52
			if(dyPage == filPage) {
53
				var imgvar = '<img src="' + entry.toLocalURL() + '" style="width:100%"/>';
54
				//console.log(imgvar) 
55
				document.getElementById('imgshow').innerHTML = imgvar;
56
			}
50
				var filPage = plus.webview.getWebviewById('../html/fillinfo.html');
51
				var dyPage = plus.webview.currentWebview();
52
				if(dyPage == filPage) {
53
					var imgvar = '<img src="' + entry.toLocalURL() + '" style="width:100%"/>';
54
					//console.log(imgvar) 
55
					document.getElementById('imgshow').innerHTML = imgvar;
56
				}
57 57
				mui.openWindow({
58 58
					url: '../html/picture-upload.html',
59 59
					id: 'html/picture-upload.html',
@ -63,7 +63,9 @@ mui.plusReady(function() {
63 63
					extras: {
64 64
						imgurl: entry.toLocalURL(),
65 65
						flag: flag,
66
						resourceId: resourceId
66
						resourceId: resourceId,
67
						headFlag: headF,
68
						resouFlag: resouF
67 69
					}
68 70
				});
69 71
			}, function(e) {
@ -107,7 +109,9 @@ mui.plusReady(function() {
107 109
				extras: {
108 110
					imgurl: entry.toLocalURL(),
109 111
					flag: flag,
110
					resourceId: resourceId
112
					resourceId: resourceId,
113
					headFlag: headF,
114
					resouFlag: resouF
111 115
				}
112 116
			});
113 117
		});

+ 127 - 63
app/js/resinforbrow.js

@ -15,73 +15,75 @@ var ofield = document.getElementById("field"); //学术领域
15 15
var oapply = document.getElementById("apply"); //应用行业
16 16
var odetail = document.getElementById("detail"); //详细描述
17 17
var ohezuo = document.getElementById("hezuo"); //合作备注
18
19
var ofielddiv = document.getElementById("fielddiv");//学术领域容器
20
var oapplydiv =document.getElementById("applydiv");//应用行业容器
21
var odetaildiv =document.getElementById("detaildiv");//详细描述容器
22
var ohezuodiv =document.getElementById("hezuodiv");//合作备注容器
18
var oEnter = document.getElementById("fess");
19
var ofielddiv = document.getElementById("fielddiv"); //学术领域容器
20
var oapplydiv = document.getElementById("applydiv"); //应用行业容器
21
var odetaildiv = document.getElementById("detaildiv"); //详细描述容器
22
var ohezuodiv = document.getElementById("hezuodiv"); //合作备注容器
23 23
24 24
var oconsult = document.getElementById("consult"); //咨询
25 25
var oconsultBtn = document.getElementById("consultBtn"); //咨询按钮
26
26
var professorId;
27 27
var proId;
28 28
29 29
function ziyuaninfo(resourceId) {
30 30
	mui.plusReady(function() {
31
		
31
32 32
		mui.ajax(baseUrl + '/ajax/resource/resourceInfo', {
33
			data:{'resourceId':resourceId},
33
			data: {
34
				'resourceId': resourceId
35
			},
34 36
			dataType: 'json', //服务器返回json格式数据
35 37
			type: 'get', //HTTP请求类型
36 38
			timeout: 10000, //超时时间设置为10秒;
37 39
			success: function(data) {
38 40
				if(data.success) {
39 41
					console.log(JSON.stringify(data));
40
					
42
41 43
					var mydata = data.data;
42 44
					//资源名称
43
					(mydata['resourceName'])? oresorcename.innerHTML = mydata['resourceName'] : oresorcename.innerHTML ='';
44
					(mydata['resourceName'])? oresourceName.innerHTML = mydata['resourceName'] : oresourceName.innerHTML ='';
45
					
45
					professorId = mydata['professor']['id'];
46
					(mydata['resourceName']) ? oresorcename.innerHTML = mydata['resourceName']: oresorcename.innerHTML = '';
47
					(mydata['resourceName']) ? oresourceName.innerHTML = mydata['resourceName']: oresourceName.innerHTML = '';
48
46 49
					//专家信息
47 50
					proId = mydata['professor']['id']; //专家id
48 51
					//专家名字
49
					(mydata['professor']["name"]) ? oproname.innerText = mydata['professor']["name"] : oproname.innerText = '';
52
					(mydata['professor']["name"]) ? oproname.innerText = mydata['professor']["name"]: oproname.innerText = '';
50 53
					//职称
51
					(mydata['professor']["title"]) ? oprotitle.innerHTML = mydata['professor']["title"] : oprotitle.innerHTML = '';
54
					(mydata['professor']["title"]) ? oprotitle.innerHTML = mydata['professor']["title"]: oprotitle.innerHTML = '';
52 55
					//职位
53
					if(mydata['professor']["office"] == null || mydata['professor']["office"] == undefined ) {
54
	 					oprooffice.innerHTML = '';
55
	 				}else {
56
	 					if(mydata['professor']["title"]){
57
	 						oprooffice.innerHTML = ','+mydata['professor']["office"];//职位
58
	 					}
59
	 					oprooffice.innerHTML = mydata['professor']["office"];//职位
60
	 				};
56
					if(mydata['professor']["office"] == null || mydata['professor']["office"] == undefined) {
57
						oprooffice.innerHTML = '';
58
					} else {
59
						if(mydata['professor']["title"]) {
60
							oprooffice.innerHTML = ',' + mydata['professor']["office"]; //职位
61
						}
62
						oprooffice.innerHTML = mydata['professor']["office"]; //职位
63
					};
61 64
					//所在机构
62
					(mydata['professor']["orgName"]) ? oproorgName.innerHTML = mydata['professor']["orgName"] : oproorgName.innerHTML = '';
65
					(mydata['professor']["orgName"]) ? oproorgName.innerHTML = mydata['professor']["orgName"]: oproorgName.innerHTML = '';
63 66
					//所在地
64
					(mydata['professor']["address"]) ? oproadress.innerHTML = mydata['professor']["address"] : oproadress.innerHTML = '';
67
					(mydata['professor']["address"]) ? oproadress.innerHTML = mydata['professor']["address"]: oproadress.innerHTML = '';
65 68
					/*是否认证*/
66
					(mydata['professor']["authentication"] == true) ? opromodify.classList.add('authicon') : opromodify.classList.add('unauthicon');
69
					(mydata['professor']["authentication"] == true) ? opromodify.classList.add('authicon'): opromodify.classList.add('unauthicon');
67 70
					/*专家头像*/
68
					(mydata['professor']["hasHeadImage"] == 0) ? oproimg.setAttribute('src','../images/default-photo.jpg') 
69
					: oproimg.setAttribute('src',baseUrl+'/images/head/'+mydata['professor']['id']+'_m.jpg');
70
					
71
					(mydata['professor']["hasHeadImage"] == 0) ? oproimg.setAttribute('src', '../images/default-photo.jpg'): oproimg.setAttribute('src', baseUrl + '/images/head/' + mydata['professor']['id'] + '_m.jpg');
72
71 73
					//资源基本信息
72 74
					//(mydata['images']['imageSrc']) ? oziyuanimg.setAttribute('src', mydata['images']['imageSrc']): oziyuanimg.setAttribute('src', '../images/default-resource.jpg'); //资源图片
73
					
74
					var imgRes=baseUrl + "/images/resource/" + mydata.resourceId + ".jpg";
75
					if(mydata['images'].length) {						
75
76
					var imgRes = baseUrl + "/images/resource/" + mydata.resourceId + ".jpg";
77
					if(mydata['images'].length) {
76 78
						oziyuanimg.setAttribute('src', imgRes)
77
					} else {						
79
					} else {
78 80
						oziyuanimg.setAttribute('src', '../images/default-resource.jpg')
79 81
					}
80 82
					(mydata['supportedServices']) ? oyongtu.innerHTML = mydata['supportedServices']: oyongtu.innerHTML = ''; //应用用途
81
	
83
82 84
					//学术领域
83 85
					if(mydata['subject']) {
84
						if(mydata['subject'].indexOf(',') != -1) {//字符串是否包含,
86
						if(mydata['subject'].indexOf(',') != -1) { //字符串是否包含,
85 87
							var fieldlist = mydata['subject'].split(",");
86 88
							console.log(fieldlist.length);
87 89
							for(var i = 0; i < fieldlist; i++) {
@ -89,19 +91,19 @@ function ziyuaninfo(resourceId) {
89 91
								oli.innerText = fieldlist[i];
90 92
								ofield.appendChild(oli);
91 93
							}
92
						}else {
94
						} else {
93 95
							var oli = document.createElement('li');
94 96
							oli.innerText = mydata['subject'];
95 97
							ofield.appendChild(oli);
96 98
						}
97
						
99
98 100
					} else {
99 101
						ofielddiv.style.display = 'none';
100 102
					}
101
	
103
102 104
					//应用行业
103 105
					if(mydata['industry']) {
104
						if(mydata['industry'].indexOf(',') != -1) {//字符串是否包含,
106
						if(mydata['industry'].indexOf(',') != -1) { //字符串是否包含,
105 107
							var applylist = mydata['industry'].split(",");
106 108
							console.log(applylist.length);
107 109
							for(var i = 0; i < applylist; i++) {
@ -109,31 +111,31 @@ function ziyuaninfo(resourceId) {
109 111
								oli.innerText = fieldlist[i];
110 112
								oapply.appendChild(oli);
111 113
							}
112
						}else {
114
						} else {
113 115
							var oli = document.createElement('li');
114 116
							oli.innerText = mydata['industry'];
115 117
							oapply.appendChild(oli);
116 118
						}
117
					}else {
119
					} else {
118 120
						oapplydiv.style.display = 'none';
119 121
					}
120
	
122
121 123
					//详细描述
122 124
					if(mydata['descp']) {
123 125
						odetail.innerHTML = mydata['descp']
124
					}else {
126
					} else {
125 127
						odetaildiv.style.display = 'none';
126 128
					}
127
					
129
128 130
					//合作备注
129 131
					if(mydata['cooperationNotes']) {
130 132
						ohezuo.innerHTML = mydata['cooperationNotes'];
131
					}else {
133
					} else {
132 134
						ohezuodiv.style.display = 'none';
133 135
					}
134
					
136
135 137
					plus.nativeUI.closeWaiting();
136
					plus.webview.currentWebview().show("slide-in-right",150);
138
					plus.webview.currentWebview().show("slide-in-right", 150);
137 139
				}
138 140
			},
139 141
			error: function(xhr, type, errorThrown) {
@ -141,7 +143,7 @@ function ziyuaninfo(resourceId) {
141 143
			}
142 144
		});
143 145
	})
144
	
146
145 147
}
146 148
147 149
mui.plusReady(function() {
@ -150,24 +152,87 @@ mui.plusReady(function() {
150 152
	var userid = plus.storage.getItem('userid');
151 153
	var self = plus.webview.currentWebview();
152 154
	var resourceId = self.resourceId;
153
	console.log("资源id=="+resourceId);
155
	oEnter.addEventListener("tap", function() {
156
		judge()
157
	})
158
	var judge = function() {
159
		mui.ajax(baseUrl + "/ajax/professor/editBaseInfo/" + professorId, {
160
			dataType: 'json', //数据格式类型
161
			type: 'GET', //http请求类型
162
			timeout: 10000, //超时设置
163
			async: false,
164
			success: function(data) {
165
166
				var $info = data.data || {}
167
168
				if(data.success && data.data) {
169
					if($info.authentication == 1) {
170
						mui.openWindow({
171
							url: '../html/proinforbrow.html',
172
							id: 'html/proinforbrow.html',
173
							show: {
174
								autoShow: false,
175
								aniShow: "slide-in-left"
176
							},
177
							extras: {
178
								proid: professorId
179
							},
180
						});
181
					} else if($info.authentication == 2) {
182
						mui.openWindow({
183
							url: '../html/companybrowse.html',
184
							id: 'html/companybrowse.html',
185
							show: {
186
								autoShow: false,
187
								aniShow: "slide-in-left"
188
							},
189
							extras: {
190
								proid: professorId
191
							},
192
						});
193
					} else if($info.authentication == 3) {
194
						mui.openWindow({
195
							url: '../html/studentbrowse.html',
196
							id: 'html/studentbrowse.html',
197
							show: {
198
								autoShow: false,
199
								aniShow: "slide-in-left"
200
							},
201
							extras: {
202
								proid: professorId
203
							},
204
						});
205
					}
206
207
				}
208
			},
209
			error: function() {
210
				plus.nativeUI.toast("服务器链接超时", toastStyle);
211
				return;
212
			}
213
		});
214
	}
215
	console.log("资源id==" + resourceId);
154 216
	//资源信息
155 217
	ziyuaninfo(resourceId);
156 218
	/*点击咨询*/
157
	if(userid){
219
	if(userid) {
158 220
		oconsult.addEventListener('tap', function() {
159 221
			var flag = 'ziyuan';
160 222
			var consulttitle = oresorcename.innerHTML;
161
			var nwaiting = plus.nativeUI.showWaiting();//显示原生等待框
162
			webviewShow = plus.webview.create("../html/consultapply.html",'consultapply.html',{},
163
			{'proId': proId,'flag': flag,'consulttitle': consulttitle});
164
			
165
		    webviewShow.addEventListener("loaded", function() {
166
		        
167
		    }, false);
168
			
223
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
224
			webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
225
				'proId': proId,
226
				'flag': flag,
227
				'consulttitle': consulttitle
228
			});
229
230
			webviewShow.addEventListener("loaded", function() {
231
232
			}, false);
233
169 234
		});
170
	}else if(userid == '' || userid == undefined){
235
	} else if(userid == '' || userid == undefined) {
171 236
		oconsult.addEventListener('tap', function() {
172 237
			/*mui.alert('请登录', '' ,function(){
173 238
				mui.openWindow({
@ -181,12 +246,11 @@ mui.plusReady(function() {
181 246
			plus.nativeUI.toast("请先登录");
182 247
		});
183 248
	}
184
	
249
185 250
	/*咨询成功,返回资源信息*/
186
	window.addEventListener('backziyuaninfo',function(event){
187
		
251
	window.addEventListener('backziyuaninfo', function(event) {
252
188 253
	});
189
	
190 254
191 255
	ifCollection();
192 256
@ -194,7 +258,7 @@ mui.plusReady(function() {
194 258
		var $this = this;
195 259
		if(userid && userid != null && userid != "null") {
196 260
			collectionExpert($this);
197
		}else{
261
		} else {
198 262
			plus.nativeUI.toast("请先登录");
199 263
		}
200 264
	});

+ 21 - 6
app/js/resinforupdate.js

@ -2,6 +2,8 @@ mui.ready(function() {
2 2
	mui.plusReady(function() {
3 3
		var userid = plus.storage.getItem('userid');
4 4
		var self = plus.webview.currentWebview();
5
		document.getElementById("userimg").setAttribute("resouFlag", self.reFlag);
6
		console.log(document.getElementById("userimg").getAttribute("resouFlag"))
5 7
		var resourceId = self.resourceId;
6 8
		window.addEventListener("resourceMess", function(event) {
7 9
				resourceMess();
@ -56,7 +58,7 @@ mui.ready(function() {
56 58
						self.show("slide-in-right", 150);
57 59
						//资源基本信息
58 60
						if($data.images.length) {
59
							document.getElementById("userimg").src = baseUrl + '/images/resource/' + $data.resourceId + '.jpg';					
61
							document.getElementById("userimg").src = baseUrl + '/images/resource/' + $data.resourceId + '.jpg';
60 62
						}
61 63
						var oRes = document.getElementsByClassName("listtit2");
62 64
						oRes[0].innerText = $data.resourceName;
@ -96,7 +98,8 @@ mui.ready(function() {
96 98
		document.getElementById("mess").addEventListener("click", function() {
97 99
			plus.nativeUI.showWaiting();
98 100
			var web = plus.webview.create("../html/updateinfo-res01.html", "updateinfo-res01.html", {}, {
99
				rsId: resourceId
101
				rsId: resourceId,
102
				reFlag: self.reFlag
100 103
			}); //后台创建webview并打开show.html   	    	
101 104
			web.addEventListener("loaded", function() {}, false);
102 105
		});
@ -118,7 +121,8 @@ mui.ready(function() {
118 121
		document.getElementById("descp").addEventListener("click", function() {
119 122
			var nwaiting = plus.nativeUI.showWaiting();
120 123
			var web = plus.webview.create("../html/updateinfo-res04.html", "updateinfo-res04.html", {}, {
121
				rsId: resourceId
124
				rsId: resourceId,
125
				reFlag: self.reFlag
122 126
			}); //后台创建webview并打开show.html   	    	
123 127
			web.addEventListener("loaded", function() {}, false);
124 128
		});
@ -136,9 +140,20 @@ mui.ready(function() {
136 140
				"type": "DELETE",
137 141
				"success": function($data) {
138 142
					if($data.success) {
139
						var web = plus.webview.getWebviewById("html/proinforupdate.html");
140
						mui.fire(web, "newId");
141
						mui.back();
143
						if(self.reFlag == 0) {
144
							var web = plus.webview.getWebviewById("html/proinforupdate.html");
145
							mui.fire(web, "newId");
146
							mui.back();
147
						} else if(self.reFlag == 1) {
148
							var web = plus.webview.getWebviewById("html/companyUpdata.html");
149
							mui.fire(web, "newId");
150
							mui.back();
151
						} else if(self.reFlag == 2) {
152
							var web = plus.webview.getWebviewById("html/studentUpdata.html");
153
							mui.fire(web, "newId");
154
							mui.back();
155
						}
156

142 157
					} else {
143 158
						plus.nativeUI.toast("服务器链接超时", toastStyle);
144 159
					}

+ 160 - 0
app/js/studentUpdata.js

@ -0,0 +1,160 @@
1
mui.ready(function() {		
2
	mui.plusReady(function() {
3
		var userid = plus.storage.getItem('userid');
4
		var oImg=document.getElementsByTagName("img")[0];
5
		var personalMaterial=document.getElementsByClassName('personalMaterial');
6
		var personSummary=document.getElementsByClassName("breifinfo")[0];
7
		var fl;
8
		window.addEventListener("newId",function(event){
9
			fl=event.detail.rd;
10
			personalMaterial[1].parentNode.style.display = "block";
11
			personalMaterial[2].parentNode.style.display = "block";
12
			personalMaterial[3].parentNode.style.display = "block";	
13
			personalMaterial[4].parentNode.style.display = "block";
14
			personalMaterial[5].parentNode.style.display = "block";	
15
			personalMessage();
16
		})
17
		//获取个人的信息
18
		function personalMessage() {
19
			mui.ajax(baseUrl + "/ajax/professor/info/" + userid, {
20
				dataType: 'json', //数据格式类型
21
				type: 'GET', //http请求类型
22
				timeout: 10000, //超时设置
23
				success: function(data) {
24
					if(!fl){
25
						plus.nativeUI.closeWaiting(); 
26
					plus.webview.currentWebview().show("slide-in-right", 300);
27
					}
28
					var $data = data.data;
29
					personalMaterial[0].innerText = $data.name;
30
					//头像					
31
					if($data.hasHeadImage) {						
32
						oImg.src = baseUrl + "/images/head/" + $data.id + "_l.jpg";						
33
					}
34
					//基本信息
35
//					if(!$data.authentication) {
36
//						document.getElementsByClassName('authword')[0].innerText = "未认证";
37
//						document.getElementsByClassName('authword')[0].style.backgroundColor = "#cccccc";
38
//					}
39
					
40
					if($data.orgName) {
41
						personalMaterial[1].innerText = $data.orgName;
42
					} else {
43
						personalMaterial[1].parentNode.style.display = "none";
44
					}
45
					if($data.department) {
46
						personalMaterial[2].innerText = $data.department;
47
					} else {
48
						personalMaterial[2].parentNode.style.display = "none";
49
					}
50
					if($data.address) {
51
						personalMaterial[3].innerText =$data.province+" "+$data.address;
52
					} else {
53
						personalMaterial[3].parentNode.style.display = "none";
54
					}
55
					if($data.phone) {
56
						personalMaterial[4].innerText = $data.phone;
57
					} else {
58
						personalMaterial[4].parentNode.style.display = "none";
59
					}
60
					if($data.email) {
61
						personalMaterial[5].innerText = $data.email;
62
					} else {
63
						personalMaterial[5].parentNode.style.display = "none";
64
					}
65
					//个人简介
66

67
						if($data.descp) {
68
							personSummary.innerHTML = $data.descp;
69
						}						
70
						//我的资源
71
						if($data.resources.length) {
72
						resource($data.resources, $data.resources.length);
73
						}
74
					},
75
					error: function() {
76
						plus.nativeUI.toast("服务器链接超时", toastStyle);
77
						return;
78
					}
79
				});
80
			}
81
			//我的所有资源、
82
		function resource(oDa, n) {
83
			var $data = oDa;
84
			var html = [];
85
			for(var i = 0; i < n; i++) {
86
				var string = '<li class="mui-table-view-cell mui-media" resouId=' + $data[i].resourceId + '>'
87
				string += '<a class="proinfor" href="resinforupdate.html">'
88
				if($data[i].images.length) {
89
					string += '<img class="mui-media-object mui-pull-left resimg" src="'+baseUrl+'/images/resource/' + $data[i].resourceId + '.jpg">'					
90
				} else {
91

92
						string += '<img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">'
93
					}
94
					string += '<div class="mui-media-body">'
95
					string += '<span class="listtit">' + $data[i].resourceName + '<div class="updatebox updatebox2" style="top:6px;right:6px;"><em class="mui-icon mui-icon-compose updatebtn"></em></div></span>'
96
					string += '<p class="listtit2">' + $data[i].supportedServices + '</p>'
97
					string += '<p class="listtit3 resbrief">'
98
					if($data[i].descp) {
99
						string += $data[i].descp;
100
					}
101
					string += '</p></div></a></li>'
102
					html.push(string);
103
				}
104
				document.getElementById("resourceList").innerHTML = html.join('');
105
			
106
		}
107
		//个人信息修改
108
		document.getElementsByClassName("updatebox")[0].addEventListener("tap", function() {
109
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框  
110
			webviewShow = plus.webview.create("../html/studentUpdate1.html", "../html/studentUpdate1.html",{},{flag:0}); //后台创建webview并打开show.html   	    	
111
			webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件
112
//				nwaiting.close(); //新webview的载入完毕后关闭等待框
113
//				webviewShow.show("slide-in-right", 150); //把新webview窗体显示出来,显示动画效果为速度150毫秒的右侧移入动画         
114
			}, false);
115
		});
116
		document.getElementsByClassName("updatebox")[1].addEventListener("tap", function() {
117
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框  
118
			var arr = {
119
				descp: personSummary.innerText,
120
				flag:0
121
			}
122
			webviewShow = plus.webview.create("../html/updateinfo2.html", "updateinfo2.html", {}, arr); //后台创建webview并打开show.html   	    	
123
			webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件
124
				nwaiting.close(); //新webview的载入完毕后关闭等待框
125
				webviewShow.show("slide-in-right", 150); //把新webview窗体显示出来,显示动画效果为速度150毫秒的右侧移入动画         
126
			}, false);
127
		});
128
		
129
		//添加我的资源
130
		document.getElementsByClassName("addinfobox")[0].addEventListener("tap", function() {
131
			var nwaiting = plus.nativeUI.showWaiting();
132
			var web = plus.webview.create("../html/updateinfo-res01.html", "updateinfo-res01.html",{},{reFlag:2}); //后台创建webview并打开show.html   	    	
133
			web.addEventListener("loaded", function() {
134
				plus.nativeUI.closeWaiting();
135
				web.show("slide-in-right", 150);
136
			}, false);
137
		});
138
		//修改我的资源
139
		mui("#resourceList").on("tap", "li", function() {
140
				var resouId = this.getAttribute("resouId");
141
				var nwaiting = plus.nativeUI.showWaiting();
142
				var web = plus.webview.create("../html/resinforupdate.html", "resinforupdate.html", {}, {
143
					resourceId: resouId,
144
					reFlag:2
145
				}); //后台创建webview并打开show.html   	    	
146
				web.addEventListener("loaded", function() {
147

148
				}, false);
149
			})
150
			//修改详细页面
151
		document.getElementsByClassName("gotonext2")[0].addEventListener("tap", function() {
152
			var nwaiting = plus.nativeUI.showWaiting();
153
			var web = plus.webview.create("../html/proinforupdate-more.html", "proinforupdate-more.html"); //后台创建webview并打开show.html   	    	
154
			web.addEventListener("loaded", function() {}, false);
155
		});
156
		personalMessage();		
157
	});
158
});
159

160
  

+ 206 - 0
app/js/studentUpdate1.js

@ -0,0 +1,206 @@
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		var userid = plus.storage.getItem('userid');
4
		var ws = plus.webview.currentWebview();
5
		var str = JSON.stringify(ws);
6
		var oDt = document.getElementsByClassName("frmtype");
7
		var dataProvince = document.getElementById("data-province");
8
		var dataAddress = document.getElementById("data-address");
9
		var oAddress = document.getElementById("addressa")
10
		var telePhone = document.getElementById("telePhone");
11
		var mail = document.getElementById("mail");
12
		var authu = document.getElementsByClassName("authu");
13
		var authStatus;
14
		var name;
15
		var org;
16
		function personalMessage() {
17
			mui.ajax(baseUrl + "/ajax/professor/info/" + userid, {
18
				dataType: 'json', //数据格式类型
19
				type: 'GET', //http请求类型
20
				timeout: 10000, //超时设置
21
				success: function(data) {
22
					plus.nativeUI.closeWaiting();; //新webview的载入完毕后关闭等待框
23
					ws.show("slide-in-right", 150);
24
					var $data = data.data;
25
					if($data.authStatus == 0) {
26
						authu[0].innerText = "未认证"
27
					} else if($data.authStatus == 1) {
28
						authu[0].innerText = "已认证"
29
					} 
30
					authStatus = $data.authStatus;
31
					name = $data.name;
32
					org = $data.orgName;
33
					//学术领域
34
					oDt[0].value = $data.name
35
					oDt[1].value = $data.orgName;
36
					oDt[2].value = $data.department;
37
					oAddress.innerText = $data.province + " " + $data.address;
38
					dataProvince.value = $data.province;
39
					dataAddress.value = $data.address;
40
					if($data.email) {
41
						mail.value = $data.email
42
					}
43
					if($data.phone) {
44
						telePhone.value = $data.phone
45
					}
46
				},
47
				error: function() {
48
					plus.nativeUI.toast("服务器链接超时", toastStyle);
49
					return;
50
				}
51
			});
52
		}
53

54
		function trim(str) { //删除左右两端的空格
55
			  
56
			return str.replace(/(^\s*)|(\s*$)/g, "");  
57
		}
58
		oDt[0].addEventListener("focus", function() {
59
			if(authStatus == 1) {
60
				plus.nativeUI.toast("修改姓名后,身份认证失效,需重新认证");
61
			} else {
62
				var length = trim(oDt[0].value);
63
				if(!length)
64
					plus.nativeUI.toast("姓名不能为空");
65
			}
66
		});
67
		oDt[1].addEventListener("focus", function() {
68
			if(authStatus == 1) {
69
				plus.nativeUI.toast("修改所在高校后,身份认证失效,需重新认证");
70
			} else {
71
				var length = trim(oDt[1].value);
72
				if(!length)
73
					plus.nativeUI.toast("所在高校不能为空");
74
			}
75

76
		});
77
		/*选择地址*/
78
		var cityPicker = new mui.PopPicker({
79
			layer: 2
80
		});
81
		cityPicker.setData(cityData);
82
		var showCityPickerButton = document.getElementById('showCityPicker');
83
		showCityPickerButton.addEventListener('tap', function(event) {
84
			cityPicker.show(function(items) {
85
				oAddress.innerText = items[0].text + " " + items[1].text;
86
				dataProvince.value = items[0].text;
87
				dataAddress.value = items[1].text;
88
				//返回 false 可以阻止选择框的关闭  
89
				//return false;
90
			});
91
		}, false);
92
		//更新认证状态函数
93
		var upStatus = function() {		
94
			mui.ajax(baseUrl + "/ajax/professor/authStatus", {
95
				dataType: 'json', //数据格式类型
96
				type: 'post', //http请求类型
97
				data: {
98
					authStatus: 0,
99
					id: userid
100
				},
101
				timeout: 10000, //超时设置				
102
				success: function(data) {
103
					if(data.success) {						
104
					}else{
105
						
106
					}
107
				}
108
			})
109
		}
110
		function savePro() {
111
			var mess = {};
112
			mess.name = oDt[0].value;
113
			mess.orgName = oDt[1].value;
114
			mess.department = oDt[2].value;
115
			mess.province = dataProvince.value;
116
			mess.address = dataAddress.value;
117
			mess.email = trim(mail.value);
118
			mess.phone = trim(telePhone.value);
119
			mess.id = userid;
120
			var mess1 = JSON.stringify(mess);
121
			$.ajax({
122
				"url": baseUrl + '/ajax/professor',
123
				"type": "PUT",
124
				"async": true,
125
				"data": mess1,
126
				"contentType": "application/json",
127
				"success": function(data) {
128
					if(data.success) {
129
						
130
						var web = plus.webview.getWebviewById("html/studentUpdata.html");
131
						mui.fire(web, "newId");
132
//						var web3 = plus.webview.getWebviewById("html/myaccount.html");
133
//						mui.fire(web3, "photoUser");
134
						mui.back();
135
					} else {
136
						plus.nativeUI.toast("服务器链接超时", toastStyle);
137
						return;
138
					}
139
				}
140
			});			
141
		}
142
		/*校验手机号*/
143
		function phoneVal() {
144
			var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
145
			if(!hunPhone.test(trim(telePhone.value))) {
146
				plus.nativeUI.toast("请输入正确的手机号码", toastStyle);
147
				return 0;
148
			}
149
		}
150
		telePhone.addEventListener("blur", function() {
151
				phoneVal()
152
			})
153
			/*校验用户账号*/
154
		function userEmail() {
155
			var gunf = /^\w+@\w+\.((cn)|(com)|(com\.cn))$/;
156
			if(!gunf.test(trim(mail.value))) {
157
				plus.nativeUI.toast("请输入正确的邮箱", toastStyle);
158
				return 0;
159
			}
160
		}
161
		mail.addEventListener("blur", function() {
162
			userEmail();
163
		})
164
		var save = function() {
165
			if(trim(telePhone.value)) {
166
				var t = phoneVal();
167
				if(t == 0) {
168
					return;
169
				}
170
			}
171
			if(trim(mail.value)) {
172
				var mt = userEmail();
173
				if(mt == 0) {
174
					return;
175
				}
176
			}
177
			var length1 = trim(oDt[0].value);
178
			var length2 = trim(oDt[1].value);
179
			if(length1 && length2) {
180
				plus.nativeUI.showWaiting();
181
				savePro();
182
			} else if(!length1 && length2) {
183
				plus.nativeUI.toast("姓名不能为空");
184
			} else if(length1 && !length2) {
185
				plus.nativeUI.toast("所在高校不能为空");
186
			} else if(!length1 && !length2) {
187
				plus.nativeUI.toast("姓名不能为空&&所在高校不能为空");
188
			}
189
		}
190
		document.getElementsByClassName("topsave")[0].addEventListener("click", function() {
191

192
			if(authStatus == 1 && (name != oDt[0].value || org != oDt[1].value)) {
193
				plus.nativeUI.confirm("确认修改?", function(e) {
194
					if(e.index == 0) {
195
						upStatus();
196
						save();
197
					}
198
				}, "修改姓名或所在高校后,身份认证失效,需重新认证", ["确认", "取消"]);
199
			} else {
200
				save();
201
			}
202

203
		});
204
		personalMessage();
205
	});
206
})              

+ 297 - 0
app/js/studentbrowse.js

@ -0,0 +1,297 @@
1
var ozixun = document.getElementById("zixun");
2
var yesExpert = document.getElementById("yesExpert");
3
var noExpert = document.getElementById("noExpert");
4
var personalMaterial = document.getElementsByClassName('personalMaterial');
5
var personSummary = document.getElementsByClassName("breifinfo")[0];
6

7
mui.plusReady(function() {
8
	var userid = plus.storage.getItem('userid');
9
	var self = plus.webview.currentWebview();
10
	var proId = self.proid;
11
	console.log(userid);
12
	/*点击咨询*/
13
	if(userid) {
14
		ozixun.addEventListener('tap', function() {
15
			var flag = 'professor';
16
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
17
			webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
18
				'proId': proId,
19
				'flag': flag
20
			});
21

22
			webviewShow.addEventListener("loaded", function() {
23

24
			}, false);
25
		});
26
	} else if(userid == '' || userid == undefined) {
27
		ozixun.addEventListener('tap', function() {
28
			/*mui.alert('请登录', '' ,function(){
29
				mui.openWindow({
30
					url: '../html/login.html',
31
					id: 'html/login.html',
32
					show: {
33
						aniShow: "slide-in-left"
34
					}
35
				});
36
			});*/
37
			plus.nativeUI.toast("请先登录");
38
		});
39
	}
40

41
	
42
	var professorResource = function(odata) {
43
			var $data = odata;
44
			var html = [];
45
			for(var i = 0; i < odata.length; i++) {
46
				var string = '<li class="mui-table-view-cell mui-media" resouseId=' + $data[i].resourceId + '>'
47
				string += '<a class="proinfor">'
48
				if($data[i].images.length) {
49
					string += '<img class="mui-media-object mui-pull-left resimg" src="' + baseUrl + '/images/resource/' + $data[i].resourceId + '.jpg">'
50

51
				} else {
52

53
					string += '<img class="mui-media-object mui-pull-left resimg" src="../images/default-resource.jpg">'
54
				}
55
				string += '<div class="mui-media-body">'
56
				string += '<span class="listtit">' + $data[i].resourceName + '</span>'
57
				string += '<p class="listtit2">' + $data[i].supportedServices + '</p>'
58
				string += '<p class="listtit3 resbrief">'
59
				if($data[i].descp) {
60
					string += $data[i].descp;
61
				}
62
				string += '</p></div></a></li>'
63
				html.push(string);
64
			}
65
			document.getElementById("resourceList").innerHTML = html.join('');
66

67
		}
68
		/*获取个人信息*/
69
	function personalMessage() {
70
		mui.ajax(baseUrl + "/ajax/professor/info/" + proId, {
71
			dataType: 'json', //数据格式类型
72
			type: 'GET', //http请求类型
73
			timeout: 10000, //超时设置
74
			success: function(data) {
75
				plus.nativeUI.closeWaiting();
76
				plus.webview.currentWebview().show("slide-in-right", 150);
77
				var $data = data.data;
78
				personalMaterial[0].innerText = $data.name;
79
				//基本信息
80
				if($data.consultCount){
81
					document.getElementsByClassName("consultCount")[0].innerText = $data.consultCount;
82
				}else{
83
					document.getElementById("accessHistory").style.display="none";
84
				}
85
				var startLeval = parseInt($data.starLevel);
86
				var start = document.getElementsByClassName("start");
87
				for(var i = 0; i < startLeval; i++) {
88
					start[i].classList.add("icon-favorfill");
89
					start[i].classList.remove("icon-favor");
90
				}
91
				if($data.hasHeadImage) {
92
					document.getElementsByClassName("headimg")[0].src = baseUrl + "/images/head/" + $data.id + "_l.jpg";
93
				} else {
94
					document.getElementsByClassName("headimg")[0].src = "../images/default-photo.jpg";
95
				}
96
				if($data.authType) {
97
							nameli.classList.add('icon-vip');
98
							nameli.classList.add('authicon-cu');
99
						} else {
100
							if($data.authStatus){
101
								if($data.authentication==1){
102
									nameli.classList.add('icon-renzheng');
103
									nameli.classList.add('authicon-mana');
104
									nameli.innerHTML="<span>科研</span>";
105
							   }else if($data.authentication==2){
106
							    	nameli.classList.add('icon-renzheng');
107
									nameli.classList.add('authicon-staff');
108
									nameli.innerHTML="<span>企业</span>";
109
							    }else{
110
							    	nameli.classList.add('icon-renzheng');
111
									nameli.classList.add('authicon-stu');
112
									nameli.innerHTML="<span>学生</span>";
113
							    }
114
							}
115
						}			
116
				if($data.orgName) {
117
					if($data.department) {
118
						personalMaterial[0].innerText = $data.orgName + " , ";
119
					} else {
120
						personalMaterial[0].innerText = $data.orgName;
121
					}
122

123
				}
124
				if($data.department) {
125
					if($data.address) {
126
						personalMaterial[1].innerText = $data.department + " | ";
127
					} else {
128
						personalMaterial[1].innerText = $data.department;
129
					}
130

131
				}
132
				if($data.address) {
133
					personalMaterial[2].innerText = $data.address;
134
				}
135
				//个人简介
136

137
				if($data.descp) {
138
					personSummary.innerHTML = $data.descp;
139
				} else {
140
					document.getElementById("professorBreifinfo").style.display = "none";
141
				}
142
				//专家资源
143
				if($data.resources.length) {
144
					professorResource($data.resources);
145
				} else {
146
					document.getElementById("professorresourceList").style.display = "none";
147
				}
148
				//如无详细内容数据,隐藏详细点击的按钮
149
				if(!$data.edus.length && !$data.jobs.length && !$data.projects.length && !$data.papers.length && !$data.patents.length && !$data.honors.length) {
150
					document.getElementById("detailProfessor").style.display = "none";
151
				}
152
			},
153
			error: function() {
154
				plus.nativeUI.toast("服务器链接超时", toastStyle);
155
				return;
156
			}
157
		});
158
	}
159
	//修改详细页面
160
	document.getElementsByClassName("gotonext")[0].addEventListener("tap", function() {
161
		var nwaiting = plus.nativeUI.showWaiting();
162
		var web = plus.webview.create("../html/proinforbrow-more.html", "proinforbrow-more.html", {}, {
163
			pro: proId
164
		}); //后台创建webview并打开show.html   	    	
165
		web.addEventListener("loaded", function() {}, false);
166
	});
167
	
168

169
	personalMessage();
170
	/*进入资源详细页面*/
171
	mui("#resourceList").on('tap', 'li', function() {
172
		var resouId = this.getAttribute("resouseId");
173
		plus.nativeUI.showWaiting();
174
		plus.webview.create("../html/resinforbrow.html", 'resinforbrow.html', {}, {
175
			resourceId: resouId
176
		});
177
	});
178
	/*咨询成功,返回专家信息*/
179
	window.addEventListener('backproinfo', function(event) {
180
		var proid = event.detail.proId;
181
		console.log(proid);
182
		/*ozixun.classList.add('displayNone');*/
183
	});
184

185
	ifCollection();
186

187
	yesExpert.addEventListener('tap', function() {
188
		var $this = this;
189
		if(userid && userid != null && userid != "null") {
190
			collectionExpert($this);
191
		} else {
192
			plus.nativeUI.toast("请先登录");
193
		}
194
	});
195

196
	noExpert.addEventListener('tap', function() {
197
		var $this = this;
198
		cancelCollectionExpert($this);
199
	});
200

201
	/*判断是非收藏专家*/
202
	function ifCollection() {
203
		mui.ajax(baseUrl + '/ajax/watch/hasWatch', {
204
			data: {
205
				"professorId": userid,
206
				"watchObject": proId
207
			},
208
			dataType: 'json', //数据格式类型
209
			type: 'get', //http请求类型
210
			timeout: 10000,
211
			async: false,
212
			success: function(data) {
213
				if(data.success && data.data != null) {
214
					yesExpert.style.display = "none";
215
					noExpert.style.display = "block";
216
					returnId = data.data.watchObject;
217
				} else {
218
					yesExpert.style.display = "block";
219
					noExpert.style.display = "none";
220
				}
221
			},
222
			error: function() {
223
				plus.nativeUI.toast("服务器链接超时", toastStyle);
224
			}
225
		});
226
	}
227

228
	/*收藏专家*/
229
	function collectionExpert($this) {
230
		mui.ajax(baseUrl + '/ajax/watch', {
231
			data: {
232
				"professorId": userid,
233
				"watchObject": proId,
234
				"watchType": 1
235
			},
236
			dataType: 'json', //数据格式类型
237
			type: 'POST', //http请求类型
238
			timeout: 10000,
239
			async: false,
240
			success: function(data) {
241
				console.log(data.success)
242
				if(data.success) {
243
					$this.style.display = "none";
244
					noExpert.style.display = "block";
245
					returnId = data.data;
246
					//console.log(returnId)
247
					plus.nativeUI.toast("专家关注成功", toastStyle);
248
				}
249
			},
250
			error: function() {
251
				plus.nativeUI.toast("服务器链接超时", toastStyle);
252
			}
253
		});
254
	}
255

256
	/*取消收藏专家*/
257
	function cancelCollectionExpert($this) {
258
		//console.log(returnId)
259
		// console.log(userid)
260
		mui.ajax({
261
			url: baseUrl + '/ajax/watch/delete',
262
			data: {
263
				professorId: userid,
264
				watchObject: returnId
265
			},
266
			dataType: 'json', //数据格式类型
267
			type: 'post', //http请求类型
268
			timeout: 10000,
269
			async: true,
270
			success: function(data) {
271
				console.log(data.success)
272
				if(data.success) {
273
					$this.style.display = "none";
274
					yesExpert.style.display = "block";
275
					plus.nativeUI.toast("取消关注成功", toastStyle);
276
				}
277
			},
278
			error: function(data) {
279
				plus.nativeUI.toast("服务器链接超时", toastStyle);
280
			}
281
		});
282

283
	}
284
	/*专家的历史和评价*/
285
	document.getElementById("accessHistory").addEventListener('tap', function() {
286
		mui.openWindow({
287
			url: '../html/coophistory-other.html',
288
			id: 'html/coophistory-other.html',
289
			show: {
290
				autoShow: false,
291
			},
292
			extras: {
293
				professorId: proId
294
			}
295
		});
296
	})
297
});

+ 37 - 7
app/js/updateinfo-res01.js

@ -2,6 +2,7 @@ mui.ready(function() {
2 2
	mui.plusReady(function() {
3 3
		var userid = plus.storage.getItem('userid');
4 4
		var ws = plus.webview.currentWebview();
5
		console.log(ws.reFlag)
5 6
		var oDt = document.getElementsByClassName("frmtype");
6 7
		var service = document.getElementsByClassName("textareabox");
7 8

@ -60,9 +61,23 @@ mui.ready(function() {
60 61
							var web = plus.webview.getWebviewById("resinforupdate.html");
61 62
							mui.fire(web, "resourceMess");
62 63
							mui.back();
63
							var web1 = plus.webview.getWebviewById("html/proinforupdate.html"); 
64
							mui.fire(web1,"newId",{rd:1});  
65
							
64
							if(ws.reFlag == 0) {
65
								var web1 = plus.webview.getWebviewById("html/proinforupdate.html");
66
								mui.fire(web1, "newId", {
67
									rd: 1
68
								});
69
							} else if(ws.reFlag == 1) {
70
								var web2 = plus.webview.getWebviewById("html/companyUpdata.html");
71
								mui.fire(web2, "newId", {
72
									rd: 1
73
								});
74
							} else if(ws.reFlag == 2) {
75
								var web2 = plus.webview.getWebviewById("html/studentUpdata.html");
76
								mui.fire(web2, "newId", {
77
									rd: 1
78
								});
79
							}
80

66 81
						} else {
67 82
							plus.nativeUI.toast("服务器链接超时", toastStyle);
68 83
							return;
@ -77,13 +92,28 @@ mui.ready(function() {
77 92
					"data": $data,
78 93
					"success": function(data) {
79 94
						var y = JSON.stringify(data)
80
						if(data.success) {							
95
						if(data.success) {
81 96
							var id = data.data;
82 97
							plus.nativeUI.showWaiting();
83
							var web2 = plus.webview.getWebviewById("html/proinforupdate.html"); 
84
							mui.fire(web2,"newId",{rd:1});
98
							if(ws.reFlag == 0) {
99
								var web2 = plus.webview.getWebviewById("html/proinforupdate.html");
100
								mui.fire(web2, "newId", {
101
									rd: 1
102
								});
103
							} else if(ws.reFlag == 1) {
104
								var web2 = plus.webview.getWebviewById("html/companyUpdata.html");
105
								mui.fire(web2, "newId", {
106
									rd: 1
107
								});
108
							} else if(ws.reFlag == 2) {
109
								var web2 = plus.webview.getWebviewById("html/studentUpdata.html");
110
								mui.fire(web2, "newId", {
111
									rd: 1
112
								});
113
							}
85 114
							var web = plus.webview.create("../html/resinforupdate.html", "resinforupdate.html", {}, {
86
								resourceId: id
115
								resourceId: id,
116
								reFlag: ws.reFlag
87 117
							}); //后台创建webview并打开show.html   	    	
88 118
							web.addEventListener("loaded", function() {}, false);
89 119
						} else {

+ 11 - 2
app/js/updateinfo-res04.js

@ -38,8 +38,17 @@ mui.ready(function() {
38 38
						var web = plus.webview.getWebviewById("resinforupdate.html");
39 39
						mui.fire(web, "resourceMess");
40 40
						mui.back();
41
						var web1 = plus.webview.getWebviewById("html/proinforupdate.html"); 
42
							mui.fire(web1,"newId",{rd:1});
41
						if(ws.reFlag==0) {
42
								var web1 = plus.webview.getWebviewById("html/proinforupdate.html"); 
43
								mui.fire(web1,"newId",{rd:1});  
44
							}else if(ws.reFlag==1){								
45
								var web2 = plus.webview.getWebviewById("html/companyUpdata.html"); 
46
							mui.fire(web2,"newId",{rd:1});
47
							}else if(ws.reFlag==2){
48
								var web2 = plus.webview.getWebviewById("html/studentUpdata.html"); 
49
							mui.fire(web2,"newId",{rd:1});
50
							}
51
						
43 52
					}
44 53
				},
45 54
				error: function() {

+ 111 - 13
app/js/updateinfo1.js

@ -6,7 +6,13 @@ mui.ready(function() {
6 6
		var oDt = document.getElementsByClassName("frmtype");
7 7
		var dataProvince = document.getElementById("data-province");
8 8
		var dataAddress = document.getElementById("data-address");
9
		var oAddress = document.getElementById("addressa")
9
		var oAddress = document.getElementById("addressa");
10
		var telePhone = document.getElementById("telePhone");
11
		var mail = document.getElementById("mail");
12
		var authu = document.getElementsByClassName("authu");
13
		var authStatus;
14
		var name;
15
		var org;
10 16

11 17
		function personalMessage() {
12 18
			mui.ajax(baseUrl + "/ajax/professor/info/" + userid, {
@ -14,9 +20,18 @@ mui.ready(function() {
14 20
				type: 'GET', //http请求类型
15 21
				timeout: 10000, //超时设置
16 22
				success: function(data) {
23
					console.log(JSON.stringify(data))
17 24
					plus.nativeUI.closeWaiting();; //新webview的载入完毕后关闭等待框
18 25
					ws.show("slide-in-right", 150);
19 26
					var $data = data.data;
27
					if($data.authStatus == 0) {
28
						authu[0].innerText = "未认证"
29
					} else if($data.authStatus == 1) {
30
						authu[0].innerText = "已认证"
31
					} 
32
					authStatus = $data.authStatus;
33
					name = $data.name;
34
					org = $data.orgName;
20 35
					//学术领域
21 36
					oDt[0].value = $data.name
22 37
					oDt[1].value = $data.orgName;
@ -26,6 +41,12 @@ mui.ready(function() {
26 41
					oAddress.innerText = $data.province + " " + $data.address;
27 42
					dataProvince.value = $data.province;
28 43
					dataAddress.value = $data.address;
44
					if($data.email) {
45
						mail.value = $data.email
46
					}
47
					if($data.phone) {
48
						telePhone.value = $data.phone
49
					}
29 50
				},
30 51
				error: function() {
31 52
					plus.nativeUI.toast("服务器链接超时", toastStyle);
@ -38,15 +59,24 @@ mui.ready(function() {
38 59
			  
39 60
			return str.replace(/(^\s*)|(\s*$)/g, "");  
40 61
		}
41
		oDt[0].addEventListener("blur", function() {
42
			var length = trim(oDt[0].value);
43
			if(!length)
44
				plus.nativeUI.toast("姓名不能为空");
62
		oDt[0].addEventListener("focus", function() {
63
			if(authStatus == 1) {
64
				plus.nativeUI.toast("修改姓名后,身份认证失效,需重新认证");
65
			} else {
66
				var length = trim(oDt[0].value);
67
				if(!length)
68
					plus.nativeUI.toast("姓名不能为空");
69
			}
45 70
		});
46
		oDt[1].addEventListener("blur", function() {
47
			var length = trim(oDt[1].value);
48
			if(!length)
49
				plus.nativeUI.toast("所在机构不能为空");
71
		oDt[1].addEventListener("focus", function() {
72
			if(authStatus == 1) {
73
				plus.nativeUI.toast("修改所在机构后,身份认证失效,需重新认证");
74
			} else {
75
				var length = trim(oDt[1].value);
76
				if(!length)
77
					plus.nativeUI.toast("所在机构不能为空");
78
			}
79

50 80
		});
51 81
		/*选择地址*/
52 82
		var cityPicker = new mui.PopPicker({
@ -63,6 +93,24 @@ mui.ready(function() {
63 93
				//return false;
64 94
			});
65 95
		}, false);
96
		//更新认证状态函数
97
		var upStatus = function() {		
98
			mui.ajax(baseUrl + "/ajax/professor/authStatus", {
99
				dataType: 'json', //数据格式类型
100
				type: 'post', //http请求类型
101
				data: {
102
					authStatus: 0,
103
					id: userid
104
				},
105
				timeout: 10000, //超时设置				
106
				success: function(data) {
107
					if(data.success) {						
108
					}else{
109
						
110
					}
111
				}
112
			})
113
		}
66 114

67 115
		function savePro() {
68 116
			var mess = {};
@ -73,6 +121,8 @@ mui.ready(function() {
73 121
			mess.title = oDt[4].value;
74 122
			mess.province = dataProvince.value;
75 123
			mess.address = dataAddress.value;
124
			mess.email = trim(mail.value);
125
			mess.phone = trim(telePhone.value);
76 126
			mess.id = userid;
77 127
			var mess1 = JSON.stringify(mess);
78 128
			$.ajax({
@ -85,16 +135,51 @@ mui.ready(function() {
85 135
					if(data.success) {
86 136
						var web = plus.webview.getWebviewById("html/proinforupdate.html");
87 137
						mui.fire(web, "newId");
138
						var web3 = plus.webview.getWebviewById("html/myaccount.html");
139
						mui.fire(web3, "photoUser");
88 140
						mui.back();
89 141
					} else {
90 142
						plus.nativeUI.toast("服务器链接超时", toastStyle);
91 143
						return;
92 144
					}
93 145
				}
94
			});			
146
			});
95 147
		}
96

97
		document.getElementsByClassName("topsave")[0].addEventListener("click", function() {
148
		/*校验手机号*/
149
		function phoneVal() {
150
			var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
151
			if(!hunPhone.test(trim(telePhone.value))) {
152
				plus.nativeUI.toast("请输入正确的手机号码", toastStyle);
153
				return 0;
154
			}
155
		}
156
		telePhone.addEventListener("blur", function() {
157
				phoneVal()
158
			})
159
			/*校验用户账号*/
160
		function userEmail() {
161
			var gunf = /^\w+@\w+\.((cn)|(com)|(com\.cn))$/;
162
			if(!gunf.test(trim(mail.value))) {
163
				plus.nativeUI.toast("请输入正确的邮箱", toastStyle);
164
				return 0;
165
			}
166
		}
167
		mail.addEventListener("blur", function() {
168
			userEmail();
169
		})
170
		var save = function() {
171
			if(trim(telePhone.value)) {
172
				var t = phoneVal();
173
				if(t == 0) {
174
					return;
175
				}
176
			}
177
			if(trim(mail.value)) {
178
				var mt = userEmail();
179
				if(mt == 0) {
180
					return;
181
				}
182
			}
98 183
			var length1 = trim(oDt[0].value);
99 184
			var length2 = trim(oDt[1].value);
100 185
			if(length1 && length2) {
@ -106,8 +191,21 @@ mui.ready(function() {
106 191
			} else if(!length1 && !length2) {
107 192
				plus.nativeUI.toast("姓名不能为空&&所在机构不能为空");
108 193
			}
194
		}
195
		document.getElementsByClassName("topsave")[0].addEventListener("click", function() {
196

197
			if(authStatus == 1 && (name != oDt[0].value || org != oDt[1].value)) {
198
				plus.nativeUI.confirm("确认修改?", function(e) {
199
					if(e.index == 0) {
200
						upStatus();
201
						save();
202
					}
203
				}, "修改姓名或所在机构后,身份认证失效,需重新认证", ["确认", "取消"]);
204
			} else {
205
				save();
206
			}
109 207

110 208
		});
111 209
		personalMessage();
112 210
	});
113
})              
211
})

+ 28 - 19
app/js/updateinfo2.js

@ -1,25 +1,37 @@
1
mui.ready(function() {		
2
	mui.plusReady(function(){
3
		var userid = plus.storage.getItem('userid');		
4
		var ws=plus.webview.currentWebview();		
5
		var str = JSON.stringify(ws);	    	
6
    	document.getElementsByClassName("borderarea")[0].innerText=ws.descp;  
7
    	document.getElementsByClassName("topsave")[0].addEventListener("tap",function(){
8
    		mui.ajax(baseUrl + '/ajax/professor/descp', {
9
				data:{
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		var userid = plus.storage.getItem('userid');
4
		var ws = plus.webview.currentWebview();
5
		var str = JSON.stringify(ws);
6
		console.log(ws.flag)
7
		document.getElementsByClassName("borderarea")[0].innerText = ws.descp;
8
		document.getElementsByClassName("topsave")[0].addEventListener("tap", function() {
9
			mui.ajax(baseUrl + '/ajax/professor/descp', {
10
				data: {
10 11
					"id": userid,
11
 					"descp":document.getElementsByClassName("borderarea")[0].innerText 
12
					"descp": document.getElementsByClassName("borderarea")[0].innerText
12 13
				},
13 14
				dataType: 'json', //数据格式类型
14 15
				async: false,
15 16
				type: 'POST', //http请求类型
16 17
				timeout: 10000, //超时设置
17 18
				success: function(data) {
18
					console.log(data.success);
19
					console.log(ws.flag);
19 20
					if(data.success) {
20
						ws.close();
21
						var web=plus.webview.getWebviewById("html/proinforupdate.html");
22
						mui.fire(web,"newId");						
21
						if(ws.flag == 1) {
22
							ws.close();
23
							var web = plus.webview.getWebviewById("html/companyUpdata.html");
24
							mui.fire(web, "newId");
25
						} else if(ws.flag == 2) {
26
							ws.close();
27
							var web = plus.webview.getWebviewById("html/proinforupdate.html");
28
							mui.fire(web, "newId");
29
						} else if(ws.flag == 0) {
30
							ws.close();
31
							var web = plus.webview.getWebviewById("html/studentUpdata.html");
32
							mui.fire(web, "newId");
33
						}
34

23 35
					}
24 36
				},
25 37
				error: function() {
@ -27,9 +39,6 @@ mui.ready(function() {
27 39
					return;
28 40
				}
29 41
			});
30
    	});
42
		});
31 43
	});
32
})    
33

34

35

44
})

+ 1 - 1
app/js/updateinfo6.js

@ -81,7 +81,7 @@ mui.ready(function() {
81 81
				"data" :ws.edu?JSON.stringify($data):$data,
82 82
				"contentType" : ws.edu ? "application/json"
83 83
						: "application/x-www-form-urlencoded",
84
				"success" : function(data) {					
84
				"success" : function(data) {	
85 85
					if (data.success) 
86 86
					{
87 87
						var web=plus.webview.getWebviewById("proinforupdate-more.html");