Browse Source

收藏与关注
企业和个人主页
添加相关服务
修改资料
邀请回答搜索
我的问答中的关注

luyanan 7 years ago
parent
commit
ed69898a85
57 changed files with 4217 additions and 2781 deletions
  1. 5 10
      app/css/app.css
  2. 26 137
      app/html/attentedList.html
  3. 4 5
      app/html/cmpInforShow-article.html
  4. 4 4
      app/html/cmpInforShow-more.html
  5. 4 5
      app/html/cmpInforShow-resources.html
  6. 40 0
      app/html/cmpInforShow-service.html
  7. 30 45
      app/html/cmpInforShow.html
  8. 6 0
      app/html/patentShow.html
  9. 6 0
      app/html/professorArticle.html
  10. 30 26
      app/html/qa-request-da.html
  11. 7 0
      app/html/resourceShow.html
  12. 40 0
      app/html/updateBasic-birthday.html
  13. 45 0
      app/html/updateBasic-sex.html
  14. 24 1
      app/html/updateBasic.html
  15. 5 5
      app/html/userInforShow-more.html
  16. 49 53
      app/html/userInforShow.html
  17. 1 1
      app/html/userInforUpdate.html
  18. 43 0
      app/html/userQAList.html
  19. 4 3
      app/html/useraiticleList.html
  20. 4 3
      app/html/userpaperList.html
  21. 4 3
      app/html/userpatentList.html
  22. 4 3
      app/html/userresourceList.html
  23. 10 8
      app/html/userEvaluate.html
  24. BIN
      app/images/default-service.jpg
  25. 70 13
      app/js/articleShow.js
  26. 460 429
      app/js/attentedList.js
  27. 131 90
      app/js/cmpInforShow-article.js
  28. 135 86
      app/js/cmpInforShow-resources.js
  29. 149 0
      app/js/cmpInforShow-service.js
  30. 409 377
      app/js/cmpInforShow.js
  31. 9 12
      app/js/index.js
  32. 1 18
      app/js/needShow.js
  33. 1 14
      app/js/paperShow.js
  34. 6 14
      app/js/patentShow.js
  35. 302 214
      app/js/public/base.js
  36. 120 109
      app/js/qa-my-wenda.js
  37. 1 14
      app/js/qa-question-show.js
  38. 277 209
      app/js/qa-request-da.js
  39. 78 15
      app/js/resourceShow.js
  40. 70 0
      app/js/updateBasic-birthday.js
  41. 2 0
      app/js/updateBasic-city.js
  42. 2 0
      app/js/updateBasic-depart.js
  43. 2 0
      app/js/updateBasic-email.js
  44. 2 0
      app/js/updateBasic-org.js
  45. 2 0
      app/js/updateBasic-post.js
  46. 57 0
      app/js/updateBasic-sex.js
  47. 2 0
      app/js/updateBasic-tel.js
  48. 2 0
      app/js/updateBasic-title.js
  49. 20 1
      app/js/updateBasic.js
  50. 0 109
      app/js/userEvaluate.js
  51. 597 580
      app/js/userInforShow.js
  52. 208 0
      app/js/userQAList.js
  53. 130 79
      app/js/userarticleList.js
  54. 153 10
      app/js/userpaperList.js
  55. 140 0
      app/js/userpatentList.js
  56. 135 76
      app/js/userresourceList.js
  57. 149 0
      app/js/userserviceList.js

+ 5 - 10
app/css/app.css

@ -332,24 +332,19 @@ ul.boxnav li.set span:before{font-family:"iconfont";content: "\e733";font-size:1
332 332
.personinfo .listtit{ font-size: 20px; line-height: 30px; color: #333333;}
333 333
.personinfo .listtit3{font-size: 14px; line-height: 24px; color: #AAAAAA; margin: 0;}
334 334
/*咨询记录及等级*/
335
/*.peolevelbox{ display: block; padding:4% 16px; border-top:1px #F0F0F0 solid;}
336
.peocountbox{width: 150px;}
337
.peocount { color:#888888 ; overflow:hidden; }
338
.peocount span em{font-size: 14px; padding: 0 3px; color: #FF9900; font-weight: 600;}
339
.peocount .dialogicon{color: #FF9900;}
340
.peocount:before{position: absolute;right: 0; top: 0;left: 15px; height: 1px; content: ''; -webkit-transform: scaleY(.5); transform: scaleY(.5);background-color: #c8c7cc;}*/
341 335
.levelbox{margin: auto; overflow: hidden; }
342 336
.levelbox .mui-icon{ font-size: 14px; color: #CCCCCC;}
343 337
.levelbox .icon-favorfill{ color:#F4C600;}
344 338
.starShow{position: absolute;right: 0;top:-4px;overflow: hidden;}
345 339
.commentsArea .madiaHead.useHeadMsg{top:36px;margin-top:0;}
346 340
/*专家相关信息*/
347
.infocontit{font-size:16px;line-height: 40px;min-height:40px;border-bottom: 1px solid #E5E5E5; position: relative;padding-left: 26px;color:#333}
341
.infocontit{font-size:16px;line-height: 40px;min-height:40px; position: relative;padding-left: 26px;color:#333}
348 342
.infocontit:before{position:absolute;top:50%;margin-top:-10px;left: 15px;;display:inline-block;content:"";width:4px;height:18px;border-radius:10px;background:#ff9900;}
349 343
.infocontitM{padding-left: 15px;font-size:15px;}
350 344
.infocontitM:before{content: none;}
351 345
.OnetitM{border-color: transparent;}
352 346
.infocon{padding:15px; font-size: 14px;color:#666;}
347
.infoconM{border-top: 1px solid #E5E5E5;}
353 348
.infocon .breifinfo{line-height: 22px;word-wrap: break-word;}
354 349
.infocon ul{ padding:0; margin: 0; overflow: hidden;}
355 350
.infocon ul>li{list-style: none;}
@ -621,9 +616,9 @@ footer.chatFooter .mui-icon-paperplane {font-size: 16px;word-break: keep-all;lin
621 616

622 617
/***********************缺省页面*******************/
623 618
.nodatabox{width:100%;height: 100%;padding:50px 10px; margin:auto;text-align: center;}
624
.nodatabox .picbox{margin:8px auto;display:inline-block;width:140px;height:140px;background-position: center;background-repeat: no-repeat;background-size:cover;}
625
.nodatabox .picbox.picNull{background-image:url(../images/points_icon_ku_nor@3x.png);}
626
.nodatabox .txtbox { margin:6px auto;}
619
.picbox{margin:8px auto;display:inline-block;width:140px;height:140px;background-position: center;background-repeat: no-repeat;background-size:cover;}
620
.picbox.picNull{background-image:url(../images/points_icon_ku_nor@3x.png);}
621
.txtbox { margin:6px auto;line-height: 22px;}
627 622
.nodatabox .noContip{font-size:12px;color:#BBBBBB;line-height:40px;}
628 623
.nodatabox .picbox .defpic{display:block;margin:auto;width:160px; height: 160px;background: url(../images/nodata.png) -6px 0 no-repeat;}
629 624
.nodatabox .picbox .defpic.consult-pic{background-position: -232px -1320px;}/*咨询页面未登录*/

+ 26 - 137
app/html/attentedList.html

@ -8,6 +8,7 @@
8 8
	<link href="../css/mui.min.css" rel="stylesheet" />
9 9
	<link href="../css/app.css" rel="stylesheet" />
10 10
	<link href="../css/iconfont.css" rel="stylesheet" />
11
	<script src="../js/public/jquery-1.11.1.js"></script>
11 12
	<style type="text/css">
12 13
		html,body{height: 100%;margin:0;padding:0px;overflow: hidden;}
13 14
		.mui-content{height:100%;overflow: auto;}
@ -24,64 +25,30 @@
24 25
		<div id="slider" class="mui-slider mui-fullscreen">
25 26
			<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
26 27
				<div class="mui-scroll">
27
					<a class="mui-control-item mui-active" href="#item1mobile">专家</a>
28
					<a class="mui-control-item" href="#item2mobile">企业</a>
29
					<a class="mui-control-item" href="#item3mobile">资源</a>
30
					<a class="mui-control-item" href="#item4mobile">专利</a>
31
					<a class="mui-control-item" href="#item5mobile">论文</a>
32
					<a class="mui-control-item" href="#item6mobile">文章</a>
33
					<a class="mui-control-item" href="#item7mobile">需求</a>
28
					<a class="mui-control-item mui-active" href="#item1mobile" rel="1">专家</a>
29
					<a class="mui-control-item" href="#item2mobile" rel="10">服务</a>
30
					<a class="mui-control-item" href="#item3mobile" rel="2">资源</a>
31
					<a class="mui-control-item" href="#item4mobile" rel="4">专利</a>
32
					<a class="mui-control-item" href="#item5mobile" rel="5">论文</a>
33
					<a class="mui-control-item" href="#item6mobile" rel="3">文章</a>
34
					<a class="mui-control-item" href="#item7mobile" rel="6">企业</a>
35
					<a class="mui-control-item" href="#item8mobile" rel="7">需求</a>
34 36
				</div>
35 37
			</div>
36 38
			<div class="mui-slider-group">
37 39
				<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
38
					<div id="scroll1" class="mui-scroll-wrapper">
40
					<div class="mui-scroll-wrapper">
39 41
						<div class="mui-scroll">
40 42
							<ul class="mui-table-view" id="likeUser">
41
						        <!--<li class="mui-table-view-cell">
42
						            <div class="flexCenter mui-clearfix">
43
						                <div class="madiaHead useHead"></div>
44
										<div class="madiaInfo">
45
											<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
46
											<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
47
											<p class="mui-ellipsis h2Font">研究方向:研究方向研究方向研究方向研究方向研究方向研究方向</p>
48
										</div>
49
						            </div>
50
						        </li>-->
51
							</ul><div class="nodatabox displayNone">
52
						        <div class="nodata">
53
						            <div class="picbox picNull"></div>
54
						            <div class="txtbox">
55
						            	<p class="noContip">您还未关注任何专家</p>
56
						            </div>
57
						        </div>
58
						    </div>
43
							</ul>
59 44
						</div>
60 45
					</div>
61 46
				</div>
62 47
				<div id="item2mobile" class="mui-slider-item mui-control-content">
63 48
					<div class="mui-scroll-wrapper">
64 49
						<div class="mui-scroll">
65
							<ul class="mui-table-view" id="likeCmp">
66
								<!--<li class="mui-table-view-cell">
67
						            <div class="flexCenter OflexCenter mui-clearfix">
68
						                <div class="madiaHead companyHead">
69
						                	<div class="boxBlock"><img class="boxBlockimg companyImg" src="../images/default-icon.jpg"></div>
70
						                </div>
71
										<div class="madiaInfo OmadiaInfo">
72
											<p class="mui-ellipsis h1Font">企业名称<em class="authicon authicon-com-ok" title="科袖认证企业"></em></p>
73
											<p class="mui-ellipsis h2Font"><span id="">企业类型</span> <span id="">所属行业 | 所属行业</span></p>
74
										</div>
75
						            </div>
76
						        </li>-->
77
							</ul><div class="nodatabox displayNone">
78
						        <div class="nodata">
79
						            <div class="picbox picNull"></div>
80
						            <div class="txtbox">
81
						            	<p class="noContip">您还未关注任何企业</p>
82
						            </div>
83
						        </div>
84
						    </div>
50
							<ul class="mui-table-view" id="likeSer">
51
							</ul>
85 52
						</div>
86 53
					</div>
87 54
				</div>
@ -89,24 +56,7 @@
89 56
					<div class="mui-scroll-wrapper">
90 57
						<div class="mui-scroll">
91 58
							<ul class="mui-table-view" id="likeRes">
92
								<!--<li class="mui-table-view-cell">
93
						            <div class="flexCenter OflexCenter mui-clearfix">
94
						                <div class="madiaHead resouseHead"></div>
95
										<div class="madiaInfo OmadiaInfo">
96
											<p class="mui-ellipsis h1Font">资源名称资源名称资源名称资源名称</p>
97
											<p class="mui-ellipsis h2Font">用途:资源用途资源用途资源用途资源用途资源用途</p>
98
											<p><span class="h2Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
99
										</div>
100
						            </div>
101
						        </li>-->
102
							</ul><div class="nodatabox displayNone">
103
								<div class="nodata">
104
									<div class="picbox picNull"></div>
105
									<div class="txtbox">
106
										<p class="noContip">您还未收藏任何资源</p>
107
									</div>
108
								</div>
109
							</div>
59
							</ul>
110 60
						</div>
111 61
					</div>
112 62
				</div>
@ -114,23 +64,7 @@
114 64
					<div class="mui-scroll-wrapper">
115 65
						<div class="mui-scroll">
116 66
							<ul class="mui-table-view" id="likePat">
117
								<!--<li class="mui-table-view-cell">
118
						            <div class="flexCenter OflexCenter mui-clearfix">
119
						                <div class="madiaHead patentHead"></div>
120
										<div class="madiaInfo OmadiaInfo">
121
											<p class="mui-ellipsis h1Font">专利名称</p>
122
											<p class="mui-ellipsis h2Font">发明人:发明人一,发明人一,发明人一,发明人一,发明人一</p>
123
										</div>
124
						            </div>
125
						        </li>-->
126
							</ul><div class="nodatabox displayNone">
127
								<div class="nodata">
128
									<div class="picbox picNull"></div>
129
									<div class="txtbox">
130
										<p class="noContip">您还未收藏任何专利</p>
131
									</div>
132
								</div>
133
							</div>
67
							</ul>
134 68
						</div>
135 69
					</div>
136 70
				</div>
@ -138,23 +72,7 @@
138 72
					<div class="mui-scroll-wrapper">
139 73
						<div class="mui-scroll">
140 74
							<ul class="mui-table-view" id="likePer">
141
								<!--<li class="mui-table-view-cell">
142
						            <div class="flexCenter OflexCenter mui-clearfix">
143
						                <div class="madiaHead paperHead"></div>
144
										<div class="madiaInfo OmadiaInfo">
145
											<p class="mui-ellipsis h1Font">论文题目</p>
146
											<p class="mui-ellipsis h2Font">作者:作者一,作者一,作者一,作者一,作者一,作者一</p>
147
										</div>
148
						            </div>
149
						        </li>-->
150
							</ul><div class="nodatabox displayNone">
151
								<div class="nodata">
152
									<div class="picbox picNull"></div>
153
									<div class="txtbox">
154
										<p class="noContip">您还未收藏任何论文</p>
155
									</div>
156
								</div>
157
							</div>
75
							</ul>
158 76
						</div>
159 77
					</div>
160 78
				</div>
@ -162,39 +80,24 @@
162 80
					<div class="mui-scroll-wrapper">
163 81
						<div class="mui-scroll">
164 82
							<ul class="mui-table-view" id="likeArt">
165
								<!--<li class="mui-table-view-cell">
166
						            <div class="flexCenter OflexCenter mui-clearfix">
167
						                <div class="madiaHead artHead"></div>
168
										<div class="madiaInfo OmadiaInfo">
169
											<p class="mui-ellipsis-2 h1Font">文章名称章名称文章名称</p>
170
											<p><span class="h2Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
171
										</div>
172
						            </div>
173
						        </li>-->
174
							</ul><div class="nodatabox displayNone">
175
								<div class="nodata">
176
									<div class="picbox picNull"></div>
177
									<div class="txtbox">
178
										<p class="noContip">您还未收藏任何文章</p>
179
									</div>
180
								</div>
181
							</div>
83
							</ul>
182 84
						</div>
183 85
					</div>
184 86
				</div>
185 87
				<div id="item7mobile" class="mui-slider-item mui-control-content">
88
					<div class="mui-scroll-wrapper">
89
						<div class="mui-scroll">
90
							<ul class="mui-table-view" id="likeCmp">
91
							</ul>
92
						</div>
93
					</div>
94
				</div>				
95
				<div id="item8mobile" class="mui-slider-item mui-control-content">
186 96
					<div class="mui-scroll-wrapper">
187 97
						<div class="mui-scroll needList">
188 98
							<ul class="mui-table-view" id="likeDemand">
189 99
								
190
							</ul><div class="nodatabox displayNone">
191
								<div class="nodata">
192
									<div class="picbox picNull"></div>
193
									<div class="txtbox">
194
										<p class="noContip">您还未收藏任何需求</p>
195
									</div>
196
								</div>
197
							</div>
100
							</ul>
198 101
						</div>
199 102
					</div>
200 103
				</div>
@ -209,20 +112,6 @@
209 112
	<script type="text/javascript">
210 113
		//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
211 114
	    iosheader();
212
//	    var anos=ifiosAmdandroid();
213
//
214
//	    (function($) {
215
//	    	//阻尼系数
216
//			var deceleration = mui.os.ios?0.003:0.0009;
217
//			$('.mui-scroll-wrapper').scroll({
218
//				bounce: false,
219
//				indicators: true, //是否显示滚动条
220
//				deceleration:deceleration
221
//			});
222
//			
223
//		})(mui);
224
	    
225
	    
226 115
	</script>
227 116
</body>
228 117
</html>

+ 4 - 5
app/html/cmpInforShow-article.html

@ -8,7 +8,6 @@
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12 11
	</head>
13 12
14 13
	<body>
@ -18,8 +17,8 @@
18 17
		</header>
19 18
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
20 19
		 	<div class="mui-scroll">
21
				<div class="mui-input-group mainbox">
22
					<div class="infocon madiaBlock">
20
				<div class="mui-input-group mainbox madiaBlock">
21
					<div class="infocon">
23 22
						<ul class="mui-table-view" id="articelShow">
24 23
					        
25 24
					    </ul>
@ -29,8 +28,8 @@
29 28
		</div>
30 29
		<script src="../js/public/mui.min.js"></script>
31 30
		<script src="../js/public/base.js"></script>
32
		<script src="../js/public/mui.zoom.js" type="text/javascript" charset="utf-8"></script>
33
		<script src="../js/public/mui.previewimage.js" type="text/javascript" charset="utf-8"></script>
31
		<script src="../js/public/mui.pullToRefresh.js"></script>
32
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
34 33
		<script src="../js/cmpInforShow-article.js"></script>
35 34
	</body>
36 35

+ 4 - 4
app/html/cmpInforShow-more.html

@ -20,14 +20,14 @@
20 20
    		<!-- 主界面具体展示内容 -->
21 21
    		<div class="mui-input-group mainbox">
22 22
					<div class="infocontit infocontitM">企业简介</div>
23
					<div class="infocon">
23
					<div class="infocon infoconM">
24 24
						<span class="breifinfo" id="breifinfo">
25 25
				        </span>
26 26
					</div>
27 27
			</div>
28 28
		    <div class="mui-input-group mainbox">
29 29
				<div class="infocontit infocontitM">企业详情</div>
30
			       <div class="infocon detailInfo">
30
			       <div class="infocon infoconM detailInfo">
31 31
				      <ul>
32 32
				      	  <li>企业名称:<span id="companyName"></span></li>
33 33
				      	  <li>企业类型:<span id="orgType"></span></li>
@ -40,7 +40,7 @@
40 40
		    </div>
41 41
		    <div class="mui-input-group mainbox">
42 42
				<div class="infocontit infocontitM">企业资质</div>
43
		        <div class="infocon infoapply">
43
		        <div class="infocon infoconM infoapply">
44 44
			      <ul id="qiyelist">
45 45
			      	 <!-- <li>公司名称公司名称公司名称公司名称</li>-->
46 46
			      </ul>
@ -48,7 +48,7 @@
48 48
		    </div>
49 49
		    <div class="mui-input-group mainbox">
50 50
				<div class="infocontit infocontitM">工商信息</div>
51
		       <div class="infocon detailInfo">
51
		       <div class="infocon infoconM detailInfo">
52 52
			      <ul id="comMes">
53 53
			      	  
54 54
			      </ul>

+ 4 - 5
app/html/cmpInforShow-resources.html

@ -8,7 +8,6 @@
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12 11
	</head>
13 12
14 13
	<body>
@ -20,8 +19,8 @@
20 19
21 20
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
22 21
		 	<div class="mui-scroll">
23
				<div class="mui-input-group mainbox">
24
					<div class="infocon madiaBlock">
22
				<div class="mui-input-group mainbox madiaBlock">
23
					<div class="infocon">
25 24
						<ul class="mui-table-view" id="resourceShow">
26 25
					        
27 26
					    </ul>
@ -32,8 +31,8 @@
32 31
		
33 32
		<script src="../js/public/mui.min.js"></script>
34 33
		<script src="../js/public/base.js"></script>
35
		<script src="../js/public/mui.zoom.js" type="text/javascript" charset="utf-8"></script>
36
		<script src="../js/public/mui.previewimage.js" type="text/javascript" charset="utf-8"></script>
34
		<script src="../js/public/mui.pullToRefresh.js"></script>
35
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
37 36
		<script src="../js/cmpInforShow-resources.js"></script>
38 37
		
39 38
	</body>

+ 40 - 0
app/html/cmpInforShow-service.html

@ -0,0 +1,40 @@
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
		<div class="maskBlack" id="maskBlack"></div>
15
		<header class="mui-bar mui-bar-nav toptitbox">
16
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
17
			<h1 class="mui-title toptit">企业服务</h1>
18
		</header>
19
20
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox madiaBlock">
23
					<div class="infocon">
24
						<ul class="mui-table-view" id="serviceShow">
25
					        
26
					    </ul>
27
					</div>
28
				</div>
29
			</div>
30
		</div>
31
		
32
		<script src="../js/public/mui.min.js"></script>
33
		<script src="../js/public/base.js"></script>
34
		<script src="../js/public/mui.pullToRefresh.js"></script>
35
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
36
		<script src="../js/cmpInforShow-service.js"></script>
37
		
38
	</body>
39
40
</html>

+ 30 - 45
app/html/cmpInforShow.html

@ -9,10 +9,12 @@
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11 11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12
		<script src="../js/public/jquery-1.11.1.js"></script>
12 13
		<style type="text/css">
13 14
			.toptitbox{background: #28b8fa;}
14 15
			.showCardI{background-image: url(../images/enterprise_img_bg_nor@3x.png)}
15 16
			.infocontit:before{background: #28b8fa;}
17
			.establishments{display: none;}
16 18
		</style>
17 19
	</head>
18 20
@ -53,68 +55,51 @@
53 55
					</div>		
54 56
				</div>
55 57
			</div>
56
			<div class="mui-input-group mainbox">
58
			<div class="mui-input-group mainbox displayNone">
57 59
				<div class="infocon madiaBlock needList">
58
					<ul class="mui-table-view" id="bower_u">
59
						<!--<li class="mui-table-view-cell">
60
							<div class="madiaInfo">
61
								<p class="h1Font mui-ellipsis-2">需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问</p>
62
								<p class="h2Font mui-ellipsis-5">需求内容:我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进,
63
									想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出产品的三维模型,用于展示以及为后续生产做准备我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进,
64
									想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出</p>
65
								<div class="showli mui-ellipsis h3Font">
66
									<span>北京市</span>
67
									<span>预期 1个月内</span>
68
									<span>预算 1万元以内</span>
69
									<span>有效期至 8月17日</span>
70
								</div>
71
							</div>
72
						</li>-->
73
						<!--<li class="mui-table-view-cell">
74
							<div class="madiaInfo">
75
								<p class="h1Font mui-ellipsis-2">需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问</p>
76
								<p class="h2Font mui-ellipsis-5">需求内容:我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进,
77
									想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出产品的三维模型,用于展示以及为后续生产做准备我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进,
78
									想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出</p>
79
								<div class="showli mui-ellipsis h3Font">
80
									<span>北京市</span>
81
									<span>预期 1个月内</span>
82
									<span>预算 1万元以内</span>
83
									<span>有效期至 8月17日</span>
84
								</div>
85
							</div>
86
						</li>-->
60
					<ul class="mui-table-view" id="demandShow">
87 61
					</ul>
88 62
				</div>
89 63
			</div>
64
			<div class="establishments">
65
				<div class="mui-input-group mainbox displayNone">
66
					<div class="infocontit">可提供服务</div>
67
					<div class="infocon infoconM madiaBlock">
68
						<ul class="mui-table-view" id="serviceShow">
69
					        
70
					    </ul>
71
					</div>
72
					<div class="seeMore displayNone" id="seeMoreService"><em>查看全部 <span id="serviceNum">0</span>个</em></div>
73
				</div>
74
				<div class="mui-input-group mainbox displayNone">
75
					<div class="infocontit">可共享资源</div>
76
					<div class="infocon infoconM madiaBlock">
77
						<ul class="mui-table-view" id="resourceShow">
78
					        
79
					    </ul>
80
					</div>
81
					<div class="seeMore displayNone" id="seeMoreResource"><em>查看全部 <span id="resourceNum">0</span>个</em></div>
82
				</div>
83
			</div>
90 84
			<div class="mui-input-group mainbox" id="goCmpBrief">
91 85
				<div class="infocontit mui-navigate-right mui-clearfix">企业介绍 </div>
92
				<div class="infocon">
86
				<div class="infocon infoconM"class="infocon infoconM">
93 87
					<span class="breifinfo mui-ellipsis-5" id="breifinfo">
94 88
			        </span>
95 89
				</div>
96 90
			</div>
97 91
			<div class="mui-input-group mainbox">
98 92
				<div class="infocontit">专注领域</div>
99
				<div class="infocon listArea">
93
				<div class="infocon infoconM listArea">
100 94
					<ul id="subjectShow">
101 95
						<!--<li>领域1</li>
102 96
			       		<li>领域领域领域2</li>-->
103 97
					</ul>
104 98
				</div>
105 99
			</div>
106
			<div class="mui-input-group mainbox">
107
				<div class="infocontit">资源</div>
108
				<div class="infocon madiaBlock">
109
					<ul class="mui-table-view" id="resourceShow">
110
				        
111
				    </ul>
112
				</div>
113
				<div class="seeMore displayNone" id="seeMoreResource"><em>查看全部<span id="resourceNum">0</span>个</em></div>
114
			</div>
115
			<div class="mui-input-group mainbox">
100
			<div class="mui-input-group mainbox displayNone">
116 101
				<div class="infocontit">文章</div>
117
				<div class="infocon madiaBlock">
102
				<div class="infocon infoconM madiaBlock">
118 103
					<ul class="mui-table-view" id="articelShow">
119 104
				        
120 105
				    </ul>
@ -124,7 +109,7 @@
124 109
			<!--相关文章-->
125 110
			<div class="mui-input-group mainbox displayNone">
126 111
				<div class="infocontit">相关文章</div>
127
				<div class="infocon madiaBlock">
112
				<div class="infocon infoconM madiaBlock">
128 113
					<ul class="mui-table-view" id="relateArt">
129 114
				    </ul>
130 115
				</div>
@ -132,7 +117,7 @@
132 117
			<!--您可能感兴趣的qiye-->
133 118
			<div class="mui-input-group mainbox displayNone">
134 119
				<div class="infocontit">您可能感兴趣的企业</div>
135
				<div class="infocon madiaBlock">
120
				<div class="infocon infoconM madiaBlock">
136 121
					<ul class="mui-table-view" id="likePro">
137 122
				    </ul>
138 123
				</div>

+ 6 - 0
app/html/patentShow.html

@ -69,6 +69,12 @@
69 69
							<div class="showTit">摘要:</div>
70 70
							<div class="showCon" id="patentAbstract">
71 71
								
72
							</div>
73
						</li>
74
						<li>
75
							<div class="showTit">合作备注:</div>
76
							<div class="showCon" id="patentRemarks">
77
								
72 78
							</div>
73 79
						</li>
74 80
					</ul>

+ 6 - 0
app/html/professorArticle.html

@ -85,6 +85,12 @@
85 85
					       
86 86
					    </ul>
87 87
					</div>
88
					<div class="madiaBlock displayNone" id="correlationService">
89
						<div class="madiaTit">相关服务</div>
90
						<ul class="mui-table-view" id="serviceList">
91
					       
92
					    </ul>
93
					</div>
88 94
					<div class="madiaBlock displayNone" id="resource">
89 95
						<div class="madiaTit">相关资源</div>
90 96
						<ul class="mui-table-view" id="resourceList">

+ 30 - 26
app/html/qa-request-da.html

@ -11,6 +11,9 @@
11 11
		<link href="../css/iconfont.css" rel="stylesheet" />
12 12
		<link href="../css/app.css" rel="stylesheet" />
13 13
		<script src="../js/public/jquery-1.11.1.js"></script>
14
		<style type="text/css">
15
			.mui-scroll-wrapper{top:45px}
16
		</style>
14 17
	</head>
15 18
16 19
	<body>
@ -22,37 +25,38 @@
22 25
				</form>
23 26
			</div>
24 27
		</header>
25
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
26
			<div class="mui-scroll">
27
				<ul class="mui-table-view madiaBlock request-qa" id="questList">
28
					<li class="mui-table-view-cell">
29
			            <div class="flexCenter flex-pright">
30
			                <div class="madiaHead useHead"></div>
31
							<div class="madiaInfo">
32
								<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
33
								<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
34
								<p class="mui-ellipsis h3Font">研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;</p>
35
							</div>
36
			            </div>
37
			            <span class="yaoqing">邀请</span>
38
			        </li>
39
					<!--<li class="mui-table-view-cell">
40
			            <div class="flexCenter flex-pright">
41
			                <div class="madiaHead useHead"></div>
42
							<div class="madiaInfo">
43
								<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
44
								<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
45
								<p class="mui-ellipsis h3Font">研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;</p>
46
							</div>
47
			            </div>
48
			            <span class="yaoqing yiyaoqing">已邀请</span>
49
			        </li>-->
50
				</ul>
28
		<div class="mui-content">
29
			<div class="mui-scroll-wrapper" id="pullrefresh1">
30
				<div class="mui-scroll">
31
					<ul class="mui-table-view madiaBlock request-qa" id="questList">
32
						<!--<li class="mui-table-view-cell">
33
				            <div class="flexCenter flex-pright">
34
				                <div class="madiaHead useHead"></div>
35
								<div class="madiaInfo">
36
									<p><span class="h1Font">张某某</span><em class="authicon authicon-pro" title="科袖认证专家"></em></p>
37
									<p class="mui-ellipsis h2Font">职称/职位,所在机构</p>
38
									<p class="mui-ellipsis h3Font">研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;研究方向;</p>
39
								</div>
40
				            </div>
41
				            <span class="yaoqing yiyaoqing">已邀请</span>
42
				        </li>-->
43
					</ul>
44
				</div>
45
			</div>
46
			<div class="mui-scroll-wrapper displayNone" id="pullrefresh2">
47
				<div class="mui-scroll">
48
					<ul class="mui-table-view madiaBlock request-qa" id="questListSearch">
49
						
50
					</ul>
51
				</div>
51 52
			</div>
52 53
		</div>
54
		
53 55
54 56
		<script src="../js/public/mui.min.js"></script>
55 57
		<script src="../js/public/base.js"></script>
58
		<script src="../js/public/mui.pullToRefresh.js"></script>
59
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
56 60
		<script src="../js/qa-request-da.js"></script>
57 61
	</body>
58 62

+ 7 - 0
app/html/resourceShow.html

@ -9,6 +9,7 @@
9 9
		<link href="../css/previewImage.css" rel="stylesheet" type="text/css" />
10 10
		<link href="../css/iconfont.css" rel="stylesheet" />
11 11
		<link href="../css/app.css" rel="stylesheet" />
12
		<script src="../js/public/jquery-1.11.1.js"></script>
12 13
		<style>
13 14
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;background: #FFFFFF;}
14 15
			.mui-content{height:100%;overflow: auto;background: #FFFFFF;}
@ -97,6 +98,12 @@
97 98
						<span class="h2Font"></span>
98 99
					</li>-->
99 100
				</ul>
101
				<div class="madiaBlock displayNone">
102
					<div class="madiaTit">相关服务</div>
103
					<ul class="mui-table-view" id="likeService">
104
				        
105
				    </ul>
106
				</div>
100 107
				<div class="madiaBlock displayNone">
101 108
					<div class="madiaTit">相关文章</div>
102 109
					<ul class="mui-table-view" id="likeArtical">

+ 40 - 0
app/html/updateBasic-birthday.html

@ -0,0 +1,40 @@
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/iconfont.css" rel="stylesheet" />
11
		<link href="../css/app.css" rel="stylesheet" />
12
		<style>
13
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;}
14
			.mui-content{height:100%;overflow: auto;}
15
		</style>
16
	</head>
17
18
	<body>
19
		<header class="mui-bar mui-bar-nav toptitbox">
20
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
21
		    <h1 class="mui-title toptit">出生日期</h1>
22
		</header>
23
		<div class="mui-content">
24
 		    <div class="mui-input-group mainbox">
25
	 		    <div class="infocontit infocontitM OnetitM mui-navigate-right mui-clearfix" data-options='{"type":"date","beginYear":1900}' id="showDatePicker">
26
					<span class="mui-pull-left">日期</span>
27
				    <span class="rightword" id="dateResult"></span>
28
				</div>
29
			</div>
30
			<div class="mui-content-padded frmboxNew">
31
				<button id="login" class="mui-btn mui-btn-block frmbtn frmactive">保存</button>
32
			</div>
33
		</div>
34
		<script src="../js/public/mui.min.js"></script>
35
		<script src="../js/public/mui.picker.min.js"></script>
36
		<script src="../js/public/base.js"></script>
37
		<script src="../js/updateBasic-birthday.js"></script>
38
	</body>
39
40
</html>

+ 45 - 0
app/html/updateBasic-sex.html

@ -0,0 +1,45 @@
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/iconfont.css" rel="stylesheet" />
11
		<link href="../css/app.css" rel="stylesheet" />
12
		<style>
13
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;}
14
			.mui-content{height:100%;overflow: auto;}
15
		</style>
16
	</head>
17
18
	<body>
19
		<header class="mui-bar mui-bar-nav toptitbox">
20
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
21
		    <h1 class="mui-title toptit">性别</h1>
22
		</header>
23
		<div class="mui-content">
24
			<ul class="mui-table-view mui-table-view-radio" id="sexRadio">
25
				<li class="mui-table-view-cell" data-val="1">
26
					<a class="mui-navigate-right">
27
28
					</a>
29
				</li>
30
				<li class="mui-table-view-cell" data-val="2">
31
					<a class="mui-navigate-right">
32
33
					</a>
34
				</li>
35
			</ul>
36
			<div class="mui-content-padded frmboxNew">
37
				<button id="login" class="mui-btn mui-btn-block frmbtn frmactive" >保存</button>
38
			</div>
39
		</div>
40
		<script src="../js/public/mui.min.js"></script>
41
		<script src="../js/public/base.js"></script>
42
		<script src="../js/updateBasic-sex.js"></script>
43
	</body>
44
45
</html>

+ 24 - 1
app/html/updateBasic.html

@ -11,6 +11,7 @@
11 11
		<style>
12 12
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;}
13 13
			.mui-content{height:100%;overflow: auto;}
14
			.mui-table-view{margin-bottom:10px;}
14 15
			.mui-table-view-cell.mui-active{background: none;}
15 16
			.mui-table-view-cell>a:not(.mui-btn).mui-active{background: none;}
16 17
			.dangle{
@ -27,7 +28,7 @@
27 28
		    <h1 class="mui-title toptit">修改基本信息</h1>
28 29
		</header>
29 30
		<div class="mui-content">
30
			<div class="mui-input-group marginbox setblock">
31
			<div class="marginbox setblock">
31 32
				<ul class="mui-table-view">
32 33
				    <li class="mui-table-view-cell" style="line-height: 42px;">
33 34
				        	<span class="mui-pull-left">头像</span>
@ -35,6 +36,8 @@
35 36
				        		<div class="useHead" id="userimg" flag="0" headFlag="0"></div>
36 37
				        	</div>
37 38
				    </li>
39
				</ul>
40
				<ul class="mui-table-view">
38 41
				    <li class="mui-table-view-cell">
39 42
			        	<span class="mui-pull-left exName">姓名</span>
40 43
			        	<div class="mui-pull-right exName"></div>
@ -43,12 +46,30 @@
43 46
				        	<div class="rightword exName" id="name"></div>
44 47
				        </a>
45 48
				    </li>
49
				</ul>
50
				<ul class="mui-table-view">
51
				    <li class="mui-table-view-cell">
52
				        <a class="mui-navigate-right">
53
				        	<span class="mui-pull-left">性别</span>
54
				        	<div class="rightword" id="sex">请选择性别</div>
55
				        </a>
56
				    </li>
57
				    <li class="mui-table-view-cell">
58
				        <a class="mui-navigate-right">
59
				        	<span class="mui-pull-left">出生日期</span>
60
				        	<div class="rightword" id="birthday">请选择出生日期</div>
61
				        </a>
62
				    </li>
63
				</ul>
64
				<ul class="mui-table-view">
46 65
				    <li class="mui-table-view-cell">
47 66
				        <a class="mui-navigate-right">
48 67
				        	<span class="mui-pull-left">职称</span>
49 68
				        	<div class="rightword" id="title">请填写最高职称</div>
50 69
				        </a>
51 70
				    </li>
71
			    </ul>
72
				<ul class="mui-table-view">
52 73
				    <li class="mui-table-view-cell">
53 74
				        <a class="mui-navigate-right">
54 75
				        	<span class="mui-pull-left">所在机构</span>
@ -67,6 +88,8 @@
67 88
				        	<div class="rightword" id="office">请填写当前担任的职位</div>
68 89
				        </a>
69 90
				    </li>
91
			    </ul>
92
				<ul class="mui-table-view">
70 93
				    <li class="mui-table-view-cell">
71 94
				        <a class="mui-navigate-right">
72 95
				        	<span class="mui-pull-left">所在城市</span>

+ 5 - 5
app/html/userInforShow-more.html

@ -20,14 +20,14 @@
20 20
    		<!-- 主界面具体展示内容 -->
21 21
    		<div class="mui-input-group mainbox" id="professorBreifinfo">
22 22
				<div class="infocontit infocontitM" id="detailProfessor">个人简介 </div>
23
				<div class="infocon">
23
				<div class="infocon infoconM ">
24 24
					<span class="breifinfo" id="descp">
25 25
			       		
26 26
				</div>
27 27
			</div>
28 28
		     <div class="mui-input-group mainbox" id="perfessorExperience">
29 29
				   <div class="infocontit infocontitM">项目经历</div>
30
			       <div class="infocon">
30
			       <div class="infocon infoconM ">
31 31
				       <ul class="mui-table-view listitembox" id="projectExperience">
32 32
				           <!--<li class="mui-table-view-cell listitem">
33 33
		                       <div class="h4Tit listtit2">科袖网项目</div>
@ -44,7 +44,7 @@
44 44
		    </div>
45 45
		     <div class="mui-input-group mainbox" id="perfessorhonor">
46 46
				  <div class="infocontit infocontitM">荣誉奖项</div>
47
			       <div class="infocon">
47
			       <div class="infocon infoconM ">
48 48
				       <ul class="mui-table-view listitembox" id="honor">
49 49
				           <!--<li class="mui-table-view-cell listitem">
50 50
		                       <div class="h4Tit listtit2">2008感动中国年度人物</div>
@ -61,7 +61,7 @@
61 61
		    </div>
62 62
		    <div class="mui-input-group mainbox" id="perfessorsoJob">
63 63
				   <div class="infocontit infocontitM">工作经历</div>
64
			       <div class="infocon">
64
			       <div class="infocon infoconM ">
65 65
				       <ul class="mui-table-view listitembox" id="soJob">
66 66
				           <!--<li class="mui-table-view-cell mui-media listitem">
67 67
		                      <div class="h4Tit listtit2">北京科袖科技有限公司</div>
@ -78,7 +78,7 @@
78 78
		    </div>
79 79
		    <div class="mui-input-group mainbox" id="perfessorEducation">
80 80
					<div class="infocontit infocontitM">教育背景</div>
81
			       <div class="infocon">
81
			       <div class="infocon infoconM ">
82 82
				       <ul class="mui-table-view listitembox" id="education">
83 83
				           <!--<li class="mui-table-view-cell mui-media listitem">
84 84
		                       <div class="h4Tit listtit2">曼彻斯特大学</div>

+ 49 - 53
app/html/userInforShow.html

@ -9,6 +9,7 @@
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11 11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12
		<script src="../js/public/jquery-1.11.1.js"></script>
12 13
	</head>
13 14
14 15
	<body>
@ -49,9 +50,9 @@
49 50
					</div>		
50 51
				</div>
51 52
			</div>
52
			<div class="mui-input-group mainbox">
53
			<div class="mui-input-group mainbox displayNone">
53 54
				<div class="infocon madiaBlock needList">
54
					<ul class="mui-table-view" id="bower_u">
55
					<ul class="mui-table-view" id="demandShow">
55 56
						
56 57
						<!--<li class="mui-table-view-cell">
57 58
							<div class="madiaInfo">
@ -66,27 +67,31 @@
66 67
									<span>有效期至 8月17日</span>
67 68
								</div>
68 69
							</div>
69
						</li>
70
						<li class="mui-table-view-cell">-->
71
							<!--<div class="madiaInfo">
72
								<p class="h1Font mui-ellipsis-2">需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问需求主题寻求一名斯特林热机技术顾问</p>
73
								<p class="h2Font mui-ellipsis-5">需求内容:我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进,
74
									想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出产品的三维模型,用于展示以及为后续生产做准备我们是一家医疗器械公司,主要生产健康理疗类的电子产品,目前希望对护膝、护腰类的产品进行改进,
75
									想先找一位有资深设计经验的三维工业设计专家,通过三维建模的方式先设计出</p>
76
								<div class="showli mui-ellipsis">
77
									<span>北京市</span>
78
									<span>预期 1个月内</span>
79
									<span>预算 1万元以内</span>
80
									<span>有效期至 8月17日</span>
81
								</div>
82
							</div>-->
83
						<!--</li>-->
70
						</li>-->
84 71
					</ul>
85 72
				</div>
86 73
			</div>
74
			<div class="mui-input-group mainbox displayNone">
75
				<div class="infocontit">可提供服务</div>
76
				<div class="infocon infoconM madiaBlock">
77
					<ul class="mui-table-view" id="serviceShow">
78
				        
79
				    </ul>
80
				</div>
81
				<div class="seeMore displayNone" id="seeMoreService"><em>查看全部 <span id="serviceNum">0</span>个</em></div>
82
			</div>
83
			<div class="mui-input-group mainbox displayNone">
84
				<div class="infocontit">可共享资源</div>
85
				<div class="infocon infoconM madiaBlock">
86
					<ul class="mui-table-view" id="resourceShow">
87
				        
88
				    </ul>
89
				</div>
90
				<div class="seeMore displayNone" id="seeMoreResource"><em>查看全部 <span id="resourceNum">0</span>个</em></div>
91
			</div>
87 92
			<div class="mui-input-group mainbox" id="detailProfessor">
88 93
				<div class="infocontit mui-navigate-right mui-clearfix">个人介绍 </div>
89
				<div class="infocon">
94
				<div class="infocon infoconM">
90 95
					<span class="breifinfo mui-ellipsis-5" id="descp">
91 96
			       		
92 97
			        </span>
@ -94,7 +99,7 @@
94 99
			</div>
95 100
			<div class="mui-input-group mainbox" id="professorInfosubject">
96 101
				<div class="infocontit">学术领域</div>
97
				<div class="infocon listArea">
102
				<div class="infocon infoconM listArea">
98 103
					<ul id="subjectlist">
99 104
						
100 105
					</ul>
@ -102,67 +107,58 @@
102 107
			</div>
103 108
			<div class="mui-input-group mainbox" id="professorReserachMess">
104 109
				<div class="infocontit">研究方向</div>
105
				<div class="infocon reserachMess">
110
				<div class="infocon infoconM reserachMess">
106 111
107 112
				</div>
108 113
			</div>
109 114
			<div class="mui-input-group mainbox" id="professorinfoapply">
110 115
				<div class="infocontit">行业领域</div>
111
				<div class="infocon listArea">
116
				<div class="infocon infoconM listArea">
112 117
					<ul id="industry1">
113 118
						
114 119
					</ul>
115 120
				</div>
116 121
			</div>
117
			<div class="mui-input-group mainbox">
118
				<div class="infocontit">资源</div>
119
				<div class="infocon madiaBlock">
120
					<ul class="mui-table-view" id="resourceShow">
122
			<div class="mui-input-group mainbox displayNone">
123
				<div class="infocontit">问答</div>
124
				<div class="infocon infoconM madiaBlock needList">
125
					<ul class="mui-table-view" id="QAShow">
121 126
				        
122 127
				    </ul>
123 128
				</div>
124
				<div class="seeMore displayNone" id="seeMoreResource"><em>查看全部<span id="resourceNum">0</span>个</em></div>
129
				<div class="seeMore displayNone" id="seeMoreQA"><em>查看全部 <span id="QANum">0</span>个</em></div>
125 130
			</div>
126
			<div class="mui-input-group mainbox">
127
				<div class="infocontit">专利</div>
128
				<div class="infocon madiaBlock">
129
					<ul class="mui-table-view" id="patent">
130
				       
131
				    </ul>
132
				</div>
133
				<div class="seeMore displayNone" id="seeMorePatent"><em>查看全部<span id="patentNum">0</span>项</em></div>
134
			</div>
135
			<div class="mui-input-group mainbox">
136
				<div class="infocontit">论文</div>
137
				<div class="infocon madiaBlock">
138
					<ul class="mui-table-view" id="paper">
131
			<div class="mui-input-group mainbox displayNone">
132
				<div class="infocontit">文章</div>
133
				<div class="infocon infoconM madiaBlock">
134
					<ul class="mui-table-view" id="articelShow">
139 135
				        
140 136
				    </ul>
141 137
				</div>
142
				<div class="seeMore displayNone" id="seeMorePaper"><em>查看全部<span id="paperNum">0</span>篇</em></div>
138
				<div class="seeMore displayNone" id="seeMoreArtical"><em>查看全部 <span id="articalNum">0</span></em></div>
143 139
			</div>
144
			<div class="mui-input-group mainbox">
145
				<div class="infocontit">文章</div>
146
				<div class="infocon madiaBlock">
147
					<ul class="mui-table-view" id="articelShow">
148
				        
140
			<div class="mui-input-group mainbox displayNone">
141
				<div class="infocontit">专利</div>
142
				<div class="infocon infoconM madiaBlock">
143
					<ul class="mui-table-view" id="patent">
144
				       
149 145
				    </ul>
150 146
				</div>
151
				<div class="seeMore displayNone" id="seeMoreArtical"><em>查看全部<span id="articalNum">0</span></em></div>
147
				<div class="seeMore displayNone" id="seeMorePatent"><em>查看全部 <span id="patentNum">0</span></em></div>
152 148
			</div>
153 149
			<div class="mui-input-group mainbox displayNone">
154
				<div class="infocontit">合作评价</div>
155
				<div class="infocon madiaBlock">
156
					<ul class="mui-table-view commentsArea" id="evaluateShow">
150
				<div class="infocontit">论文</div>
151
				<div class="infocon infoconM madiaBlock">
152
					<ul class="mui-table-view" id="paper">
157 153
				        
158 154
				    </ul>
159 155
				</div>
160
				<div class="seeMore displayNone" id="seeMoreEvaluate"><em>查看全部<span id="evaluateNum">0</span></em></div>
156
				<div class="seeMore displayNone" id="seeMorePaper"><em>查看全部 <span id="paperNum">0</span></em></div>
161 157
			</div>
162 158
			<!--合作专家-->
163 159
			<div class="mui-input-group mainbox displayNone">
164 160
				<div class="infocontit">合作专家</div>
165
				<div class="infocon madiaBlock">
161
				<div class="infocon infoconM madiaBlock">
166 162
					<ul class="mui-table-view" id="relatePro">
167 163
				    </ul>
168 164
				</div>
@ -170,7 +166,7 @@
170 166
			<!--相关文章-->
171 167
			<div class="mui-input-group mainbox displayNone">
172 168
				<div class="infocontit">相关文章</div>
173
				<div class="infocon madiaBlock">
169
				<div class="infocon infoconM madiaBlock">
174 170
					<ul class="mui-table-view" id="relateArt">
175 171
				    </ul>
176 172
				</div>
@ -178,7 +174,7 @@
178 174
			<!--您可能感兴趣的专家-->
179 175
			<div class="mui-input-group mainbox displayNone">
180 176
				<div class="infocontit">您可能感兴趣的专家</div>
181
				<div class="infocon madiaBlock">
177
				<div class="infocon infoconM madiaBlock">
182 178
					<ul class="mui-table-view" id="likePro">
183 179
				    </ul>
184 180
				</div>

+ 1 - 1
app/html/userInforUpdate.html

@ -24,7 +24,7 @@
24 24
    	<div class="mui-content">
25 25
    		<!-- 主界面具体展示内容 -->
26 26
    		<div class="mui-input-group">
27
    			<div class="littip-top">使用电脑登录科袖网 www.ekexiu.com,修改资料更方便<br />还可以在工作台发布您的资源、专利论文和文章</div>
27
    			<div class="littip-top">使用电脑登录科袖网 www.ekexiu.com,修改资料更方便<br />还可以在工作台发布您的服务、资源、文章、专利论文</div>
28 28
    		</div>
29 29
    		<div class="mui-input-group marginbox searchTab">
30 30
    			<div class="infocontit infocontitM OnetitM mui-navigate-right mui-clearfix">

+ 43 - 0
app/html/userQAList.html

@ -0,0 +1,43 @@
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
		<script src="../js/public/jquery-1.11.1.js"></script>
12
	</head>
13

14
	<body>
15
		<div class="maskBlack" id="maskBlack"></div>
16
		<header class="mui-bar mui-bar-nav toptitbox">
17
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
18
			<h1 class="mui-title toptit" id="professorName">他的问答</h1>
19
		</header>
20
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox madiaBlock needList">
23
					<div class="infocon">
24
						<ul class="mui-table-view" id="QAShow">
25
					        
26
					    </ul>
27
					</div>
28
				</div>
29
			</div>
30
		</div>
31
		
32
		<script src="../js/public/mui.min.js"></script>
33
		<script src="../js/public/base.js"></script>
34
		<script src="../js/public/mui.pullToRefresh.js"></script>
35
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
36
		<script src="../js/userQAList.js"></script>
37
		<script type="text/javascript"> 
38
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
39
		    iosheader();
40
		</script>
41
	</body>
42

43
</html>

+ 4 - 3
app/html/useraiticleList.html

@ -8,7 +8,6 @@
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12 11
	</head>
13 12

14 13
	<body>
@ -19,8 +18,8 @@
19 18
		</header>
20 19
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21 20
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox">
23
					<div class="infocon madiaBlock">
21
				<div class="mui-input-group mainbox madiaBlock">
22
					<div class="infocon">
24 23
						<ul class="mui-table-view" id="articelShow">
25 24
					        
26 25
					    </ul>
@ -30,6 +29,8 @@
30 29
		</div>
31 30
		<script src="../js/public/mui.min.js"></script>
32 31
		<script src="../js/public/base.js"></script>
32
		<script src="../js/public/mui.pullToRefresh.js"></script>
33
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
33 34
		<script src="../js/userarticleList.js"></script>
34 35
		<script type="text/javascript"> 
35 36
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题

+ 4 - 3
app/html/userpaperList.html

@ -8,7 +8,6 @@
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12 11
	</head>
13 12

14 13
	<body>
@ -19,8 +18,8 @@
19 18
		</header>
20 19
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21 20
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox">
23
					<div class="infocon madiaBlock">
21
				<div class="mui-input-group mainbox madiaBlock">
22
					<div class="infocon">
24 23
						<ul class="mui-table-view" id="paper">
25 24
					        
26 25
					    </ul>
@ -30,6 +29,8 @@
30 29
		</div>
31 30
		<script src="../js/public/mui.min.js"></script>
32 31
		<script src="../js/public/base.js"></script>
32
		<script src="../js/public/mui.pullToRefresh.js"></script>
33
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
33 34
		<script src="../js/userpaperList.js"></script>
34 35
		<script type="text/javascript"> 
35 36
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题

+ 4 - 3
app/html/userpatentList.html

@ -8,7 +8,6 @@
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12 11
	</head>
13 12

14 13
	<body>
@ -19,8 +18,8 @@
19 18
		</header>
20 19
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21 20
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox">
23
					<div class="infocon madiaBlock">
21
				<div class="mui-input-group mainbox madiaBlock">
22
					<div class="infocon">
24 23
						<ul class="mui-table-view" id="patent">
25 24
					        
26 25
					    </ul>
@ -31,6 +30,8 @@
31 30
		
32 31
		<script src="../js/public/mui.min.js"></script>
33 32
		<script src="../js/public/base.js"></script>
33
		<script src="../js/public/mui.pullToRefresh.js"></script>
34
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
34 35
		<script src="../js/userpatentList.js"></script>
35 36
		<script type="text/javascript"> 
36 37
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题

+ 4 - 3
app/html/userresourceList.html

@ -8,7 +8,6 @@
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12 11
	</head>
13 12

14 13
	<body>
@ -19,8 +18,8 @@
19 18
		</header>
20 19
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21 20
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox">
23
					<div class="infocon madiaBlock">
21
				<div class="mui-input-group mainbox madiaBlock">
22
					<div class="infocon">
24 23
						<ul class="mui-table-view" id="resourceShow">
25 24
					        
26 25
					    </ul>
@ -31,6 +30,8 @@
31 30
		
32 31
		<script src="../js/public/mui.min.js"></script>
33 32
		<script src="../js/public/base.js"></script>
33
		<script src="../js/public/mui.pullToRefresh.js"></script>
34
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
34 35
		<script src="../js/userresourceList.js"></script>
35 36
		<script type="text/javascript"> 
36 37
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题

+ 10 - 8
app/html/userEvaluate.html

@ -8,29 +8,31 @@
8 8
		<link href="../css/mui.min.css" rel="stylesheet" />
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11
		<link rel="stylesheet" type="text/css" href="../css/previewImage.css"/>
12 11
	</head>
13 12

14 13
	<body>
15 14
		<div class="maskBlack" id="maskBlack"></div>
16 15
		<header class="mui-bar mui-bar-nav toptitbox">
17 16
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
18
			<h1 class="mui-title toptit" id="professorName">他的合作评价</h1>
17
			<h1 class="mui-title toptit" id="professorName">他的服务</h1>
19 18
		</header>
20 19
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox">
23
					<div class="infocon madiaBlock">
24
						<ul class="mui-table-view commentsArea" id="evaluateShow">
20
		 	<div class="mui-scroll">
21
				<div class="mui-input-group mainbox madiaBlock">
22
					<div class="infocon">
23
						<ul class="mui-table-view" id="serviceShow">
25 24
					        
26 25
					    </ul>
27 26
					</div>
28 27
				</div>
29
			</div>
28
			</div>
30 29
		</div>
30
		
31 31
		<script src="../js/public/mui.min.js"></script>
32 32
		<script src="../js/public/base.js"></script>
33
		<script src="../js/userEvaluate.js"></script>
33
		<script src="../js/public/mui.pullToRefresh.js"></script>
34
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
35
		<script src="../js/userserviceList.js"></script>
34 36
		<script type="text/javascript"> 
35 37
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
36 38
		    iosheader();

BIN
app/images/default-service.jpg


+ 70 - 13
app/js/articleShow.js

@ -271,6 +271,45 @@ mui.plusReady(function() {
271 271
				'</div>'
272 272
			document.getElementById("resourceList").appendChild(li);
273 273
		},
274
		correlationService: function() {
275
			oArticleModule.oAjaxGet(baseUrl + "/ajax/ware/byArticle",{
276
				"id": oArticleModule.articleId,
277
				"rows":5
278
			}, "get", function(res){
279
				console.log(JSON.stringify(res));
280
				var $data=res
281
				if($data.length == 0) {
282
					return;
283
				}
284
				document.getElementById("correlationService").style.display = "block";
285
				for(var i = 0; i < $data.length; i++) {
286
					var rImg="../images/default-service.jpg"
287
					if($data[i].images) {
288
						var subs = strToAry($data[i].images)
289
						if(subs.length > 0) {
290
							rImg=baseUrl+"/data/ware" + subs[0]
291
						}
292
					}
293
					var li = document.createElement("li");
294
					li.setAttribute("data-id",$data[i].id);
295
					li.className = "mui-table-view-cell";
296
					li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
297
						' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
298
						'<div class="madiaInfo OmadiaInfo">' +
299
						'<p class="mui-ellipsis-2 h1Font">' + $data[i].name + '</p>' +
300
						'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
301
						'</div>' +
302
						'</div>'
303
					document.getElementById("serviceList").appendChild(li);
304
					var $li=$(li)
305
					if($data[i].category==1){
306
						oArticleModule.proSigInfo($data[i].owner,$li)
307
					}else{
308
						oArticleModule.orgSigInfo($data[i].owner,$li)
309
					}
310
				}
311
			});
312
		},
274 313
		correlationArticle: function($data) {
275 314
				if($data.total) {
276 315
					if($data.data.length == 0) {
@ -394,25 +433,35 @@ mui.plusReady(function() {
394 433
			plus.nativeUI.toast("已取消收藏", toastStyle);
395 434
			document.getElementsByClassName("icon-shoucang")[0].classList.remove("icon-yishoucang");
396 435
		},
436
		proSigInfo:function(id,$list){
437
			oArticleModule.oAjaxGet(baseUrl + "/ajax/professor/baseInfo/"+id,{
438
			}, "get", function(data){
439
				var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
440
				$list.find(".ownerName").html(data.data.name)
441
				$list.find(".ownerSty").addClass(userType.sty)
442
			});
443
		},
444
		orgSigInfo:function(id,$list){
445
			oArticleModule.oAjaxGet(baseUrl + "/ajax/org/" + id,{
446
			}, "get", function(data){
447
				var name=data.data.name;
448
				if(data.data.forShort){
449
					name=data.data.forShort
450
				}
451
				$list.find(".ownerName").html(name)
452
				if(data.data.authStatus == 3){
453
					$list.find(".ownerSty").addClass("authicon-com-ok")
454
				}
455
			});
456
		}
397 457
	}
458
	pageViewLog(oArticleModule.articleId, 3)
398 459
	wlog("article", oArticleModule.articleId, "2")
399 460
	/*文章详细内容*/
400 461
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/query", {
401 462
		articleId: oArticleModule.articleId
402 463
	}, "get", oArticleModule.articleMess);
403
	mui.ajax(baseUrl + '/ajax/article/pageViews',{
404
		"type" :  "POST" ,
405
		"dataType" : "json",
406
		"data" :{"articleId":oArticleModule.articleId},
407
		"success" : function(data) {
408
			console.log(data);
409
			if (data.success){
410
			}
411
		},
412
		"error":function(){
413
			
414
		}
415
	});
464
	
416 465
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/find", {pageSize:5}, "get", oArticleModule.correlationArticle);
417 466
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralatePro", {
418 467
		"articleId": oArticleModule.articleId
@ -420,6 +469,7 @@ mui.plusReady(function() {
420 469
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralateRes", {
421 470
		"articleId": oArticleModule.articleId
422 471
	}, "get", oArticleModule.correlationResource);
472
	oArticleModule.correlationService()
423 473
	//相关企业
424 474
	function companylist() {
425 475
		mui.ajax(baseUrl+"/ajax/article/ralateOrg",{
@ -506,6 +556,13 @@ mui.plusReady(function() {
506 556
			resourceId: resouId
507 557
		});
508 558
	})
559
	mui("#serviceList").on('tap', 'li', function() {
560
		var serviceId = this.getAttribute("data-id");
561
		plus.nativeUI.showWaiting();
562
		plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
563
			serviceId: serviceId
564
		});
565
	})
509 566
	mui('#articleList,#newarticleList').on('tap', 'li', function() {
510 567
		var id = this.getAttribute("data-id");
511 568
		plus.nativeUI.showWaiting();

+ 460 - 429
app/js/attentedList.js

@ -1,283 +1,227 @@
1 1
//阻尼系数
2 2
var deceleration = mui.os.ios ? 0.003 : 0.0009;
3 3
mui('.mui-scroll-wrapper').scroll({
4
	bounce: false,
5
	indicators: true, //是否显示滚动条
6
	deceleration: deceleration
4
    bounce: false,
5
    indicators: true, //是否显示滚动条
6
    deceleration: deceleration
7 7
});
8 8

9

10 9
mui.ready(function() {
11 10
	mui.plusReady(function() {
12 11
		var userId = plus.storage.getItem('userid');
13
		var pullRefreshEl,index;
14
		//跳转专家浏览页面
15
		mui("#likeUser").on("tap", "li", function() {
16
			var id = this.getAttribute("data-id");
17
			plus.nativeUI.showWaiting(); //显示原生等待框
18
			plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
19
				proid: id
20
			});
21
		})
22
		mui("#likeRes").on("tap", "li", function() {
23
			var resouId = this.getAttribute("data-id");
24
			plus.nativeUI.showWaiting();
25
			plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
26
				resourceId: resouId
27
			});
28
		})
29
		mui("#likeArt").on("tap", "li", function() {
30
			var id = this.getAttribute("data-id");
31
			plus.nativeUI.showWaiting();
32
			plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
33
				articleId: id
34
			});
35
		})
36
		mui("#likePer").on("tap", "li", function() {
37
			var id = this.getAttribute("data-id");
38
			plus.nativeUI.showWaiting();
39
			plus.webview.create("../html/paperShow.html", 'paperShow.html', {}, {
40
				"paperId": id
41
			});
42
		})
43
		mui("#likePat").on("tap", "li", function() {
44
			var id = this.getAttribute("data-id");
45
			plus.nativeUI.showWaiting();
46
			plus.webview.create("../html/patentShow.html", 'patentShow.html', {}, {
47
				"patentId": id
48
			});
49
		})
50
		mui("#likeCmp").on("tap", "li", function() {
51
			var id = this.getAttribute("data-id");
52
			plus.nativeUI.showWaiting();
53
			plus.webview.create("../html/cmpInforShow.html", 'cmpInforShow.html', {}, {
54
				"cmpId": id
55
			});
56
		})
57
		mui("#likeDemand").on("tap", "li", function() {
58
			var id = this.getAttribute("data-id");
59
			plus.nativeUI.showWaiting();
60
			plus.webview.create("../html/needShow.html", 'needShow.html', {}, {
61
				"demanid": id
62
			});
63
		})
64
		
65
		getWatchCon(1,10,1)
66
		getWatchCon(1,10,2)
67
		getWatchCon(1,10,3)
68
		getWatchCon(1,10,4)
69
		getWatchCon(1,10,5)
70
		getWatchCon(1,10,6)
71
		getWatchCon(1,10,7)
72
		
73
		//左滑及右滑
74
		document.querySelector('#slider').addEventListener('slide', function(event) {
75
			var $this = document.querySelector(".mui-scroll .mui-active");
76
			if($this.innerHTML == "专家") {
77
				getWatchCon(1,10,1)
78
			} else if($this.innerHTML == "资源") {
79
				getWatchCon(1,10,2)
80
			} else if($this.innerHTML == "文章") {
81
				getWatchCon(1,10,3)
82
			} else if($this.innerHTML == "专利") {
83
				getWatchCon(1,10,4)
84
			} else if($this.innerHTML == "论文") {
85
				getWatchCon(1,10,5)
86
			}else if($this.innerHTML == "企业") {
87
				getWatchCon(1,10,6)
88
			}else if($this.innerHTML == "需求") {
89
				getWatchCon(1,10,7)
90
			}
91
		});
92
		//点击
93
		document.querySelector('#slider').addEventListener('tap', function(event) {
94
			var $this = document.querySelector(".mui-scroll .mui-active");
95
			if($this.innerHTML == "专家") {
96
				getWatchCon(1,10,1)
97
			} else if($this.innerHTML == "资源") {
98
				getWatchCon(1,10,2)
99
			} else if($this.innerHTML == "文章") {
100
				getWatchCon(1,10,3)
101
			} else if($this.innerHTML == "专利") {
102
				getWatchCon(1,10,4)
103
			} else if($this.innerHTML == "论文") {
104
				getWatchCon(1,10,5)
105
			}else if($this.innerHTML == "企业") {
106
				getWatchCon(1,10,6)
107
			}else if($this.innerHTML == "需求") {
108
				getWatchCon(1,10,7)
109
			}
110
		});
111

112
		
113
		
114
		function getWatchCon(pageNo,pageSize,num) {
115
			mui.ajax(baseUrl + '/ajax/watch/qaPro', {
116
				data: {
12
		var pullRefreshEl;
13
		var rows =10,
14
			currentIndex,
15
			currentSelf,
16
			watchO={
17
				watchTime:"",
18
				watchObjId:"",
19
			};
20
		var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun) {
21
				mui.ajax(baseUrl+url,{
22
					dataType: 'json',
23
					type: otype,
24
					data: dataS,
25
					traditional: true,
26
					beforeSend: beforeFun,
27
					success: function(res) {
28
						if(res.success) {
29
							oFun(res)
30
						}
31
					},
32
					complete:completeFun
33
		            
34
				});
35
			},	
36
			insertNodata = function (targetE,newStr) {
37
	            var parent = document.getElementById(targetE).parentNode;
38
	            var kong = document.createElement("div");
39
	            kong.className = "con-kong";
40
	            kong.innerHTML ='<div class="picbox picNull"></div>'+
41
				            '<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
42
	            if(newStr){
43
	            	kong.querySelector(".txtbox").innerHTML = newStr;
44
	            }
45
	            if (parent.firstChild.className == "con-kong") {
46
	                return
47
	            } else {
48
	                parent.insertBefore(kong,parent.firstChild);
49
	            }
50
	
51
	        },
52
	        removeNodata = function (targetE) {
53
	            var parent = document.getElementById(targetE).parentNode;
54
	            if (parent.firstChild.className == "con-kong") {
55
	                parent.removeChild(parent.firstChild);
56
	            } else {
57
	                return
58
	            }
59
	        },
60
			collectSorts=function(tabIndex,type){
61
				var aimId="",newStr=""
62
				oAjax("/ajax/watch/proList",{//我关注的列表
117 63
					"professorId": userId,
118
					"watchType": num,
119
					"pageNo": pageNo,
120
					"pageSize": pageSize
121
				},
122
				dataType: 'json', //数据格式类型
123
				type: 'GET', //http请求类型
124
				success: function(data) {
64
					"watchType":type,
65
					"createTime": watchO.watchTime,
66
					"watchObject":watchO.watchObjId,
67
					"rows":rows
68
				}, "GET", function(res){
125 69
					plus.nativeUI.closeWaiting();
126 70
					plus.webview.currentWebview().show("fade-in", 150);
127
					if(data.success && data.data.data != "") {
128
						var datalist = data.data.data;
129
						if(num==1){
130
							detailPro(datalist);
131
						}else if(num==2){
132
							detailRes(datalist);
133
						}else if(num==3){
134
							detailArt(datalist);
135
						}else if(num==4){
136
							detailPat(datalist);
137
						}else if(num==5){
138
							detailPer(datalist);
139
						}else if(num==6){
140
							detailCmp(datalist);
141
						}else if(num==7){
142
							detailDemand(datalist);
143
						}
144
					}else{
145
						if(num==1){
146
							document.getElementById("likePro").nextSibling.classList.remove("displayNone");
147
						}else if(num==2){
148
							document.getElementById("likeRes").nextSibling.classList.remove("displayNone");
149
						}else if(num==3){
150
							document.getElementById("likeArt").nextSibling.classList.remove("displayNone");
151
						}else if(num==4){
152
							document.getElementById("likePat").nextSibling.classList.remove("displayNone");
153
						}else if(num==5){
154
							document.getElementById("likePer").nextSibling.classList.remove("displayNone");
155
						}else if(num==6){
156
							document.getElementById("likeCmp").nextSibling.classList.remove("displayNone");
157
						}else if(num==7){
158
							document.getElementById("likeDemand").nextSibling.classList.remove("displayNone");
71
					var $info = res.data;
72
					var arr=[];
73
					if($info.length > 0) {
74
						$("#"+aimId).show()
75
						watchO.watchTime = $info[$info.length - 1].createTime;
76
						watchO.watchObjId = $info[$info.length - 1].watchObject;
77
						for(var i in $info) {
78
							arr[i]=$info[i].watchObject;
159 79
						}
160 80
					}
161
				},
162
				error: function() {
163
					plus.nativeUI.toast("服务器链接超时", toastStyle); 
164
				}
165
			});
166
		}
167
		
168
		function detailPro(datalist) {
169
			document.getElementById("likeUser").innerHTML="";
170
			//console.log(JSON.stringify(datalist))	
171
			for(var i = 0; i < datalist.length; i++) {
172
				var li = document.createElement("li");
173
				var userType = autho(datalist[i].professor.authType, datalist[i].professor.orgAuth, datalist[i].professor.authStatus);
174
				var os = "";
175
				if(datalist[i].professor.title) {
176
					if(datalist[i].professor.orgName) {
177
						os = datalist[i].professor.title + "," + datalist[i].professor.orgName;
178
					} else {
179
						os = datalist[i].professor.title;
81
					if(type==1){
82
	                	aimId="likeUser"
83
	                	newStr="您还未关注任何专家"
84
	                	detailPro(arr,aimId);
85
	                }else if(type==2){
86
	                	aimId="likeRes"
87
	                	newStr="您还未收藏任何资源"
88
	                	detailRes(arr,aimId);
89
					}else if(type==3){
90
						aimId="likeArt"
91
						newStr="您还未收藏任何文章"
92
						detailArt(arr,aimId);
93
					}else if(type==4){
94
						aimId="likePat"
95
						newStr="您还未收藏任何专利"
96
						detailPat(arr,aimId);
97
					}else if(type==5){
98
						aimId="likePer"
99
						newStr="您还未收藏任何论文"
100
						detailPer(arr,aimId);
101
					}else if(type==6){
102
						aimId="likeCmp"
103
						newStr="您还未关注任何企业"
104
						detailCmp(arr,aimId);
105
					}else if(type==7){
106
						aimId="likeDemand"
107
						newStr="您还未收藏任何需求"
108
						detailDemand(arr,aimId);
109
					}else if(type==10){
110
						aimId="likeSer"
111
						newStr="您还未收藏任何服务"
112
						detailService(arr,aimId);
180 113
					}
181
				} else {
182
					if(datalist[i].professor.office) {
183
						if(datalist[i].professor.orgName) {
184
							os = datalist[i].professor.office + "," + datalist[i].professor.orgName;
114
					if (currentIndex != tabIndex) {
115
		                currentIndex = tabIndex;
116
		                mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function ($_index, pullRefreshEl) {
117
		                    if ($_index == tabIndex) {
118
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
119
		                            up: {
120
		                                callback: function () {
121
		                                	if(currentSelf.loading){
122
			                                    setTimeout(function () {
123
			                                         collectSorts(tabIndex,type)
124
			                                         currentSelf.endPullUpToRefresh();
125
			                                    }, 1000);
126
		                                    }
127
		                                }
128
		                            }
129
		                        });
130
		                    }
131
		                })
132
		            }
133
					var liLen=document.getElementById(aimId).querySelectorAll("li").length;
134
	                removeNodata(aimId);
135
	                if($info.length == 0 && liLen == 0 ){
136
	                	$("#"+aimId).hide()
137
	                    insertNodata(aimId,newStr);
138
	                }
139
					if ($info.length < rows) {
140
                        currentSelf.endPullUpToRefresh(true);
141
                    }else {
142
                        currentSelf.endPullUpToRefresh(false);
143
                    }
144
				})
145
			},
146
			detailPro=function(arr,obj) {
147
				oAjax("/ajax/professor/qm",{
148
					id:arr,
149
				},"get",function(data){
150
					var dataStr=data.data;
151
					for(var i = 0; i < dataStr.length; i++) {
152
						var userType = autho(dataStr[i].authType, dataStr[i].orgAuth, dataStr[i].authStatus);
153
						var os = "";
154
						if(dataStr[i].title) {
155
							if(dataStr[i].orgName) {
156
								os = dataStr[i].title + "," + dataStr[i].orgName;
157
							} else {
158
								os = dataStr[i].title;
159
							}
185 160
						} else {
186
							os = datalist[i].professor.office;
161
							if(dataStr[i].office) {
162
								if(dataStr[i].orgName) {
163
									os = dataStr[i].office + "," + dataStr[i].orgName;
164
								} else {
165
									os = dataStr[i].office;
166
								}
167
							} else {
168
								if(dataStr[i].orgName) {
169
									os = dataStr[i].orgName;
170
								}
171
							}
187 172
						}
188
					} else {
189
						if(datalist[i].professor.orgName) {
190
							os = datalist[i].professor.orgName;
173
						var baImg = "../images/default-photo.jpg";
174
						if(dataStr[i].hasHeadImage == 1) {
175
							baImg = baseUrl+"/images/head/" + dataStr[i].id + "_l.jpg";
191 176
						}
177
						
178
						var li = document.createElement("li");
179
						li.setAttribute("data-id", dataStr[i].id);
180
						li.setAttribute("data-flag", 1);
181
						li.className = "mui-table-view-cell flexCenter";
182
						li.innerHTML =
183
							' <div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
184
							'<div class="madiaInfo">' +
185
							'<p><span class="h1Font">' + dataStr[i].name + '</span><em class="authicon ' + userType.sty + '"></em></p>' +
186
							'<p class="mui-ellipsis h2Font">' + os + '</p>' +
187
							'</div>'
188
						document.getElementById(obj).appendChild(li);
192 189
					}
193
				}
194
				var baImg = "../images/default-photo.jpg";
195
				if(datalist[i].professor.hasHeadImage == 1) {
196
					baImg = baseUrl + "/images/head/" + datalist[i].professor.id + "_l.jpg";
197
				}
198
				var oSub = "";
199
				if(datalist[i].professor.researchAreas.length) {
200
					var arr = [];
201
					for(var n = 0; n < datalist[i].professor.researchAreas.length; n++) {
202
						arr[n] = datalist[i].professor.researchAreas[n].caption;
203
					}
204
					oSub = "研究方向:" + arr.join(",");
205
				}
206
				li.setAttribute("data-id", datalist[i].professor.id);
207
				li.setAttribute("data-flag", 1);
208
				li.className = "mui-table-view-cell flexCenter";
209
				li.innerHTML =
210
					' <div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
211
					'<div class="madiaInfo">' +
212
					'<p><span class="h1Font">' + datalist[i].professor.name + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>' +
213
					'<p class="mui-ellipsis h2Font">' + os + '</p>' +
214
					'<p class="mui-ellipsis h2Font">' + oSub + '</p>' +
215
					'</div>'
216
				document.getElementById("likeUser").appendChild(li);
217
			}
218
		}
219
		function detailCmp(datalist) {
220
			document.getElementById("likeCmp").innerHTML="";
221
			//console.log(JSON.stringify(datalist))
222
			var arr=[];
223
			for(var i in datalist) {
224
				arr[i]=datalist[i].watchObject;
225
			}
226
			mui.ajax(baseUrl+"/ajax/org/qm",{
227
				data: {
190
				});
191
			},
192
			detailCmp=function(arr,obj) {
193
				oAjax("/ajax/org/qm",{
228 194
					id:arr,
229
				},
230
				dataType: 'json', //数据格式类型
231
				type: 'get', //http请求类型
232
				traditional: true,
233
				success: function(data) {
234
					if(data.success && data.data != "") {
235
						var $data=data.data;
236
						for(var i = 0; i < $data.length; i++) {
237
							var li = document.createElement("li");
238
							li.setAttribute("data-id", $data[i].id);
239
							var oimg = ($data[i].hasOrgLogo) ? baseUrl + "/images/org/" + $data[i].id + ".jpg" : "../images/default-icon.jpg";
240
							var oAuth = ($data[i].authStatus == 3) ? 'authicon-com-ok' : '';
241
							var orgName = ($data[i].forShort) ? $data[i].forShort : $data[i].name;
242
							var orgType = ($data[i].orgType == '2') ? "上市企业" : "";
243
							var orgOther = ($data[i].industry) ? $data[i].industry.replace(/,/gi, " | ") : "";
244
							li.className = "mui-table-view-cell flexCenter OflexCenter";
245
							li.innerHTML = 
246
								'<div class="madiaHead companyHead">' +
247
								'<div class="boxBlock"><img class="boxBlockimg companyImg" src="' + oimg + '"></div>' +
248
								'</div>' +
249
								'<div class="madiaInfo OmadiaInfo">' +
250
								'<p class="mui-ellipsis h1Font">' + orgName + '<em class="authicon ' + oAuth + '" title="科袖认证企业"></em></p>' +
251
								'<p class="mui-ellipsis h2Font"><span id="">' + orgType + '</span> <span id="">' + orgOther + '</span></p>' +
252
								'</div>'
253
							document.getElementById("likeCmp").appendChild(li);
254
						}
195
				},"get",function(data){
196
					var dataStr=data.data;
197
					for(var i = 0; i < dataStr.length; i++) {
198
						var li = document.createElement("li");
199
						li.setAttribute("data-id", dataStr[i].id);
200
						var oimg = (dataStr[i].hasOrgLogo) ?baseUrl+"/images/org/" + dataStr[i].id + ".jpg" : "../images/default-icon.jpg";
201
						var oAuth = (dataStr[i].authStatus == 3) ? 'authicon-com-ok' : '';
202
						var orgName = (dataStr[i].forShort) ? dataStr[i].forShort : dataStr[i].name;
203
						var orgType = (dataStr[i].orgType == '2') ? "上市企业" : "";
204
						var orgOther = (dataStr[i].industry) ? dataStr[i].industry.replace(/,/gi, " | ") : "";
205
						li.className = "mui-table-view-cell flexCenter OflexCenter";
206
						li.innerHTML = 
207
								'<div class="madiaHead companyHead">' +
208
							'<div class="boxBlock"><img class="boxBlockimg companyImg" src="' + oimg + '"></div>' +
209
							'</div>' +
210
							'<div class="madiaInfo OmadiaInfo">' +
211
							'<p class="mui-ellipsis h1Font">' + orgName + '<em class="authicon ' + oAuth + '" title="科袖认证企业"></em></p>' +
212
							'<p class="mui-ellipsis h2Font"><span id="">' + orgType + '</span> <span id="">' + orgOther + '</span></p>' +
213
							'</div>'
214
						document.getElementById(obj).appendChild(li);
255 215
					}
256
				},
257
				error:  function() {
258
					plus.nativeUI.toast("服务器链接超时", toastStyle); 
259
				}
260
			});
261
		}
262
		function detailPat(datalist) {
263
			document.getElementById("likePat").innerHTML="";
264
			//console.log(JSON.stringify(datalist))
265
			var arr=[];
266
			for(var i in datalist) {
267
				arr[i]=datalist[i].watchObject;
268
			}
269
			mui.ajax(baseUrl+"/ajax/ppatent/qm",{
270
				data: {
216
				});
217
			},
218
			detailPat=function(arr,obj) {
219
				oAjax("/ajax/ppatent/qm",{
271 220
					id:arr,
272
				},
273
				dataType: 'json', //数据格式类型
274
				type: 'get', //http请求类型
275
				traditional: true,
276
				success: function(data) {
277
					if(data.success && data.data != "") {
278
						var $data=data.data;
279
						for(var i = 0; i < $data.length; i++) {
280
							var li = document.createElement("li");
221
				},"get",function(data){
222
					var $data=data.data;
223
					for(var i = 0; i < $data.length; i++) {
224
						var li = document.createElement("li");
281 225
							li.setAttribute("data-id", $data[i].id);
282 226
							li.className = "mui-table-view-cell flexCenter OflexCenter";
283 227
							li.innerHTML = 
@ -286,186 +230,273 @@ mui.ready(function() {
286 230
								'<p class="mui-ellipsis-2 h1Font">' + $data[i].name + '</p>' +
287 231
								'<p class="mui-ellipsis h2Font">' + $data[i].authors.substring(0, $data[i].authors.length - 1) + '</p>' +
288 232
								'</div>'
289
							document.getElementById("likePat").appendChild(li);
290
						}
233
						document.getElementById(obj).appendChild(li);
291 234
					}
292
				},
293
				error:  function() {
294
					plus.nativeUI.toast("服务器链接超时", toastStyle); 
295
				}
296
			});
297
		}
298
		function detailPer(datalist) {
299
			document.getElementById("likePer").innerHTML="";
300
			//console.log(JSON.stringify(datalist))
301
			var arr=[];
302
			for(var i in datalist) {
303
				arr[i]=datalist[i].watchObject;
304
			}
305
			mui.ajax(baseUrl+"/ajax/ppaper/qm",{
306
				data: {
235
				});
236
			},
237
			detailPer=function(arr,obj) {
238
				oAjax("/ajax/ppaper/qm",{
307 239
					id:arr,
308
				},
309
				dataType: 'json', //数据格式类型
310
				type: 'get', //http请求类型
311
				traditional: true,
312
				success: function(data) {
313
					if(data.success && data.data != "") {
314
						var $data=data.data;
315
						for(var i = 0; i < $data.length; i++) {
316
							var li = document.createElement("li");
317
							li.setAttribute("data-id", $data[i].id);
318
							li.className = "mui-table-view-cell flexCenter OflexCenter";
319
							li.innerHTML = 
320
								'<div class="madiaHead paperHead"></div>' +
321
								'<div class="madiaInfo OmadiaInfo">' +
322
								'<p class="mui-ellipsis-2 h1Font">' + $data[i].name + '</p>' +
323
								'<p class="mui-ellipsis h2Font">' + $data[i].authors.substring(0, $data[i].authors.length - 1) + '</p>' +
324
								'</div>'
325
							document.getElementById("likePer").appendChild(li);
326
						}
327
					}
328
				},
329
				error:  function() {
330
					plus.nativeUI.toast("服务器链接超时", toastStyle); 
331
				}
332
			});
333
		}
334
		function detailRes(datalist) {
335
			document.getElementById("likeRes").innerHTML="";
336
			//console.log(JSON.stringify(datalist))
337
			for(var i = 0; i < datalist.length; i++) {
338
				var $data = datalist[i].resource;
339
				var namepo, userType;
340
				if($data.resourceType == 1) {
341
					namepo = $data.editProfessor.name;
342
					userType = autho($data.editProfessor.authType, $data.editProfessor.orgAuth, $data.editProfessor.authStatus);
343
				} else {
344
					userType = {};
345
					if($data.organization.forShort){
346
						namepo = $data.organization.forShort;
347
					}else{
348
						namepo = $data.organization.name;
240
				},"get",function(data){
241
					var $data=data.data;
242
					for(var i = 0; i < $data.length; i++) {
243
						var li = document.createElement("li");
244
						li.setAttribute("data-id", $data[i].id);
245
						li.className = "mui-table-view-cell flexCenter OflexCenter";
246
						li.innerHTML = 
247
							'<div class="madiaHead paperHead"></div>' +
248
							'<div class="madiaInfo OmadiaInfo">' +
249
							'<p class="mui-ellipsis-2 h1Font">' + $data[i].name + '</p>' +
250
							'<p class="mui-ellipsis h2Font">' + $data[i].authors.substring(0, $data[i].authors.length - 1) + '</p>' +
251
							'</div>'
252
						document.getElementById(obj).appendChild(li);
349 253
					}
350
					
351
					if($data.organization.authStatus == 3) {
352
						userType.sty = "authicon-com-ok"
353
					} else {
354
						userType.sty = "e"
254
				});
255
			},
256
			detailRes=function(arr,obj) {
257
				oAjax("/ajax/resource/qm",{
258
					id:arr,
259
				},"get",function(data){
260
					var dataItem=data.data;
261
					for(var i = 0; i < dataItem.length; i++) {
262
						var dataStr=dataItem[i]
263
						var rImg = "../images/default-resource.jpg";
264
						if(dataStr.images.length) {
265
							rImg = baseUrl+"/data/resource/" + dataStr.images[0].imageSrc;
266
						}
267
						var li = document.createElement("li");
268
						li.setAttribute("data-id", dataStr.resourceId);
269
						li.setAttribute("data-flag", 2);
270
						li.className = "mui-table-view-cell flexCenter OflexCenter";
271
						li.innerHTML =
272
							' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
273
							'<div class="madiaInfo OmadiaInfo">' +
274
							'<p class="mui-ellipsis h1Font">' + dataStr.resourceName + '</p>' +
275
							'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
276
							'<p class="mui-ellipsis h2Font">用途:' + dataStr.supportedServices + '</p>' +
277
							'</div>'
278
						var $itemlist = $(li);
279
						document.getElementById(obj).appendChild(li);
280
						if(dataStr.resourceType=="1"){
281
							proSigInfo(dataStr.professorId,$itemlist)
282
						}else if(dataStr.resourceType=="2"){
283
							orgSigInfo(dataStr.orgId,$itemlist)
284
						}
355 285
					}
356
				}
357
				var rImg = "../images/default-resource.jpg";
358
				if($data.images.length) {
359
					rImg = baseUrl + "/data/resource/" + $data.images[0].imageSrc;
360
				}
361
				var li = document.createElement("li");
362
				li.setAttribute("data-id", $data.resourceId);
363
				li.setAttribute("data-flag", 2);
364
				li.className = "mui-table-view-cell flexCenter OflexCenter";
365
				li.innerHTML =
366
					' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
367
					'<div class="madiaInfo OmadiaInfo">' +
368
					'<p class="mui-ellipsis h1Font">' + $data.resourceName + '</p>' +
369
					'<p><span class="h2Font">' + namepo + '</span><em class="authicon ' + userType.sty + '" title="科袖认证专家"></em></p>' +
370
					'<p class="mui-ellipsis-2 h2Font">用途:' + $data.supportedServices + '</p>' +
371
					'</div>'
372
				document.getElementById("likeRes").appendChild(li);
373
			}
374
		}
375
		function detailArt(datalist) {
376
			document.getElementById("likeArt").innerHTML="";
377
			//console.log(JSON.stringify(datalist))
378
			for(var i = 0; i < datalist.length; i++) {
379
				var dataItem = datalist[i].article;
380
				var of ;
381
				if(dataItem.articleType == 1) { of = 1;
382
				} else { of = 2;
383
				}
384
				var arImg = "../images/default-artical.jpg";
385
				if(dataItem.articleImg) {
386
					arImg = baseUrl + "/data/article/" + dataItem.articleImg
387
				}
388
				var title = dataItem.articleTitle;
389
				var name = ""
390
				var li = document.createElement("li");
391
				if( of == 1) {
392
					var userType = autho(dataItem.professor.authType, dataItem.professor.orgAuth, dataItem.professor.authStatus);
393
					li.setAttribute("owner-id", dataItem.professor.id);
394
					li.setAttribute("data-type", 1);
395
					name = dataItem.professor.name;
396
				} else {
397
					var userType = {};
398
					if(dataItem.organization.authStatus == 3) {
399
						userType.sty = 'authicon-com-ok'
400
					} else {
401
						userType.sty = "e"
286
				});
287
			},
288
			detailArt=function (arr,obj) {
289
				oAjax("/ajax/article/qm",{
290
					id:arr,
291
				},"get",function(data){
292
					var dataStr=data.data;
293
					for(var i = 0; i < dataStr.length; i++) {
294
						var dataItem=dataStr[i]
295
						var arImg = "../images/default-artical.jpg";
296
						if(dataItem.articleImg) {
297
							arImg =baseUrl+"/data/article/" + dataItem.articleImg
298
						}
299
						var li = document.createElement("li");
300
						li.setAttribute("data-id", dataItem.articleId);
301
						li.setAttribute("data-flag", 3);
302
						li.className = "mui-table-view-cell flexCenter OflexCenter";
303
						li.innerHTML = 
304
							'<div class="madiaHead artHead" style="background-image:url(' + arImg + ')"></div>' +
305
							'<div class="madiaInfo OmadiaInfo">' +
306
							'<p class="mui-ellipsis-2 h1Font">' + dataItem.articleTitle + '</p>' +
307
							'<p><span class="h2Font ownerName" style="margin-right:10px"></span><span class="time">'+commenTime(dataItem.publishTime)+'</span></p>'+
308
							'</div>'
309
						var $itemlist = $(li);
310
						document.getElementById(obj).appendChild(li);
311
						if(dataItem.articleType=="1"){
312
							proSigInfo(dataItem.professorId,$itemlist)
313
						}else if(dataItem.articleType=="2"){
314
							orgSigInfo(dataItem.orgId,$itemlist)
315
						}
402 316
					}
403
					li.setAttribute("owner-id", dataItem.organization.id);
404
					li.setAttribute("data-type", 2);
405
					if(dataItem.organization.forShort){
406
						name = dataItem.organization.forShort;
407
					}else{
408
						name = dataItem.organization.name;
317
				});
318
			},
319
			detailDemand=function(arr,obj) {
320
				oAjax("/ajax/demand/qm",{
321
					id:arr,
322
				},"get",function(data){
323
					var $data=data.data;
324
					for(var i = 0; i < $data.length; i++) {
325
						var li = document.createElement("li");
326
						li.setAttribute("data-id",$data[i].id);
327
						li.className = "mui-table-view-cell flexCenter OflexCenter";
328
						var strCon='';
329
						strCon+='<div class="madiaInfo">'
330
						strCon+='<p class="h1Font mui-ellipsis-2">'+ $data[i].title +'</p>'
331
						strCon+='<div class="showli mui-ellipsis">'
332
						
333
						if($data[i].city){ strCon+='<span>'+$data[i].city+'</span>' }
334
						if($data[i].duration!=0){ strCon+='<span>预期 '+demandDuration[$data[i].duration]+'</span>' }
335
						if($data[i].cost!=0){ strCon+='<span>预算 '+demandCost[$data[i].cost]+'</span>' }
336
						if($data[i].invalidDay){ strCon+='<span>有效期至 '+TimeTr($data[i].invalidDay)+'</span>' }
337
						
338
						strCon+='</div></div>'
339
						
340
						li.innerHTML = strCon
341
						document.getElementById(obj).appendChild(li);
409 342
					}
410 343
					
411
				}
412
				li.setAttribute("data-id", dataItem.articleId);
413
				li.setAttribute("data-flag", 3);
414
				li.className = "mui-table-view-cell flexCenter OflexCenter";
415
				li.innerHTML = 
416
					'<div class="madiaHead artHead" style="background-image:url(' + arImg + ')"></div>' +
417
					'<div class="madiaInfo OmadiaInfo">' +
418
					'<p class="mui-ellipsis-2 h1Font">' + title + '</p>' +
419
					'<p><span class="h2Font" style="margin-right:10px">'+name+'</span><span class="time">'+commenTime(dataItem.publishTime)+'</span></p>'+
420
					'</div>'
421
				document.getElementById("likeArt").appendChild(li);
422

423
			}
424
		}
425
		
426
		function detailDemand(datalist) {
427
			document.getElementById("likeDemand").innerHTML="";
428
			var arr=[];
429
			for(var i in datalist) {
430
				arr[i]=datalist[i].watchObject;
344
				});
431 345
			}
432
			mui.ajax(baseUrl+"/ajax/demand/qm",{
433
				data: {
346
			detailService=function(arr,obj) {
347
				oAjax("/ajax/ware/qm",{
434 348
					id:arr,
435
				},
436
				dataType: 'json', //数据格式类型
437
				type: 'get', //http请求类型
438
				traditional: true,
439
				success: function(data) {
440
					if(data.success && data.data != "") {
441
						var $data=data.data;
442
						for(var i = 0; i < $data.length; i++) {
443
							var li = document.createElement("li");
444
							
445
							li.setAttribute("data-id",$data[i].id);
446
							li.className = "mui-table-view-cell flexCenter OflexCenter";
447
							var strCon='';
448
							strCon+='<div class="madiaInfo">'
449
							strCon+='<p class="h1Font mui-ellipsis-2">'+ $data[i].title +'</p>'
450
							strCon+='<div class="showli mui-ellipsis">'
451
							
452
							if($data[i].city){ strCon+='<span>'+$data[i].city+'</span>' }
453
							if($data[i].duration!=0){ strCon+='<span>预期 '+demandDuration[$data[i].duration]+'</span>' }
454
							if($data[i].cost!=0){ strCon+='<span>预算 '+demandCost[$data[i].cost]+'</span>' }
455
							if($data[i].invalidDay){ strCon+='<span>有效期至 '+TimeTr($data[i].invalidDay)+'</span>' }
456
							
457
							strCon+='</div></div>'
458
							
459
							li.innerHTML = strCon
460
							document.getElementById("likeDemand").appendChild(li);
461
			
349
				},"get",function(data){
350
					console.log(data)
351
					var dataItem=data.data;
352
					for(var i = 0; i < dataItem.length; i++) {
353
						var dataStr=dataItem[i]
354
						var cnt="", rImg = "../images/default-service.jpg";
355
						if(dataStr.images) {
356
							var subs = strToAry(dataStr.images)
357
							if(subs.length > 0) {
358
								rImg=baseUrl+"/data/ware" + subs[0]
359
							}
462 360
						}
361
						if(dataStr.cnt){
362
							cnt="内容:"+dataStr.cnt
363
						}
364
						var li = document.createElement("li");
365
						li.setAttribute("data-id", dataStr.resourceId);
366
						li.setAttribute("data-flag", 2);
367
						li.className = "mui-table-view-cell flexCenter OflexCenter";
368
						li.innerHTML =
369
							' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
370
							'<div class="madiaInfo OmadiaInfo">' +
371
							'<p class="mui-ellipsis h1Font">' + dataStr.name + '</p>' +
372
							'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
373
							'<p class="mui-ellipsis h2Font">'+ cnt+'</p>' +
374
							'</div>'
375
						var $itemlist = $(li);
376
						document.getElementById(obj).appendChild(li);
377
						if(dataStr.category=="1"){
378
							proSigInfo(dataStr.owner,$itemlist)
379
						}else if(dataStr.category=="2"){
380
							orgSigInfo(dataStr.owner,$itemlist)
381
						}
382
						
383
					}
384
				});
385
			},
386
			proSigInfo=function(id,$list){
387
				oAjax("/ajax/professor/baseInfo/"+id,{
388
				}, "get", function(data){
389
					var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
390
					$list.find(".ownerName").html(data.data.name)
391
					$list.find(".ownerSty").addClass(userType.sty)
392
				});
393
			},
394
			orgSigInfo=function(id,$list){
395
				oAjax("/ajax/org/" + id,{
396
				}, "get", function(data){
397
					var name=data.data.name;
398
					if(data.data.forShort){
399
						name=data.data.forShort
463 400
					}
464
				},
465
				error:  function() {
466
					plus.nativeUI.toast("服务器链接超时", toastStyle); 
467
				}
468
			});
469
		}
401
					$list.find(".ownerName").html(name)
402
					if(data.data.authStatus == 3){
403
						$list.find(".ownerSty").addClass("authicon-com-ok")
404
					}
405
				});
406
			},
407
			tabToFun=function($this){
408
				var htm=$this.getAttribute("href")
409
				var type=$this.getAttribute("rel");
410
				var obj = document.querySelectorAll(".mui-scroll .mui-control-item")
411
				var cuIndex=0
412
				for (var i = 0; i<obj.length; i++) {
413
					if (obj[i] == $this) { 
414
						cuIndex = i; 
415
					} 
416
				} 
417
				mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function ($_index, pullRefreshEl) {
418
	                var freshId = pullRefreshEl.getAttribute("data-pullToRefresh");
419
	                if(freshId) {
420
	                    pullRefreshEl.removeAttribute("data-pullToRefresh");
421
	                }
422
	            });
423
				watchO={
424
					watchTime:"",
425
					watchObjId:"",
426
				};
427
				$(htm).find("ul.mui-table-view").html("")
428
				collectSorts(cuIndex,type)
429
			},
430
			bindClickFun=function(){
431
				//左滑及右滑
432
				document.querySelector('#slider').addEventListener('slide', function(event) {
433
					var $this = document.querySelector(".mui-scroll .mui-active")
434
					tabToFun($this)
435
				});
436
				//点击
437
				document.querySelector('#slider').addEventListener('tap', function(event) {
438
					var $this = document.querySelector(".mui-scroll .mui-active")
439
					tabToFun($this)
440
				});
441
				
442
				mui("#likeUser").on("tap", "li", function() {
443
					var id = this.getAttribute("data-id");
444
					plus.nativeUI.showWaiting(); //显示原生等待框
445
					plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
446
						proid: id
447
					});
448
				})
449
				mui("#likeSer").on("tap", "li", function() {
450
					var serviceId = this.getAttribute("data-id");
451
					plus.nativeUI.showWaiting();
452
					plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
453
						serviceId: serviceId
454
					});
455
				})
456
				mui("#likeRes").on("tap", "li", function() {
457
					var resouId = this.getAttribute("data-id");
458
					plus.nativeUI.showWaiting();
459
					plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
460
						resourceId: resouId
461
					});
462
				})
463
				mui("#likeArt").on("tap", "li", function() {
464
					var id = this.getAttribute("data-id");
465
					plus.nativeUI.showWaiting();
466
					plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
467
						articleId: id
468
					});
469
				})
470
				mui("#likePer").on("tap", "li", function() {
471
					var id = this.getAttribute("data-id");
472
					plus.nativeUI.showWaiting();
473
					plus.webview.create("../html/paperShow.html", 'paperShow.html', {}, {
474
						"paperId": id
475
					});
476
				})
477
				mui("#likePat").on("tap", "li", function() {
478
					var id = this.getAttribute("data-id");
479
					plus.nativeUI.showWaiting();
480
					plus.webview.create("../html/patentShow.html", 'patentShow.html', {}, {
481
						"patentId": id
482
					});
483
				})
484
				mui("#likeCmp").on("tap", "li", function() {
485
					var id = this.getAttribute("data-id");
486
					plus.nativeUI.showWaiting();
487
					plus.webview.create("../html/cmpInforShow.html", 'cmpInforShow.html', {}, {
488
						"cmpId": id
489
					});
490
				})
491
				mui("#likeDemand").on("tap", "li", function() {
492
					var id = this.getAttribute("data-id");
493
					plus.nativeUI.showWaiting();
494
					plus.webview.create("../html/needShow.html", 'needShow.html', {}, {
495
						"demanid": id
496
					});
497
				})
498
			}
499
		collectSorts(0,1)
500
		bindClickFun()
470 501
	})
471 502
});

+ 131 - 90
app/js/cmpInforShow-article.js

@ -1,103 +1,144 @@
1
var orgId;
2
mui.init({
3
	pullRefresh: {
4
		container: '#pullrefresh',
5
		up: {
6
			height:50,
7
			contentrefresh: '正在加载...',
8
			callback: pullupRefresh
9
		}
10
	}
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
11 6
});
12
var Num=1;
13
function pullupRefresh() {
14
	setTimeout(function() {
15
		Num++;
16
		getArtice(10,Num);
17
	}, 1000);
18

19
}
20

21
mui.plusReady(function() {
22
    var userid = plus.storage.getItem('userid');
23
	var self = plus.webview.currentWebview();
24
	orgId = self.cmpId;
25
	
26
	mui('#articelShow').on('tap', 'li', function() {
27
		var id = this.getAttribute("data-id");
28
		plus.nativeUI.showWaiting(); //显示原生等待框
29
		plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
30
			articleId: id
31
		});
32
	})
33
	getArtice(10,1)
34
})	
35
		
36
	
37
		
38
function getArtice(pageSize,pageNo) {
7
mui.ready(function() {
39 8
	mui.plusReady(function() {
40
		mui.ajax(baseUrl + "/ajax/article/pqOrgPublish", {
41
			type: "GET",
42
			timeout: 10000,
43
			dataType: "json",
44
			data: {
45
				"orgId": orgId,
46
				"pageSize": pageSize,
47
				"pageNo": pageNo
48
			},
49
			success: function(data) {
50
				console.log(JSON.stringify(data));
51
				plus.nativeUI.closeWaiting();
52
				plus.webview.currentWebview().show("slide-in-right", 150);
53
				if(data.success) {
54
					if(pageNo!=data.data.pageNo) {
55
						data.data.data=[];
9
		var self = plus.webview.currentWebview();
10
		var orgId = self.cmpId;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				artPublishTime: "",
17
				artShareId: "",
18
			}
19
		var oAjax = function(url, dataS, otype, oFun) {
20
				mui.ajax(baseUrl + url, {
21
					dataType: 'json',
22
					type: otype,
23
					data: dataS,
24
					traditional: true,
25
					success: function(res) {
26
						if(res.success) {
27
							oFun(res)
28
						}
56 29
					}
57
					var obj = data.data.data;
58
					if(obj.length>0){
30
				});
31
			},
32
			insertNodata = function(targetE, newStr) {
33
				var parent = document.getElementById(targetE).parentNode;
34
				var kong = document.createElement("div");
35
				kong.className = "con-kong";
36
				kong.innerHTML = '<div class="picbox picNull"></div>' +
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
				if(newStr) {
39
					kong.querySelector(".txtbox").innerHTML = newStr;
40
				}
41
				if(parent.firstChild.className == "con-kong") {
42
					return
43
				} else {
44
					parent.insertBefore(kong, parent.firstChild);
45
				}
46
			},
47
			removeNodata = function (targetE) {
48
	            var parent = document.getElementById(targetE).parentNode;
49
	            if (parent.firstChild.className == "con-kong") {
50
	                parent.removeChild(parent.firstChild);
51
	            } else {
52
	                return
53
	            }
54
	        },
55
			articalListVal = function(tabIndex) {
56
				var aimId = "articelShow",
57
					newStr = "企业尚未发布任何文章"
58
				oAjax("/ajax/article/publish", {
59
					"category": "2",
60
					"owner": orgId,
61
					"publishTime": dataO.artPublishTime,
62
					"shareId": dataO.artShareId,
63
					"rows": rows
64
				}, "get", function(res) {
65
					plus.nativeUI.closeWaiting();
66
					plus.webview.currentWebview().show("slide-in-right", 150);
67
					console.log(JSON.stringify(res))
68
					var obj = res.data;
69
					if(obj.length > 0) {
70
						dataO.artPublishTime = obj[obj.length - 1].publishTime;
71
						dataO.artShareId = obj[obj.length - 1].shareId;
72
						
59 73
						for(var i = 0; i < obj.length; i++) {
60
							var liItem = document.createElement("li");
61
							liItem.setAttribute("data-id",obj[i].articleId);
62
							liItem.setAttribute("owner-id",obj[i].orgId);
63
							liItem.className = "mui-table-view-cell"
64
							var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
74
							var hasImg = "../images/default-artical.jpg"
65 75
							if(obj[i].articleImg) {
66
								oString += '<div class="madiaHead artHead" style="background-image:url(' + baseUrl + '/data/article/' + obj[i].articleImg + ')"></div>'
67
							} else {
68
								oString += '<div class="madiaHead artHead"></div>'
76
								hasImg = baseUrl + "/data/article/" + obj[i].articleImg
69 77
							}
70
							oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>'
71
							oString += '<p class="h2Font mui-ellipsis"><span class="time">'+commenTime(obj[i].publishTime)+'</span></p>'
72
							oString += '</div></div>'
73
							liItem.innerHTML = oString;
74
							document.getElementById("articelShow").appendChild(liItem);
75
						}
76
						if(obj.length<pageSize){ 
77
							mui("#pullrefresh").pullRefresh().endPullupToRefresh(true);
78
							var li = document.createElement("li");
79
							li.setAttribute("data-id", obj[i].articleId);
80
							li.className = "mui-table-view-cell";
81
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
82
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
83
								'<div class="madiaInfo OmadiaInfo">' +
84
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>' +
85
								'<p class="h2Font mui-ellipsis"><span class="time">' + commenTime(obj[i].publishTime) + '</span></p>' +
86
								'</div>' +
87
								'</div>'
88
							document.getElementById(aimId).appendChild(li);
78 89
						}
79 90
					}
80
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
81
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
91
					if (currentIndex != tabIndex) {
92
		                currentIndex = tabIndex;
93
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
94
		                    if ($_index == tabIndex) {
95
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
96
		                            up: {
97
		                                callback: function () {
98
		                                	if(currentSelf.loading){
99
			                                    setTimeout(function () {
100
			                                         articalListVal(tabIndex)
101
			                                         currentSelf.endPullUpToRefresh();
102
			                                    }, 1000);
103
		                                    }
104
		                                }
105
		                            }
106
		                        });
107
		                    }
108
		                })
109
		            }
110
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
111
					removeNodata(aimId);
112
					if(obj.length == 0 && liLen == 0) {
113
						document.getElementById(aimId).style.display="none";
114
						insertNodata(aimId, newStr);
115
					}
116
					if(obj.length < rows) {
117
						currentSelf.endPullUpToRefresh(true);
82 118
					} else {
83
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
119
						currentSelf.endPullUpToRefresh(false);
84 120
					}
85
				}
121
				})
86 122
			},
87
			error: function() {
88
				plus.nativeUI.toast("服务器链接超时", toastStyle);
89
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
90
				return;
123
			bindClikFun=function(){
124
				mui('#articelShow').on('tap', 'li', function() {
125
					var id = this.getAttribute("data-id");
126
					plus.nativeUI.showWaiting();
127
					plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
128
						articleId: id
129
					});
130
				})
131
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
132
					var web = plus.webview.getWebviewById("cmpInforShow.html");
133
					if(web)
134
						mui.fire(web, "newId", {
135
							rd: 1
136
						});
137
				})
91 138
			}
92
		})
139
			
140
		articalListVal(0)
141
		bindClikFun()
142
		
93 143
	})
94
}
95
	
96
document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
97
	var web = plus.webview.getWebviewById("cmpInforShow.html");
98
	if(web)
99
		mui.fire(web, "newId", {
100
			rd: 1
101
		});
102
})
103
		
144
})

+ 135 - 86
app/js/cmpInforShow-resources.js

@ -1,99 +1,148 @@
1
var orgId;
2
mui.init({
3
	pullRefresh: {
4
		container: '#pullrefresh',
5
		up: {
6
			height:50,
7
			contentrefresh: '正在加载...',
8
			callback: pullupRefresh
9
		}
10
	}
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
11 6
});
12
var Num=1;
13
function pullupRefresh() {
14
	setTimeout(function() {
15
		Num++;
16
		getResource(10,Num);
17
	}, 1000);
18

19
}
20

21
mui.plusReady(function() {
22
	var userid = plus.storage.getItem('userid');
23
	var self = plus.webview.currentWebview();
24
	orgId = self.cmpId;
25

26
	getResource(10,1);
27
	
28
	mui('#resourceShow').on('tap', 'li', function() {
29
		var id = this.getAttribute("data-id");
30
		plus.nativeUI.showWaiting(); //显示原生等待框
31
		plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
32
			resourceId: id
33
		});
34
	})
35
})		
36
//获取资源
37
function getResource(pageSize,pageNo) {
7
mui.ready(function() {
38 8
	mui.plusReady(function() {
39
		mui.ajax(baseUrl + "/ajax/resource/pqOrgPublish", {
40
			type: "GET",
41
			timeout: 10000,
42
			dataType: "json",
43
			data: {
44
				"orgId": orgId,
45
				"pageNo": pageNo,
46
				"pageSize": pageSize,
47
			},
48
			success: function(data) {
49
				console.log(JSON.stringify(data))
50
				plus.nativeUI.closeWaiting();
51
				plus.webview.currentWebview().show("slide-in-right", 150);
52
				if(data.success) {
53
					if(pageNo!=data.data.pageNo) {
54
						data.data.data=[];
9
		var self = plus.webview.currentWebview();
10
		var orgId = self.cmpId;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				resPublishTime:"",
17
				resShareId:"",
18
			}
19
		var oAjax = function(url, dataS, otype, oFun) {
20
				mui.ajax(baseUrl + url, {
21
					dataType: 'json',
22
					type: otype,
23
					data: dataS,
24
					traditional: true,
25
					success: function(res) {
26
						if(res.success) {
27
							oFun(res)
28
						}
55 29
					}
56
					var obj = data.data.data;
57
					if(obj.length>0){
30
				});
31
			},
32
			insertNodata = function(targetE, newStr) {
33
				var parent = document.getElementById(targetE).parentNode;
34
				var kong = document.createElement("div");
35
				kong.className = "con-kong";
36
				kong.innerHTML = '<div class="picbox picNull"></div>' +
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
				if(newStr) {
39
					kong.querySelector(".txtbox").innerHTML = newStr;
40
				}
41
				if(parent.firstChild.className == "con-kong") {
42
					return
43
				} else {
44
					parent.insertBefore(kong, parent.firstChild);
45
				}
46
			},
47
			removeNodata = function (targetE) {
48
	            var parent = document.getElementById(targetE).parentNode;
49
	            if (parent.firstChild.className == "con-kong") {
50
	                parent.removeChild(parent.firstChild);
51
	            } else {
52
	                return
53
	            }
54
	        },
55
			resourceListVal = function(tabIndex) {
56
				var aimId = "resourceShow",
57
					newStr = "企业尚未发布任何资源"
58
				oAjax("/ajax/resource/publish",{
59
					"category": "2",
60
					"owner":orgId,
61
					"publishTime":dataO.resPublishTime,
62
					"shareId": dataO.resShareId,
63
					"rows": rows
64
				}, "get", function(res){
65
					plus.nativeUI.closeWaiting();
66
					plus.webview.currentWebview().show("slide-in-right", 150);
67
					console.log(JSON.stringify(res))
68
					var obj = res.data;
69
					if(obj.length > 0) {
70
						dataO.resPublishTime = obj[obj.length - 1].publishTime;
71
						dataO.resShareId = obj[obj.length - 1].shareId;
72
						
58 73
						for(var i = 0; i < obj.length; i++) {
59
							var liItem = document.createElement("li");
60
							liItem.setAttribute("data-id",obj[i].resourceId);
61
							liItem.className = "mui-table-view-cell"
62
							var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
74
							var cnt = "",
75
								hasImg = "../images/default-resource.jpg"
63 76
							if(obj[i].images.length) {
64
								oString += '<div class="madiaHead resouseHead" style="background-image:url(' + baseUrl + '/data/resource/' + obj[i].images[0].imageSrc +')"></div>'
65
							} else {
66
								oString += '<div class="madiaHead resouseHead"></div>'
77
								hasImg = baseUrl + '/data/resource/' + obj[i].images[0].imageSrc
67 78
							}
68
							oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis h1Font">' + obj[i].resourceName + '</p><p class="h2Font mui-ellipsis-2">用途:' + obj[i].supportedServices + '</p>'
69
							oString += '</div></div>'
70
							liItem.innerHTML = oString;
71
							document.getElementById("resourceShow").appendChild(liItem);
72
						}
73
						if(obj.length<pageSize){ 
74
							mui("#pullrefresh").pullRefresh().endPullupToRefresh(true);
79
							if(obj[i].supportedServices) {
80
								cnt = "用途:" + obj[i].supportedServices
81
							}
82
							var li = document.createElement("li");
83
							li.setAttribute("data-id", obj[i].resourceId);
84
							li.className = "mui-table-view-cell";
85
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
86
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
87
								'<div class="madiaInfo OmadiaInfo">' +
88
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].resourceName + '</p>' +
89
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
90
								'</div>' +
91
								'</div>'
92
							document.getElementById(aimId).appendChild(li);
75 93
						}
76 94
					}
77
					
78
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
79
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
95
					if (currentIndex != tabIndex) {
96
		                currentIndex = tabIndex;
97
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
98
		                    if ($_index == tabIndex) {
99
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
100
		                            up: {
101
		                                callback: function () {
102
		                                	if(currentSelf.loading){
103
			                                    setTimeout(function () {
104
			                                         resourceListVal(tabIndex)
105
			                                         currentSelf.endPullUpToRefresh();
106
			                                    }, 1000);
107
		                                    }
108
		                                }
109
		                            }
110
		                        });
111
		                    }
112
		                })
113
		            }
114
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
115
					removeNodata(aimId);
116
					if(obj.length == 0 && liLen == 0) {
117
						document.getElementById(aimId).style.display="none";
118
						insertNodata(aimId, newStr);
119
					}
120
					if(obj.length < rows) {
121
						currentSelf.endPullUpToRefresh(true);
80 122
					} else {
81
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
123
						currentSelf.endPullUpToRefresh(false);
82 124
					}
83
				}
125
				})
84 126
			},
85
			error: function() {
86
				plus.nativeUI.toast("服务器链接超时", toastStyle);
87
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
88
				return;
127
			bindClikFun=function(){
128
				mui('#resourceShow').on('tap', 'li', function() {
129
					var id = this.getAttribute("data-id");
130
					plus.nativeUI.showWaiting();
131
					plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
132
						resourceId: id
133
					});
134
				})
135
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
136
					var web = plus.webview.getWebviewById("cmpInforShow.html");
137
					if(web)
138
						mui.fire(web, "newId", {
139
							rd: 1
140
						});
141
				})
89 142
			}
90
		})
143
			
144
		resourceListVal(0)
145
		bindClikFun()
146
		
91 147
	})
92
}
93
document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
94
	var web = plus.webview.getWebviewById("cmpInforShow.html");
95
	if(web)
96
		mui.fire(web, "newId", {
97
			rd: 1
98
		});
99
});
148
})

+ 149 - 0
app/js/cmpInforShow-service.js

@ -0,0 +1,149 @@
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
6
});
7
mui.ready(function() {
8
	mui.plusReady(function() {
9
		var self = plus.webview.currentWebview();
10
		var orgId = self.cmpId;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				serModifyTime: "",
17
				serId: "",
18
			}
19
		var oAjax = function(url, dataS, otype, oFun) {
20
				mui.ajax(baseUrl + url, {
21
					dataType: 'json',
22
					type: otype,
23
					data: dataS,
24
					traditional: true,
25
					success: function(res) {
26
						if(res.success) {
27
							oFun(res)
28
						}
29
					}
30
				});
31
			},
32
			insertNodata = function(targetE, newStr) {
33
				var parent = document.getElementById(targetE).parentNode;
34
				var kong = document.createElement("div");
35
				kong.className = "con-kong";
36
				kong.innerHTML = '<div class="picbox picNull"></div>' +
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
				if(newStr) {
39
					kong.querySelector(".txtbox").innerHTML = newStr;
40
				}
41
				if(parent.firstChild.className == "con-kong") {
42
					return
43
				} else {
44
					parent.insertBefore(kong, parent.firstChild);
45
				}
46
			},
47
			removeNodata = function (targetE) {
48
	            var parent = document.getElementById(targetE).parentNode;
49
	            if (parent.firstChild.className == "con-kong") {
50
	                parent.removeChild(parent.firstChild);
51
	            } else {
52
	                return
53
	            }
54
	        },
55
			serviceListVal = function(tabIndex) {
56
				var aimId = "serviceShow",
57
					newStr = "企业尚未发布任何服务"
58
				oAjax("/ajax/ware/publish",{
59
					"category":"2",
60
					"owner":orgId,
61
					"modifyTime":dataO.serModifyTime,
62
					"rows": rows
63
				}, "get", function(res){
64
					plus.nativeUI.closeWaiting();
65
					plus.webview.currentWebview().show("slide-in-right", 150);
66
					console.log(JSON.stringify(res))
67
					var obj = res.data;
68
					if(obj.length > 0) {
69
						dataO.serModifyTime = obj[obj.length - 1].modifyTime;
70
						
71
						for(var i = 0; i < obj.length; i++) {
72
							var cnt = "",
73
								hasImg = "../images/default-service.jpg"
74
							if(obj[i].images) {
75
								var subs = strToAry(obj[i].images)
76
								if(subs.length > 0) {
77
									hasImg = baseUrl + "/data/ware" + subs[0]
78
								}
79
							}
80
							if(obj[i].cnt) {
81
								cnt = "内容:" + obj[i].cnt
82
							}
83
							var li = document.createElement("li");
84
							li.setAttribute("data-id", obj[i].id);
85
							li.className = "mui-table-view-cell";
86
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
87
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
88
								'<div class="madiaInfo OmadiaInfo">' +
89
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
90
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
91
								'</div>' +
92
								'</div>'
93
							document.getElementById(aimId).appendChild(li);
94
						}
95
					}
96
					if (currentIndex != tabIndex) {
97
		                currentIndex = tabIndex;
98
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
99
		                    if ($_index == tabIndex) {
100
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
101
		                            up: {
102
		                                callback: function () {
103
		                                	if(currentSelf.loading){
104
			                                    setTimeout(function () {
105
			                                         serviceListVal(tabIndex)
106
			                                         currentSelf.endPullUpToRefresh();
107
			                                    }, 1000);
108
		                                    }
109
		                                }
110
		                            }
111
		                        });
112
		                    }
113
		                })
114
		            }
115
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
116
					removeNodata(aimId);
117
					if(obj.length == 0 && liLen == 0) {
118
						document.getElementById(aimId).style.display="none";
119
						insertNodata(aimId, newStr);
120
					}
121
					if(obj.length < rows) {
122
						currentSelf.endPullUpToRefresh(true);
123
					} else {
124
						currentSelf.endPullUpToRefresh(false);
125
					}
126
				})
127
			},
128
			bindClikFun=function(){
129
				mui('#serviceShow').on('tap', 'li', function() {
130
					var id = this.getAttribute("data-id");
131
					plus.nativeUI.showWaiting();
132
					plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
133
						serviceId: id,
134
					});
135
				})
136
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
137
					var web = plus.webview.getWebviewById("cmpInforShow.html");
138
					if(web)
139
						mui.fire(web, "newId", {
140
							rd: 1
141
						});
142
				})
143
			}
144
			
145
		serviceListVal(0)
146
		bindClikFun()
147
		
148
	})
149
})

+ 409 - 377
app/js/cmpInforShow.js

@ -1,168 +1,289 @@
1

2 1
mui.ready(function() {
3 2
	mui.plusReady(function() {
4
		plus.navigator.setStatusBarBackground( "#28b8fa" );
3
		plus.navigator.setStatusBarBackground("#28b8fa");
5 4
		var userid = plus.storage.getItem('userid');
6 5
		var self = plus.webview.currentWebview();
7 6
		var orgId = self.cmpId;
8
		companyMessage(orgId);
9
		getArticel();
10
		getResource();
11
		relevantarticalList();//相关文章
12
		likeExperts();//感兴趣企业
13
		enterprise();
14
		mui.ajax(baseUrl + '/ajax/org/incPageViews',{
15
			"type": "POST",
16
			"dataType": "json",
17
			"data": {
18
				"id": orgId
19
			},
20
			"success": function(data) {
21
				if(data.success) {}
22
			},
23
			"error": function() {
24
				
25
			}
26
		});
27
		//点击收藏按钮
28
		var oifAttend=document.getElementById("ifAttend")
29
		ifcollectionAbout(orgId,oifAttend,6);
30
		document.getElementById("collectBtn").addEventListener('tap', function() {
31
			if(userid && userid != null && userid != "null") {
32
				if(oifAttend.className=='mui-icon iconfontnew icon-yishoucang'){
33
					cancelCollectionAbout(orgId,oifAttend,6)
34
				} else {
35
					collectionAbout(orgId,oifAttend,6);
36
				}
37
			}else{
38
				isLogin();
39
			}
40
		});
41
		//详细页面
42
		document.getElementById("goCmpBrief").addEventListener("tap", function() {
43
			var nwaiting = plus.nativeUI.showWaiting();
44
			var web = plus.webview.create("../html/cmpInforShow-more.html", "cmpInforShow-more.html", {}, {
45
				cmpId: orgId
46
			}); //后台创建webview并打开show.html   	    	
47
			web.addEventListener("loaded", function() {}, false);
48
		});
49
		//查看更多资源
50
		document.getElementById("seeMoreResource").addEventListener("tap", function() {
51
			var nwaiting = plus.nativeUI.showWaiting();
52
			var web = plus.webview.create("../html/cmpInforShow-resources.html", "cmpInforShow-resources.html", {}, {
53
				cmpId: orgId
54
			}); //后台创建webview并打开show.html   	    	
55
			web.addEventListener("loaded", function() {}, false);
56
		});
57
		//查看更多文章
58
		document.getElementById("seeMoreArtical").addEventListener("tap", function() {
59
			var nwaiting = plus.nativeUI.showWaiting();
60
			var web = plus.webview.create("../html/cmpInforShow-article.html", "cmpInforShow-article.html", {}, {
61
				cmpId: orgId
62
			}); //后台创建webview并打开show.html   	    	
63
			web.addEventListener("loaded", function() {}, false);
64
		});
65
		mui('#articelShow').on('tap', 'li', function() {
66
			var id = this.getAttribute("data-id");
67
			var ownerid = this.getAttribute("owner-id");
68
			plus.nativeUI.showWaiting(); //显示原生等待框
69
			plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
70
				articleId: id,
71
				ownerid:ownerid,
72
				oFlag:1
73
			});
74
		})
75
		mui('#resourceShow').on('tap', 'li', function() {
76
			var id = this.getAttribute("data-id");
77
			plus.nativeUI.showWaiting(); //显示原生等待框
78
			plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
79
				resourceId: id
80
			});
81
		})
82
		mui('#likePro').on('tap', 'li', function() {
83
			var id = this.getAttribute("data-id");
84
			plus.nativeUI.showWaiting(); //显示原生等待框
85
			var webviewShow1=plus.webview.create("../html/cmpInforShow.html", 'cmpInforShow.html', {}, {
86
				cmpId: id
87
			});
88
			webviewShow1.addEventListener("loaded", function() {
89
				setTimeout(function(){plus.webview.currentWebview().close()},1000)
90
				
91
			}, false);
92
		})
93
		mui('#relateArt').on('tap', 'li', function() {
94
			var id = this.getAttribute("data-id");
95
			var ownerid = this.getAttribute("owner-id");
96
			var datatype = this.getAttribute("data-type");
97
			if(datatype == 1) {
98
				plus.nativeUI.showWaiting();
99
				var webviewShow=plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
100
					articleId: id,
101
					ownerid: ownerid,
102
				});
103
			} else if(datatype == 2) {
104
				plus.nativeUI.showWaiting();
105
				var webviewShow=plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
106
					articleId: id,
107
					ownerid: ownerid,
108
					oFlag: 1
7

8
		var rows = 1
9
		var oAjax = function(url, dataS, otype, oFun) {
10
				mui.ajax(baseUrl + url, {
11
					dataType: 'json',
12
					type: otype,
13
					data: dataS,
14
					traditional: true,
15
					success: function(res) {
16
						if(res.success) {
17
							oFun(res)
18
						}
19
					}
109 20
				});
110
			}
111
		})
112
		function enterprise(){
113
		mui.ajax(baseUrl + "/ajax/demand/pq", {
114
			type: "GET",
115
			timeout: 10000,
116
			dataType: "json",
117
			data:{
118
				"state":1,
119
				"oid":orgId
120 21
			},
121
			success: function(data) {
122
				console.log(JSON.stringify(data)); 	
123
				if(data.success){
124
					var obj = data.data.data;
125
					if(obj.length>0){
126
						for(var i=0;i<obj.length;i++){
22
			demandListVal = function() {
23
				var aimId = "demandShow"
24
				oAjax("/ajax/demand/pq", {
25
					"state": '2',
26
					"uid": orgId,
27
					"pageSize": 5
28
				}, "get", function(res) {
29
					console.log(JSON.stringify(res));
30
					var obj = res.data.data;
31
					if(obj.length > 0) {
32
						document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
33
						for(var i = 0; i < obj.length; i++) {
127 34
							var li = document.createElement("li");
128
							li.setAttribute("id",obj[i].id);
129
							var needDate=obj[i].invalidDay;
130
							var lastDate=TimeTr(needDate);
35
							li.setAttribute("data-id", obj[i].id);
36
							var needDate = obj[i].invalidDay;
37
							var lastDate = TimeTr(needDate);
131 38
							li.className = "mui-table-view-cell";
132 39
							var oString = '<div class="madiaInfo">'
133
								oString += '<p class="h1Font mui-ellipsis-2">'+obj[i].title+'</p>';
134
								oString += '<p class="h2Font mui-ellipsis-5">'+obj[i].descp+'</p>'
135
								oString += '<div class="showli mui-ellipsis h3Font">'
136
								oString += '<span>'+obj[i].province+'</span>'
137
								if(obj[i].duration!=0){oString += '<span>预期 '+demandDuration[obj[i].duration]+'</span>'}
138
								if(obj[i].cost!=0){oString += '<span>预算 '+demandCost[obj[i].cost]+'</span>'}
139
								oString += '<span>有效期至'+lastDate+' </span>'
140
							    oString += '</div>'
141
								oString += '</div>'
142
							
143
								li.innerHTML = oString;
144
								document.getElementById("bower_u").appendChild(li);
145
							
40
							oString += '<p class="h1Font mui-ellipsis-2">' + obj[i].title + '</p>';
41
							oString += '<p class="h2Font mui-ellipsis-5">' + obj[i].descp + '</p>'
42
							oString += '<div class="showli mui-ellipsis h3Font">'
43
							oString += '<span>' + obj[i].province + '</span>'
44
							if(obj[i].duration != 0) {
45
								oString += '<span>预期 ' + demandDuration[obj[i].duration] + '</span>'
46
							}
47
							if(obj[i].cost != 0) {
48
								oString += '<span>预算 ' + demandCost[obj[i].cost] + '</span>'
49
							}
50
							oString += '<span>有效期至' + lastDate + ' </span>'
51
							oString += '</div>'
52
							oString += '</div>'
53
							li.innerHTML = oString
54
							document.getElementById(aimId).appendChild(li);
146 55
						}
147
					}else{
148
						document.getElementById("bower_u").parentNode.parentNode.style.display = "none";
149 56
					}
150
				}
57
				})
58
			},
59
			articalListVal = function() {
60
				var aimId = "articelShow"
61
				oAjax("/ajax/article/publish", {
62
					"category": "2",
63
					"owner": orgId,
64
					"rows": rows
65
				}, "get", function(res) {
66
					var obj = res.data;
67
					if(obj.length > 0) {
68
						document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
69

70
						for(var i = 0; i < obj.length; i++) {
71
							var hasImg = "../images/default-artical.jpg"
72
							if(obj[i].articleImg) {
73
								hasImg = baseUrl + "/data/article/" + obj[i].articleImg
74
							}
75
							var li = document.createElement("li");
76
							li.setAttribute("data-id", obj[i].articleId);
77
							li.className = "mui-table-view-cell";
78
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
79
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
80
								'<div class="madiaInfo OmadiaInfo">' +
81
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>' +
82
								'<p class="h2Font mui-ellipsis"><span class="time">' + commenTime(obj[i].publishTime) + '</span></p>' +
83
								'</div>' +
84
								'</div>'
85
							document.getElementById(aimId).appendChild(li);
86
						}
87
					}
88
				})
89
			},
90
			resourceListVal = function() {
91
				var aimId = "resourceShow"
92
				oAjax("/ajax/resource/publish", {
93
					"category": "2",
94
					"owner": orgId,
95
					"rows": rows
96
				}, "get", function(res) {
97
					var obj = res.data;
98
					if(obj.length > 0) {
99
						document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
100
						for(var i = 0; i < obj.length; i++) {
101
							var cnt = "",
102
								hasImg = "../images/default-resource.jpg"
103
							if(obj[i].images.length) {
104
								hasImg = baseUrl + '/data/resource/' + obj[i].images[0].imageSrc
105
							}
106
							if(obj[i].supportedServices) {
107
								cnt = "用途:" + obj[i].supportedServices
108
							}
109
							var li = document.createElement("li");
110
							li.setAttribute("data-id", obj[i].resourceId);
111
							li.className = "mui-table-view-cell";
112
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
113
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
114
								'<div class="madiaInfo OmadiaInfo">' +
115
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].resourceName + '</p>' +
116
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
117
								'</div>' +
118
								'</div>'
119
							document.getElementById(aimId).appendChild(li);
120
						}
121
					}
122
				})
151 123
			},
152
			error: function() {
153
				plus.nativeUI.toast("服务器链接超时", toastStyle);
154
				return;
124
			serviceListVal = function() {
125
				var aimId = "serviceShow"
126
				oAjax("/ajax/ware/publish", {
127
					"category": "2",
128
					"owner": orgId,
129
					"rows": rows
130
				}, "get", function(res) {
131
					var obj = res.data;
132
					if(obj.length > 0) {
133
						document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
134
						for(var i = 0; i < obj.length; i++) {
135
							var cnt = "",
136
								hasImg = "../images/default-service.jpg"
137
							if(obj[i].images) {
138
								var subs = strToAry(obj[i].images)
139
								if(subs.length > 0) {
140
									hasImg = baseUrl + "/data/ware" + subs[0]
141
								}
142
							}
143
							if(obj[i].cnt) {
144
								cnt = "内容:" + obj[i].cnt
145
							}
146
							var li = document.createElement("li");
147
							li.setAttribute("data-id", obj[i].id);
148
							li.className = "mui-table-view-cell";
149
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
150
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
151
								'<div class="madiaInfo OmadiaInfo">' +
152
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
153
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
154
								'</div>' +
155
								'</div>'
156
							document.getElementById(aimId).appendChild(li);
157
						}
158
					}
159
				})
160
			},
161
			queryPubCount = function() {
162
				oAjax("/ajax/article/count/publish", { //文章总数
163
					"owner": orgId,
164
					"category": "2"
165
				}, "GET", function(data) {
166
					if(data.data > rows) {
167
						$("#seeMoreArtical").removeClass("displayNone")
168
						$("#articalNum").text(data.data);
169
					}
170
				});
171
				oAjax("/ajax/resource/count/publish", { //资源总数
172
					"owner": orgId,
173
					"category": "2"
174
				}, "GET", function(data) {
175
					if(data.data > rows) {
176
						$("#seeMoreResource").removeClass("displayNone")
177
						$("#resourceNum").text(data.data);
178
					}
179
				});
180
				oAjax("/ajax/ware/count/publish", { //服务总数
181
					"owner": orgId,
182
					"category": "2"
183
				}, "GET", function(data) {
184
					if(data.data > rows) {
185
						$("#seeMoreService").removeClass("displayNone")
186
						$("#serviceNum").text(data.data);
187
					}
188
				});
189
			},
190
			bindClickFun = function() {
191
				//点击收藏按钮
192
				var oifAttend = document.getElementById("ifAttend")
193
				ifcollectionAbout(orgId, oifAttend, 6);
194
				document.getElementById("collectBtn").addEventListener('tap', function() {
195
					if(userid && userid != null && userid != "null") {
196
						if(oifAttend.className == 'mui-icon iconfontnew icon-yishoucang') {
197
							cancelCollectionAbout(orgId, oifAttend, 6)
198
						} else {
199
							collectionAbout(orgId, oifAttend, 6);
200
						}
201
					} else {
202
						isLogin();
203
					}
204
				});
205
				//详细页面
206
				document.getElementById("goCmpBrief").addEventListener("tap", function() {
207
					var nwaiting = plus.nativeUI.showWaiting();
208
					var web = plus.webview.create("../html/cmpInforShow-more.html", "cmpInforShow-more.html", {}, {
209
						cmpId: orgId
210
					});    	    	
211
					web.addEventListener("loaded", function() {}, false);
212
				});
213
				document.getElementById("seeMoreResource").addEventListener("tap", function() {
214
					var nwaiting = plus.nativeUI.showWaiting();
215
					var web = plus.webview.create("../html/cmpInforShow-resources.html", "cmpInforShow-resources.html", {}, {
216
						cmpId: orgId
217
					});
218
					web.addEventListener("loaded", function() {}, false);
219
				});
220
				document.getElementById("seeMoreArtical").addEventListener("tap", function() {
221
					var nwaiting = plus.nativeUI.showWaiting();
222
					var web = plus.webview.create("../html/cmpInforShow-article.html", "cmpInforShow-article.html", {}, {
223
						cmpId: orgId
224
					});
225
					web.addEventListener("loaded", function() {}, false);
226
				});
227
				document.getElementById("seeMoreService").addEventListener("tap", function() {
228
					var nwaiting = plus.nativeUI.showWaiting();
229
					var web = plus.webview.create("../html/cmpInforShow-service.html", "cmpInforShow-service.html", {}, {
230
						cmpId: orgId
231
					});
232
					web.addEventListener("loaded", function() {}, false);
233
				});
234
				mui('#articelShow,#relateArt').on('tap', 'li', function() {
235
					var id = this.getAttribute("data-id");
236
					plus.nativeUI.showWaiting();
237
					plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
238
						articleId: id,
239
					});
240
				})
241
				mui('#serviceShow').on('tap', 'li', function() {
242
					var id = this.getAttribute("data-id");
243
					plus.nativeUI.showWaiting();
244
					plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
245
						serviceId: id,
246
					});
247
				})
248
				mui('#resourceShow').on('tap', 'li', function() {
249
					var id = this.getAttribute("data-id");
250
					plus.nativeUI.showWaiting();
251
					plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
252
						resourceId: id
253
					});
254
				})
255
				mui("#demandShow").on("tap", "li", function() {
256
					var dId = this.getAttribute("data-id");
257
					plus.nativeUI.showWaiting();
258
					plus.webview.create("../html/needShow.html", 'needShow.html', {}, {
259
						demanid: dId
260
					});
261
				})
262
				mui('#likePro').on('tap', 'li', function() {
263
					var id = this.getAttribute("data-id");
264
					plus.nativeUI.showWaiting();
265
					var webviewShow1 = plus.webview.create("../html/cmpInforShow.html", 'cmpInforShow.html', {}, {
266
						cmpId: id
267
					});
268
					webviewShow1.addEventListener("loaded", function() {
269
						setTimeout(function() {
270
							plus.webview.currentWebview().close()
271
						}, 1000)
272

273
					}, false);
274
				})
275

155 276
			}
156
		})
157
		
158
	}
159
		mui("#bower_u").on("tap","li",function(){
160
		var dId=this.getAttribute("id");
161
		plus.nativeUI.showWaiting();
162
		plus.webview.create("../html/needShow.html", 'needShow.html', {}, {
163
			demanid: dId
164
		});
165
	})
277

278
		pageViewLog(orgId, 6)
279
		companyMessage(orgId);
280
		relevantarticalList(); //相关文章
281
		likeExperts(); //感兴趣企业	
282
		demandListVal()
283
		articalListVal()
284
		bindClickFun()
285
		queryPubCount();
286

166 287
		function companyMessage(id) {
167 288
			mui.ajax(baseUrl + "/ajax/org/" + id, {
168 289
				dataType: 'json', //数据格式类型
@ -173,16 +294,20 @@ mui.ready(function() {
173 294
						var web = plus.webview.currentWebview()
174 295
						plus.nativeUI.closeWaiting();
175 296
						web.show("slide-in-right", 150);
176
						
177 297
						var $data = data.data;
178
						if($data.forShort){
298
						if($data.resMgr){
299
							resourceListVal();
300
							serviceListVal();
301
							document.getElementsByClassName("establishments").style.display="block"
302
						}
303
						if($data.forShort) {
179 304
							document.getElementById("companyNameT").innerText = $data.forShort;
180 305
							document.getElementById("companyName").innerText = $data.forShort;
181
						}else{
306
						} else {
182 307
							document.getElementById("companyNameT").innerText = $data.name;
183 308
							document.getElementById("companyName").innerHTML = $data.name;
184 309
						}
185
						
310

186 311
						if($data.hasOrgLogo) {
187 312
							document.getElementById("oimg").src = baseUrl + "/images/org/" + $data.id + ".jpg";
188 313
						} else {
@ -192,7 +317,7 @@ mui.ready(function() {
192 317
						if($data.authStatus == 3) {
193 318
							document.getElementById("authFlag").classList.add("authicon-com-ok");
194 319
						}
195
						
320

196 321
						/*所在城市*/
197 322
						if($data.city) {
198 323
							document.getElementById("address").innerHTML = '<em class="mui-icon iconfontnew icon-address"></em> ' + $data.city;
@ -203,9 +328,8 @@ mui.ready(function() {
203 328
						/*企业简介*/
204 329
						if($data.descp) {
205 330
							document.getElementById("breifinfo").innerText = $data.descp;
206
						}else{
331
						} else {
207 332
							document.getElementById("breifinfo").parentNode.style.display = "none";
208
							document.getElementById("goCmpBrief").style.borderBottomColor="transparent";
209 333
						}
210 334
						/*应用行业*/
211 335
						var proOther = "";
@ -228,7 +352,7 @@ mui.ready(function() {
228 352
				}
229 353
			});
230 354
		}
231
		
355

232 356
		/*应用行业及领域及企业纸质*/
233 357
		function indu(oString, oSelector) {
234 358
			var arr = oString.split(",");
@ -239,134 +363,40 @@ mui.ready(function() {
239 363
			}
240 364
			document.getElementById(oSelector).innerHTML = oArr.join("");
241 365
		}
242
		
243
		//获取资源
244
		function getResource() {
245
			mui.ajax(baseUrl + "/ajax/resource/pqOrgPublish", {
246
				type: "GET",
247
				timeout: 10000,
248
				dataType: "json",
249
				data: {
250
					"orgId": orgId,
251
					"pageSize": 10,
252
					"pageNo": 1
253
				},
254
				success: function(data) {
255
					console.log(JSON.stringify(data))
256
					if(data.success) {
257
						var obj = data.data.data;
258
						if(obj.length>0){
259
							document.getElementById("resourceNum").innerText = data.data.total;
260
							if(obj.length>2){
261
								obj.length =2;
262
								document.getElementById("seeMoreResource").classList.remove("displayNone");
263
							}
264
							for(var i = 0; i < obj.length; i++) {
265
								var liItem = document.createElement("li");
266
								liItem.className = "mui-table-view-cell"
267
								liItem.setAttribute("data-id",obj[i].resourceId)
268
								var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
269
								if(obj[i].images.length) {
270
									oString += '<div class="madiaHead resouseHead" style="background-image:url(' + baseUrl + '/data/resource/' + obj[i].images[0].imageSrc +')"></div>'
271
								} else {
272
									oString += '<div class="madiaHead resouseHead"></div>'
273
								}
274
								oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis h1Font">' + obj[i].resourceName + '</p><p class="h2Font mui-ellipsis-2">用途:' + obj[i].supportedServices + '</p>'
275
								oString += '</div></div>'
276
								liItem.innerHTML = oString;
277
								document.getElementById("resourceShow").appendChild(liItem);
278
							}
279
						}else{
280
							document.getElementById("resourceShow").parentNode.parentNode.style.display="none";
281
						}
282
					}
283
				},
284
				error: function() {
285
					plus.nativeUI.toast("服务器链接超时", toastStyle);
286
					return;
287
				}
288
			})
289
		}
290
		/*企业文章html*/
291
		function getArticel() {
292
			mui.ajax(baseUrl + "/ajax/article/pqOrgPublish", {
293
				type: "GET",
294
				timeout: 10000,
295
				dataType: "json",
296
				data: {
297
					"orgId": orgId,
298
					"pageSize": 10,
299
					"pageNo": 1
300
				},
301
				success: function(data) {
302
					console.log(JSON.stringify(data))
303
					if(data.success) {
304
						var obj = data.data.data;
305
						if(obj.length>0){
306
							document.getElementById("articalNum").innerText = data.data.total;
307
							if(obj.length>2){
308
								obj.length =2;
309
								document.getElementById("seeMoreArtical").classList.remove("displayNone");
310
							}
311
							for(var i = 0; i < obj.length; i++) {
312
								var liItem = document.createElement("li");
313
								liItem.setAttribute("data-id",obj[i].articleId);
314
								liItem.setAttribute("owner-id",obj[i].orgId);
315
								liItem.className = "mui-table-view-cell"
316
								var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
317
								if(obj[i].articleImg) {
318
									oString += '<div class="madiaHead artHead" style="background-image:url(' + baseUrl + '/data/article/' + obj[i].articleImg + ')"></div>'
319
								} else {
320
									oString += '<div class="madiaHead artHead"></div>'
321
								}
322
								oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>'
323
								oString += '<p class="h2Font mui-ellipsis"><span class="time">'+commenTime(obj[i].publishTime)+'</span></p>'
324
								oString += '</div></div>'
325
								liItem.innerHTML = oString;
326
								document.getElementById("articelShow").appendChild(liItem);
327
							}
328
						}else{
329
							document.getElementById("articelShow").parentNode.parentNode.style.display="none";
330
						}
331
					}
332
				},
333
				error: function() {
334
					plus.nativeUI.toast("服务器链接超时", toastStyle);
335
					return;
336
				}
337
			})
338
		}
366

339 367
		//相关文章信息
340
		function relevantarticalList(){
368
		function relevantarticalList() {
341 369
			mui.ajax(baseUrl + "/ajax/article/byAssOrg", {
342
				"type" :  "GET" ,
343
				"dataType" : "json",
344
				"data" :{"id":orgId},
345
				"async":"false",
370
				"type": "GET",
371
				"dataType": "json",
372
				"data": {
373
					"id": orgId
374
				},
375
				"async": "false",
346 376
				"traditional": true, //传数组必须加这个
347
				"success" : function(data) {
377
				"success": function(data) {
348 378
					console.log(JSON.stringify(data));
349
					if (data.success && data.data!=""){
379
					if(data.success && data.data != "") {
350 380
						document.getElementById("relateArt").parentNode.parentNode.classList.remove("displayNone");
351
						document.getElementById("relateArt").innerHTML="";
381
						document.getElementById("relateArt").innerHTML = "";
352 382
						var StrData = data.data
353 383
						var lengthT;
354
						if(data.data.length>5){
355
							lengthT=5;
356
						}else{
357
							lengthT=data.data.length
384
						if(data.data.length > 5) {
385
							lengthT = 5;
386
						} else {
387
							lengthT = data.data.length
358 388
						}
359 389
						for(var i = 0; i < lengthT; i++) {
360 390
							(function(n) {
361
								var imgL="../images/default-artical.jpg";
362
								if(StrData[i].articleImg){
363
									imgL=baseUrl+'/data/article/' + StrData[i].articleImg 
391
								var imgL = "../images/default-artical.jpg";
392
								if(StrData[i].articleImg) {
393
									imgL = baseUrl + '/data/article/' + StrData[i].articleImg
364 394
								}
365 395
								var oURL;
366
								if(StrData[i].articleType==1) {
367
									oURL="/ajax/professor/baseInfo/"+StrData[i].professorId;
368
								}else{
369
									oURL="/ajax/org/" + StrData[i].orgId;
396
								if(StrData[i].articleType == 1) {
397
									oURL = "/ajax/professor/baseInfo/" + StrData[i].professorId;
398
								} else {
399
									oURL = "/ajax/org/" + StrData[i].orgId;
370 400
								}
371 401
								mui.ajax(baseUrl + oURL, {
372 402
									"type": "GET",
@ -375,29 +405,29 @@ mui.ready(function() {
375 405
										if(data.success) {
376 406
											console.log(JSON.stringify(data));
377 407
											var add = document.createElement("li");
378
											add.className = "mui-table-view-cell"; 
379
											add.setAttribute("data-id",StrData[n].articleId);
380
											var thisName,userType,thisAuth,thisTitle
381
											if(data.data.forShort){
382
												thisName=data.data.forShort;
383
											}else{
384
												thisName=data.data.name;
408
											add.className = "mui-table-view-cell";
409
											add.setAttribute("data-id", StrData[n].articleId);
410
											var thisName, userType, thisAuth, thisTitle
411
											if(data.data.forShort) {
412
												thisName = data.data.forShort;
413
											} else {
414
												thisName = data.data.name;
385 415
											}
386
											if(StrData[n].articleType==1) {
416
											if(StrData[n].articleType == 1) {
387 417
												add.setAttribute("owner-id", data.data.id);
388 418
												add.setAttribute("data-type", 1);
389
											}else {
419
											} else {
390 420
												add.setAttribute("owner-id", data.data.id);
391 421
												add.setAttribute("data-type", 2);
392 422
											}
393
											
394
											var itemlist = '<div class="flexCenter OflexCenter mui-clearfix"><div class="madiaHead artHead" style="background-image:url('+imgL+')"></div>';
395
												itemlist += '<div class="madiaInfo OmadiaInfo">';
396
												itemlist += '<p class="mui-ellipsis-2 h1Font" id="usertitle">'+StrData[n].articleTitle+'</p>';
397
												itemlist += '<p><span class="h2Font" style="margin-right:10px">'+thisName+'</span><span class="time">'+commenTime(StrData[n].publishTime)+'</span></p>';
398
												itemlist += '</div></div>';
399
												
400
											add.innerHTML=itemlist;
423

424
											var itemlist = '<div class="flexCenter OflexCenter mui-clearfix"><div class="madiaHead artHead" style="background-image:url(' + imgL + ')"></div>';
425
											itemlist += '<div class="madiaInfo OmadiaInfo">';
426
											itemlist += '<p class="mui-ellipsis-2 h1Font" id="usertitle">' + StrData[n].articleTitle + '</p>';
427
											itemlist += '<p><span class="h2Font" style="margin-right:10px">' + thisName + '</span><span class="time">' + commenTime(StrData[n].publishTime) + '</span></p>';
428
											itemlist += '</div></div>';
429

430
											add.innerHTML = itemlist;
401 431
											document.getElementById("relateArt").appendChild(add);
402 432
										}
403 433
									},
@ -416,26 +446,28 @@ mui.ready(function() {
416 446
				}
417 447
			});
418 448
		}
419
	    
420
	    //感兴趣
421
		function likeExperts(){
449

450
		//感兴趣
451
		function likeExperts() {
422 452
			mui.ajax(baseUrl + "/ajax/org/ralateOrgs", {
423 453
				"type": "get",
424
				"dataType" : "json",
425
				"data" :{"orgId":orgId},
454
				"dataType": "json",
455
				"data": {
456
					"orgId": orgId
457
				},
426 458
				"success": function(data) {
427 459
					if(data.success && data.data) {
428 460
						var lengthT;
429
						if(data.data.length>5){
430
							lengthT=5;
431
						}else{
432
							lengthT=data.data.length
461
						if(data.data.length > 5) {
462
							lengthT = 5;
463
						} else {
464
							lengthT = data.data.length
433 465
						}
434 466
						for(var i = 0; i < lengthT; i++) {
435 467
							var ExpId = data.data[i].id;
436 468
							likeExpertsList(ExpId);
437 469
						}
438
						
470

439 471
					}
440 472
				},
441 473
				error: function() {
@ -445,43 +477,43 @@ mui.ready(function() {
445 477
			});
446 478
		}
447 479
		//感兴趣
448
		function likeExpertsList(ExpId){
449
			mui.ajax(baseUrl +  "/ajax/org/"+ExpId, {
450
				"type" :  "GET" ,
451
				"dataType" : "json",
452
				"success" : function(data) {
453
					if (data.success && data.data!=""){
454
						document.getElementById("likePro").parentNode.parentNode.classList.remove("displayNone");	
480
		function likeExpertsList(ExpId) {
481
			mui.ajax(baseUrl + "/ajax/org/" + ExpId, {
482
				"type": "GET",
483
				"dataType": "json",
484
				"success": function(data) {
485
					if(data.success && data.data != "") {
486
						document.getElementById("likePro").parentNode.parentNode.classList.remove("displayNone");
455 487
						var add = document.createElement("li");
456
						add.setAttribute("data-id",data.data.id);
488
						add.setAttribute("data-id", data.data.id);
457 489
						add.className = "mui-table-view-cell";
458
						add.style.minHeight="68px";
459
						var imgL,thisName,thisAuth,thisTitle,otherI="";
490
						add.style.minHeight = "68px";
491
						var imgL, thisName, thisAuth, thisTitle, otherI = "";
460 492
						if(data.data.hasOrgLogo == 1) {
461
							imgL= baseUrl+"/images/org/" + data.data.id + ".jpg";
462
						}else{
463
							imgL='../images/default-icon.jpg'
493
							imgL = baseUrl + "/images/org/" + data.data.id + ".jpg";
494
						} else {
495
							imgL = '../images/default-icon.jpg'
464 496
						}
465
						if(data.data.forShort){
466
							thisName=data.data.forShort
467
						}else{
468
							thisName=data.data.name
497
						if(data.data.forShort) {
498
							thisName = data.data.forShort
499
						} else {
500
							thisName = data.data.name
469 501
						}
470
						if(data.data.industry){
471
							otherI=data.data.industry.replace(/,/gi, " | ");
502
						if(data.data.industry) {
503
							otherI = data.data.industry.replace(/,/gi, " | ");
472 504
						}
473
						if(data.data.authStatus==3){
474
							thisAuth="authicon-com-ok"
475
							thisTitle="科袖认证企业"
505
						if(data.data.authStatus == 3) {
506
							thisAuth = "authicon-com-ok"
507
							thisTitle = "科袖认证企业"
476 508
						}
477
						var itemlist = '<div class="flexCenter OflexCenter mui-clearfix"><div class="madiaHead cmpHead"><div class="boxBlock"><img class="boxBlockimg" src="'+imgL+'" /></div></div>';
478
							itemlist += '<div class="madiaInfo OmadiaInfo">';
479
							itemlist += '<p class="mui-ellipsis"><span class="mui-ellipsis h1Font">'+thisName+'</span><em class="authicon '+thisAuth+'" title="'+thisTitle+'"></em></p>';
480
							itemlist += '<p class="mui-ellipsis h2Font">'+otherI+'</p>';
481
							itemlist += '</div></div>';
482
						add.innerHTML=itemlist;
509
						var itemlist = '<div class="flexCenter OflexCenter mui-clearfix"><div class="madiaHead cmpHead"><div class="boxBlock"><img class="boxBlockimg" src="' + imgL + '" /></div></div>';
510
						itemlist += '<div class="madiaInfo OmadiaInfo">';
511
						itemlist += '<p class="mui-ellipsis"><span class="mui-ellipsis h1Font">' + thisName + '</span><em class="authicon ' + thisAuth + '" title="' + thisTitle + '"></em></p>';
512
						itemlist += '<p class="mui-ellipsis h2Font">' + otherI + '</p>';
513
						itemlist += '</div></div>';
514
						add.innerHTML = itemlist;
483 515
						document.getElementById("likePro").appendChild(add);
484
						
516

485 517
					}
486 518
				},
487 519
				error: function() {
@ -491,18 +523,17 @@ mui.ready(function() {
491 523
			});
492 524
		}
493 525

494
		
495 526
		//判断是否登录,登录才可咨询,关注,收藏
496 527
		function isLogin() {
497 528
			var userid = plus.storage.getItem('userid');
498
	         if(userid==null || userid=='null'|userid == undefined |userid == 'undefined'){
529
			if(userid == null || userid == 'null' | userid == undefined | userid == 'undefined') {
499 530
				mui.openWindow({
500 531
					url: '../html/login.html',
501 532
					id: 'login.html'
502 533
				})
503 534
			}
504 535
		};
505
	
536

506 537
		/*微信及微信朋友圈分享专家*/
507 538
		var auths, shares;
508 539
		plus.oauth.getServices(function(services) {
@ -510,20 +541,20 @@ mui.ready(function() {
510 541
			for(var i in services) {
511 542
				var t = services[i];
512 543
				auths[t.id] = t;
513
	
544

514 545
			}
515 546
		}, function(e) {
516 547
			alert("获取登录服务列表失败:" + e.message + " - " + e.code);
517 548
		});
518 549
		plus.share.getServices(function(services) {
519
	
550

520 551
			shares = {};
521 552
			for(var i in services) {
522
	
553

523 554
				var t = services[i];
524
	
555

525 556
				shares[t.id] = t;
526
	
557

527 558
			}
528 559
		}, function(e) {
529 560
			alert("获取分享服务列表失败:" + e.message + " - " + e.code);
@ -532,10 +563,10 @@ mui.ready(function() {
532 563
			document.getElementById("shareBlock").style.display = "none";
533 564
			document.getElementById("maskBlack").style.display = "none";
534 565
			var oFen = this.getElementsByTagName("span")[0].innerHTML;
535
	
536
			var oUrl=baseUrl + "/images/logo180.png";
537
			if(document.getElementById("oimg").src !="../images/default-icon.jpg"){
538
				oUrl= document.getElementById("oimg").src;
566

567
			var oUrl = baseUrl + "/images/logo180.png";
568
			if(document.getElementById("oimg").src != "../images/default-icon.jpg") {
569
				oUrl = document.getElementById("oimg").src;
539 570
			}
540 571
			if(oFen == "微信好友") {
541 572
				if(!weixinClient()) {
@ -544,9 +575,9 @@ mui.ready(function() {
544 575
				var share = buildShareService("weixin");
545 576
				if(share) {
546 577
					shareMessage(share, "WXSceneSession", {
547
						content: document.getElementById("industryShow").innerHTML.substr(0,70),
578
						content: document.getElementById("industryShow").innerHTML.substr(0, 70),
548 579
						title: document.getElementById("companyName").innerHTML,
549
						href: baseUrl + "/e/c.html?id=" + orgId ,
580
						href: baseUrl + "/e/c.html?id=" + orgId,
550 581
						thumbs: [oUrl]
551 582
					});
552 583
				}
@ -557,9 +588,9 @@ mui.ready(function() {
557 588
				var share = buildShareService("weixin");
558 589
				if(share) {
559 590
					shareMessage(share, "WXSceneTimeline", {
560
						content: document.getElementById("industryShow").innerHTML.substr(0,70),
591
						content: document.getElementById("industryShow").innerHTML.substr(0, 70),
561 592
						title: document.getElementById("companyName").innerHTML,
562
						href: baseUrl + "/e/c.html?id=" + orgId ,
593
						href: baseUrl + "/e/c.html?id=" + orgId,
563 594
						thumbs: [oUrl]
564 595
					});
565 596
				}
@ -567,13 +598,13 @@ mui.ready(function() {
567 598
				var share = buildShareService("sinaweibo");
568 599
				if(share) {
569 600
					shareMessage(share, "sinaweibo", {
570
						content: document.getElementById("companyName").innerHTML+ baseUrl + "/e/c.html?id=" + orgId ,
601
						content: document.getElementById("companyName").innerHTML + baseUrl + "/e/c.html?id=" + orgId,
571 602
					});
572 603
				}
573 604
			}
574
	
605

575 606
		})
576
	
607

577 608
		function buildShareService(ttt) {
578 609
			var share = shares[ttt];
579 610
			if(share) {
@ -593,9 +624,9 @@ mui.ready(function() {
593 624
				alert("没有获取微信分享服务");
594 625
				return null;
595 626
			}
596
	
627

597 628
		}
598
	
629

599 630
		function shareMessage(share, ex, msg) {
600 631
			msg.extra = {
601 632
				scene: ex
@ -609,42 +640,43 @@ mui.ready(function() {
609 640
			}, function(e) {
610 641
				plus.nativeUI.closeWaiting();
611 642
				if(e.code == -2) {
612
					
643

613 644
				}
614 645
			});
615 646
		}
616
	
647

617 648
		/*图像预览*/
618 649
		mui.previewImage();
619
		 moreMes();
620
	function moreMes(){
621
		document.getElementById("BtnMore").addEventListener("tap",function(){
622
			var oUrl=baseUrl + "/images/logo180.png";
623
			if(document.getElementById("oimg").src !="../images/default-icon.jpg"){
624
				oUrl= document.getElementById("oimg").src;
625
			}
626
			plus.nativeUI.showWaiting(); //显示原生等待框
627
		var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
628
			proid: orgId,
629
			name:"org",
630
			data:{
631
						content: document.getElementById("industryShow").innerHTML.substr(0,40),
650
		moreMes();
651

652
		function moreMes() {
653
			document.getElementById("BtnMore").addEventListener("tap", function() {
654
				var oUrl = baseUrl + "/images/logo180.png";
655
				if(document.getElementById("oimg").src != "../images/default-icon.jpg") {
656
					oUrl = document.getElementById("oimg").src;
657
				}
658
				plus.nativeUI.showWaiting(); //显示原生等待框
659
				var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
660
					proid: orgId,
661
					name: "org",
662
					data: {
663
						content: document.getElementById("industryShow").innerHTML.substr(0, 40),
632 664
						title: document.getElementById("companyName").innerHTML,
633
						href: baseUrl + "/e/c.html?id=" + orgId ,
665
						href: baseUrl + "/e/c.html?id=" + orgId,
634 666
						thumbs: [oUrl]
635 667
					},
636
			weiboData:{
637
						content: document.getElementById("companyName").innerHTML+ baseUrl + "/e/c.html?id=" + orgId ,
668
					weiboData: {
669
						content: document.getElementById("companyName").innerHTML + baseUrl + "/e/c.html?id=" + orgId,
638 670
					}
671
				})
672
			})
673
		}
674
		window.addEventListener("newId", function(event) {
675
			plus.navigator.setStatusBarBackground("#28b8fa");
639 676
		})
677
		document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
678
			plus.navigator.setStatusBarBackground("#FF9900");
640 679
		})
641
	}
642
	window.addEventListener("newId", function(event) {
643
			plus.navigator.setStatusBarBackground( "#28b8fa" );
644
		})
645
	document.getElementsByClassName("topback")[0].addEventListener("tap",function(){
646
		plus.navigator.setStatusBarBackground( "#FF9900" );
647
	})
648 680
	});
649 681

650 682
})

+ 9 - 12
app/js/index.js

@ -182,17 +182,16 @@ mui('.gridbg').on('tap', 'li', function() {
182 182
})
183 183

184 184
function ruZhuCmp(){//入驻企业
185
	mui.ajax(baseUrl+"/ajax/org/find/pq",{
185
	mui.ajax(baseUrl+"/ajax/org/index/search",{
186 186
		type: "GET",
187 187
		timeout: 10000,
188 188
		dataType: "json",
189 189
		data:{
190
			"pageSize": 5,
191
			"pageNo": 1
190
			"rows": 5
192 191
		},
193 192
		success: function(data) {
194 193
			if(data.success) {
195
				var $info = data.data.data;
194
				var $info = data.data;
196 195
				for(var i = 0; i < $info.length; i++) {
197 196
					var liStr=document.createElement("li");
198 197
					liStr.className="mui-table-view-cell";
@ -243,17 +242,16 @@ function ruZhuCmp(){//入驻企业
243 242
	})
244 243
}
245 244
function resShare(){//资源共享
246
	mui.ajax(baseUrl+"/ajax/resource/firstpq",{
245
	mui.ajax(baseUrl+ "/ajax/resource/index/search",{
247 246
		type: "GET",
248 247
		timeout: 10000,
249 248
		dataType: "json",
250 249
		data:{
251
			"pageSize":5,
252
			"pageNo": 1
250
			"rows":5
253 251
		},
254 252
		success: function(data) {
255 253
			if(data.success) {
256
				var $info = data.data.data;
254
				var $info = data.data;
257 255
				for(var i = 0; i < $info.length; i++) {
258 256
					var liStr = document.createElement("li");
259 257
					liStr.setAttribute("data-id", $info[i].resourceId);
@ -301,17 +299,16 @@ function resShare(){//资源共享
301 299
	})
302 300
}
303 301
function proShow(){//专家
304
	mui.ajax(baseUrl+"/ajax/professor/pqBaseInfo",{
302
	mui.ajax(baseUrl+"/ajax/professor/index/search",{
305 303
		type: "GET",
306 304
		timeout: 10000,
307 305
		dataType: "json",
308 306
		data:{
309
			"pageSize":5,
310
			"pageNo": 1
307
			"rows": 5
311 308
		},
312 309
		success: function(data) {
313 310
			if(data.success) {
314
				var $info = data.data.data;
311
				var $info = data.data;
315 312
				for(var i = 0; i < $info.length; i++) {
316 313
					var liStr = document.createElement("li");
317 314
					liStr.setAttribute("data-id", $info[i].id);

+ 1 - 18
app/js/needShow.js

@ -19,7 +19,7 @@ mui.ready(function() {
19 19
	    var attBtn=document.getElementById("attBtn");
20 20
		 
21 21
		getDemandinfo();
22
		pageViewsVal();
22
		pageViewLog(demandId, 7)
23 23
		moreMes();//更多
24 24
		
25 25
		document.getElementById("personAL").addEventListener("tap", function() {//企业详情
@ -227,23 +227,6 @@ mui.ready(function() {
227 227
			});
228 228
			
229 229
		}
230
		//浏览量
231
		function pageViewsVal() {
232
			mui.ajax(baseUrl+"/ajax/demand/incPageViews",{
233
				"type": "POST",
234
				"dataType": "json",
235
				"data": {
236
					"id": demandId
237
				},
238
				"success": function(data) {
239
					if(data.success) {}
240
				},
241
				error: function() {
242
					plus.nativeUI.toast("服务器链接超时", toastStyle);
243
					return;
244
				}
245
			});
246
		}
247 230
		/*企业用户信息*/
248 231
		function cmpFun(id) {
249 232
			mui.ajax(baseUrl+"/ajax/org/" + id,{

+ 1 - 14
app/js/paperShow.js

@ -10,6 +10,7 @@ mui.plusReady(function() {
10 10
	getRecourceMe(); /*获取资源信息*/
11 11
	//关键词标签点击进去搜索
12 12
	module.lWord(paperId, 2);
13
	pageViewLog(paperId, 5)
13 14
	mui(".tagList").on("tap", "li", function() {
14 15
		var tagText = this.getElementsByTagName("span")[0].innerText;
15 16
		plus.nativeUI.showWaiting();
@ -33,20 +34,6 @@ mui.plusReady(function() {
33 34
		}
34 35
	});
35 36
36
	mui.ajax(baseUrl + '/ajax/ppaper/incPageViews', {
37
		"type": "POST",
38
		"dataType": "json",
39
		"data": {
40
			"id": paperId
41
		},
42
		"success": function(data) {
43
			if(data.success) {}
44
		},
45
		"error": function() {
46
47
		}
48
	});
49
50 37
	//点击进入个人详情页面
51 38
	mui("#aboutAuthors").on("tap","li",function(){
52 39
		var oDataId =this.getAttribute("data-id");

+ 6 - 14
app/js/patentShow.js

@ -8,6 +8,7 @@ mui.plusReady(function() {
8 8
	patentId = self.patentId;
9 9
	getRecourceMe();/*获取资源信息*/
10 10
	module.lWord(patentId, 3);
11
	pageViewLog(patentId, 4)
11 12
	//关键词标签点击进去搜索
12 13
	mui(".tagList").on("tap","li",function(){
13 14
		var tagText = this.getElementsByTagName("span")[0].innerText;
@ -32,20 +33,6 @@ mui.plusReady(function() {
32 33
		}
33 34
	});
34 35
	
35
	
36
	mui.ajax(baseUrl + '/ajax/ppatent/incPageViews',{
37
			"type": "POST",
38
			"dataType": "json",
39
			"data": {
40
				"id": patentId
41
			},
42
			"success": function(data) {
43
				if(data.success) {}
44
			},
45
			"error": function() {
46
				
47
			}
48
		});
49 36
	//点击进入个人详情页面
50 37
	mui("#aboutAuthors").on("tap","li",function(){
51 38
		var oDataId =this.getAttribute("data-id");
@ -96,6 +83,11 @@ mui.plusReady(function() {
96 83
		document.getElementById("patentName").innerHTML = $da.name; //名字
97 84
		document.getElementById("patentAbstract").innerHTML = $da.summary; //摘要内容
98 85
		document.getElementById("Znum1").innerHTML = $da.code;//专利号
86
		if($da.cooperation){
87
			document.getElementById("patentRemarks").innerHTML = $da.cooperation;
88
		}else{
89
			document.getElementById("patentRemarks").parentNode.style.display="none";
90
		}
99 91
		if($da.pubDay){
100 92
			document.getElementById("Znum2").innerHTML = TimeTr($da.pubDay);
101 93
		}else{

+ 302 - 214
app/js/public/base.js

@ -1,12 +1,10 @@
1 1
//公共文件
2 2
//mui.init();
3
//var baseUrl = "http://www.ekexiu.com"; 
4
//var baseUrl = "http://192.168.3.233";
5
var baseUrl = "http://192.168.3.233:81";    
6
var wlogurl="http://192.168.3.233:8080"
3
//var baseUrl = "http://www.ekexiu.com"; 
7 4
//var wlogurl="http://www.ekexiu.com:8082";
5
var baseUrl = "http://192.168.3.233:81";
6
var wlogurl = "http://192.168.3.233:8080";
8 7

9
10 8
toastStyle = {
11 9
	'verticalAlign': 'top',
12 10
}
@ -31,7 +29,6 @@ function goLoginFun() {
31 29
	});
32 30
}
33 31

34

35 32
function goRegFun() {
36 33
	mui.openWindow({
37 34
		url: '../html/reg.html',
@ -43,7 +40,7 @@ function goRegFun() {
43 40
}
44 41

45 42
/*校验下一步按钮显示状态*/
46
function hideButtn(oneName,twoName,threeName,fourName) {
43
function hideButtn(oneName, twoName, threeName, fourName) {
47 44
	if(oneName.value == "" || twoName.value == "") {
48 45
		threeName.classList.remove(fourName);
49 46
		threeName.disabled = "disabled";
@ -53,7 +50,7 @@ function hideButtn(oneName,twoName,threeName,fourName) {
53 50
	}
54 51
}
55 52

56
function hideButtn2(oneName,twoName,threeName,fourName,fiveName) {
53
function hideButtn2(oneName, twoName, threeName, fourName, fiveName) {
57 54
	if(oneName.value == "" || twoName.value == "" || fiveName.value == "") {
58 55
		threeName.classList.remove(fourName);
59 56
		threeName.disabled = "disabled";
@ -65,27 +62,30 @@ function hideButtn2(oneName,twoName,threeName,fourName,fiveName) {
65 62

66 63
//设置系统状态栏背景
67 64
plusReady();
68
function plusReady(){
69
	mui.plusReady(function(){
70
		plus.navigator.setStatusBarBackground( "#FF9900" );
65

66
function plusReady() {
67
	mui.plusReady(function() {
68
		plus.navigator.setStatusBarBackground("#FF9900");
71 69
	})
72 70
}
73 71
//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
74
function iosheader(){
75
	mui.plusReady(function(){ 
76
		plus.webview.currentWebview().setStyle({ softinputMode:"adjustResize" });
72
function iosheader() {
73
	mui.plusReady(function() {
74
		plus.webview.currentWebview().setStyle({
75
			softinputMode: "adjustResize"
76
		});
77 77
	})
78 78
}
79 79
//判断设备是iOS或者Android系统
80
function ifiosAmdandroid(test){
80
function ifiosAmdandroid(test) {
81 81
	var u = navigator.userAgent;
82 82
	var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
83 83
	var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
84
	if(isAndroid){
85
		 return '0';
84
	if(isAndroid) {
85
		return '0';
86 86
	}
87
	if(isiOS){
88
		 return '1';
87
	if(isiOS) {
88
		return '1';
89 89
	}
90 90
}
91 91

@ -108,38 +108,45 @@ function autho() {
108 108
					"sty": "authicon-real",
109 109
					"title": "实名认证用户"
110 110
				}
111
			}else{
112
					return {
113
						"sty": "e",
114
						"title": " "
115
						}
111
			} else {
112
				return {
113
					"sty": "e",
114
					"title": " "
116 115
				}
116
			}
117 117
		}
118 118
	}
119 119
}
120

120
//字符串string转换为数组[]
121
function strToAry(str) {
122
	var subs = new Array();
123
	if(str.indexOf(',')) {
124
		subs = str.split(',');
125
	} else {
126
		subs[0] = str;
127
	}
128
	return subs
129
}
121 130
//用户分享专家到微信后增加积分
122 131
function shareAddIntegral(num) {
123 132
	var userId = plus.storage.getItem('userid');
124
	var burl,title;
125
	if(num==1){
133
	var burl, title;
134
	if(num == 1) {
126 135
		burl = "/ajax/growth/sharePro";
127 136
		title = "成功分享专家信息";
128
	}else if(num==2){
137
	} else if(num == 2) {
129 138
		burl = "/ajax/growth/shareRes";
130 139
		title = "成功分享资源信息";
131
	}else if(num==3){
140
	} else if(num == 3) {
132 141
		burl = "/ajax/growth/shareArticle";
133 142
		title = "成功分享文章信息";
134
	}else if(num==4){
143
	} else if(num == 4) {
135 144
		burl = "/ajax/growth/shareOrg";
136 145
		title = "成功分享企业信息";
137
	}
138
	else if(num==5){
146
	} else if(num == 5) {
139 147
		burl = "/ajax/growth/sharePatent";
140 148
		title = "成功分享专利信息";
141
	}
142
	else if(num==6){
149
	} else if(num == 6) {
143 150
		burl = "/ajax/growth/sharePaper";
144 151
		title = "成功分享论文信息";
145 152
	}
@ -166,34 +173,35 @@ function shareAddIntegral(num) {
166 173
	});
167 174
}
168 175

169
function listConCut(str){//**回答内容过滤html标签**//
170
	var regTag =/<\/?[a-zA-Z]+[^><]*?>/g;
171
	var strTo=str.replace(/<img(.*?)>/g, "[图片]").replace(regTag,"")
176
function listConCut(str) { //**回答内容过滤html标签**//
177
	var regTag = /<\/?[a-zA-Z]+[^><]*?>/g;
178
	var strTo = str.replace(/<img(.*?)>/g, "[图片]").replace(regTag, "")
172 179
	return strTo
173 180
}
174
function checkHtmltag(htmlStr) {/*字符串是否含有html标签的检测*/
175
    return htmlStr.substr(0,1)=="<"
181

182
function checkHtmltag(htmlStr) { /*字符串是否含有html标签的检测*/
183
	return htmlStr.substr(0, 1) == "<"
176 184
}
177 185
//时间显示规则
178
function commenTime(startTime){
179
	var nowTimg =  new Date();
180
	var startdate = new Date(); 
181
	startdate.setFullYear(parseInt(startTime.substring(0,4)));
182
	startdate.setMonth(parseInt(startTime.substring(4,6))-1);
183
	startdate.setDate(parseInt(startTime.substring(6,8)));
184
	startdate.setHours(parseInt(startTime.substring(8,10)));
185
	startdate.setMinutes(parseInt(startTime.substring(10,12)));
186
	startdate.setSeconds(parseInt(startTime.substring(12,14)));
187
	var date3=nowTimg.getTime()-startdate.getTime();  //时间差的毫秒数
188
    var hours = parseInt((date3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
189
    var minutes = parseInt((date3 % (1000 * 60 * 60)) / (1000 * 60));
190
    if(date3 < 60000){
191
    	return "刚刚";
192
    }else if(date3 >= 60000 && date3 < 3600000){
193
    	return minutes + "分钟前";
194
    }else if(date3 >= 3600000 && date3 < 86400000){
195
    	return hours + "小时前";
196
    }else if(date3 >= 86400000) {
186
function commenTime(startTime) {
187
	var nowTimg = new Date();
188
	var startdate = new Date();
189
	startdate.setFullYear(parseInt(startTime.substring(0, 4)));
190
	startdate.setMonth(parseInt(startTime.substring(4, 6)) - 1);
191
	startdate.setDate(parseInt(startTime.substring(6, 8)));
192
	startdate.setHours(parseInt(startTime.substring(8, 10)));
193
	startdate.setMinutes(parseInt(startTime.substring(10, 12)));
194
	startdate.setSeconds(parseInt(startTime.substring(12, 14)));
195
	var date3 = nowTimg.getTime() - startdate.getTime(); //时间差的毫秒数
196
	var hours = parseInt((date3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
197
	var minutes = parseInt((date3 % (1000 * 60 * 60)) / (1000 * 60));
198
	if(date3 < 60000) {
199
		return "刚刚";
200
	} else if(date3 >= 60000 && date3 < 3600000) {
201
		return minutes + "分钟前";
202
	} else if(date3 >= 3600000 && date3 < 86400000) {
203
		return hours + "小时前";
204
	} else if(date3 >= 86400000) {
197 205

198 206
		if(nowTimg.getFullYear() == startTime.substring(0, 4)) {
199 207

@ -203,7 +211,7 @@ function commenTime(startTime){
203 211
			return startTime.substring(0, 4) + "年" + startTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
204 212
		}
205 213
	}
206
  
214

207 215
}
208 216
/*时间转换*/
209 217
function TimeTr(dealtime) {
@ -251,7 +259,7 @@ var orgTypeShow = {
251 259
	"9": "协会学会",
252 260
	"10": "新闻媒体",
253 261
	"11": "教育机构",
254
	"undefined":""
262
	"undefined": ""
255 263
}
256 264
//学位
257 265
var eduDegree = {
@ -279,8 +287,8 @@ var demandDuration = {
279 287
	'5': '1年以上'
280 288
}
281 289
/*判断是否收藏资源文章或者是否关注专家*/
282
function ifcollectionAbout(watchObject,sel, num,flag) {
283
	var that=sel;
290
function ifcollectionAbout(watchObject, sel, num, flag) {
291
	var that = sel;
284 292
	mui.ajax(baseUrl + '/ajax/watch/hasWatch', {
285 293
		data: {
286 294
			"professorId": plus.storage.getItem('userid'),
@ -293,28 +301,28 @@ function ifcollectionAbout(watchObject,sel, num,flag) {
293 301
		success: function(data) {
294 302
			console.log(JSON.stringify(data))
295 303
			if(data.success && data.data != null) {
296
				if(num=="1" || num == "6" || num=="8"){//已关注专家
297
					if(flag==1){
304
				if(num == "1" || num == "6" || num == "8") { //已关注专家
305
					if(flag == 1) {
298 306
						that.classList.add("attenedSpan");
299
						that.innerText="已关注";
300
					}else{
307
						that.innerText = "已关注";
308
					} else {
301 309
						that.classList.remove("icon-shoucang");
302 310
						that.classList.add("icon-yishoucang");
303 311
					}
304
				}else{//已收藏资源或文章
312
				} else { //已收藏资源或文章
305 313
					that.classList.remove("icon-shoucang");
306 314
					that.classList.add("icon-yishoucang");
307 315
				}
308 316
			} else {
309
				if(num=="1" || num == "6" || num=="8"){//关注专家
310
					if(flag==1){
317
				if(num == "1" || num == "6" || num == "8") { //关注专家
318
					if(flag == 1) {
311 319
						that.classList.remove("attenedSpan");
312
						that.innerText="关注";
313
					}else{
320
						that.innerText = "关注";
321
					} else {
314 322
						that.classList.add("icon-shoucang");
315 323
						that.classList.remove("icon-yishoucang");
316 324
					}
317
				}else{//收藏资源或文章
325
				} else { //收藏资源或文章
318 326
					that.classList.add("icon-shoucang");
319 327
					that.classList.remove("icon-yishoucang");
320 328
				}
@ -327,8 +335,8 @@ function ifcollectionAbout(watchObject,sel, num,flag) {
327 335
}
328 336

329 337
/*收藏资源、文章或者关注专家*/
330
function collectionAbout(watchObject,sel, num,flag) {
331
	var that=sel;
338
function collectionAbout(watchObject, sel, num, flag) {
339
	var that = sel;
332 340
	mui.ajax(baseUrl + '/ajax/watch', {
333 341
		data: {
334 342
			"professorId": plus.storage.getItem('userid'),
@ -343,16 +351,16 @@ function collectionAbout(watchObject,sel, num,flag) {
343 351
		success: function(data) {
344 352
			console.log(JSON.stringify(data))
345 353
			if(data.success) {
346
				if(num=="1" || num == "6" || num=="8"){//关注专家
347
					if(flag==1){
354
				if(num == "1" || num == "6" || num == "8") { //关注专家
355
					if(flag == 1) {
348 356
						that.classList.add("attenedSpan");
349
						that.innerText="已关注";
350
					}else{
357
						that.innerText = "已关注";
358
					} else {
351 359
						that.classList.remove("icon-shoucang");
352 360
						that.classList.add("icon-yishoucang");
353 361
					}
354 362
					plus.nativeUI.toast("关注成功", toastStyle);
355
				}else{//收藏资源或文章
363
				} else { //收藏资源或文章
356 364
					that.classList.remove("icon-shoucang");
357 365
					that.classList.add("icon-yishoucang");
358 366
					plus.nativeUI.toast("收藏成功", toastStyle);
@ -366,8 +374,8 @@ function collectionAbout(watchObject,sel, num,flag) {
366 374
}
367 375

368 376
/*取消收藏资源、文章或者取消关注专家*/
369
function cancelCollectionAbout(watchObject,sel, num,flag) {
370
	var that=sel;
377
function cancelCollectionAbout(watchObject, sel, num, flag) {
378
	var that = sel;
371 379
	mui.ajax({
372 380
		url: baseUrl + '/ajax/watch/delete',
373 381
		data: {
@ -381,21 +389,21 @@ function cancelCollectionAbout(watchObject,sel, num,flag) {
381 389
		success: function(data) {
382 390
			console.log(JSON.stringify(data))
383 391
			if(data.success) {
384
				if(num=="1" || num == "6" || num=="8"){//关注专家
385
					if(flag==1){
392
				if(num == "1" || num == "6" || num == "8") { //关注专家
393
					if(flag == 1) {
386 394
						that.classList.remove("attenedSpan");
387
						that.innerText="关注";
388
					}else{
395
						that.innerText = "关注";
396
					} else {
389 397
						that.classList.add("icon-shoucang");
390 398
						that.classList.remove("icon-yishoucang");
391 399
					}
392 400
					plus.nativeUI.toast("已取消关注", toastStyle);
393
				}else{//收藏资源或文章
401
				} else { //收藏资源或文章
394 402
					that.classList.add("icon-shoucang");
395 403
					that.classList.remove("icon-yishoucang");
396 404
					plus.nativeUI.toast("已取消收藏", toastStyle);
397 405
				}
398
				
406

399 407
			}
400 408
		},
401 409
		error: function(data) {
@ -404,108 +412,185 @@ function cancelCollectionAbout(watchObject,sel, num,flag) {
404 412
	});
405 413

406 414
}
407
function checkVersion(){
415

416
function checkVersion() {
408 417
	//mui.plusReady(function(){
409
		if(!plus.webview.currentWebview()) return;
410
		// 获取本地应用资源版本号
411
	    plus.runtime.getProperty(plus.runtime.appid,function(inf){
412
		    wgtVer=inf.version;
413
		    console.log("当前应用版本:"+wgtVer);
414
		    mui.ajax(baseUrl + "/data/manager/version.json", {
415
				dataType: 'json', //数据格式类型
416
				type: 'GET', //http请求类型
417
				timeout: 10000, //超时设置
418
				async: false,
419
				success: function(data) {
420
					if (data.version > wgtVer) {
421
						var btn = ["立即更新", "稍后更新"];
422
						mui.confirm("新版本上线了,为了不影响您的正常使用,赶快更新吧", "提示", btn, function(e) {
423
							if(e.index == 0) {
424
								if(mui.os.ios) {
425
									plus.runtime.openURL('https://itunes.apple.com/cn/app/ke-xiu-da-jian-qi-ye-yu-zhuan/id1197110983?l=en&mt=8');
426
									return;
427
								}
428
								try {
429
								     plus.nativeUI.showWaiting("正在下载...");
430
								     //var d="http://192.168.3.233/download/app1.0.6.apk";
431
									 plus.downloader.createDownload( data.wgt, {filename:"_doc/update/"}, function(d,status){
432
								        if ( status == 200 ) { 
433
								            plus.runtime.install(d.filename, {}, function() {
434
												console.log("安装新版本文件成功!");
435
												/*plus.nativeUI.alert("应用资源更新完成,程序需要立即重启", function() {
436
													plus.runtime.restart();
437
												});*/
438
											}, function(e) {
439
												console.log("安装新版文件失败[" + e.code + "]:" + e.message);
440
												plus.nativeUI.toast("安装新版文件失败[" + e.code + "]:" + e.message);
441
											});
442
								            
443
								        } else {
444
								            console.log("下载新版本失败!");
445
								            plus.nativeUI.toast("下载新版本失败!");
446
								        }
447
						       			plus.nativeUI.closeWaiting();
448
						    		}).start();
449
					    		} catch (e) {
450
									console.log(e.message);
451
								}	
418
	if(!plus.webview.currentWebview()) return;
419
	// 获取本地应用资源版本号
420
	plus.runtime.getProperty(plus.runtime.appid, function(inf) {
421
		wgtVer = inf.version;
422
		console.log("当前应用版本:" + wgtVer);
423
		mui.ajax(baseUrl + "/data/manager/version.json", {
424
			dataType: 'json', //数据格式类型
425
			type: 'GET', //http请求类型
426
			timeout: 10000, //超时设置
427
			async: false,
428
			success: function(data) {
429
				if(data.version > wgtVer) {
430
					var btn = ["立即更新", "稍后更新"];
431
					mui.confirm("新版本上线了,为了不影响您的正常使用,赶快更新吧", "提示", btn, function(e) {
432
						if(e.index == 0) {
433
							if(mui.os.ios) {
434
								plus.runtime.openURL('https://itunes.apple.com/cn/app/ke-xiu-da-jian-qi-ye-yu-zhuan/id1197110983?l=en&mt=8');
435
								return;
452 436
							}
453
						});
454
					}else{
455
						//plus.nativeUI.toast("您使用的是最新版本,请放心使用!", toastStyle);
456
					}
457
				},
458
				error: function() {
459
					plus.nativeUI.toast("服务器链接超时", toastStyle);
460
					return;
437
							try {
438
								plus.nativeUI.showWaiting("正在下载...");
439
								//var d="http://192.168.3.233/download/app1.0.6.apk";
440
								plus.downloader.createDownload(data.wgt, {
441
									filename: "_doc/update/"
442
								}, function(d, status) {
443
									if(status == 200) {
444
										plus.runtime.install(d.filename, {}, function() {
445
											console.log("安装新版本文件成功!");
446
											/*plus.nativeUI.alert("应用资源更新完成,程序需要立即重启", function() {
447
												plus.runtime.restart();
448
											});*/
449
										}, function(e) {
450
											console.log("安装新版文件失败[" + e.code + "]:" + e.message);
451
											plus.nativeUI.toast("安装新版文件失败[" + e.code + "]:" + e.message);
452
										});
453

454
									} else {
455
										console.log("下载新版本失败!");
456
										plus.nativeUI.toast("下载新版本失败!");
457
									}
458
									plus.nativeUI.closeWaiting();
459
								}).start();
460
							} catch(e) {
461
								console.log(e.message);
462
							}
463
						}
464
					});
465
				} else {
466
					//plus.nativeUI.toast("您使用的是最新版本,请放心使用!", toastStyle);
461 467
				}
462
			});
468
			},
469
			error: function() {
470
				plus.nativeUI.toast("服务器链接超时", toastStyle);
471
				return;
472
			}
463 473
		});
464
		
465
	//})
474
	});
475
}
476

477
function pageViewLog(id, type) { //增加浏览量
478
	var str = {
479
		"1": { //专家
480
			url: '/ajax/professor/incPageViews',
481
			data: {
482
				'id': id
483
			}
484
		},
485
		"2": { //资源
486
			url: '/ajax/resource/pageViews',
487
			data: {
488
				'resourceId': id
489
			}
490
		},
491
		"3": { //文章
492
			url: '/ajax/article/pageViews',
493
			data: {
494
				'articleId': id
495
			}
496
		},
497
		"4": { //专利
498
			url: '/ajax/ppatent/incPageViews',
499
			data: {
500
				'id': id
501
			}
502
		},
503
		"5": { //论文
504
			url: '/ajax/ppaper/incPageViews',
505
			data: {
506
				'id': id
507
			}
508
		},
509
		"6": { //企业
510
			url: '/ajax/org/incPageViews',
511
			data: {
512
				'id': id
513
			}
514
		},
515
		"7": { //需求
516
			url: '/ajax/demand/incPageViews',
517
			data: {
518
				'id': id
519
			}
520
		},
521
		"8": { //问题
522
			url: '/ajax/question/pageViews',
523
			data: {
524
				'qid': id
525
			}
526
		},
527
		"9": { //回答
528
			url: '',
529
			data: {}
530
		},
531
		"10": { //服务
532
			url: '/ajax/ware/incPageViews',
533
			data: {
534
				'id': id
535
			}
536
		}
537

538
	};
539
	var datastr = str[type].data,
540
		url = str[type].url;
541
	mui.ajax(baseUrl + url,{
542
		data: datastr,
543
		type: "POST",
544
		success: function(data) {
545
			console.log(JSON.stringify(data));
546
		}
547
	});
548

466 549
}
550

467 551
function wlog(dt, id, src) {
468 552
	var src = src || "1";
469 553
	mui.ajax({
470
		url: wlogurl+"/log/jsonp/log",
554
		url: wlogurl + "/log/jsonp/log",
471 555
		data: {
472 556
			"id": id,
473 557
			"src": src,
474 558
			"__lt": dt,
475 559
		},
476
		success:function(data) {
477
		},
560
		success: function(data) {},
478 561
		dataType: "jsonp"
479 562
	});
480 563
}
564

481 565
function client1() {
482
   	var uId = plus.storage.getItem('userid');
483
   	var bId = plus.storage.getItem('bid');
484
   	if(uId && uId != "null" && uId != null) {
485
   		if(bId && bId != "null" && bId != null) {
486
   			if(uId==bId) {
487
   				return;
488
   			}else {
489
   				client();
490
   			}
491
   		}else{
492
   			client();
493
   		}
494
   	}else{
495
   		return;
496
   	}
497
   }
498
 function client() {
499
		var infor=plus.push.getClientInfo();
500
		var ouid;
501
		if(mui.os.ios) {
502
			ouid="I_"+plus.storage.getItem('userid')
503
		}else{
504
			ouid="A_"+plus.storage.getItem('userid')
566
	var uId = plus.storage.getItem('userid');
567
	var bId = plus.storage.getItem('bid');
568
	if(uId && uId != "null" && uId != null) {
569
		if(bId && bId != "null" && bId != null) {
570
			if(uId == bId) {
571
				return;
572
			} else {
573
				client();
574
			}
575
		} else {
576
			client();
505 577
		}
506
		mui.ajax(baseUrl + '/ajax/push/bindAlias',{
578
	} else {
579
		return;
580
	}
581
}
582

583
function client() {
584
	var infor = plus.push.getClientInfo();
585
	var ouid;
586
	if(mui.os.ios) {
587
		ouid = "I_" + plus.storage.getItem('userid')
588
	} else {
589
		ouid = "A_" + plus.storage.getItem('userid')
590
	}
591
	mui.ajax(baseUrl + '/ajax/push/bindAlias', {
507 592
		data: {
508
			alias: ouid, 
593
			alias: ouid,
509 594
			cid: infor.clientid
510 595
		},
511 596
		dataType: 'json', //数据格式类型
@ -518,7 +603,7 @@ function client1() {
518 603
					plus.storage.setItem('bid', plus.storage.getItem('userid'));
519 604
				}
520 605
			}
521
			
606

522 607
		},
523 608
		error: function() {
524 609
			plus.nativeUI.toast("服务器链接超时", toastStyle);
@ -526,61 +611,64 @@ function client1() {
526 611
	});
527 612

528 613
}
529
 function toNum() {
530
						mui.ajax(baseUrl + '/ajax/webMsg/unReadedCount', {
531
							"data": {
532
								id: plus.storage.getItem('userid')
533
							},
534
							"type": "get",
535
							"async": true,
536
							"context": this,
537
							"success": function(data) {
538
								if(data.success) {	
539
									plus.runtime.setBadgeNumber(data.data);
540
									 var GeTuiSdk = plus.ios.importClass('GeTuiSdk');
541
            								GeTuiSdk.setBadge(data.data);
542
								}
543
							},
544
							"error": function() {
545
								plus.nativeUI.toast("服务器链接超时", toastStyle);
546
							}
547
						});
548
					}
549
	
614

615
function toNum() {
616
	mui.ajax(baseUrl + '/ajax/webMsg/unReadedCount', {
617
		"data": {
618
			id: plus.storage.getItem('userid')
619
		},
620
		"type": "get",
621
		"async": true,
622
		"context": this,
623
		"success": function(data) {
624
			if(data.success) {
625
				plus.runtime.setBadgeNumber(data.data);
626
				var GeTuiSdk = plus.ios.importClass('GeTuiSdk');
627
				GeTuiSdk.setBadge(data.data);
628
			}
629
		},
630
		"error": function() {
631
			plus.nativeUI.toast("服务器链接超时", toastStyle);
632
		}
633
	});
634
}
635

550 636
//广告轮播操作
551
function addscript(that){
552
	var script=document.createElement("script");  
553
	script.setAttribute("type", "text/javascript");  
554
	var srclink= "http://www.ekexiu.com/data/inc/ad/"+ that +".js?r=" + new Date().getTime();
555
	script.setAttribute("src", srclink);  
556
	var heads = document.getElementsByTagName("head");  
557
	if(heads.length){  
558
	    heads[0].appendChild(script);  
559
	}else{
637
function addscript(that) {
638
	var script = document.createElement("script");
639
	script.setAttribute("type", "text/javascript");
640
	var srclink = "http://www.ekexiu.com/data/inc/ad/" + that + ".js?r=" + new Date().getTime();
641
	script.setAttribute("src", srclink);
642
	var heads = document.getElementsByTagName("head");
643
	if(heads.length) {
644
		heads[0].appendChild(script);
645
	} else {
560 646
		document.documentElement.appendChild(script);
561 647
	}
562 648
}
563 649
// 判断微信客户端
564
 function weixinClient() {
565
 	if(!plus.runtime.isApplicationExist({pname:'com.tencent.mm',action:'weixin://'})) {
650
function weixinClient() {
651
	if(!plus.runtime.isApplicationExist({
652
			pname: 'com.tencent.mm',
653
			action: 'weixin://'
654
		})) {
566 655
		plus.nativeUI.toast("请安装微信客户端", toastStyle);
567
						return false;
568
		}
569
 	return true;
570
 }
571
mui.ready(function(){
656
		return false;
657
	}
658
	return true;
659
}
660
mui.ready(function() {
572 661
	//处理点击事件,需要打开原生浏览器
573
	mui("body").on("tap","a.advertsub",function(){
662
	mui("body").on("tap", "a.advertsub", function() {
574 663
		var adId = this.getAttribute('data-id');
575 664
		var urlHref = this.getAttribute('href');
576
		if (urlHref) {
577
			if (window.plus) {
665
		if(urlHref) {
666
			if(window.plus) {
578 667
				plus.runtime.openURL(urlHref);
579 668
			} else {
580 669
				location.href = urlHref;
581 670
			}
582 671
		}
583
		wlog("ad", adId ,"2");
672
		wlog("ad", adId, "2");
584 673
	})
585
})
586
 	
674
})

+ 120 - 109
app/js/qa-my-wenda.js

@ -14,15 +14,14 @@ mui.ready(function () {
14 14
		self.show("slide-in-right", 150);
15 15
        var currentIndex,
16 16
            currentSelf,
17
            pageNo = 1,
18
            rows = 20,
19
            pageSize = 20;
20
        var listData = [{
21
                type: 0,
22
                aimid: "myQ",
23
                url: "/ajax/question/my",
24
                notip: "您还没有提过问题"
25
            },
17
            rows = 20
18
        var listData = [
19
        		{
20
	                type: 0,
21
	                aimid: "myQ",
22
	                url: "/ajax/question/my",
23
	                notip: "您还没有提过问题"
24
            	},
26 25
                {
27 26
                    type: 1,
28 27
                    aimid: "myA",
@ -32,7 +31,7 @@ mui.ready(function () {
32 31
                {
33 32
                    type: 2,
34 33
                    aimid: "watchPro",
35
                    url: "/ajax/watch/qaPro",
34
                    url: "/ajax/watch/proList",
36 35
                    notip: "您还没有关注的人"
37 36
                },
38 37
                {
@ -48,7 +47,11 @@ mui.ready(function () {
48 47
                    notip: "您还没有收藏的回答"
49 48
                }
50 49
            ],
51
            dataO = {time: "", id: ""};
50
            dataO = {time: "", id: ""},
51
            watchO={
52
				watchTime:"",
53
				watchObjId:"",
54
			};
52 55
        var userid = plus.storage.getItem('userid');
53 56
54 57
        function allAgreeNum() {
@ -80,7 +83,7 @@ mui.ready(function () {
80 83
                });
81 84
            })
82 85
        };
83
        var comPull = function (dataStr, index, reStr) {
86
        var comPull = function (dataStr, index) {
84 87
            var url = listData[index].url,
85 88
                aimId = listData[index].aimid,
86 89
                newStr = listData[index].notip;
@ -95,10 +98,11 @@ mui.ready(function () {
95 98
	                                    setTimeout(function () {
96 99
	                                        if (index == 2) {
97 100
	                                            var rs = {
98
	                                                "professorId": userid,
99
	                                                "watchType": 1,
100
	                                                "pageSize": pageSize,
101
	                                                "pageNo": ++pageNo
101
	                                            	"professorId": userid,
102
													"watchType":1,
103
													"createTime": watchO.watchTime,
104
													"watchObject":watchO.watchObjId,
105
													"rows":rows
102 106
	                                            };
103 107
	                                            oAjaxGet(url, rs, "get", oWatchPro);
104 108
	                                        } else {
@ -128,36 +132,33 @@ mui.ready(function () {
128 132
                })
129 133
            }
130 134
            if (dataStr.length > 0) {
131
                dataO.time = dataStr[dataStr.length - 1].createTime;
132
                dataO.id = dataStr[dataStr.length - 1].id;
133
134
                for (var i = 0; i < dataStr.length; i++) {
135
                    var liStr = document.createElement("li");
136
                    document.getElementById(aimId).appendChild(liStr);
137
                    if (index == 0 || index == 3) {
138
                        questionModule(dataStr[i], liStr);
139
                    } else if (index == 1 || index == 4) {
140
                        answerModule(dataStr[i], liStr);
141
                    } else if (index == 2) {
142
                        proModule(dataStr[i], liStr);
143
                    }
144
                }
145
                if (index == 2) {
146
                    if (pageNo < Math.ceil(reStr.total / reStr.pageSize)) {
147
                        currentSelf.endPullUpToRefresh(false);
148
                    } else {
149
                        currentSelf.endPullUpToRefresh(true);
150
                    }
151
                    if(reStr.total<=reStr.pageSize){
152
                        currentSelf.endPullUpToRefresh(true);
153
                    }
154
                } else {
155
                    if (dataStr.length < rows) {
156
                        currentSelf.endPullUpToRefresh(true);
157
                    }else {
158
                        currentSelf.endPullUpToRefresh(false);
159
                    }
135
				var arr=[];
136
				if(index == 2){
137
					watchO.watchTime = dataStr[dataStr.length - 1].createTime;
138
					watchO.watchObjId = dataStr[dataStr.length - 1].watchObject;
139
					for(var i in dataStr) {
140
						arr[i]=dataStr[i].watchObject;
141
					}
142
					proModule(arr,aimId);
143
				}else{
144
					dataO.time = dataStr[dataStr.length - 1].createTime;
145
               		dataO.id = dataStr[dataStr.length - 1].id;	
146
               		for (var i = 0; i < dataStr.length; i++) {
147
	                    var liStr = document.createElement("li");
148
	                    document.getElementById(aimId).appendChild(liStr);
149
	                    if (index == 0 || index == 3) {
150
	                        questionModule(dataStr[i], liStr);
151
	                    } else if (index == 1 || index == 4) {
152
	                        answerModule(dataStr[i], liStr);
153
	                    }
154
	                }
155
				}
156
                if (dataStr.length < rows) {
157
                    currentSelf.endPullUpToRefresh(true);
158
                }else {
159
                    currentSelf.endPullUpToRefresh(false);
160 160
                }
161
               
161 162
            } else {
162 163
                currentSelf.endPullUpToRefresh(true);
163 164
                var liLen=document.getElementById(aimId).querySelectorAll("li").length;
@ -175,7 +176,7 @@ mui.ready(function () {
175 176
                comPull(res.data, 1);
176 177
            },
177 178
            oWatchPro = function (res) {
178
                comPull(res.data.data, 2, res.data);
179
                comPull(res.data, 2);
179 180
            },
180 181
            oWatchQ = function (res) {
181 182
                comPull(res.data, 3);
@ -183,51 +184,52 @@ mui.ready(function () {
183 184
            oWatchA = function (res) {
184 185
                comPull(res.data, 4);
185 186
            },
186
            proModule = function (dataStr, liStr) {
187
                var dataStr = dataStr.professor;
188
                var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
189
                var os = "";
190
                if (dataStr.title) {
191
                    if (dataStr.orgName) {
192
                        os = dataStr.title + "," + dataStr.orgName;
193
                    } else {
194
                        os = dataStr.title;
195
                    }
196
                } else {
197
                    if (dataStr.office) {
198
                        if (dataStr.orgName) {
199
                            os = dataStr.office + "," + dataStr.orgName;
200
                        } else {
201
                            os = dataStr.office;
202
                        }
203
                    } else {
204
                        if (dataStr.orgName) {
205
                            os = dataStr.orgName;
206
                        }
207
                    }
208
                }
209
                var baImg = "../images/default-photo.jpg";
210
                if (dataStr.hasHeadImage == 1) {
211
                    baImg = baseUrl + "/images/head/" + dataStr.id + "_l.jpg";
212
                }
213
                var oSub = "";
214
                if (dataStr.researchAreas.length) {
215
                    var arr = [];
216
                    for (var n = 0; n < dataStr.researchAreas.length; n++) {
217
                        arr[n] = dataStr.researchAreas[n].caption;
218
                    }
219
                    oSub = "研究方向:" + arr.join(";");
220
                }
221
                liStr.setAttribute("data-id", dataStr.id);
222
                liStr.setAttribute("data-flag", 1);
223
                liStr.className = "mui-table-view-cell flexCenter";
224
                liStr.innerHTML = ' <div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
225
                    '<div class="madiaInfo">' +
226
                    '<p><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + '" title="' + userType.title + '"></em></p>' +
227
                    '<p class="mui-ellipsis h2Font">' + os + '</p>' +
228
                    '<p class="mui-ellipsis h2Font">' + oSub + '</p>' +
229
                    '</div>'
230
            },
187
            proModule=function(arr,obj) {
188
				oAjaxGet("/ajax/professor/qm",{
189
					id:arr,
190
				},"get",function(data){
191
					var dataStr=data.data;
192
					for(var i = 0; i < dataStr.length; i++) {
193
						var userType = autho(dataStr[i].authType, dataStr[i].orgAuth, dataStr[i].authStatus);
194
						var os = "";
195
						if(dataStr[i].title) {
196
							if(dataStr[i].orgName) {
197
								os = dataStr[i].title + "," + dataStr[i].orgName;
198
							} else {
199
								os = dataStr[i].title;
200
							}
201
						} else {
202
							if(dataStr[i].office) {
203
								if(dataStr[i].orgName) {
204
									os = dataStr[i].office + "," + dataStr[i].orgName;
205
								} else {
206
									os = dataStr[i].office;
207
								}
208
							} else {
209
								if(dataStr[i].orgName) {
210
									os = dataStr[i].orgName;
211
								}
212
							}
213
						}
214
						var baImg = "../images/default-photo.jpg";
215
						if(dataStr[i].hasHeadImage == 1) {
216
							baImg = baseUrl+"/images/head/" + dataStr[i].id + "_l.jpg";
217
						}
218
						
219
						var li = document.createElement("li");
220
						li.setAttribute("data-id", dataStr[i].id);
221
						li.setAttribute("data-flag", 1);
222
						li.className = "mui-table-view-cell flexCenter";
223
						li.innerHTML =
224
							' <div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
225
							'<div class="madiaInfo">' +
226
							'<p><span class="h1Font">' + dataStr[i].name + '</span><em class="authicon ' + userType.sty + '"></em></p>' +
227
							'<p class="mui-ellipsis h2Font">' + os + '</p>' +
228
							'</div>'
229
						document.getElementById(obj).appendChild(li);
230
					}
231
				});
232
			},
231 233
            questionModule = function (dataStr, liStr) {
232 234
                var baImg = "../images/default-q&a.jpg";
233 235
				var subs = new Array();
@ -368,35 +370,38 @@ mui.ready(function () {
368 370
            }
369 371
370 372
        var slideFun = function (index) {
373
        	var url=listData[index].url,
374
        		obj=listData[index].aimid
371 375
            if (index == "0") {
372
                document.getElementById("myQ").innerHTML = "";
373
                oAjaxGet("/ajax/question/my", {
376
                document.getElementById(obj).innerHTML = "";
377
                oAjaxGet(url, {
374 378
                    "uid": userid,
375 379
                    "rows": rows
376 380
                }, "get", oMyQ);
377 381
            } else if (index == "1") {
378
                document.getElementById("myA").innerHTML = "";
379
                oAjaxGet("/ajax/question/answer/bySelf", {
382
                document.getElementById(obj).innerHTML = "";
383
                oAjaxGet(url, {
380 384
                    "uid": userid,
381 385
                    "rows": rows
382 386
                }, "get", oMyA);
383 387
            } else if (index == "2") {
384
                document.getElementById("watchPro").innerHTML = "";
385
                oAjaxGet("/ajax/watch/qaPro", {
388
                document.getElementById(obj).innerHTML = "";
389
                oAjaxGet(url, {
386 390
                    "professorId": userid,
387
                    "watchType": 1,
388
                    "pageSize": pageSize,
389
                    "pageNo": pageNo
391
					"watchType":1,
392
					"createTime": watchO.watchTime,
393
					"watchObject":watchO.watchObjId,
394
					"rows":rows
390 395
                }, "get", oWatchPro);
391 396
            } else if (index == "3") {
392
                document.getElementById("watchQ").innerHTML = "";
393
                oAjaxGet("/ajax/question/watch", {
397
                document.getElementById(obj).innerHTML = "";
398
                oAjaxGet(url, {
394 399
                    "uid": userid,
395 400
                    "rows": rows
396 401
                }, "get", oWatchQ);
397 402
            } else if (index == "4") {
398
                document.getElementById("watchA").innerHTML = "";
399
                oAjaxGet("/ajax/question/answer/byWatch", {
403
                document.getElementById(obj).innerHTML = "";
404
                oAjaxGet(url, {
400 405
                    "uid": userid,
401 406
                    "rows": rows
402 407
                }, "get", oWatchA);
@ -404,34 +409,40 @@ mui.ready(function () {
404 409
        }
405 410
406 411
		allAgreeNum() 
407
        oAjaxGet("/ajax/question/my", {
412
        oAjaxGet(listData[0].url, {
408 413
            "uid": userid,
409 414
            "rows":rows
410 415
        }, "get", oMyQ);
411 416
        //左滑及右滑
412 417
        document.querySelector('#slider').addEventListener('slide', function (event) {
413
            // currentSelf.endPullUpToRefresh(false);
414 418
            mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function ($_index, pullRefreshEl) {
415 419
                var id = pullRefreshEl.getAttribute("data-pullToRefresh");
416 420
                if(id) {
417 421
                    pullRefreshEl.removeAttribute("data-pullToRefresh");
418 422
                }
419 423
            });
420
            dataO = {time: "", id: ""};pageNo = 1;
424
            dataO = {time: "", id: ""};
425
            watchO={
426
				watchTime:"",
427
				watchObjId:"",
428
			};
421 429
            var $this = document.querySelector(".mui-scroll .mui-active");
422 430
            var $type = $this.getAttribute("data-type");
423 431
            slideFun($type);
424 432
        });
425 433
        //点击
426 434
        document.querySelector('#slider').addEventListener('tap', function (event) {
427
            // currentSelf.endPullUpToRefresh(false);
428 435
            mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function ($_index, pullRefreshEl) {
429 436
                var id = pullRefreshEl.getAttribute("data-pullToRefresh");
430 437
                if(id) {
431 438
                    pullRefreshEl.removeAttribute("data-pullToRefresh");
432 439
                }
433 440
            });
434
            dataO = {time: "", id: ""};pageNo = 1;
441
            dataO = {time: "", id: ""};
442
            watchO={
443
				watchTime:"",
444
				watchObjId:"",
445
			};
435 446
            var $this = document.querySelector(".mui-scroll .mui-active");
436 447
            var $type = $this.getAttribute("data-type");
437 448
            slideFun($type);

+ 1 - 14
app/js/qa-question-show.js

@ -317,23 +317,10 @@ mui.ready(function() {
317 317
					})
318 318
				})
319 319
			}
320
		mui.ajax(baseUrl + '/ajax/question/pageViews',{
321
			"type" :  "POST" ,
322
			"dataType" : "json",
323
			"data" :{"qid":questionId},
324
			"success" : function(data) {
325
				console.log(data);
326
				if (data.success){
327
				}
328
			},
329
			"error":function(){
330
				
331
			}
332
		});
333
		
334 320
		pullEvent();
335 321
		getConmain();
336 322
		answerList();
323
		pageViewLog(questionId,8)
337 324
		moreMes();
338 325
		if(userid && userid != null && userid != "null") {
339 326
			anExist(); //判断是否回答过该问题

+ 277 - 209
app/js/qa-request-da.js

@ -1,232 +1,300 @@
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
6
});
1 7
mui.ready(function() {
2
	var qid, userid, username;
3
	var rows = 20,
4
		pageNum=1,
5
		dataC = {
6
			count: "",
7
			pid: ""
8
		};
9
	var pulldownRefresh = function() {
10
			setTimeout(function() {
11
				onePage();
12
				mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
13
			}, 1000);
14
		},
15
		pullupRefresh = function() {
16
			setTimeout(function() {
17
				morePage();
18
				mui('#pullrefresh').pullRefresh().endPullupToRefresh();
19
			}, 1000);
20
		}
21
	var oAjax = function(url, dataS, otype, oFun) {
22
			mui.ajax(baseUrl + url, {
23
				dataType: 'json',
24
				type: otype,
25
				data: dataS,
26
				success: function(res) {
27
					if(res.success) {
28
//						console.log(JSON.stringify(res))
29
						oFun(res)
8
	mui.plusReady(function() {
9
		var self = plus.webview.currentWebview();
10
			plus.nativeUI.closeWaiting();
11
			self.show("slide-in-right", 150);
12
		var qid=self.quid,
13
			userid = plus.storage.getItem('userid'),
14
			username = plus.storage.getItem('name');
15
		var rows = 1,
16
			pullRefreshEl,
17
			currentIndex,
18
			currentSelf,
19
			dataC = {
20
				count: "",
21
				pid: "",
22
				proSortFirst:"",
23
				proStarLevel: "",
24
				proId: ""
25
			};
26
		var oAjax = function(url, dataS, otype, oFun) {
27
				mui.ajax(baseUrl + url, {
28
					dataType: 'json',
29
					type: otype,
30
					data: dataS,
31
					traditional: true,
32
					success: function(res) {
33
						if(res.success) {
34
							oFun(res)
35
						}
30 36
					}
37
				});
38
			},
39
			insertNodata = function(targetE, newStr) {
40
				var parent = document.getElementById(targetE).parentNode;
41
				var kong = document.createElement("div");
42
				kong.className = "con-kong";
43
				kong.innerHTML = '<div class="picbox picNull"></div>' +
44
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
45
				if(newStr) {
46
					kong.querySelector(".txtbox").innerHTML = newStr;
31 47
				}
32
			});
33
		},
34
		onePage = function() {
35
			document.getElementById("questList").innerHTML = ""
36
			oAjax("/ajax/question/commendatoryPro", {
37
				"id": qid,
38
				"uid": userid,
39
				"rows": rows
40
			}, "get", myConList)
41
		},
42
		morePage = function() {
43
			oAjax("/ajax/question/commendatoryPro", {
44
				"id": qid,
45
				"uid": userid,
46
				"count": dataC.count,
47
				"pid": dataC.pid,
48
				"rows": rows
49
			}, "get", myConList)
50
		},
51
		myConList = function(res) {
52
			var $info = res.data;
53
			if($info.length > 0) {
54
				dataC.count = res.data[res.data.length - 1].kws;
55
				dataC.pid = res.data[res.data.length - 1].id;
56

57
				for(var i = 0; i < $info.length; i++) {
58
					var liStr = document.createElement("li");
59
					liStr.className = "mui-table-view-cell";
60
					liStr.setAttribute("data-id", $info[i].id);
61
					document.getElementById("questList").appendChild(liStr);
62
					proModule($info[i].id, liStr);
63
				}
64
				if($info.length > rows) {
65
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
48
				if(parent.firstChild.className == "con-kong") {
49
					return
50
				} else {
51
					parent.insertBefore(kong, parent.firstChild);
66 52
				}
67
			} else {
68
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
69
				return;
70
			}
71
		},
72
		proModule = function(pid, liStr) {
73
			oAjax("/ajax/professor/info/" + pid, {}, "get", function(res) {
74
				var dataStr = res.data
75
				var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
76
				var os = "";
77
				if(dataStr.title) {
78
					if(dataStr.orgName) {
79
						os = dataStr.title + "," + dataStr.orgName;
53
			},
54
			removeNodata = function (targetE) {
55
	            var parent = document.getElementById(targetE).parentNode;
56
	            if (parent.firstChild.className == "con-kong") {
57
	                parent.removeChild(parent.firstChild);
58
	            } else {
59
	                return
60
	            }
61
	        },
62
			myConList = function() {
63
				var aimId = "questList",
64
					newStr = "抱歉,没有搜到可以邀请的人<br/>您可以通过分享该问题的方式获得更多答案"
65
				oAjax("/ajax/question/commendatoryPro", {
66
					"id": qid,
67
					"uid": userid,
68
					"count": dataC.count,
69
					"pid": dataC.pid,
70
					"rows": rows
71
				}, "get", function(res){
72
					console.log(JSON.stringify(res))
73
					var obj = res.data;
74
					if(obj.length > 0) {
75
						dataC.count = obj[obj.length - 1].kws;
76
						dataC.pid = obj[obj.length - 1].id;
77
		
78
						for(var i = 0; i < obj.length; i++) {
79
							var liStr = document.createElement("li");
80
							liStr.className = "mui-table-view-cell";
81
							liStr.setAttribute("data-id", obj[i].id);
82
							document.getElementById(aimId).appendChild(liStr);
83
							proModule(obj[i].id, liStr);
84
						}
85
					}
86
					if (currentIndex != 0) {
87
		                currentIndex = 0;
88
		                mui.each(document.querySelectorAll('.mui-scroll-wrapper .mui-scroll'), function ($_index, pullRefreshEl) {
89
		                    if ($_index == 0) {
90
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
91
		                            up: {
92
		                                callback: function () {
93
		                                	if(currentSelf.loading){
94
			                                    setTimeout(function () {
95
			                                        myConList();
96
			                                        currentSelf.endPullUpToRefresh();
97
			                                    }, 1000);
98
		                                    }
99
		                                }
100
		                            }
101
		                        });
102
		                    }
103
		                })
104
		            }
105
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
106
					removeNodata(aimId);
107
					if(obj.length == 0 && liLen == 0) {
108
						document.getElementById(aimId).style.display="none";
109
						insertNodata(aimId, newStr);
110
					}
111
					if(obj.length < rows) {
112
						currentSelf.endPullUpToRefresh(true);
80 113
					} else {
81
						os = dataStr.title;
114
						currentSelf.endPullUpToRefresh(false);
82 115
					}
83
				} else {
84
					if(dataStr.office) {
116
				})
117
			},
118
			proModule = function(pid, liStr) {
119
				oAjax("/ajax/professor/info/" + pid, {}, "get", function(res) {
120
					var dataStr = res.data
121
					var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
122
					var os = "";
123
					if(dataStr.title) {
85 124
						if(dataStr.orgName) {
86
							os = dataStr.office + "," + dataStr.orgName;
125
							os = dataStr.title + "," + dataStr.orgName;
87 126
						} else {
88
							os = dataStr.office;
127
							os = dataStr.title;
89 128
						}
90 129
					} else {
91
						if(dataStr.orgName) {
92
							os = dataStr.orgName;
130
						if(dataStr.office) {
131
							if(dataStr.orgName) {
132
								os = dataStr.office + "," + dataStr.orgName;
133
							} else {
134
								os = dataStr.office;
135
							}
136
						} else {
137
							if(dataStr.orgName) {
138
								os = dataStr.orgName;
139
							}
93 140
						}
94 141
					}
95
				}
96
				var baImg = "../images/default-photo.jpg";
97
				if(dataStr.hasHeadImage == 1) {
98
					baImg = baseUrl + "/images/head/" + dataStr.id + "_l.jpg";
99
				}
100
				var oSub = "";
101
				if(dataStr.researchAreas.length) {
102
					var arr = [];
103
					for(var n = 0; n < dataStr.researchAreas.length; n++) {
104
						arr[n] = dataStr.researchAreas[n].caption;
142
					var baImg = "../images/default-photo.jpg";
143
					if(dataStr.hasHeadImage == 1) {
144
						baImg = baseUrl + "/images/head/" + dataStr.id + "_l.jpg";
105 145
					}
106
					oSub = "研究方向:" + arr.join(";");
107
				}
108
				liStr.setAttribute("data-id", dataStr.id);
109
				liStr.setAttribute("data-flag", 1);
110
				liStr.className = "mui-table-view-cell";
111
				liStr.innerHTML = '<div class="flexCenter flex-pright">' +
112
					'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
113
					'<div class="madiaInfo">' +
114
					'<p><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + '" title="' + userType.title + '"></em></p>' +
115
					'<p class="mui-ellipsis h2Font">' + os + '</p>' +
116
					'<p class="mui-ellipsis h2Font">' + oSub + '</p>' +
117
					'</div></div>' +
118
					'<span class="yaoqing">999</span>'
119
				var $str = $(liStr);
120
				inviteStatus(dataStr.id, $str);
121
			});
122
		},
123
		inviteStatus = function(id, $str) {
124
			oAjax("/ajax/question/invite", {
125
				"qid": qid,
126
				"pid": id,
127
				"uid": userid,
128
			}, "get", function(res) {
129
				if(res.data.length>0){
130
					$str.find(".yaoqing").addClass("yiyaoqing");
131
					$str.find(".yaoqing").html("已邀请");
132
					$str.find(".yaoqing").attr("data-type","0");
133
				}else{
134
					$str.find(".yaoqing").text("邀请")
135
					$str.find(".yaoqing").attr("data-type","1");
136
				}
137
			});
138
		},
139
		searchPage = function(searchval) {
140
			document.getElementById("questList").innerHTML = ""
141
			oAjax("/ajax/professor/pqBaseInfo", {
142
				"key": searchval,
143
				"pageSize": rows,
144
				"pageNo": pageNum++
145
			}, "get", searchConList)
146
		},
147
		searchConList = function(res) {
148
			console.log(JSON.stringify(res))
149
			var $info = res.data.data;
150
			if($info.length > 0) {
151
				for(var i = 0; i < $info.length; i++) {
152
					if($info[i].id==userid){
153
						
154
					}else{
155
						var liStr = document.createElement("li");
156
						liStr.className = "mui-table-view-cell";
157
						liStr.setAttribute("data-id", $info[i].id);
158
						document.getElementById("questList").appendChild(liStr);
159
						proModule($info[i].id, liStr);
146
					var oSub = "";
147
					if(dataStr.researchAreas.length) {
148
						var arr = [];
149
						for(var n = 0; n < dataStr.researchAreas.length; n++) {
150
							arr[n] = dataStr.researchAreas[n].caption;
151
						}
152
						oSub = "研究方向:" + arr.join(";");
160 153
					}
161
				}
162
				mui('#pullrefresh').pullRefresh().refresh(true);
163
				if(pageNum < Math.ceil(res.data.total / res.data.pageSize)) {
164
					mui('#pullrefresh').pullRefresh().endPullUpToRefresh(false);
165
				}else{
166
					mui('#pullrefresh').pullRefresh().endPullUpToRefresh(true);
167
				}
168
			} else {
169
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
170
				return;
171
			}
172
		}
173
		
174
	mui.init({
175
		pullRefresh: {
176
			container: '#pullrefresh',
177
			up: {
178
				height: 50,
179
				callback: pullupRefresh
154
					liStr.setAttribute("data-id", dataStr.id);
155
					liStr.setAttribute("data-flag", 1);
156
					liStr.className = "mui-table-view-cell";
157
					liStr.innerHTML = '<div class="flexCenter flex-pright">' +
158
						'<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
159
						'<div class="madiaInfo">' +
160
						'<p><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + '" title="' + userType.title + '"></em></p>' +
161
						'<p class="mui-ellipsis h2Font">' + os + '</p>' +
162
						'<p class="mui-ellipsis h2Font">' + oSub + '</p>' +
163
						'</div></div>' +
164
						'<span class="yaoqing">999</span>'
165
					var $str = $(liStr);
166
					inviteStatus(dataStr.id, $str);
167
				});
180 168
			},
181
//			down: {
182
//				auto: true,
183
//				callback: pulldownRefresh
184
//			}
185
		}
186
	});
187
	mui.plusReady(function() {
188
		var self = plus.webview.currentWebview();
189
			plus.nativeUI.closeWaiting();
190
			self.show("slide-in-right", 150);
191
			qid=self.quid;
192
		userid = plus.storage.getItem('userid');
193
		username = plus.storage.getItem('name');
194
		onePage();
195

196
		mui("#questList").on("tap", "li .flexCenter", function() {
197
			var id = this.parentNode.getAttribute("data-id");
198
			plus.nativeUI.showWaiting();
199
			plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
200
				proid: id
201
			});
202
		})
203
		mui("#questList").on("tap", ".yaoqing", function() {
204
			var id = this.parentNode.getAttribute("data-id");
205
			var type = this.getAttribute("data-type");
206
			var that = this
207
			if(type) {
169
			inviteStatus = function(id, $str) {
208 170
				oAjax("/ajax/question/invite", {
209 171
					"qid": qid,
210 172
					"pid": id,
211 173
					"uid": userid,
212
					"uname": username,
213
				}, "post", function(res) {
214
					that.setAttribute("data-type", "0");
215
					that.classList.add("yiyaoqing");
216
					that.innerText="已邀请";
217
					plus.nativeUI.toast("邀请成功");
174
				}, "get", function(res) {
175
					if(res.data.length>0){
176
						$str.find(".yaoqing").addClass("yiyaoqing");
177
						$str.find(".yaoqing").html("已邀请");
178
						$str.find(".yaoqing").attr("data-type","0");
179
					}else{
180
						$str.find(".yaoqing").text("邀请")
181
						$str.find(".yaoqing").attr("data-type","1");
182
					}
183
				});
184
			},
185
			searchPage = function(searchval) {
186
				var aimId = "questListSearch",
187
					newStr = "抱歉,没有搜到可以邀请的人<br/>您可以通过分享该问题的方式获得更多答案"
188
				oAjax("/ajax/professor/index/search", {
189
					"key": searchval,
190
					"sortFirst": dataC.proSortFirst,
191
					"starLevel":dataC.proStarLevel,
192
					"id": dataC.proId,
193
					"rows":rows
194
				}, "get", function(res){
195
					console.log(JSON.stringify(res))
196
					var obj = res.data;
197
					if(obj.length > 0) {
198
						dataC.proSortFirst = obj[obj.length - 1].sortFirst;
199
						dataC.proStarLevel = obj[obj.length - 1].starLevel;
200
						dataC.proId = obj[obj.length - 1].id;
201
						
202
						for(var i = 0; i < obj.length; i++) {
203
							if(obj[i].id==userid){
204
								
205
							}else{
206
								var liStr = document.createElement("li");
207
								liStr.className = "mui-table-view-cell";
208
								liStr.setAttribute("data-id", obj[i].id);
209
								document.getElementById(aimId).appendChild(liStr);
210
								proModule(obj[i].id, liStr);
211
							}
212
						}
213
					}
214
					if (currentIndex != 1) {
215
		                currentIndex = 1;
216
		                mui.each(document.querySelectorAll('.mui-scroll-wrapper .mui-scroll'), function ($_index, pullRefreshEl) {
217
		                    if ($_index == 1) {
218
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
219
		                            up: {
220
		                                callback: function () {
221
		                                	if(currentSelf.loading){
222
			                                    setTimeout(function () {
223
			                                        searchPage(searchval)
224
			                                        currentSelf.endPullUpToRefresh();
225
			                                    }, 1000);
226
		                                    }
227
		                                }
228
		                            }
229
		                        });
230
		                    }
231
		                })
232
		            }
233
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
234
					removeNodata(aimId);
235
					if(obj.length == 0 && liLen == 0) {
236
						document.getElementById(aimId).style.display="none";
237
						insertNodata(aimId, newStr);
238
					}
239
					if(obj.length < rows) {
240
						currentSelf.endPullUpToRefresh(true);
241
					} else {
242
						currentSelf.endPullUpToRefresh(false);
243
					}
218 244
				})
245
			},
246
			bindClikFun=function(){
247
				mui("#questList,#questListSearch").on("tap", "li .flexCenter", function() {
248
					var id = this.parentNode.getAttribute("data-id");
249
					plus.nativeUI.showWaiting();
250
					plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
251
						proid: id
252
					});
253
				})
254
				mui("#questList,#questListSearch").on("tap", ".yaoqing", function() {
255
					var id = this.parentNode.getAttribute("data-id");
256
					var type = this.getAttribute("data-type");
257
					var that = this
258
					if(type) {
259
						oAjax("/ajax/question/invite", {
260
							"qid": qid,
261
							"pid": id,
262
							"uid": userid,
263
							"uname": username,
264
						}, "post", function(res) {
265
							that.setAttribute("data-type", "0");
266
							that.classList.add("yiyaoqing");
267
							that.innerText="已邀请";
268
							plus.nativeUI.toast("邀请成功");
269
						})
270
					}
271
				})
272
				document.getElementById("searchval").addEventListener("keyup", function() {
273
					var e = event || window.event || arguments.caller.arguments[0];
274
					if(e.keyCode == 13) {
275
						document.getElementById("questListSearch").innerHTML = ""
276
						var searchval = document.getElementById("searchval").value;
277
						dataC = {
278
							proSortFirst:"",
279
							proStarLevel: "",
280
							proId: ""
281
						};
282
						document.getElementById("pullrefresh2").classList.remove("displayNone")
283
						document.getElementById("pullrefresh1").classList.add("displayNone")
284
						mui.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function ($_index, pullRefreshEl) {
285
			                var freshId = pullRefreshEl.getAttribute("data-pullToRefresh");
286
			                if(freshId) {
287
			                    pullRefreshEl.removeAttribute("data-pullToRefresh");
288
			                }
289
			            });
290
						searchPage(searchval)
291
					}
292
		
293
				});
219 294
			}
220
		})
221
		document.getElementById("searchval").addEventListener("keyup", function() {
222
			var e = event || window.event || arguments.caller.arguments[0];
223
			if(e.keyCode == 13) {
224
				var searchval = document.getElementById("searchval").value;
225
				searchPage(searchval)
226
			}
227

228
		});
295
			
296
		myConList()
297
		bindClikFun()
229 298
		
230 299
	})
231

232
})
300
})

+ 78 - 15
app/js/resourceShow.js

@ -31,23 +31,13 @@ mui.plusReady(function() {
31 31
	resourceId = self.resourceId;
32 32
	getRecourceMe();/*获取资源信息*/
33 33
	relatedArticles();/*相关文章信息*/
34
	relatedServices();
34 35
	interestingResources();
36
	pageViewLog(resourceId,2)
35 37
	mui('#detailDescp').on('tap','a',function(){
36 38
		plus.runtime.openURL( this.href);
37 39
	});
38
	mui.ajax(baseUrl + '/ajax/resource/pageViews',{
39
			"type": "POST",
40
			"dataType": "json",
41
			"data": {
42
				"resourceId": resourceId
43
			},
44
			"success": function(data) {
45
				if(data.success) {}
46
			},
47
			"error": function() {
48
				
49
			}
50
		});
40
	
51 41
	function getRecourceMe() {
52 42
		mui.plusReady(function() {
53 43
			mui.ajax(baseUrl + '/ajax/resource/queryOne', {
@ -280,9 +270,52 @@ mui.plusReady(function() {
280 270
				
281 271
					}
282 272
				}
273
			}
274
		});
275
	}
276
	function relatedServices() {
277
		mui.ajax(baseUrl + '/ajax/ware/byResourceWithModifyTime', {
278
			type: "GET",
279
			data: {
280
				"id": resourceId,
281
				"rows":5
283 282
			},
284
			error:  function(xhr, type, errorThrown) {
285
				plus.nativeUI.toast("服务器链接超时", toastStyle);
283
			dataType: "json",
284
			success: function(data) {
285
				console.log(JSON.stringify(data));
286
				if(data.success) {
287
					if(data.data.length == 0) {
288
						return;
289
					}
290
					document.getElementById("likeService").parentNode.classList.remove("displayNone");
291
					var $html= data.data;
292
					for(var i = 0; i < $html.length; i++) {
293
						var rImg="../images/default-service.jpg"
294
						if($html[i].images) {
295
							var subs = strToAry($html[i].images)
296
							if(subs.length > 0) {
297
								rImg=baseUrl+"/data/ware" + subs[0]
298
							}
299
						}
300
						var li = document.createElement("li");
301
						li.setAttribute("data-id",$html[i].id);
302
						li.className = "mui-table-view-cell";
303
						li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
304
							' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
305
							'<div class="madiaInfo OmadiaInfo">' +
306
							'<p class="mui-ellipsis-2 h1Font">' + $html[i].name + '</p>' +
307
							'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
308
							'</div>' +
309
							'</div>'
310
						var $li=$(li)
311
						document.getElementById("likeService").appendChild(li);
312
						if($html[i].category==1){
313
							proSigInfo($html[i].owner,$li)
314
						}else{
315
							orgSigInfo($html[i].owner,$li)
316
						}
317
					}
318
				}
286 319
			}
287 320
		});
288 321
	}
@ -443,6 +476,36 @@ mui.plusReady(function() {
443 476
			})
444 477
		}
445 478
	};
479
	function proSigInfo(id,$list){
480
		mui.ajax(baseUrl + "/ajax/professor/baseInfo/"+id, {
481
			type: "GET",
482
			data: {},
483
			dataType: "json",
484
			success: function(data) {
485
				var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
486
				$list.find(".ownerName").html(data.data.name)
487
				$list.find(".ownerSty").addClass(userType.sty)
488
			}
489
		});
490
	}
491
	function orgSigInfo(id,$list){
492
		mui.ajax(baseUrl + "/ajax/org/" + id, {
493
			type: "GET",
494
			data: {},
495
			dataType: "json",
496
			success: function(data) {
497
				var name=data.data.name;
498
				if(data.forShort){
499
					name=data.data.forShort
500
				}
501
				$list.find(".ownerName").html(name)
502
				if(data.data.authStatus == 3){
503
					$list.find(".ownerSty").addClass("authicon-com-ok")
504
				}
505
			}
506
		});
507
	}
508
	
446 509
	//咨询
447 510
	oconsultBtn.addEventListener('tap', function() {
448 511
		var reType = othisInfo.getAttribute("data-type");

+ 70 - 0
app/js/updateBasic-birthday.js

@ -0,0 +1,70 @@
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		var web = plus.webview.currentWebview();
4
		console.log(JSON.stringify(web));
5
		plus.nativeUI.closeWaiting();
6
		web.show("slide-in-right", 150);
7
		
8
		var userid = plus.storage.getItem('userid');
9
		var dateResult = document.getElementById('dateResult');
10
		
11
		if(web.birthday) {
12
			dateResult.innerText = web.birthday;
13
		}
14
		
15
		var showDatePickerButton = document.getElementById('showDatePicker');
16

17
		showDatePickerButton.addEventListener('tap', function() {
18
			var optionsJson = this.getAttribute('data-options') || '{}';
19
			var options = JSON.parse(optionsJson);
20
			var id = this.getAttribute('id');
21
			var picker = new mui.DtPicker(options);
22
			picker.show(function(rs) {
23
				dateResult.innerText = rs.text;
24
				picker.dispose();
25
			});
26
		}, false);
27
		
28
		document.getElementById("login").addEventListener("tap", function() {
29
			savePro();
30
		})
31

32
		function savePro() {
33
			var mess = {};
34
			mess.sex=web.sex;
35
			mess.birthday= dateResult.innerText;
36
			mess.name = web.name;
37
			mess.orgName = web.orgName;
38
			mess.department = web.department;
39
			mess.title = web.title;
40
			mess.office = web.office;
41
			mess.address = web.city;
42
			mess.email = web.email;
43
			mess.province = web.province;
44
			mess.phone = web.phone;
45
			mess.id = userid;
46
			var mess1 = JSON.stringify(mess);
47
			console.log(JSON.stringify(mess))
48
			mui.ajax({
49
				"url": baseUrl + '/ajax/professor',
50
				"type": "PUT",
51
				"async": true,
52
				"data": mess1,
53
				"contentType": "application/json",
54
				"success": function(data) {
55
					console.log(JSON.stringify(data));
56
					if(data.success) {
57
						plus.nativeUI.showWaiting();
58
						var web = plus.webview.getWebviewById("updateBasic.html");
59
						mui.fire(web, "newId", {
60
							rd: 1
61
						});
62
						mui.back();
63
					} else {
64
						plus.nativeUI.toast("服务器链接超时", toastStyle);
65
					}
66
				}
67
			});
68
		}
69
	})
70
})

+ 2 - 0
app/js/updateBasic-city.js

@ -54,6 +54,8 @@ mui.ready(function() {
54 54

55 55
		function savePro() {
56 56
			var mess = {};
57
			mess.sex=web.sex;
58
			mess.birthday=web.birthday;
57 59
			mess.name = web.name;
58 60
			mess.orgName = web.orgName;
59 61
			mess.department = web.department;

+ 2 - 0
app/js/updateBasic-depart.js

@ -27,6 +27,8 @@ mui.ready(function() {
27 27
					return;
28 28
				}
29 29
			}
30
			mess.sex=web.sex;
31
			mess.birthday=web.birthday;
30 32
			mess.name = web.name;
31 33
			mess.orgName = web.orgName;
32 34
			mess.department = document.getElementById("title").value;

+ 2 - 0
app/js/updateBasic-email.js

@ -44,6 +44,8 @@ mui.ready(function() {
44 44
					return;
45 45
				}
46 46
			}
47
			mess.sex=web.sex;
48
			mess.birthday=web.birthday;
47 49
			mess.name = web.name;
48 50
			mess.orgName = web.orgName;
49 51
			mess.department =web.department;

+ 2 - 0
app/js/updateBasic-org.js

@ -49,6 +49,8 @@ mui.ready(function() {
49 49
					return;
50 50
				}
51 51
			}
52
			mess.sex=web.sex;
53
			mess.birthday=web.birthday;
52 54
			mess.name = web.name;
53 55
			mess.orgName = document.getElementById("title").value;
54 56
			mess.department =web.department;

+ 2 - 0
app/js/updateBasic-post.js

@ -28,6 +28,8 @@ mui.ready(function() {
28 28
					return;
29 29
				}
30 30
			}
31
			mess.sex=web.sex;
32
			mess.birthday=web.birthday;
31 33
			mess.name = web.name;
32 34
			mess.orgName = web.orgName;
33 35
			mess.department = web.department;

+ 57 - 0
app/js/updateBasic-sex.js

@ -0,0 +1,57 @@
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		var web = plus.webview.currentWebview()
4
		web.show("slide-in-right", 150);
5
		var userid = plus.storage.getItem('userid');
6
		var sexRadio = document.getElementById("sexRadio");
7
		function person() {
8
			plus.nativeUI.closeWaiting();
9
			if(web.sex==1){
10
				sexRadio.getElementsByTagName('li')[0].classList.add("mui-selected")
11
			}else if(web.sex==2){
12
				sexRadio.getElementsByTagName('li')[1].classList.add("mui-selected")
13
			}
14
		}
15
		person();
16
		document.getElementById("login").addEventListener("tap",function(){
17
			savePro();
18
		})
19
		function savePro() {
20
			var mess = {};
21
			mess.sex=sexRadio.getElementsByClassName("mui-selected")[0].getAttribute("data-val");
22
			mess.birthday=web.birthday;
23
			mess.name = web.name;
24
			mess.orgName = web.orgName;
25
			mess.department =web.department;
26
			mess.title = web.title;
27
			mess.office =web.office;	
28
			mess.address = web.address;
29
			mess.province=web.province;
30
			mess.email = web.email;
31
			mess.phone =web.phone;			
32
			mess.id = userid;
33
			var mess1 = JSON.stringify(mess);
34
			console.log(JSON.stringify(mess))
35
			mui.ajax({
36
				"url": baseUrl + '/ajax/professor',
37
				"type": "PUT",
38
				"async": true,
39
				"data": mess1,
40
				"contentType": "application/json",
41
				"success": function(data) {
42
					console.log(JSON.stringify(data))
43
					if(data.success) {
44
						plus.nativeUI.showWaiting();
45
							var web = plus.webview.getWebviewById("updateBasic.html");
46
							mui.fire(web, "newId", {
47
								rd: 1
48
							});
49
						mui.back();
50
					} else {
51
						plus.nativeUI.toast("服务器链接超时", toastStyle);
52
					}
53
				}
54
			});
55
		}
56
	})
57
})

+ 2 - 0
app/js/updateBasic-tel.js

@ -30,6 +30,8 @@ mui.ready(function() {
30 30
					return;
31 31
				}
32 32
			}
33
			mess.sex=web.sex;
34
			mess.birthday=web.birthday;
33 35
			mess.name = web.name;
34 36
			mess.orgName = web.orgName;
35 37
			mess.department = web.department;

+ 2 - 0
app/js/updateBasic-title.js

@ -26,6 +26,8 @@ mui.ready(function() {
26 26
					return;
27 27
				}
28 28
			}
29
			mess.sex=web.sex;
30
			mess.birthday=web.birthday;
29 31
			mess.name = web.name;
30 32
			mess.orgName = web.orgName;
31 33
			mess.department = web.department;

+ 20 - 1
app/js/updateBasic.js

@ -45,6 +45,23 @@ mui.ready(function() {
45 45
							
46 46
						}
47 47
						person.name=$data.name;
48
						if($data.sex == 1) {
49
							document.getElementById('sex').innerHTML="男";
50
							person.sex=$data.sex;
51
						}else if($data.sex == 2){
52
							document.getElementById('sex').innerHTML="女";
53
							person.sex=$data.sex;
54
						}else{
55
							person.sex="";
56
							document.getElementById('sex').innerHTML="请选择性别";
57
						}
58
						if($data.birthday) {
59
							document.getElementById('birthday').innerHTML=$data.birthday;
60
							person.birthday=$data.birthday;
61
						}else{
62
							person.birthday="";
63
							document.getElementById('birthday').innerHTML="请选择出生日期";
64
						}
48 65
						if($data.orgName) {
49 66
							document.getElementById('orgName').innerHTML=$data.orgName;
50 67
							person.orgName=$data.orgName;
@ -126,7 +143,9 @@ mui.ready(function() {
126 143
			openNewWebview(obj.web);
127 144
		})
128 145
		}
129
		//职称
146
		
147
		bindEvent({selector:"sex",txt:"请选择性别",web:{html:'updateBasic-sex.html',id:"updateBasic-sex.html"}});
148
		bindEvent({selector:"birthday",txt:"请选择出生日期",web:{html:'updateBasic-birthday.html',id:"updateBasic-birthday.html"}});
130 149
		bindEvent({selector:"title",txt:"请填写最高职位",web:{html:'updateBasic-title.html',id:"updateBasic-title.html"}});
131 150
		bindEvent({selector:"department",txt:"请填写当前就职的部门",web:{html:'updateBasic-depart.html',id:"updateBasic-depart.html"}});
132 151
		bindEvent({selector:"office",txt:"请填写当前担任的职位",web:{html:'updateBasic-post.html',id:"updateBasic-post.html"}});

+ 0 - 109
app/js/userEvaluate.js

@ -1,109 +0,0 @@
1
var proId;
2
mui.init({
3
	pullRefresh: {
4
		container: '#pullrefresh',
5
		up: {
6
			height:50,
7
			contentrefresh: '正在加载...',
8
			callback: pullupRefresh
9
		}
10
	}
11
});
12
var Num=1;
13
function pullupRefresh() {
14
	setTimeout(function() {
15
		Num++;
16
		historyEvaluate(5,Num);
17
	}, 1000);
18

19
}
20
mui.plusReady(function() {
21
	var self = plus.webview.currentWebview();
22
	proId = self.proid;
23
	mui("#evaluateShow").on("tap", ".urlhref", function() {
24
		var id = this.getAttribute("data-id");
25
		plus.nativeUI.showWaiting();
26
		plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
27
			"proid": id,
28
		});
29
	})
30
	historyEvaluate(5,1);
31
})
32

33
function historyEvaluate(pageSize,pageNo){
34
	mui.plusReady(function() {
35
		mui.ajax(baseUrl + "/ajax/consult/pqAssessHis", {
36
			"type": "get",
37
			"data": {
38
				"professorId": proId,
39
				"pageSize": pageSize,
40
				"pageNo": pageNo
41
			},
42
			traditional: true,
43
			"timeout": 10000,
44
			"success": function(response) {
45
				plus.nativeUI.closeWaiting();
46
				plus.webview.currentWebview().show("slide-in-right", 150);
47
				if(response.success) {
48
					console.log(JSON.stringify(response))
49
					if(pageNo!=response.data.pageNo) {
50
						response.data.data=[];
51
					}
52
					var $data = response.data.data;
53
					if($data.length>0){
54
						for(var i = 0; i < $data.length; i++) {
55
							var add = document.createElement("li");
56
							var assessTime = commenTime($data[i].assessTime);
57
							var assessContant ="";
58
							if($data[i].assessContant) {
59
								assessContant = $data[i].assessContant;
60
							}
61
							var userhed='';
62
							if($data[i].professor.hasHeadImage) {
63
								userhed = 'background-image:url('+baseUrl+'/images/head/' + $data[i].professor.id + '_l.jpg)';
64
							} else {
65
								userhed = 'background-image:url(../images/default-photo.jpg)';
66
							}
67

68
							add.className = "mui-table-view-cell flexCenter levelbox";
69
							
70
							add.innerHTML='<div class="madiaHead useHead useHeadMsg urlhref" style="'+ userhed +'" data-id='+$data[i].professor.id+'></div>'+
71
							       '<div class="madiaInfo"><div class="mui-clearfix" style="position:relative">'+			
72
							       '<span class="h1Font urlhref" data-id='+$data[i].professor.id+'>'+ $data[i].professor.name +'</span>'+
73
							       '<em class="authicon authicon-pro"></em>'+			
74
							       '<ul class="starShow">'+					
75
								       '<li class="mui-icon iconfont icon-favor"></li>'+ 
76
								       '<li class="mui-icon iconfont icon-favor"></li>'+
77
								       '<li class="mui-icon iconfont icon-favor"></li>'+
78
								       '<li class="mui-icon iconfont icon-favor"></li>'+
79
								       '<li class="mui-icon iconfont icon-favor"></li>'+
80
							       '</ul></div>'+		
81
							       '<p class="h2Font messageContent">'+ assessContant +'</p>'+
82
							       '<span class="commenttime">'+ assessTime +'</span>'+
83
							       '</div>';
84
							document.getElementById("evaluateShow").appendChild(add);
85
							var startLeval = parseInt($data[i].assessStar);
86
							var start = add.querySelectorAll(".iconfont");
87
							console.log(JSON.stringify(startLeval))
88
							console.log(JSON.stringify(start))
89
							for(var j = 0; j < startLeval; j++) {
90
								start[j].classList.remove("icon-favor");
91
								start[j].classList.add("icon-favorfill");
92
							}
93
						}
94
					}
95
					if(pageNo < Math.ceil(response.data.total / response.data.pageSize)) {
96
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
97
					} else {
98
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
99
					}
100
				}
101
			},
102
			error: function() {
103
				plus.nativeUI.toast("服务器链接超时", toastStyle);
104
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
105
				return;
106
			}
107
		})
108
	})
109
}

+ 597 - 580
app/js/userInforShow.js

@ -1,5 +1,4 @@
1 1
mui.plusReady(function() {
2
	//test git1 
3 2
	var userid = plus.storage.getItem('userid');
4 3
	var self = plus.webview.currentWebview();
5 4
	var ozixun = document.getElementById("consultBtn");
@ -7,9 +6,10 @@ mui.plusReady(function() {
7 6
	var title="";
8 7
	if(userid == proId) {
9 8
		document.getElementsByClassName('footbox')[0].style.display = "none";
9
	}else{
10
		pageViewLog(proId,1)
10 11
	}
11 12
	var induSubjectShow = function(obj) {
12
		//console.log(JSON.stringify(obj));
13 13
		if(obj.data != undefined && obj.data.length != 0) {
14 14
			var subs = new Array();
15 15
			if(obj.data.indexOf(',')) {
@ -27,6 +27,21 @@ mui.plusReady(function() {
27 27
		}
28 28
	}
29 29
	var resear = "";
30
	//查询研究方向	
31
	var getRecords = function($researchAreaLogs, caption) {
32
		var ret = [];
33
		var t = 0;
34
		for(var i = 0; i < $researchAreaLogs.length; i++) {
35
			if(caption == $researchAreaLogs[i].caption) {
36
				ret[t] = {
37
					id: $researchAreaLogs[i].opreteProfessorId,
38
					img: $researchAreaLogs[i].hasHeadImage
39
				}
40
				t++;
41
			}
42
		}
43
		return ret;
44
	}
30 45
	var researchAreaShow = function($datas, $datarecords) {
31 46
		if($datas != undefined && $datas.length != 0) {
32 47
			var html = [];
@ -76,7 +91,6 @@ mui.plusReady(function() {
76 91
			document.getElementsByClassName("reserachMess")[0].innerHTML = html.join('')
77 92
		}
78 93
	}
79
	personalMessage();
80 94
	var authName = "";
81 95
	/*获取个人信息*/
82 96
	function personalMessage() {
@ -85,7 +99,6 @@ mui.plusReady(function() {
85 99
			type: 'GET', //http请求类型
86 100
			timeout: 10000, //超时设置
87 101
			success: function(data) {
88
				console.log(JSON.stringify(data))
89 102
				plus.nativeUI.closeWaiting();
90 103
				plus.webview.currentWebview().show("slide-in-right", 150);
91 104
				var $data = data.data;
@ -166,188 +179,192 @@ mui.plusReady(function() {
166 179
			}
167 180
		});
168 181
	}
169
	/*进入个人简介页面*/
170
	document.getElementById("detailProfessor").addEventListener("tap", function() {
171
		plus.nativeUI.showWaiting(); //显示原生等待框
172
		var webviewShow = plus.webview.create("../html/userInforShow-more.html", 'userInforShow-more.html', {}, {
173
			pId: proId
174
		})
175
	})
176 182
	
177
	getResource();
178
	getArticel();
179
	getPaper();
180
	getPatent();
181
	//historyEvaluate();
182
	relevantExperts();//合作专家
183
	relevantarticalList();//相关文章
184
	likeExperts();//感兴趣专家
185
	usersBrowse();
186
	//用户浏览页内容
187
	function usersBrowse(){
188
		mui.ajax(baseUrl + "/ajax/demand/pq", {
189
			type: "GET",
190
			timeout: 10000,
191
			dataType: "json",
192
			data:{
193
				"state":1,
194
				"uid":proId
195
			},
196
			success: function(data) {
197
				if(data.success){
198
					var obj = data.data.data;
199
					if(obj.length>0){
200
						for(var i=0;i<obj.length;i++){
201
							var li = document.createElement("li");
202
							li.setAttribute("id",obj[i].id);
203
							var needDate=obj[i].invalidDay;
204
							var lastDate=TimeTr(needDate);
205
							li.className = "mui-table-view-cell";
206
							var oString = '<div class="madiaInfo">'
207
								oString += '<p class="h1Font mui-ellipsis-2">'+obj[i].title+'</p>';
208
								oString += '<p class="h2Font mui-ellipsis-5">'+obj[i].descp+'</p>'
209
								oString += '<div class="showli mui-ellipsis">'
210
								oString += '<span>'+obj[i].province+'</span>'
211
								if(obj[i].duration!=0){oString += '<span>预期 '+demandDuration[obj[i].duration]+'</span>'}
212
								if(obj[i].cost!=0){oString += '<span>预算 '+demandCost[obj[i].cost]+'</span>'}
213
								oString += '<span>有效期至'+lastDate+' </span>'
214
							    oString += '</div>'
215
								oString += '</div>'
216
							
217
								li.innerHTML = oString;
218
								document.getElementById("bower_u").appendChild(li);
219
							
183
	var rows = 1
184
	var oAjax = function(url, dataS, otype, oFun) {
185
			mui.ajax(baseUrl+url,{
186
				dataType: 'json',
187
				type: otype,
188
				data: dataS,
189
				traditional: true,
190
				success: function(res) {
191
					if(res.success) {
192
						oFun(res)
193
					}
194
				}
195
			});
196
		},	
197
		demandListVal=function() {
198
			var aimId="demandShow"
199
			oAjax("/ajax/demand/pq",{
200
				"state":'1',
201
				"uid":proId,
202
				"pageSize":5
203
			}, "get", function(res){
204
				console.log(JSON.stringify(res));
205
				var obj = res.data.data;
206
				if(obj.length > 0) {
207
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
208
					for(var i = 0; i < obj.length; i++) {
209
						var li = document.createElement("li");
210
						li.setAttribute("data-id",obj[i].id);
211
						var needDate=obj[i].invalidDay;
212
						var lastDate=TimeTr(needDate);
213
						li.className = "mui-table-view-cell";
214
						var oString = '<div class="madiaInfo">'
215
							oString += '<p class="h1Font mui-ellipsis-2">'+obj[i].title+'</p>';
216
							oString += '<p class="h2Font mui-ellipsis-5">'+obj[i].descp+'</p>'
217
							oString += '<div class="showli mui-ellipsis h3Font">'
218
							oString += '<span>'+obj[i].province+'</span>'
219
							if(obj[i].duration!=0){oString += '<span>预期 '+demandDuration[obj[i].duration]+'</span>'}
220
							if(obj[i].cost!=0){oString += '<span>预算 '+demandCost[obj[i].cost]+'</span>'}
221
							oString += '<span>有效期至'+lastDate+' </span>'
222
						    oString += '</div>'
223
							oString += '</div>'
224
						li.innerHTML=oString
225
						document.getElementById(aimId).appendChild(li);
226
					}
227
				}
228
			})
229
		},
230
        articalListVal=function(){
231
			var aimId="articelShow"
232
			oAjax("/ajax/article/publish",{
233
				"category": "1",
234
				"owner":proId,
235
				"rows": rows
236
			}, "get", function(res){
237
				var obj = res.data;
238
				if(obj.length > 0) {
239
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
240
			
241
					for(var i = 0; i < obj.length; i++) {
242
						var hasImg="../images/default-artical.jpg"
243
						if(obj[i].articleImg) {
244
							hasImg=baseUrl+"/data/article/" + obj[i].articleImg
220 245
						}
221
					}else{
222
						document.getElementById("bower_u").parentNode.parentNode.style.display = "none";
246
						var li = document.createElement("li");
247
						li.setAttribute("data-id", obj[i].articleId);
248
						li.className = "mui-table-view-cell";
249
						li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
250
							'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
251
							'<div class="madiaInfo OmadiaInfo">' +
252
							'<p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>' +
253
							'<p class="h2Font mui-ellipsis"><span class="time">'+commenTime(obj[i].publishTime)+'</span></p>'+
254
							'</div>' +
255
							'</div>'
256
						document.getElementById(aimId).appendChild(li);
223 257
					}
224 258
				}
225
			},
226
			error: function() {
227
				plus.nativeUI.toast("服务器链接超时", toastStyle);
228
				return;
229
			}
230
		})
231
		
232
	}
233
	mui("#bower_u").on("tap","li",function(){
234
		var dId=this.getAttribute("id");
235
		plus.nativeUI.showWaiting();
236
		plus.webview.create("../html/needShow.html", 'needShow.html', {}, {
237
			demanid: dId,
238
			professorId:proId
239
		});
240
	})
241
	function getResource() {
242
		mui.ajax(baseUrl + "/ajax/resource/pqProPublish", {
243
			type: "GET",
244
			timeout: 10000,
245
			dataType: "json",
246
			data: {
247
				"professorId": proId
248
			},
249
			success: function(data) {
250
//				console.log(JSON.stringify(data))
251
				if(data.success) {
252
					var obj = data.data.data;
253
					if(obj.length > 0) {
254
						document.getElementById("resourceNum").innerText = data.data.total;
255
						if(obj.length > 2) {
256
							obj.length = 2;
257
							document.getElementById("seeMoreResource").classList.remove("displayNone");
259
			})
260
		},
261
		resourceListVal=function(){
262
			var aimId="resourceShow"
263
			oAjax("/ajax/resource/publish",{
264
				"category": "1",
265
				"owner":proId,
266
				"rows": rows
267
			}, "get", function(res){
268
				var obj = res.data;
269
				if(obj.length > 0) {
270
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
271
					for(var i = 0; i < obj.length; i++) {
272
						var cnt="", hasImg="../images/default-resource.jpg"
273
						if(obj[i].images.length) {
274
							hasImg= baseUrl + '/data/resource/' + obj[i].images[0].imageSrc 
258 275
						}
259
						for(var i = 0; i < obj.length; i++) {
260
							var liItem = document.createElement("li");
261
							liItem.className = "mui-table-view-cell"
262
							liItem.setAttribute("data-id", obj[i].resourceId)
263
							var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
264
							if(obj[i].images.length) {
265
								oString += '<div class="madiaHead resouseHead" style="background-image:url(' + baseUrl + '/data/resource/' + obj[i].images[0].imageSrc + ')"></div>'
266
							} else {
267
								oString += '<div class="madiaHead resouseHead"></div>'
268
							}
269
							oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis h1Font">' + obj[i].resourceName + '</p><p class="h2Font mui-ellipsis-2">用途:' + obj[i].supportedServices + '</p>'
270
							oString += '</div></div>'
271
							liItem.innerHTML = oString;
272
							document.getElementById("resourceShow").appendChild(liItem);
276
						if(obj[i].supportedServices){
277
							cnt="用途:"+ obj[i].supportedServices
273 278
						}
274
					} else {
275
						document.getElementById("resourceShow").parentNode.parentNode.style.display = "none";
279
						var li = document.createElement("li");
280
						li.setAttribute("data-id", obj[i].resourceId);
281
						li.className = "mui-table-view-cell";
282
						li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
283
							'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
284
							'<div class="madiaInfo OmadiaInfo">' +
285
							'<p class="mui-ellipsis-2 h1Font">' + obj[i].resourceName + '</p>' +
286
							'<p class="mui-ellipsis h2Font">' + cnt+ '</p>' +
287
							'</div>' +
288
							'</div>'
289
						document.getElementById(aimId).appendChild(li);
276 290
					}
277 291
				}
278
			},
279
			error: function() {
280
				plus.nativeUI.toast("服务器链接超时", toastStyle);
281
				return;
282
			}
283
		})
284
	}
285
	function getArticel() {
286
		mui.ajax(baseUrl + "/ajax/article/pqProPublish", {
287
			type: "GET",
288
			timeout: 10000,
289
			dataType: "json",
290
			data: {
291
				"professorId": proId
292
			},
293
			success: function(data) {
294
				console.log(JSON.stringify(data))
295
				if(data.success) {
296
					var obj = data.data.data;
297
					if(obj.length > 0) {
298
						document.getElementById("articalNum").innerText = data.data.total;
299
						if(obj.length > 2) {
300
							obj.length = 2;
301
							document.getElementById("seeMoreArtical").classList.remove("displayNone");
302
						}
303
						for(var i = 0; i < obj.length; i++) {
304
							var liItem = document.createElement("li");
305
							liItem.setAttribute("data-id", obj[i].articleId);
306
							liItem.setAttribute("owner-id", obj[i].professorId);
307
							liItem.className = "mui-table-view-cell"
308
							var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
309
							if(obj[i].articleImg) {
310
								oString += '<div class="madiaHead artHead" style="background-image:url(' + baseUrl + '/data/article/' + obj[i].articleImg + ')"></div>'
311
							} else {
312
								oString += '<div class="madiaHead artHead"></div>'
292
			})
293
		},
294
		serviceListVal=function(){
295
			var aimId="serviceShow"
296
			oAjax("/ajax/ware/publish",{
297
				"category":"1",
298
				"owner":proId,
299
				"rows": rows
300
			}, "get", function(res){
301
				var obj = res.data;
302
				if(obj.length > 0) {
303
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
304
					for(var i = 0; i < obj.length; i++) {
305
						var cnt="", hasImg="../images/default-service.jpg"
306
						if(obj[i].images) {
307
							var subs = strToAry(obj[i].images)
308
							if(subs.length > 0) {
309
								hasImg=baseUrl+"/data/ware" + subs[0]
313 310
							}
314
							oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>'
315
							oString += '<p class="h2Font mui-ellipsis"><span class="time">'+commenTime(obj[i].publishTime)+'</span></p>'
316
							oString += '</div></div>'
317
							liItem.innerHTML = oString;
318
							document.getElementById("articelShow").appendChild(liItem);
319 311
						}
320
					} else {
321
						document.getElementById("articelShow").parentNode.parentNode.style.display = "none";
312
						if(obj[i].cnt){
313
							cnt="内容:"+obj[i].cnt
314
						}
315
						var li = document.createElement("li");
316
						li.setAttribute("data-id", obj[i].id);
317
						li.className = "mui-table-view-cell";
318
						li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
319
							'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
320
							'<div class="madiaInfo OmadiaInfo">' +
321
							'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
322
							'<p class="mui-ellipsis h2Font">' + cnt+ '</p>' +
323
							'</div>' +
324
							'</div>'
325
						document.getElementById(aimId).appendChild(li);
322 326
					}
323 327
				}
324
			},
325
			error: function() {
326
				plus.nativeUI.toast("服务器链接超时", toastStyle);
327
				return;
328
			}
329
		})
330
	}
331
	function getPaper() {
332
		mui.ajax(baseUrl + "/ajax/ppaper/byProfessor", {
333
			type: "GET",
334
			timeout: 10000,
335
			dataType: "json",
336
			data: {
337
				"id": proId
338
			},
339
			success: function(data) {
340
				console.log(JSON.stringify(data))
341
				if(data.success) {
342
					var obj = data.data.data;
343
					if(obj.length > 0) {
344
						document.getElementById("paperNum").innerText = data.data.total;
345
						if(obj.length > 2) {
346
							obj.length = 2;
347
							document.getElementById("seeMorePaper").classList.remove("displayNone");
348
						}
349
						for(var i = 0; i < obj.length; i++) {
350
							var li = document.createElement("li");
328
			})
329
		},
330
		patentListVal=function(){
331
			var aimId="patent"
332
			oAjax("/ajax/ppatent/professor",{
333
				"category":"1",
334
				"owner":proId,
335
				"rows": rows
336
			}, "get", function(res){
337
				var obj = res.data;
338
				if(obj.length > 0) {
339
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
340
					for(var i = 0; i < obj.length; i++) {
341
						var li = document.createElement("li");
342
						li.setAttribute("data-id", obj[i].id);
343
						li.className = "mui-table-view-cell";
344
						li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
345
							'<div class="madiaHead patentHead"></div>' +
346
							'<div class="madiaInfo OmadiaInfo">' +
347
							'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
348
							'<p class="mui-ellipsis h2Font">' + obj[i].authors.substring(0, obj[i].authors.length - 1) + '</p>' +
349
							'</div>' +
350
							'</div>'
351
						document.getElementById(aimId).appendChild(li);
352
					}
353
				}
354
			})
355
		},
356
		paperListVal=function(){
357
			var aimId="paper"
358
			oAjax("/ajax/ppaper/professor",{
359
				"category":"1",
360
				"owner":proId,
361
				"rows": rows
362
			}, "get", function(res){
363
				var obj = res.data;
364
				if(obj.length > 0) {
365
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
366
					for(var i = 0; i < obj.length; i++) {
367
						var li = document.createElement("li");
351 368
							li.setAttribute("data-id", obj[i].id);
352 369
							li.className = "mui-table-view-cell";
353 370
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
@ -357,127 +374,398 @@ mui.plusReady(function() {
357 374
								'<p class="mui-ellipsis h2Font">' + obj[i].authors.substring(0, obj[i].authors.length - 1) + '</p>' +
358 375
								'</div>' +
359 376
								'</div>'
360
							document.getElementById("paper").appendChild(li);
361
						}
362
					} else {
363
						document.getElementById("paper").parentNode.parentNode.style.display = "none";
377
						document.getElementById(aimId).appendChild(li);
364 378
					}
365 379
				}
366
			},
367
			error: function() {
368
				plus.nativeUI.toast("服务器链接超时", toastStyle);
369
				return;
370
			}
371
		})
372
	}
373
	function getPatent() {
374
		mui.ajax(baseUrl + "/ajax/ppatent/byProfessor", {
375
			type: "GET",
376
			timeout: 10000,
377
			dataType: "json",
378
			data: {
379
				"id": proId
380
			},
381
			success: function(data) {
382
				if(data.success) {
383
					var obj = data.data.data;
384
					if(obj.length > 0) {
385
						document.getElementById("patentNum").innerText = data.data.total;
386
						if(obj.length > 2) {
387
							obj.length = 2;
388
							document.getElementById("seeMorePatent").classList.remove("displayNone");
389
						}
390
						for(var i = 0; i < obj.length; i++) {
391
							var li = document.createElement("li");
380
				
381
			})
382
		},
383
		answerListVal=function(){
384
        	var aimId="QAShow"
385
			oAjax("/ajax/question/answer/bySelf",{
386
                "uid":proId,
387
                "rows":rows
388
			}, "get", function(res){
389
				var obj = res.data;
390
				if(obj.length > 0) {
391
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
392
					for(var i = 0; i < obj.length; i++) {
393
						var hd = "";
394
		                if (obj[i].agree > 0) {
395
		                    hd = '<span>赞 ' + obj[i].agree + '</span>'
396
		                }
397
						var li = document.createElement("li");
392 398
							li.setAttribute("data-id", obj[i].id);
393 399
							li.className = "mui-table-view-cell";
394
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
395
								'<div class="madiaHead patentHead"></div>' +
396
								'<div class="madiaInfo OmadiaInfo">' +
397
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
398
								'<p class="mui-ellipsis h2Font">' + obj[i].authors.substring(0, obj[i].authors.length - 1) + '</p>' +
399
								'</div>' +
400
								'</div>'
401
							document.getElementById("patent").appendChild(li);
402
						}
403
					} else {
404
						document.getElementById("patent").parentNode.parentNode.style.display = "none";
400
							li.innerHTML = '<div class="madiaInfo">' +
401
			                    '<p class="h1Font mui-ellipsis-2 qa-question"></p>' +
402
			                    '<div class="flexCenter qa-owner"></div>' +
403
			                    '<div class="qa-con mui-ellipsis-5">' + listConCut(obj[i].cnt) + '</div>' +
404
			                    '<div class="showliSpan mui-ellipsis">' +
405
			                    '<span>' + commenTime(obj[i].createTime) + '</span>' + hd +'<span class="leaveMsgCount"></span>'+
406
			                    '</div>' +
407
			                    '</div>'
408
						document.getElementById(aimId).appendChild(li);
409
						var $str = $(li);
410
		                questioninfo(obj[i].qid, $str);
411
		                proinfo(obj[i].uid, $str);
412
						leaveMsgCount(obj[i].id, $str);
405 413
					}
406 414
				}
407
			},
408
			error: function() {
409
				plus.nativeUI.toast("服务器链接超时", toastStyle);
410
				return;
411
			}
412
		})
413
	}
414
	function historyEvaluate(){
415
		mui.ajax(baseUrl + "/ajax/consult/pqAssessHis", {
416
			"type": "get",
417
			"data": {
418
				"professorId": proId
419
			},
420
			"async": false,
421
			"success": function(response) {
422
				if(response.success) {
423
					var $data = response.data.data;
424
					if($data.length>0){
425
						document.getElementById("evaluateNum").innerText = response.data.total;
426
						if($data.length>2){
427
							$data.length =2;
428
							document.getElementById("seeMoreEvaluate").classList.remove("displayNone");
429
						}
430
						for(var i = 0; i < $data.length; i++) {
431
							var add = document.createElement("li");
432
							var assessTime = commenTime($data[i].assessTime);
433
							var assessContant ="";
434
							if($data[i].assessContant) {
435
								assessContant = $data[i].assessContant;
436
							}
437
							var userhed='';
438
							if($data[i].professor.hasHeadImage) {
439
								userhed = 'background-image:url('+baseUrl+'/images/head/' + $data[i].professor.id + '_l.jpg)';
440
							} else {
441
								userhed = 'background-image:url(../images/default-photo.jpg)';
442
							}
443

444
							add.className = "mui-table-view-cell flexCenter levelbox";
445
							
446
							add.innerHTML='<div class="madiaHead useHead useHeadMsg urlhref" style="'+ userhed +'" data-id='+$data[i].professor.id+'></div>'+
447
							       '<div class="madiaInfo"><div class="mui-clearfix" style="position:relative">'+			
448
							       '<span class="h1Font urlhref" data-id='+$data[i].professor.id+'>'+ $data[i].professor.name +'</span>'+
449
							       '<em class="authicon authicon-pro"></em>'+			
450
							       '<ul class="starShow">'+					
451
								       '<li class="mui-icon iconfont icon-favor"></li>'+ 
452
								       '<li class="mui-icon iconfont icon-favor"></li>'+
453
								       '<li class="mui-icon iconfont icon-favor"></li>'+
454
								       '<li class="mui-icon iconfont icon-favor"></li>'+
455
								       '<li class="mui-icon iconfont icon-favor"></li>'+
456
							       '</ul></div>'+		
457
							       '<p class="h2Font messageContent">'+ assessContant +'</p>'+
458
							       '<span class="commenttime">'+ assessTime +'</span>'+
459
							       '</div>';
460
							document.getElementById("evaluateShow").appendChild(add);
461
							var startLeval = parseInt($data[i].assessStar);
462
							var start = document.getElementsByClassName("levelbox")[i].querySelectorAll(".icon-favor");
463
							for(var j = 0; j < startLeval; j++) {
464
								start[j].classList.remove("icon-favor");
465
								start[j].classList.add("icon-favorfill");
415
			})
416
    	},
417
    	proinfo=function(pid, $str) {
418
			oAjax("/ajax/professor/baseInfo/" + pid,{}, "get", function(data){
419
                var dataStr = data.data
420
                var baImg = "../images/default-photo.jpg";
421
                if (dataStr.hasHeadImage == 1) {
422
                    baImg = baseUrl+"/images/head/" + dataStr.id + "_l.jpg";
423
                }
424
                var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
425
                var os = "";
426
                if (dataStr.title) {
427
                    if (dataStr.orgName) {
428
                        os = dataStr.title + "," + dataStr.orgName;
429
                    } else {
430
                        os = dataStr.title;
431
                    }
432
                } else {
433
                    if (dataStr.office) {
434
                        if (dataStr.orgName) {
435
                            os = dataStr.office + "," + dataStr.orgName;
436
                        } else {
437
                            os = dataStr.office;
438
                        }
439
                    } else {
440
                        if (dataStr.orgName) {
441
                            os = dataStr.orgName;
442
                        }
443
                    }
444
                }
445
                var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' +
446
                    '<div class="owner-info">' +
447
                    '<div class="owner-name"><span class="h1Font">' + dataStr.name + '</span><em class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
448
                    '<div class="owner-tit mui-ellipsis h2Font">' + os + '</div>' +
449
                    '</div>'
450
                $str.find(".qa-owner").html(str)
451
	        });
452
	    },
453
	    questioninfo=function(qid, $str) {
454
	        oAjax("/ajax/question/qo",{
455
	        	id:qid
456
	        }, "get", function(data){
457
                $str.find(".qa-question").html(data.data.title);
458
                if(data.data.pageViews>0){
459
                    $str.find(".qaPageview").html("阅读量 "+data.data.pageViews);
460
                }else{
461
                    $str.find(".qaPageview").hide()
462
                }
463
	        });
464
	    },
465
	    leaveMsgCount=function(id, $str) {
466
			oAjax("/ajax/leavemsg/count", {
467
				sid:id,
468
				stype: "4"
469
			}, "get", function(data) {
470
				if(data.success) {
471
					if(data.data > 0) {
472
						$str.find(".leaveMsgCount").html("留言 " + data.data);
473
					}
474
				}
475
			})
476
		},
477
		queryPubCount=function(){
478
			oAjax("/ajax/article/count/publish",{//文章总数
479
				"owner": proId,
480
				"category":"1"
481
			}, "GET", function(data){
482
				if(data.data>rows){
483
					$("#seeMoreArtical").removeClass("displayNone")
484
					$("#articalNum").text(data.data);
485
				}
486
			});
487
			oAjax("/ajax/resource/count/publish",{//资源总数
488
				"owner": proId,
489
				"category":"1"
490
			}, "GET", function(data){
491
				if(data.data>rows){
492
					$("#seeMoreResource").removeClass("displayNone")
493
					$("#resourceNum").text(data.data);
494
				}
495
			});
496
			oAjax("/ajax/ware/count/publish",{//服务总数
497
				"owner": proId,
498
				"category":"1"
499
			}, "GET", function(data){
500
				if(data.data>rows){
501
					$("#seeMoreService").removeClass("displayNone")
502
					$("#serviceNum").text(data.data);
503
				}
504
			});
505
			oAjax("/ajax/ppatent/count/publish",{//专利总数
506
				"owner": proId,
507
			}, "GET", function(data){
508
				if(data.data>rows){
509
					$("#seeMorePatent").removeClass("displayNone")
510
					$("#patentNum").text(data.data);
511
				}
512
			});
513
			oAjax("/ajax/ppaper/count/publish",{//论文总数
514
				"owner": proId,
515
			}, "GET", function(data){
516
				if(data.data>rows){
517
					$("#seeMorePaper").removeClass("displayNone")
518
					$("#paperNum").text(data.data);
519
				}
520
			});
521
			oAjax("/ajax/question/answer/bySelf/count",{//回答总数
522
				"uid": proId,
523
			}, "GET", function(data){
524
				if(data.data>rows){
525
					$("#seeMoreQA").removeClass("displayNone")
526
					$("#QANum").text(data.data);
527
				}
528
			});
529
		},
530
		bindClickFun=function(){
531
			/*进入个人简介页面*/
532
			document.getElementById("detailProfessor").addEventListener("tap", function() {
533
				plus.nativeUI.showWaiting(); //显示原生等待框
534
				var webviewShow = plus.webview.create("../html/userInforShow-more.html", 'userInforShow-more.html', {}, {
535
					pId: proId
536
				})
537
			})
538
			
539
			var clFlag = 1;//点赞
540
			mui(".reserachMess").on("click", ".plusbtn", function() {
541
				if(userid && userid != null && userid != "null") {
542
					if(clFlag) {
543
						clFlag = 0;
544
					} else {
545
						return;
546
					}
547
					if(this.getAttribute("data-isagree") > -1) {
548
						this.classList.remove("icon-appreciatefill");
549
						this.classList.add("icon-appreciate");
550
					} else {
551
						this.classList.add("icon-appreciatefill");
552
						//this.classlist.remove("plusbtn");
553
					}
554
		
555
					mui.ajax(this.getAttribute("data-isagree") > -1 ? baseUrl + "/ajax/researchArea/unAgree" : baseUrl + "/ajax/researchArea/agree", {
556
						"type": "POST",
557
						"data": {
558
							"targetId": this.getAttribute("data-pid"),
559
							"targetCaption": this.getAttribute("data-caption"),
560
							"opId": userid,
561
							"uname":plus.storage.getItem('name')
562
						},
563
						"contentType": "application/x-www-form-urlencoded",
564
						"success": function($data) {
565
		
566
							if($data.success) {
567
								mui.ajax(baseUrl + "/ajax/professor/info/" + proId, {
568
									dataType: 'json', //数据格式类型
569
									type: 'GET', //http请求类型
570
									timeout: 10000, //超时设置
571
									success: function(data) {
572
										clFlag = 1;
573
										var $data = data.data;
574
										//研究方向
575
										document.getElementsByClassName("reserachMess")[0].innerHTML = "";
576
										if($data.researchAreas.length) {
577
		
578
											researchAreaShow($data.researchAreas, $data.editResearchAreaLogs);
579
										}
580
		
581
									},
582
									error: function() {
583
										plus.nativeUI.toast("服务器链接超时", toastStyle);
584
										return;
585
									}
586
								});
466 587
							}
588
		
467 589
						}
468
					}else{
469
						document.getElementById("evaluateShow").parentNode.parentNode.style.display="none";	
470
					}
471
					
590
					})
591
				} else {
592
					isLogin();
472 593
				}
473
			},
474
			error: function() {
475
				plus.nativeUI.toast("服务器链接超时", toastStyle);
476
				return;
477
			}
478
		})
479
	}
480
     //合作专家
594
		
595
			})
596
			/*进入研究方向点赞页面*/
597
			mui("#professorReserachMess").on('tap', '.listbrowse,.likenum', function() {
598
				var dataCap = this.getAttribute("dataCaption");
599
				plus.nativeUI.showWaiting();
600
				plus.webview.close("researchAreaHead.html");
601
				setTimeout(function() {
602
					plus.webview.create("../html/researchAreaHead.html", 'researchAreaHead.html', {}, {
603
						dataCaption: dataCap,
604
						professorId: proId
605
					});
606
				}, 500);
607
			});
608
		
609
			ozixun.addEventListener('tap', function() {
610
				isLogin();
611
			});
612
			var oifAttend=document.getElementById("ifAttend")
613
			ifcollectionAbout(proId,oifAttend,1);
614
			document.getElementById('ifAttend').addEventListener("tap", function() {
615
				if(!userid) {
616
					mui.openWindow({
617
						url: '../html/login.html',
618
						id: '../html/login.html',
619
						show: {
620
							aniShow: "slide-in-right"
621
						},
622
						extras:{
623
							ourl:self.id
624
						}
625
					});
626
					return;
627
				}
628
				if(this.className == "mui-icon iconfontnew icon-yishoucang") {
629
					cancelCollectionAbout(proId,this, 1);
630
				} else {
631
					collectionAbout(proId,this,1);
632
				}
633
		
634
			})
635
			mui("#resourceShow").on("tap", "li", function() {
636
				var resouId = this.getAttribute("data-id");
637
				plus.nativeUI.showWaiting();
638
				plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
639
					resourceId: resouId
640
				});
641
			})
642
			mui("#serviceShow").on("tap", "li", function() {
643
				var serviceId = this.getAttribute("data-id");
644
				plus.nativeUI.showWaiting();
645
				plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
646
					serviceId: serviceId
647
				});
648
			})
649
			mui("#articelShow").on("tap", "li", function() {
650
				var id = this.getAttribute("data-id");
651
				var ownerid = this.getAttribute("owner-id");
652
				plus.nativeUI.showWaiting();
653
				plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
654
					articleId: id,
655
					ownerid: ownerid,
656
				});
657
			})
658
			mui("#paper").on("tap", "li", function() {
659
				var id = this.getAttribute("data-id");
660
				plus.nativeUI.showWaiting();
661
				plus.webview.create("../html/paperShow.html", 'paperShow.html', {}, {
662
					"paperId": id
663
				});
664
			})
665
			mui("#patent").on("tap", "li", function() {
666
				var id = this.getAttribute("data-id");
667
				plus.nativeUI.showWaiting();
668
				plus.webview.create("../html/patentShow.html", 'patentShow.html', {}, {
669
					"patentId": id
670
				});
671
			})
672
			mui("#relatePro,#likePro").on("tap", "li", function() {
673
				var id = this.getAttribute("data-id");
674
				plus.nativeUI.showWaiting();
675
				var webviewShow1=plus.webview.create("userInforShow.html", 'userInforShow.html', {}, {
676
					"proid": id,
677
				});
678
//				webviewShow1.addEventListener("loaded", function() {
679
//					setTimeout(function(){plus.webview.currentWebview().close()},1000)
680
//				}, false);
681
			})
682
			mui("#relateArt").on("tap", "li", function() {
683
				var id = this.getAttribute("data-id");
684
				plus.nativeUI.showWaiting();
685
				plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
686
					articleId: id
687
				});
688
			})
689
			mui("#demandShow").on("tap","li",function(){
690
				var dId=this.getAttribute("data-id");
691
				plus.nativeUI.showWaiting();
692
				plus.webview.create("../html/needShow.html", 'needShow.html', {}, {
693
					demanid: dId,
694
					professorId:proId
695
				});
696
			})
697
			mui("#QAShow").on("tap","li",function(){
698
				var AId=this.getAttribute("data-id");
699
				plus.nativeUI.showWaiting();
700
				plus.webview.create("../html/qa-answer-show.html", 'qa-answer-show.html', {}, {
701
					"anid":AId
702
				});
703
			})
704
			
705
			document.getElementById("seeMoreResource").addEventListener("tap", function() {
706
				plus.nativeUI.showWaiting();
707
				var webviewShow = plus.webview.create("../html/userresourceList.html", 'userresourceList.html', {}, {
708
					proid: proId
709
				})
710
			})
711
			document.getElementById("seeMorePatent").addEventListener("tap", function() {
712
				plus.nativeUI.showWaiting();
713
				var webviewShow = plus.webview.create("../html/userpatentList.html", 'userpatentList.html', {}, {
714
					proid: proId,
715
					authName: authName
716
				})
717
			})
718
			document.getElementById("seeMorePaper").addEventListener("tap", function() {
719
				plus.nativeUI.showWaiting();
720
				var webviewShow = plus.webview.create("../html/userpaperList.html", 'userpaperList.html', {}, {
721
					proid: proId,
722
					authName: authName
723
				})
724
			})
725
			document.getElementById("seeMoreArtical").addEventListener("tap", function() {
726
				plus.nativeUI.showWaiting();
727
				var webviewShow = plus.webview.create("../html/useraiticleList.html", 'useraiticleList.html', {}, {
728
					proid: proId
729
				})
730
			})
731
			document.getElementById("seeMoreService").addEventListener("tap", function() {
732
				plus.nativeUI.showWaiting(); 
733
				var webviewShow = plus.webview.create("../html/userService.html", 'userService.html', {}, {
734
					proid: proId
735
				})
736
			})
737
			document.getElementById("seeMoreQA").addEventListener("tap", function() {
738
				plus.nativeUI.showWaiting();
739
				var webviewShow = plus.webview.create("../html/userQAList.html", 'userQAList.html', {}, {
740
					proid: proId
741
				})
742
			})
743
			window.addEventListener("newId", function(event) {
744
				personalMessage();
745
				userid = plus.storage.getItem('userid')
746
				if(userid == proId) {
747
					document.getElementsByClassName('footbox')[0].style.display = "none";
748
				}
749
				ifcollectionAbout(proId, '1');
750
			});
751
	
752
		}
753
	
754
	personalMessage();
755
	demandListVal()
756
	serviceListVal()
757
	resourceListVal()
758
	articalListVal()
759
	patentListVal()
760
	paperListVal()
761
	answerListVal()
762
	relevantExperts();//合作专家
763
	relevantarticalList();//相关文章
764
	likeExperts();//感兴趣专家
765
	bindClickFun()
766
	queryPubCount();
767
	
768
	//合作专家
481 769
	function relevantExperts(){
482 770
		mui.ajax(baseUrl + "/ajax/professor/coadjutant", {
483 771
			"type": "get",
@ -502,10 +790,6 @@ mui.plusReady(function() {
502 790
					}
503 791
					
504 792
				}
505
			},
506
			error: function() {
507
				plus.nativeUI.toast("服务器链接超时", toastStyle);
508
				return;
509 793
			}
510 794
		});
511 795
	}
@ -565,10 +849,6 @@ mui.plusReady(function() {
565 849
					liItem.innerHTML = itemlist
566 850
					liItem.setAttribute("data-id",data.data.id)
567 851
				}
568
			},
569
			error: function() {
570
				plus.nativeUI.toast("服务器链接超时", toastStyle);
571
				return;
572 852
			}
573 853
		});
574 854
	}
@ -581,7 +861,6 @@ mui.plusReady(function() {
581 861
			"async":"false",
582 862
			"traditional": true, //传数组必须加这个
583 863
			"success" : function(data) {
584
				console.log(JSON.stringify(data));
585 864
				if (data.success && data.data!=""){
586 865
					document.getElementById("relateArt").parentNode.parentNode.classList.remove("displayNone");
587 866
					document.getElementById("relateArt").innerHTML="";
@ -609,7 +888,6 @@ mui.plusReady(function() {
609 888
								'dataType': "json",
610 889
								"success": function(data) {
611 890
									if(data.success) {
612
										console.log(JSON.stringify(data));
613 891
										var thisName,userType,thisAuth,thisTitle
614 892
										if(data.data.forShort){
615 893
											thisName=data.data.forShort;
@ -638,14 +916,9 @@ mui.plusReady(function() {
638 916
						})(i);
639 917
					}
640 918
				}
641
			},
642
			error: function() {
643
				plus.nativeUI.toast("服务器链接超时", toastStyle);
644
				return;
645 919
			}
646 920
		});
647 921
	}
648
    
649 922
    //感兴趣
650 923
	function likeExperts(){
651 924
		mui.ajax(baseUrl + "/ajax/professor/ralateProfessors", {
@ -667,13 +940,9 @@ mui.plusReady(function() {
667 940
					
668 941
				}
669 942
			},
670
			"error": function() {
671
				$.MsgBox.Alert('提示', '链接服务器超时')
672
			}
673 943
		});
674 944
	}
675
	//感兴趣专家
676
	function likeExpertsList(ExpId){
945
	function likeExpertsList(ExpId){//感兴趣专家
677 946
		mui.ajax(baseUrl + "/ajax/professor/info/"+ExpId, {
678 947
			"type" :  "GET" ,
679 948
			"dataType" : "json",
@ -720,90 +989,13 @@ mui.plusReady(function() {
720 989
					
721 990
				}
722 991
			},
723
			error: function() {
724
				plus.nativeUI.toast("服务器链接超时", toastStyle);
725
				return;
726
			}
727 992
		});
728 993
	}
729
	
730
	
731
	//点赞
732
	var clFlag = 1;
733
	mui(".reserachMess").on("click", ".plusbtn", function() {
734
		if(userid && userid != null && userid != "null") {
735
			if(clFlag) {
736
				clFlag = 0;
737
			} else {
738
				return;
739
			}
740
			if(this.getAttribute("data-isagree") > -1) {
741
				this.classList.remove("icon-appreciatefill");
742
				this.classList.add("icon-appreciate");
743
			} else {
744
				this.classList.add("icon-appreciatefill");
745
				//this.classlist.remove("plusbtn");
746
			}
747

748
			mui.ajax(this.getAttribute("data-isagree") > -1 ? baseUrl + "/ajax/researchArea/unAgree" : baseUrl + "/ajax/researchArea/agree", {
749
				"type": "POST",
750
				"data": {
751
					"targetId": this.getAttribute("data-pid"),
752
					"targetCaption": this.getAttribute("data-caption"),
753
					"opId": userid,
754
					"uname":plus.storage.getItem('name')
755
				},
756
				"contentType": "application/x-www-form-urlencoded",
757
				"success": function($data) {
758

759
					if($data.success) {
760
						mui.ajax(baseUrl + "/ajax/professor/info/" + proId, {
761
							dataType: 'json', //数据格式类型
762
							type: 'GET', //http请求类型
763
							timeout: 10000, //超时设置
764
							success: function(data) {
765
								clFlag = 1;
766
								var $data = data.data;
767
								//研究方向
768
								document.getElementsByClassName("reserachMess")[0].innerHTML = "";
769
								if($data.researchAreas.length) {
770

771
									researchAreaShow($data.researchAreas, $data.editResearchAreaLogs);
772
								}
773

774
							},
775
							error: function() {
776
								plus.nativeUI.toast("服务器链接超时", toastStyle);
777
								return;
778
							}
779
						});
780
					}
781

782
				}
783
			})
784
		} else {
785
			//			plus.nativeUI.toast("请先登录");
786
			isLogin();
787
		}
788

789
	})
790 994

791 995
	function isLogin() {
792 996
		var userid = plus.storage.getItem('userid');
793 997

794 998
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
795

796
//			var flag = 'professor';
797
//			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
798
//			webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
799
//				'proId': proId,
800
//				'flag': flag
801
//			});
802
//
803
//			webviewShow.addEventListener("loaded", function() {
804
//
805
//			}, false);
806
			
807 999
			var wechat=plus.webview.getWebviewById('weChat.html');
808 1000
			var jubao=plus.webview.getWebviewById('jubao.html');
809 1001
			
@ -842,182 +1034,32 @@ mui.plusReady(function() {
842 1034
			});
843 1035
		}
844 1036
	}
845
	//查询研究方向	
846
	var getRecords = function($researchAreaLogs, caption) {
847
		var ret = [];
848
		var t = 0;
849
		for(var i = 0; i < $researchAreaLogs.length; i++) {
850
			if(caption == $researchAreaLogs[i].caption) {
851
				ret[t] = {
852
					id: $researchAreaLogs[i].opreteProfessorId,
853
					img: $researchAreaLogs[i].hasHeadImage
854
				}
855
				t++;
1037
	
1038
	moreMes();
1039
	function moreMes(){
1040
		document.getElementById("BtnMore").addEventListener("tap",function(){
1041
			var str;
1042
			if(resear) {
1043
				str = "研究方向:" + resear
856 1044
			}
857
		}
858
		return ret;
859
	}
860
	/*进入研究方向点赞页面*/
861
	mui("#professorReserachMess").on('tap', '.listbrowse,.likenum', function() {
862
		var dataCap = this.getAttribute("dataCaption");
863
		plus.nativeUI.showWaiting();
864
		plus.webview.close("researchAreaHead.html");
865
		setTimeout(function() {
866
			plus.webview.create("../html/researchAreaHead.html", 'researchAreaHead.html', {}, {
867
				dataCaption: dataCap,
868
				professorId: proId
869
			});
870
		}, 500);
871
	});
872

873
	ozixun.addEventListener('tap', function() {
874
		isLogin();
875
	});
876
	var oifAttend=document.getElementById("ifAttend")
877
	ifcollectionAbout(proId,oifAttend,1);
878
	document.getElementById('ifAttend').addEventListener("tap", function() {
879
		if(!userid) {
880
			mui.openWindow({
881
				url: '../html/login.html',
882
				id: '../html/login.html',
883
				show: {
884
					aniShow: "slide-in-right"
1045
			plus.nativeUI.showWaiting(); //显示原生等待框
1046
		var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
1047
			proid: proId,
1048
			name:"professor",
1049
			data:{
1050
					content: str,
1051
					title: "【科袖名片】" + authName + " " + title + "",
1052
					href: baseUrl + "/e/p.html?id=" + proId,
1053
					thumbs: [baseUrl + "/images/head/" + proId + "_m.jpg"]
885 1054
				},
886
				extras:{
887
					ourl:self.id
1055
			weiboData:{
1056
					content:  "【科袖名片】" + authName + " " + title + ""+baseUrl + "/e/p.html?id=" + proId
888 1057
				}
889
			});
890
			return;
891
		}
892
		if(this.className == "mui-icon iconfontnew icon-yishoucang") {
893
			cancelCollectionAbout(proId,this, 1);
894
		} else {
895
			collectionAbout(proId,this,1);
896
		}
897

898
	})
899
	mui("#resourceShow").on("tap", "li", function() {
900
		var resouId = this.getAttribute("data-id");
901
		plus.nativeUI.showWaiting();
902
		plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
903
			resourceId: resouId
904
		});
905
	})
906
	mui("#articelShow").on("tap", "li", function() {
907
		var id = this.getAttribute("data-id");
908
		var ownerid = this.getAttribute("owner-id");
909
		plus.nativeUI.showWaiting();
910
		plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
911
			articleId: id,
912
			ownerid: ownerid,
913
		});
914
	})
915
	mui("#paper").on("tap", "li", function() {
916
		var id = this.getAttribute("data-id");
917
		plus.nativeUI.showWaiting();
918
		plus.webview.create("../html/paperShow.html", 'paperShow.html', {}, {
919
			"paperId": id
920
		});
921
	})
922
	mui("#patent").on("tap", "li", function() {
923
		var id = this.getAttribute("data-id");
924
		plus.nativeUI.showWaiting();
925
		plus.webview.create("../html/patentShow.html", 'patentShow.html', {}, {
926
			"patentId": id
927
		});
928
	})
929
	mui("#evaluateShow").on("tap", ".urlhref", function() {
930
		var id = this.getAttribute("data-id");
931
		plus.nativeUI.showWaiting();
932
		var webviewShow1=plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
933
			"proid": id,
934
		});
935
		webviewShow1.addEventListener("loaded", function() {
936
				setTimeout(function(){plus.webview.currentWebview().close()},1000)
937
				
938
			}, false);
939
	})
940
	mui("#relatePro,#likePro").on("tap", "li", function() {
941
		var id = this.getAttribute("data-id");
942
		plus.nativeUI.showWaiting();
943
		var webviewShow1=plus.webview.create("userInforShow.html", 'userInforShow.html', {}, {
944
			"proid": id,
945
		});
946
		webviewShow1.addEventListener("loaded", function() {
947
				setTimeout(function(){plus.webview.currentWebview().close()},1000)
948
				
949
			}, false);
950
	})
951
	mui("#relateArt").on("tap", "li", function() {
952
		var id = this.getAttribute("data-id");
953
		plus.nativeUI.showWaiting();
954
		plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
955
			articleId: id
956
		});
957
	})
958

959
	document.getElementById("seeMoreResource").addEventListener("tap", function() {
960
		console.log(proId)
961
		plus.nativeUI.showWaiting(); //显示原生等待框
962
		var webviewShow = plus.webview.create("../html/userresourceList.html", 'userresourceList.html', {}, {
963
			proid: proId
964
		})
965
	})
966
	document.getElementById("seeMorePatent").addEventListener("tap", function() {
967
		plus.nativeUI.showWaiting(); //显示原生等待框
968
		var webviewShow = plus.webview.create("../html/userpatentList.html", 'userpatentList.html', {}, {
969
			proid: proId,
970
			authName: authName
971
		})
972
	})
973
	document.getElementById("seeMorePaper").addEventListener("tap", function() {
974
		plus.nativeUI.showWaiting(); //显示原生等待框
975
		var webviewShow = plus.webview.create("../html/userpaperList.html", 'userpaperList.html', {}, {
976
			proid: proId,
977
			authName: authName
978
		})
979
	})
980
	document.getElementById("seeMoreArtical").addEventListener("tap", function() {
981
		plus.nativeUI.showWaiting(); //显示原生等待框
982
		var webviewShow = plus.webview.create("../html/useraiticleList.html", 'useraiticleList.html', {}, {
983
			proid: proId
984 1058
		})
985
	})
986
	document.getElementById("seeMoreEvaluate").addEventListener("tap", function() {
987
		plus.nativeUI.showWaiting(); //显示原生等待框
988
		var webviewShow = plus.webview.create("../html/userEvaluate.html", 'userEvaluate.html', {}, {
989
			proid: proId
990 1059
		})
991
	})
992
	window.addEventListener("newId", function(event) {
993
		personalMessage();
994
		userid = plus.storage.getItem('userid')
995
		if(userid == proId) {
996
			document.getElementsByClassName('footbox')[0].style.display = "none";
997
		}
998
		ifcollectionAbout(proId, '1');
999
	});
1000
	
1001
	liulanNum();
1002
	function liulanNum() {
1003
		mui.ajax(baseUrl+"/ajax/professor/incPageViews",{
1004
			"type": "POST",
1005
			"dataType": "json",
1006
			"async": true,
1007
			"data": {
1008
				"id": proId,
1009
			},
1010
			"success": function(data) {
1011
				if(data.success) {
1012
					console.log(JSON.stringify(data))
1013
				}
1014
			},
1015
			error: function() {
1016
				plus.nativeUI.toast("服务器链接超时", toastStyle);
1017
				return;
1018
			}
1019
		});
1020 1060
	}
1061

1062
	
1021 1063
	/*微信及微信朋友圈分享专家*/
1022 1064
	var auths, shares;
1023 1065
	plus.oauth.getServices(function(services) {
@ -1087,7 +1129,6 @@ mui.plusReady(function() {
1087 1129
		}
1088 1130

1089 1131
	})
1090

1091 1132
	function buildShareService(ttt) {
1092 1133
		var share = shares[ttt];
1093 1134
		if(share) {
@ -1109,7 +1150,6 @@ mui.plusReady(function() {
1109 1150
		}
1110 1151

1111 1152
	}
1112

1113 1153
	function shareMessage(share, ex, msg) {
1114 1154
		msg.extra = {
1115 1155
			scene: ex
@ -1128,29 +1168,6 @@ mui.plusReady(function() {
1128 1168
			}
1129 1169
		});
1130 1170
	}
1131
	/*图像预览*/
1132
	mui.previewImage();
1133
	 moreMes();
1134
	function moreMes(){
1135
		document.getElementById("BtnMore").addEventListener("tap",function(){
1136
			var str;
1137
			if(resear) {
1138
				str = "研究方向:" + resear
1139
			}
1140
			plus.nativeUI.showWaiting(); //显示原生等待框
1141
		var webviewShow = plus.webview.create("../html/moreItem.html", 'moreItem.html', {}, {
1142
			proid: proId,
1143
			name:"professor",
1144
			data:{
1145
					content: str,
1146
					title: "【科袖名片】" + authName + " " + title + "",
1147
					href: baseUrl + "/e/p.html?id=" + proId,
1148
					thumbs: [baseUrl + "/images/head/" + proId + "_m.jpg"]
1149
				},
1150
			weiboData:{
1151
					content:  "【科袖名片】" + authName + " " + title + ""+baseUrl + "/e/p.html?id=" + proId
1152
				}
1153
		})
1154
		})
1155
	}
1171
	
1172
	mui.previewImage();/*图像预览*/
1156 1173
});

+ 208 - 0
app/js/userQAList.js

@ -0,0 +1,208 @@
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
6
});
7
mui.ready(function() {
8
	mui.plusReady(function() {
9
		var self = plus.webview.currentWebview();
10
		var proId = self.proid;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				AnsTime:"",
17
				AnsId:"",
18
			}
19
		var oAjax = function(url, dataS, otype, oFun) {
20
				mui.ajax(baseUrl + url, {
21
					dataType: 'json',
22
					type: otype,
23
					data: dataS,
24
					traditional: true,
25
					success: function(res) {
26
						if(res.success) {
27
							oFun(res)
28
						}
29
					}
30
				});
31
			},
32
			insertNodata = function(targetE, newStr) {
33
				var parent = document.getElementById(targetE).parentNode;
34
				var kong = document.createElement("div");
35
				kong.className = "con-kong";
36
				kong.innerHTML = '<div class="picbox picNull"></div>' +
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
				if(newStr) {
39
					kong.querySelector(".txtbox").innerHTML = newStr;
40
				}
41
				if(parent.firstChild.className == "con-kong") {
42
					return
43
				} else {
44
					parent.insertBefore(kong, parent.firstChild);
45
				}
46
			},
47
			removeNodata = function (targetE) {
48
	            var parent = document.getElementById(targetE).parentNode;
49
	            if (parent.firstChild.className == "con-kong") {
50
	                parent.removeChild(parent.firstChild);
51
	            } else {
52
	                return
53
	            }
54
	        },
55
			answerListVal = function(tabIndex) {
56
				var aimId = "QAShow",
57
					newStr = "企业尚未发布任何问答"
58
				oAjax("/ajax/question/answer/bySelf",{
59
					"time":dataO.AnsTime,
60
	                "id":dataO.AnsId,
61
	                "uid":proId,
62
	                "rows":rows
63
				}, "get", function(res){
64
					plus.nativeUI.closeWaiting();
65
					plus.webview.currentWebview().show("slide-in-right", 150);
66
					console.log(JSON.stringify(res))
67
					var obj = res.data;
68
					if(obj.length > 0) {
69
						dataO.AnsTime = obj[obj.length - 1].createTime;
70
						dataO.AnsId = obj[obj.length - 1].id;
71
						
72
						for(var i = 0; i < obj.length; i++) {
73
							var hd = "";
74
			                if (obj[i].agree > 0) {
75
			                    hd = '<span>赞 ' + obj[i].agree + '</span>'
76
			                }
77
							var li = document.createElement("li");
78
								li.setAttribute("data-id", obj[i].id);
79
								li.className = "mui-table-view-cell";
80
								li.innerHTML = '<div class="madiaInfo">' +
81
				                    '<p class="h1Font mui-ellipsis-2 qa-question"></p>' +
82
				                    '<div class="flexCenter qa-owner"></div>' +
83
				                    '<div class="qa-con mui-ellipsis-5">' + listConCut(obj[i].cnt) + '</div>' +
84
				                    '<div class="showliSpan mui-ellipsis">' +
85
				                    '<span>' + commenTime(obj[i].createTime) + '</span>' + hd +'<span class="leaveMsgCount"></span>'+
86
				                    '</div>' +
87
				                    '</div>'
88
							document.getElementById(aimId).appendChild(li);
89
							var $str = $(li);
90
			                questioninfo(obj[i].qid, $str);
91
			                proinfo(obj[i].uid, $str);
92
							leaveMsgCount(obj[i].id, $str);
93
						}
94
					}
95
					if (currentIndex != tabIndex) {
96
		                currentIndex = tabIndex;
97
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
98
		                    if ($_index == tabIndex) {
99
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
100
		                            up: {
101
		                                callback: function () {
102
		                                	if(currentSelf.loading){
103
			                                    setTimeout(function () {
104
			                                         answerListVal(tabIndex)
105
			                                         currentSelf.endPullUpToRefresh();
106
			                                    }, 1000);
107
		                                    }
108
		                                }
109
		                            }
110
		                        });
111
		                    }
112
		                })
113
		            }
114
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
115
					removeNodata(aimId);
116
					if(obj.length == 0 && liLen == 0) {
117
						document.getElementById(aimId).style.display="none";
118
						insertNodata(aimId, newStr);
119
					}
120
					if(obj.length < rows) {
121
						currentSelf.endPullUpToRefresh(true);
122
					} else {
123
						currentSelf.endPullUpToRefresh(false);
124
					}
125
				})
126
			},
127
			proinfo=function(pid, $str) {
128
				oAjax("/ajax/professor/baseInfo/" + pid,{}, "get", function(data){
129
	                var dataStr = data.data
130
	                var baImg = "../images/default-photo.jpg";
131
	                if (dataStr.hasHeadImage == 1) {
132
	                    baImg = baseUrl+"/images/head/" + dataStr.id + "_l.jpg";
133
	                }
134
	                var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
135
	                var os = "";
136
	                if (dataStr.title) {
137
	                    if (dataStr.orgName) {
138
	                        os = dataStr.title + "," + dataStr.orgName;
139
	                    } else {
140
	                        os = dataStr.title;
141
	                    }
142
	                } else {
143
	                    if (dataStr.office) {
144
	                        if (dataStr.orgName) {
145
	                            os = dataStr.office + "," + dataStr.orgName;
146
	                        } else {
147
	                            os = dataStr.office;
148
	                        }
149
	                    } else {
150
	                        if (dataStr.orgName) {
151
	                            os = dataStr.orgName;
152
	                        }
153
	                    }
154
	                }
155
	                var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' +
156
	                    '<div class="owner-info">' +
157
	                    '<div class="owner-name"><span class="h1Font">' + dataStr.name + '</span><em class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
158
	                    '<div class="owner-tit mui-ellipsis h2Font">' + os + '</div>' +
159
	                    '</div>'
160
	                $str.find(".qa-owner").html(str)
161
		        });
162
		    },
163
		    questioninfo=function(qid, $str) {
164
		        oAjax("/ajax/question/qo",{
165
		        	id:qid
166
		        }, "get", function(data){
167
	                $str.find(".qa-question").html(data.data.title);
168
	                if(data.data.pageViews>0){
169
	                    $str.find(".qaPageview").html("阅读量 "+data.data.pageViews);
170
	                }else{
171
	                    $str.find(".qaPageview").hide()
172
	                }
173
		        });
174
		    },
175
		    leaveMsgCount=function(id, $str) {
176
				oAjax("/ajax/leavemsg/count", {
177
					sid:id,
178
					stype: "4"
179
				}, "get", function(data) {
180
					if(data.success) {
181
						if(data.data > 0) {
182
							$str.find(".leaveMsgCount").html("留言 " + data.data);
183
						}
184
					}
185
				})
186
			},
187
			bindClikFun=function(){
188
				mui("#QAShow").on("tap","li",function(){
189
					var AId=this.getAttribute("data-id");
190
					plus.nativeUI.showWaiting();
191
					plus.webview.create("../html/qa-answer-show.html", 'qa-answer-show.html', {}, {
192
						"anid":AId
193
					});
194
				})
195
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
196
					var web = plus.webview.getWebviewById("cmpInforShow.html");
197
					if(web)
198
						mui.fire(web, "newId", {
199
							rd: 1
200
						});
201
				})
202
			}
203
			
204
		answerListVal(0)
205
		bindClikFun()
206
		
207
	})
208
})

+ 130 - 79
app/js/userarticleList.js

@ -1,93 +1,144 @@
1
var proId;
2
mui.init({
3
	pullRefresh: {
4
		container: '#pullrefresh',
5
		up: {
6
			height:50,
7
			contentrefresh: '正在加载...',
8
			callback: pullupRefresh
9
		}
10
	}
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
11 6
});
12
var Num=1;
13
function pullupRefresh() {
14
	setTimeout(function() {
15
		++Num;
16
		getArticel(10,Num);
17
	}, 1000);
18

19
}
20

21
mui.plusReady(function() {
22
	var self = plus.webview.currentWebview();
23
	proId = self.proid;
24
	mui("#articelShow").on("tap", "li", function() {
25
		var id = this.getAttribute("data-id");
26
		var ownerid = this.getAttribute("owner-id");
27
		console.log(id);
28
		console.log(ownerid)
29
		plus.nativeUI.showWaiting();
30
		plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
31
			articleId: id,
32
			ownerid: ownerid,
33
		});
34
	})
35
	getArticel(10,1);
36
})
37

38
function getArticel(pageSize,pageNo) {
7
mui.ready(function() {
39 8
	mui.plusReady(function() {
40
		mui.ajax(baseUrl + "/ajax/article/pqProPublish", {
41
			type: "GET",
42
			timeout: 10000,
43
			dataType: "json",
44
			data: {
45
				"professorId": proId,
46
				"pageSize": pageSize,
47
				"pageNo": pageNo
48
			},
49
			success: function(data) {
50
				plus.nativeUI.closeWaiting();
51
				plus.webview.currentWebview().show("slide-in-right", 150);
52
				console.log(JSON.stringify(data))
53
				if(data.success) {
54
					if(pageNo!=data.data.pageNo) {
55
						data.data.data=[];
9
		var self = plus.webview.currentWebview();
10
		var proId = self.proid;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				artPublishTime: "",
17
				artShareId: "",
18
			}
19
		var oAjax = function(url, dataS, otype, oFun) {
20
				mui.ajax(baseUrl + url, {
21
					dataType: 'json',
22
					type: otype,
23
					data: dataS,
24
					traditional: true,
25
					success: function(res) {
26
						if(res.success) {
27
							oFun(res)
28
						}
56 29
					}
57
					var obj = data.data.data;
30
				});
31
			},
32
			insertNodata = function(targetE, newStr) {
33
				var parent = document.getElementById(targetE).parentNode;
34
				var kong = document.createElement("div");
35
				kong.className = "con-kong";
36
				kong.innerHTML = '<div class="picbox picNull"></div>' +
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
				if(newStr) {
39
					kong.querySelector(".txtbox").innerHTML = newStr;
40
				}
41
				if(parent.firstChild.className == "con-kong") {
42
					return
43
				} else {
44
					parent.insertBefore(kong, parent.firstChild);
45
				}
46
			},
47
			removeNodata = function (targetE) {
48
	            var parent = document.getElementById(targetE).parentNode;
49
	            if (parent.firstChild.className == "con-kong") {
50
	                parent.removeChild(parent.firstChild);
51
	            } else {
52
	                return
53
	            }
54
	        },
55
			articalListVal = function(tabIndex) {
56
				var aimId = "articelShow",
57
					newStr = "他尚未发布任何文章"
58
				oAjax("/ajax/article/publish", {
59
					"category": "1",
60
					"owner": proId,
61
					"publishTime": dataO.artPublishTime,
62
					"shareId": dataO.artShareId,
63
					"rows": rows
64
				}, "get", function(res) {
65
					plus.nativeUI.closeWaiting();
66
					plus.webview.currentWebview().show("slide-in-right", 150);
67
					console.log(JSON.stringify(res))
68
					var obj = res.data;
58 69
					if(obj.length > 0) {
70
						dataO.artPublishTime = obj[obj.length - 1].publishTime;
71
						dataO.artShareId = obj[obj.length - 1].shareId;
72
						
59 73
						for(var i = 0; i < obj.length; i++) {
60
							var liItem = document.createElement("li");
61
							liItem.setAttribute("data-id", obj[i].articleId);
62
							liItem.setAttribute("owner-id", obj[i].professorId);
63
							liItem.className = "mui-table-view-cell"
64
							var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
74
							var hasImg = "../images/default-artical.jpg"
65 75
							if(obj[i].articleImg) {
66
								oString += '<div class="madiaHead artHead" style="background-image:url(' + baseUrl + '/data/article/' + obj[i].articleImg + ')"></div>'
67
							} else {
68
								oString += '<div class="madiaHead artHead"></div>'
76
								hasImg = baseUrl + "/data/article/" + obj[i].articleImg
69 77
							}
70
							oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>'
71
							oString += '<p class="h2Font mui-ellipsis"><span class="time">'+commenTime(obj[i].publishTime)+'</span></p>'
72
							oString += '</div></div>'
73
							liItem.innerHTML = oString;
74
							document.getElementById("articelShow").appendChild(liItem);
78
							var li = document.createElement("li");
79
							li.setAttribute("data-id", obj[i].articleId);
80
							li.className = "mui-table-view-cell";
81
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
82
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
83
								'<div class="madiaInfo OmadiaInfo">' +
84
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].articleTitle + '</p>' +
85
								'<p class="h2Font mui-ellipsis"><span class="time">' + commenTime(obj[i].publishTime) + '</span></p>' +
86
								'</div>' +
87
								'</div>'
88
							document.getElementById(aimId).appendChild(li);
75 89
						}
76 90
					}
77
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
78
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
91
					if (currentIndex != tabIndex) {
92
		                currentIndex = tabIndex;
93
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
94
		                    if ($_index == tabIndex) {
95
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
96
		                            up: {
97
		                                callback: function () {
98
		                                	if(currentSelf.loading){
99
			                                    setTimeout(function () {
100
			                                         articalListVal(tabIndex)
101
			                                         currentSelf.endPullUpToRefresh();
102
			                                    }, 1000);
103
		                                    }
104
		                                }
105
		                            }
106
		                        });
107
		                    }
108
		                })
109
		            }
110
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
111
					removeNodata(aimId);
112
					if(obj.length == 0 && liLen == 0) {
113
						document.getElementById(aimId).style.display="none";
114
						insertNodata(aimId, newStr);
115
					}
116
					if(obj.length < rows) {
117
						currentSelf.endPullUpToRefresh(true);
79 118
					} else {
80
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
119
						currentSelf.endPullUpToRefresh(false);
81 120
					}
82
				}
121
				})
83 122
			},
84
			error: function() {
85
				plus.nativeUI.toast("服务器链接超时", toastStyle);
86
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
87
				return;
123
			bindClikFun=function(){
124
				mui('#articelShow').on('tap', 'li', function() {
125
					var id = this.getAttribute("data-id");
126
					plus.nativeUI.showWaiting();
127
					plus.webview.create("../html/professorArticle.html", '../html/professorArticle.html', {}, {
128
						articleId: id
129
					});
130
				})
131
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
132
					var web = plus.webview.getWebviewById("cmpInforShow.html");
133
					if(web)
134
						mui.fire(web, "newId", {
135
							rd: 1
136
						});
137
				})
88 138
			}
89
		})
139
			
140
		articalListVal(0)
141
		bindClikFun()
142
		
90 143
	})
91
}
92

93

144
})

+ 153 - 10
app/js/userpaperList.js

@ -13,25 +13,26 @@ var Num=1;
13 13
function pullupRefresh() {
14 14
	setTimeout(function() {
15 15
		Num++;
16
		getPaper(10,Num);
16
		getPatent(10,Num);
17 17
	}, 1000);
18 18

19 19
}
20 20
mui.plusReady(function() {
21 21
	var self = plus.webview.currentWebview();
22 22
	proId = self.proid;
23
	mui("#paper").on("tap", "li", function() {
23
	mui("#patent").on("tap", "li", function() {
24 24
		var id = this.getAttribute("data-id");
25 25
		plus.nativeUI.showWaiting();
26
		plus.webview.create("../html/paperShow.html", 'paperShow.html', {}, {
27
			"paperId": id
26
		plus.webview.create("../html/patentShow.html", 'patentShow.html', {}, {
27
			"patentId": id
28 28
		});
29 29
	})
30
	getPaper(10,1)
30
	getPatent(10,1)
31 31
})
32
function getPaper(pageSize,pageNo) {
32

33
function getPatent(pageSize,pageNo) {
33 34
	mui.plusReady(function() {
34
		mui.ajax(baseUrl + "/ajax/ppaper/byProfessor", {
35
		mui.ajax(baseUrl + "/ajax/ppatent/byProfessor", {
35 36
			type: "GET",
36 37
			timeout: 10000,
37 38
			dataType: "json",
@ -41,6 +42,7 @@ function getPaper(pageSize,pageNo) {
41 42
				"pageNo":pageNo
42 43
			},
43 44
			success: function(data) {
45
				console.log(JSON.stringify(data));
44 46
				plus.nativeUI.closeWaiting();
45 47
				plus.webview.currentWebview().show("slide-in-right", 150);
46 48
				if(data.success) {
@ -50,19 +52,20 @@ function getPaper(pageSize,pageNo) {
50 52
					var obj = data.data.data;
51 53
					if(obj.length > 0) {
52 54
						for(var i = 0; i < obj.length; i++) {
55
							var li = document.createElement("li");
53 56
							var li = document.createElement("li");
54 57
							li.setAttribute("data-id", obj[i].id);
55 58
							li.className = "mui-table-view-cell";
56 59
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
57
								'<div class="madiaHead paperHead"></div>' +
60
								'<div class="madiaHead patentHead"></div>' +
58 61
								'<div class="madiaInfo OmadiaInfo">' +
59 62
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
60 63
								'<p class="mui-ellipsis h2Font">' + obj[i].authors.substring(0, obj[i].authors.length - 1) + '</p>' +
61 64
								'</div>' +
62 65
								'</div>'
63
							document.getElementById("paper").appendChild(li);
66
							document.getElementById("patent").appendChild(li);
64 67
						}
65
					} 
68
					}
66 69
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
67 70
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
68 71
					} else {
@ -78,3 +81,143 @@ function getPaper(pageSize,pageNo) {
78 81
		})
79 82
	})
80 83
}
84
var deceleration = mui.os.ios ? 0.003 : 0.0009;
85
mui('.mui-scroll-wrapper').scroll({
86
    bounce: false,
87
    indicators: true, //是否显示滚动条
88
    deceleration: deceleration
89
});
90
mui.ready(function() {
91
	mui.plusReady(function() {
92
		var self = plus.webview.currentWebview();
93
		var proId = self.proid;
94
		var rows = 10,
95
			pullRefreshEl,
96
			currentIndex,
97
			currentSelf,
98
			dataO = {
99
				parTime:"",
100
				parId:"",
101
			}
102
		var oAjax = function(url, dataS, otype, oFun) {
103
				mui.ajax(baseUrl + url, {
104
					dataType: 'json',
105
					type: otype,
106
					data: dataS,
107
					traditional: true,
108
					success: function(res) {
109
						if(res.success) {
110
							oFun(res)
111
						}
112
					}
113
				});
114
			},
115
			insertNodata = function(targetE, newStr) {
116
				var parent = document.getElementById(targetE).parentNode;
117
				var kong = document.createElement("div");
118
				kong.className = "con-kong";
119
				kong.innerHTML = '<div class="picbox picNull"></div>' +
120
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
121
				if(newStr) {
122
					kong.querySelector(".txtbox").innerHTML = newStr;
123
				}
124
				if(parent.firstChild.className == "con-kong") {
125
					return
126
				} else {
127
					parent.insertBefore(kong, parent.firstChild);
128
				}
129
			},
130
			removeNodata = function (targetE) {
131
	            var parent = document.getElementById(targetE).parentNode;
132
	            if (parent.firstChild.className == "con-kong") {
133
	                parent.removeChild(parent.firstChild);
134
	            } else {
135
	                return
136
	            }
137
	        },
138
			paperListVal = function(tabIndex) {
139
				var aimId = "paper",
140
					newStr = "他尚未发布任何论文"
141
				oAjax("/ajax/ppaper/professor",{
142
					"category":"1",
143
					"owner":proId,
144
					"assTime":dataO.parTime,
145
					"id":dataO.parId,
146
					"rows": rows
147
				}, "get", function(res){
148
					plus.nativeUI.closeWaiting();
149
					plus.webview.currentWebview().show("slide-in-right", 150);
150
					console.log(JSON.stringify(res))
151
					var obj = res.data;
152
					if(obj.length > 0) {
153
						dataO.parTime = obj[obj.length - 1].assTime;
154
						dataO.parId = obj[obj.length - 1].id;
155
						
156
						for(var i = 0; i < obj.length; i++) {
157
							var li = document.createElement("li");
158
								li.setAttribute("data-id", obj[i].id);
159
								li.className = "mui-table-view-cell";
160
								li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
161
									'<div class="madiaHead paperHead"></div>' +
162
									'<div class="madiaInfo OmadiaInfo">' +
163
									'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
164
									'<p class="mui-ellipsis h2Font">' + obj[i].authors.substring(0, obj[i].authors.length - 1) + '</p>' +
165
									'</div>' +
166
									'</div>'
167
							document.getElementById(aimId).appendChild(li);
168
						}
169
					}
170
					if (currentIndex != tabIndex) {
171
		                currentIndex = tabIndex;
172
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
173
		                    if ($_index == tabIndex) {
174
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
175
		                            up: {
176
		                                callback: function () {
177
		                                	if(currentSelf.loading){
178
			                                    setTimeout(function () {
179
			                                         paperListVal(tabIndex)
180
			                                         currentSelf.endPullUpToRefresh();
181
			                                    }, 1000);
182
		                                    }
183
		                                }
184
		                            }
185
		                        });
186
		                    }
187
		                })
188
		            }
189
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
190
					removeNodata(aimId);
191
					if(obj.length == 0 && liLen == 0) {
192
						document.getElementById(aimId).style.display="none";
193
						insertNodata(aimId, newStr);
194
					}
195
					if(obj.length < rows) {
196
						currentSelf.endPullUpToRefresh(true);
197
					} else {
198
						currentSelf.endPullUpToRefresh(false);
199
					}
200
				})
201
			},
202
			bindClikFun=function(){
203
				mui("#paper").on("tap", "li", function() {
204
					var id = this.getAttribute("data-id");
205
					plus.nativeUI.showWaiting();
206
					plus.webview.create("../html/paperShow.html", 'paperShow.html', {}, {
207
						"paperId": id
208
					});
209
				})
210
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
211
					var web = plus.webview.getWebviewById("cmpInforShow.html");
212
					if(web)
213
						mui.fire(web, "newId", {
214
							rd: 1
215
						});
216
				})
217
			}
218
			
219
		paperListVal(0)
220
		bindClikFun()
221
		
222
	})
223
})

+ 140 - 0
app/js/userpatentList.js

@ -81,3 +81,143 @@ function getPatent(pageSize,pageNo) {
81 81
		})
82 82
	})
83 83
}
84
var deceleration = mui.os.ios ? 0.003 : 0.0009;
85
mui('.mui-scroll-wrapper').scroll({
86
    bounce: false,
87
    indicators: true, //是否显示滚动条
88
    deceleration: deceleration
89
});
90
mui.ready(function() {
91
	mui.plusReady(function() {
92
		var self = plus.webview.currentWebview();
93
		var proId = self.proid;
94
		var rows = 10,
95
			pullRefreshEl,
96
			currentIndex,
97
			currentSelf,
98
			dataO = {
99
				patTime:"",
100
				patId:"",
101
			}
102
		var oAjax = function(url, dataS, otype, oFun) {
103
				mui.ajax(baseUrl + url, {
104
					dataType: 'json',
105
					type: otype,
106
					data: dataS,
107
					traditional: true,
108
					success: function(res) {
109
						if(res.success) {
110
							oFun(res)
111
						}
112
					}
113
				});
114
			},
115
			insertNodata = function(targetE, newStr) {
116
				var parent = document.getElementById(targetE).parentNode;
117
				var kong = document.createElement("div");
118
				kong.className = "con-kong";
119
				kong.innerHTML = '<div class="picbox picNull"></div>' +
120
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
121
				if(newStr) {
122
					kong.querySelector(".txtbox").innerHTML = newStr;
123
				}
124
				if(parent.firstChild.className == "con-kong") {
125
					return
126
				} else {
127
					parent.insertBefore(kong, parent.firstChild);
128
				}
129
			},
130
			removeNodata = function (targetE) {
131
	            var parent = document.getElementById(targetE).parentNode;
132
	            if (parent.firstChild.className == "con-kong") {
133
	                parent.removeChild(parent.firstChild);
134
	            } else {
135
	                return
136
	            }
137
	        },
138
			patentListVal = function(tabIndex) {
139
				var aimId = "patent",
140
					newStr = "他尚未发布任何专利"
141
				oAjax("/ajax/ppatent/professor",{
142
					"category":"1",
143
					"owner":proId,
144
					"assTime":dataO.patTime,
145
					"id":dataO.patId,
146
					"rows": rows
147
				}, "get", function(res){
148
					plus.nativeUI.closeWaiting();
149
					plus.webview.currentWebview().show("slide-in-right", 150);
150
					console.log(JSON.stringify(res))
151
					var obj = res.data;
152
					if(obj.length > 0) {
153
						dataO.patTime = obj[obj.length - 1].assTime;
154
						dataO.patId = obj[obj.length - 1].id;
155
						
156
						for(var i = 0; i < obj.length; i++) {
157
							var li = document.createElement("li");
158
							li.setAttribute("data-id", obj[i].id);
159
							li.className = "mui-table-view-cell";
160
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
161
								'<div class="madiaHead patentHead"></div>' +
162
								'<div class="madiaInfo OmadiaInfo">' +
163
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
164
								'<p class="mui-ellipsis h2Font">' + obj[i].authors.substring(0, obj[i].authors.length - 1) + '</p>' +
165
								'</div>' +
166
								'</div>'
167
							document.getElementById(aimId).appendChild(li);
168
						}
169
					}
170
					if (currentIndex != tabIndex) {
171
		                currentIndex = tabIndex;
172
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
173
		                    if ($_index == tabIndex) {
174
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
175
		                            up: {
176
		                                callback: function () {
177
		                                	if(currentSelf.loading){
178
			                                    setTimeout(function () {
179
			                                         patentListVal(tabIndex)
180
			                                         currentSelf.endPullUpToRefresh();
181
			                                    }, 1000);
182
		                                    }
183
		                                }
184
		                            }
185
		                        });
186
		                    }
187
		                })
188
		            }
189
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
190
					removeNodata(aimId);
191
					if(obj.length == 0 && liLen == 0) {
192
						document.getElementById(aimId).style.display="none";
193
						insertNodata(aimId, newStr);
194
					}
195
					if(obj.length < rows) {
196
						currentSelf.endPullUpToRefresh(true);
197
					} else {
198
						currentSelf.endPullUpToRefresh(false);
199
					}
200
				})
201
			},
202
			bindClikFun=function(){
203
				mui("#patent").on("tap", "li", function() {
204
					var id = this.getAttribute("data-id");
205
					plus.nativeUI.showWaiting();
206
					plus.webview.create("../html/patentShow.html", 'patentShow.html', {}, {
207
						"patentId": id
208
					});
209
				})
210
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
211
					var web = plus.webview.getWebviewById("cmpInforShow.html");
212
					if(web)
213
						mui.fire(web, "newId", {
214
							rd: 1
215
						});
216
				})
217
			}
218
			
219
		patentListVal(0)
220
		bindClikFun()
221
		
222
	})
223
})

+ 135 - 76
app/js/userresourceList.js

@ -1,89 +1,148 @@
1
var proId;
2
mui.init({
3
	pullRefresh: {
4
		container: '#pullrefresh',
5
		up: {
6
			height:50,
7
			contentrefresh: '正在加载...',
8
			callback: pullupRefresh
9
		}
10
	}
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
11 6
});
12
var Num=1;
13
function pullupRefresh() {
14
	setTimeout(function() {
15
		Num++;
16
		getResource(10,Num);
17
	}, 1000);
18

19
}
20

21
mui.plusReady(function() {
22
	var self = plus.webview.currentWebview();
23
	proId = self.proid;
24
	console.log(proId)
25
	mui("#resourceShow").on("tap", "li", function() {
26
		var resouId = this.getAttribute("data-id");
27
		plus.nativeUI.showWaiting();
28
		plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
29
			resourceId: resouId
30
		});
31
	})
32
	getResource(10,1);
33
})
34

35
	
36

37
function getResource(pageSize,pageNo) {
7
mui.ready(function() {
38 8
	mui.plusReady(function() {
39
		mui.ajax(baseUrl + "/ajax/resource/pqProPublish", {
40
			type: "GET",
41
			timeout: 10000,
42
			dataType: "json",
43
			data: {
44
				"professorId": proId,
45
				"pageSize":pageSize,
46
				"pageNo":pageNo
47
			},
48
			success: function(data) {
49
				console.log(JSON.stringify(data))
50
				plus.nativeUI.closeWaiting();
51
				plus.webview.currentWebview().show("slide-in-right", 150);
52
				if(data.success) {
53
					if(pageNo!=data.data.pageNo) {
54
						data.data.data=[];
9
		var self = plus.webview.currentWebview();
10
		var proId = self.proid;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				resPublishTime:"",
17
				resShareId:"",
18
			}
19
		var oAjax = function(url, dataS, otype, oFun) {
20
				mui.ajax(baseUrl + url, {
21
					dataType: 'json',
22
					type: otype,
23
					data: dataS,
24
					traditional: true,
25
					success: function(res) {
26
						if(res.success) {
27
							oFun(res)
28
											}
55 29
					}
56
					var obj = data.data.data;
30
				});
31
			},
32
			insertNodata = function(targetE, newStr) {
33
				var parent = document.getElementById(targetE).parentNode;
34
				var kong = document.createElement("div");
35
				kong.className = "con-kong";
36
				kong.innerHTML = '<div class="picbox picNull"></div>' +
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
				if(newStr) {
39
					kong.querySelector(".txtbox").innerHTML = newStr;
40
				}
41
				if(parent.firstChild.className == "con-kong") {
42
					return
43
				} else {
44
					parent.insertBefore(kong, parent.firstChild);
45
				}
46
			},
47
			removeNodata = function (targetE) {
48
	            var parent = document.getElementById(targetE).parentNode;
49
	            if (parent.firstChild.className == "con-kong") {
50
	                parent.removeChild(parent.firstChild);
51
	            } else {
52
	                return
53
	            }
54
	        },
55
			resourceListVal = function(tabIndex) {
56
				var aimId = "resourceShow",
57
					newStr = "他尚未发布任何资源"
58
				oAjax("/ajax/resource/publish",{
59
					"category": "1",
60
					"owner":proId,
61
					"publishTime":dataO.resPublishTime,
62
					"shareId": dataO.resShareId,
63
					"rows": rows
64
				}, "get", function(res){
65
					plus.nativeUI.closeWaiting();
66
					plus.webview.currentWebview().show("slide-in-right", 150);
67
					console.log(JSON.stringify(res))
68
					var obj = res.data;
57 69
					if(obj.length > 0) {
70
						dataO.resPublishTime = obj[obj.length - 1].publishTime;
71
						dataO.resShareId = obj[obj.length - 1].shareId;
72
						
58 73
						for(var i = 0; i < obj.length; i++) {
59
							var liItem = document.createElement("li");
60
							liItem.className = "mui-table-view-cell"
61
							liItem.setAttribute("data-id", obj[i].resourceId)
62
							var oString = '<div class="flexCenter OflexCenter mui-clearfix">'
74
							var cnt = "",
75
								hasImg = "../images/default-resource.jpg"
63 76
							if(obj[i].images.length) {
64
								oString += '<div class="madiaHead resouseHead" style="background-image:url(' + baseUrl + '/data/resource/' + obj[i].images[0].imageSrc + ')"></div>'
65
							} else {
66
								oString += '<div class="madiaHead resouseHead"></div>'
77
								hasImg = baseUrl + '/data/resource/' + obj[i].images[0].imageSrc
78
							}
79
							if(obj[i].supportedServices) {
80
								cnt = "用途:" + obj[i].supportedServices
67 81
							}
68
							oString += '<div class="madiaInfo OmadiaInfo"><p class="mui-ellipsis h1Font">' + obj[i].resourceName + '</p><p class="h2Font mui-ellipsis-2">用途:' + obj[i].supportedServices + '</p>'
69
							oString += '</div></div>'
70
							liItem.innerHTML = oString;
71
							document.getElementById("resourceShow").appendChild(liItem);
82
							var li = document.createElement("li");
83
							li.setAttribute("data-id", obj[i].resourceId);
84
							li.className = "mui-table-view-cell";
85
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
86
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
87
								'<div class="madiaInfo OmadiaInfo">' +
88
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].resourceName + '</p>' +
89
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
90
								'</div>' +
91
								'</div>'
92
							document.getElementById(aimId).appendChild(li);
72 93
						}
73
					} 
74
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
75
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
94
					}
95
					if (currentIndex != tabIndex) {
96
		                currentIndex = tabIndex;
97
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
98
		                    if ($_index == tabIndex) {
99
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
100
		                            up: {
101
		                                callback: function () {
102
		                                	if(currentSelf.loading){
103
			                                    setTimeout(function () {
104
			                                         resourceListVal(tabIndex)
105
			                                         currentSelf.endPullUpToRefresh();
106
			                                    }, 1000);
107
		                                    }
108
		                                }
109
		                            }
110
		                        });
111
		                    }
112
		                })
113
		            }
114
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
115
					removeNodata(aimId);
116
					if(obj.length == 0 && liLen == 0) {
117
						document.getElementById(aimId).style.display="none";
118
						insertNodata(aimId, newStr);
119
					}
120
					if(obj.length < rows) {
121
						currentSelf.endPullUpToRefresh(true);
76 122
					} else {
77
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
123
						currentSelf.endPullUpToRefresh(false);
78 124
					}
79
				}
125
				})
80 126
			},
81
			error: function() {
82
				plus.nativeUI.toast("服务器链接超时", toastStyle);
83
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
84
				return;
127
			bindClikFun=function(){
128
				mui('#resourceShow').on('tap', 'li', function() {
129
					var id = this.getAttribute("data-id");
130
					plus.nativeUI.showWaiting();
131
					plus.webview.create("../html/resourceShow.html", 'resourceShow.html', {}, {
132
						resourceId: id
133
					});
134
				})
135
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
136
					var web = plus.webview.getWebviewById("cmpInforShow.html");
137
					if(web)
138
						mui.fire(web, "newId", {
139
							rd: 1
140
						});
141
				})
85 142
			}
86
		})
143
			
144
		resourceListVal(0)
145
		bindClikFun()
146
		
87 147
	})
88
}
89
	
148
})

+ 149 - 0
app/js/userserviceList.js

@ -0,0 +1,149 @@
1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
6
});
7
mui.ready(function() {
8
	mui.plusReady(function() {
9
		var self = plus.webview.currentWebview();
10
		var proId = self.proid;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				serModifyTime: "",
17
				serId: "",
18
			}
19
		var oAjax = function(url, dataS, otype, oFun) {
20
				mui.ajax(baseUrl + url, {
21
					dataType: 'json',
22
					type: otype,
23
					data: dataS,
24
					traditional: true,
25
					success: function(res) {
26
						if(res.success) {
27
							oFun(res)
28
						}
29
					}
30
				});
31
			},
32
			insertNodata = function(targetE, newStr) {
33
				var parent = document.getElementById(targetE).parentNode;
34
				var kong = document.createElement("div");
35
				kong.className = "con-kong";
36
				kong.innerHTML = '<div class="picbox picNull"></div>' +
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
				if(newStr) {
39
					kong.querySelector(".txtbox").innerHTML = newStr;
40
				}
41
				if(parent.firstChild.className == "con-kong") {
42
					return
43
				} else {
44
					parent.insertBefore(kong, parent.firstChild);
45
				}
46
			},
47
			removeNodata = function (targetE) {
48
	            var parent = document.getElementById(targetE).parentNode;
49
	            if (parent.firstChild.className == "con-kong") {
50
	                parent.removeChild(parent.firstChild);
51
	            } else {
52
	                return
53
	            }
54
	        },
55
			serviceListVal = function(tabIndex) {
56
				var aimId = "serviceShow",
57
					newStr = "企业尚未发布任何服务"
58
				oAjax("/ajax/ware/publish",{
59
					"category":"1",
60
					"owner":proId,
61
					"modifyTime":dataO.serModifyTime,
62
					"rows": rows
63
				}, "get", function(res){
64
					plus.nativeUI.closeWaiting();
65
					plus.webview.currentWebview().show("slide-in-right", 150);
66
					console.log(JSON.stringify(res))
67
					var obj = res.data;
68
					if(obj.length > 0) {
69
						dataO.serModifyTime = obj[obj.length - 1].modifyTime;
70
						
71
						for(var i = 0; i < obj.length; i++) {
72
							var cnt = "",
73
								hasImg = "../images/default-service.jpg"
74
							if(obj[i].images) {
75
								var subs = strToAry(obj[i].images)
76
								if(subs.length > 0) {
77
									hasImg = baseUrl + "/data/ware" + subs[0]
78
								}
79
							}
80
							if(obj[i].cnt) {
81
								cnt = "内容:" + obj[i].cnt
82
							}
83
							var li = document.createElement("li");
84
							li.setAttribute("data-id", obj[i].id);
85
							li.className = "mui-table-view-cell";
86
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
87
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
88
								'<div class="madiaInfo OmadiaInfo">' +
89
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
90
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
91
								'</div>' +
92
								'</div>'
93
							document.getElementById(aimId).appendChild(li);
94
						}
95
					}
96
					if (currentIndex != tabIndex) {
97
		                currentIndex = tabIndex;
98
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
99
		                    if ($_index == tabIndex) {
100
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
101
		                            up: {
102
		                                callback: function () {
103
		                                	if(currentSelf.loading){
104
			                                    setTimeout(function () {
105
			                                         serviceListVal(tabIndex)
106
			                                         currentSelf.endPullUpToRefresh();
107
			                                    }, 1000);
108
		                                    }
109
		                                }
110
		                            }
111
		                        });
112
		                    }
113
		                })
114
		            }
115
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
116
					removeNodata(aimId);
117
					if(obj.length == 0 && liLen == 0) {
118
						document.getElementById(aimId).style.display="none";
119
						insertNodata(aimId, newStr);
120
					}
121
					if(obj.length < rows) {
122
						currentSelf.endPullUpToRefresh(true);
123
					} else {
124
						currentSelf.endPullUpToRefresh(false);
125
					}
126
				})
127
			},
128
			bindClikFun=function(){
129
				mui('#serviceShow').on('tap', 'li', function() {
130
					var id = this.getAttribute("data-id");
131
					plus.nativeUI.showWaiting();
132
					plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
133
						serviceId: id,
134
					});
135
				})
136
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
137
					var web = plus.webview.getWebviewById("cmpInforShow.html");
138
					if(web)
139
						mui.fire(web, "newId", {
140
							rd: 1
141
						});
142
				})
143
			}
144
			
145
		serviceListVal(0)
146
		bindClikFun()
147
		
148
	})
149
})