luyanan лет назад: 7
Родитель
Сommit
93f3f951bf

+ 32 - 32
app/html/consultlistNew.html

@ -15,39 +15,39 @@
15 15
		  	<div class="mui-scroll">
16 16
		  		<div class="infocon madiaBlock">
17 17
				    <ul class="mui-table-view consultList" id="consultList">
18
				    	<li class="mui-table-view-cell" id='hh'>
19
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
20
							<div class="madiaInfo">
21
								<div class="h1Font mui-ellipsis">
22
									<span>用户姓名</span>
23
									<span class="authicon authicon-pro"></span>
24
									<span class="thistime">8月17日 18:00</span>
25
								</div>
26
								<div class="h3Font mui-ellipsis">这里显示对话的最后一条消息,天个人似乎突然今天个人似乎突然今天跟i</div>
27
							</div>
28
						</li>
29
						<li class="mui-table-view-cell">
30
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
31
							<div class="madiaInfo">
32
								<div class="h1Font mui-ellipsis">
33
									<span>用户姓名</span>
34
									<span class="authicon authicon-pro"></span>
35
									<span class="thistime">8月17日 18:00</span>
36
								</div>
37
								<div class="h3Font mui-ellipsis">富贵花开就看看和个人似乎突然</div>
38
							</div>
39
						</li>
40
						<li class="mui-table-view-cell">
41
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
42
							<div class="madiaInfo">
43
								<div class="h1Font mui-ellipsis">
44
									<span>用户姓名</span>
45
									<span class="authicon authicon-pro"></span>
46
									<span class="thistime">8月17日 18:00</span>
47
								</div>
48
								<div class="h3Font mui-ellipsis"></div>
49
							</div>
18
				    	<!--<li class="mui-table-view-cell" id='hh'>
19
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
20
							<div class="madiaInfo">
21
								<div class="h1Font mui-ellipsis">
22
									<span>用户姓名</span>
23
									<span class="authicon authicon-pro"></span>
24
									<span class="thistime">8月17日 18:00</span>
25
								</div>
26
								<div class="h3Font mui-ellipsis">这里显示对话的最后一条消息,天个人似乎突然今天个人似乎突然今天跟i</div>
27
							</div>
50 28
						</li>
29
						<li class="mui-table-view-cell">
30
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
31
							<div class="madiaInfo">
32
								<div class="h1Font mui-ellipsis">
33
									<span>用户姓名</span>
34
									<span class="authicon authicon-pro"></span>
35
									<span class="thistime">8月17日 18:00</span>
36
								</div>
37
								<div class="h3Font mui-ellipsis">富贵花开就看看和个人似乎突然</div>
38
							</div>
39
						</li>
40
						<li class="mui-table-view-cell">
41
							<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"></div>
42
							<div class="madiaInfo">
43
								<div class="h1Font mui-ellipsis">
44
									<span>用户姓名</span>
45
									<span class="authicon authicon-pro"></span>
46
									<span class="thistime">8月17日 18:00</span>
47
								</div>
48
								<div class="h3Font mui-ellipsis"></div>
49
							</div>
50
						</li>-->
51 51
				    </ul>
52 52
				</div>
53 53
			</div>

+ 69 - 0
app/html/jubao.html

@ -0,0 +1,69 @@
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
		<style type="text/css">
12
			#table {
13
				background: #ffffff;
14
			}
15
			/*#table li .proinfor{background:#FFFFFF;}*/
16
			
17
			#table li:first-child {
18
				margin-top: 0;
19
			}
20
			
21
			#table li.mui-table-view-cell:after {
22
				position: absolute;
23
				bottom: 0;
24
				right: 0;
25
				left: 64px;
26
				height: 1px;
27
				content: '';
28
				background-color: #c8c7cc;
29
			}
30
			
31
			#table li.mui-table-view-cell:last-child:after {
32
				background: none;
33
			}
34
			#breif {
35
				margin-top:20px;
36
				background: white;
37
			}
38
		</style>
39
	</head>
40

41
	<body>
42
		<header class="mui-bar mui-bar-nav toptitbox">
43
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
44
			<h1 class="mui-title toptit">更多选项</h1>
45
		</header>
46
		<div class="mui-content researchAreaBox mui-scroll-wrapper searchTab" id="pullrefresh">
47
			<div class="mui-scroll">
48
				<ul class="mui-table-view protable" id="table">
49
					<li class="mui-table-view-cell" id="lis">
50
				<div class="flexCenter OflexCenter mui-clearfix">
51
					<div class="madiaHead useHead" id="img"></div>
52
					<div class="madiaInfo">
53
						<p><span class="h1Font" id="name"></span><em class="authicon " title="科袖认证专家" id="authicon"></em></p>
54
						<p class="mui-ellipsis-2 h2Font" id="title"></p>
55
					</div>
56
				</div>
57
			</li>
58
				</ul>
59
				<div class="infocontit infocontitM OnetitM mui-navigate-right mui-clearfix" id="breif">举报</div>
60
			</div>
61
		</div>
62
		<script src="../js/public/mui.min.js"></script>
63
		<script src="../js/public/base.js"></script>
64
		<script type="text/javascript" src='../js/jubao.js'></script>
65
			
66
		
67
	</body>
68

69
</html>

+ 41 - 0
app/html/jubao1.html

@ -0,0 +1,41 @@
1
<!DOCTYPE html>
2
<html>
3
	<head>
4
		<meta charset="UTF-8">
5
		<title>意见反馈</title>
6
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
7
		<link href="../css/mui.min.css" rel="stylesheet" />
8
		<link href="../css/app.css" rel="stylesheet" />
9
		<style type="text/css">
10
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;}
11
			.mui-content{height:100%;overflow: auto;}
12
			
13
		</style>
14
	</head>
15
	<body>
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">举报</h1>
19
		</header>
20
		<div class="mui-content">
21
			<div class="row mui-input-row textBox">
22
				<textarea id='question' class="mui-input-clear conTextare" placeholder="请具体说明举报对方的原因,以便我们为您快速解决" maxlength="500" ></textarea>
23
				
24
			</div>
25
			<div class="mui-content-padded frmboxNew">
26
				<button type="submit" class="mui-btn mui-btn-block frmbtn frmactive tijiao" id="logun" disabled="">提交</button>
27
			</div>
28
			
29
		</div>
30
		
31
		<script src="../js/public/mui.min.js"></script>
32
		<script src="../js/public/base.js"></script>
33
		
34
		<script type="text/javascript"> 
35
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
36
		    iosheader();
37
		</script>
38
		<script type="text/javascript" src="../js/jubao1.js"></script>
39
		
40
	</body>
41
</html>

+ 2 - 2
app/html/reg.html

@ -25,7 +25,7 @@
25 25
		        </div>
26 26
		        <div class="mui-row mui-input-row frm-input">
27 27
		        	<div class="mui-col-xs-8">
28
		        		<input type="tel" class="frmtype" placeholder="请输入图形验证码" id="imgCode">
28
		        		<input type="text" class="frmtype" placeholder="请输入图形验证码" id="imgCode">
29 29
		        	</div>
30 30
					<div class="mui-col-xs-4">
31 31
						<img src="http://www.ekexiu.com/ajax/PictureVC" alt="" id="changImage" width="100%" height="48"/>
@ -37,7 +37,7 @@
37 37
		        	</div>
38 38
					<div class="mui-col-xs-4">
39 39
						<input type="button" class="frmtype getCode" value="获取验证码" id="obtain-code" disabled="">
40
						<input type="button" class="frmtype getCode" value="" style="display: none;" id="getcodeoff">
40
						<input type="button" class="frmtype getCode" value="" style="display: none;" id="getcodeoff"disabled="disabled">
41 41
					</div>
42 42
				</div>
43 43
				<div class="mui-input-row frm-input">

+ 322 - 96
app/html/weChat.html

@ -18,6 +18,7 @@
18 18
				-webkit-touch-callout: none;
19 19
				-webkit-user-select: none;
20 20
			}
21
			
21 22
			footer {
22 23
				position: fixed;
23 24
				width: 100%;
@ -30,6 +31,7 @@
30 31
				padding: 0px 50px 0px 10px;
31 32
				background-color: #fafafa;
32 33
			}
34
			
33 35
			.footer-left {
34 36
				position: absolute;
35 37
				width: 50px;
@ -40,8 +42,9 @@
40 42
				vertical-align: middle;
41 43
				line-height: 100%;
42 44
				padding: 12px 4px;
43
				display:none;
45
				display: none;
44 46
			}
47
			
45 48
			.footer-right {
46 49
				position: absolute;
47 50
				width: 50px;
@ -54,15 +57,18 @@
54 57
				padding: 12px 5px;
55 58
				display: inline-block;
56 59
			}
60
			
57 61
			.footer-center {
58 62
				height: 100%;
59 63
				padding: 5px 0px;
60 64
			}
65
			
61 66
			.footer-center [class*=input] {
62 67
				width: 100%;
63 68
				height: 100%;
64 69
				border-radius: 5px;
65 70
			}
71
			
66 72
			.footer-center .input-text {
67 73
				background: #fff;
68 74
				border: solid 1px #ddd;
@ -72,33 +78,39 @@
72 78
				font-family: verdana !important;
73 79
				overflow: hidden;
74 80
			}
81
			
75 82
			.footer-center .input-sound {
76 83
				background-color: #eee;
77 84
			}
85
			
78 86
			.mui-content {
79 87
				height: 100%;
80 88
				padding: 44px 0px 50px 0px;
81 89
				overflow: auto;
82 90
				background-color: #eaeaea;
83 91
			}
92
			
84 93
			#msg-list {
85 94
				height: 100%;
86 95
				overflow: auto;
87 96
				-webkit-overflow-scrolling: touch;
88 97
			}
98
			
89 99
			.msg-item {
90 100
				padding: 8px;
91 101
				clear: both;
92 102
			}
103
			
93 104
			.msg-item .mui-item-clear {
94 105
				clear: both;
95 106
			}
107
			
96 108
			.msg-item .msg-user {
97 109
				width: 38px;
98 110
				height: 38px;
99
				border: solid 1px #d3d3d3;
111
				/*border: solid 1px #d3d3d3;*/
100 112
				display: inline-block;
101
				background: #fff;
113
				/*background: #fff;*/
102 114
				border-radius: 3px;
103 115
				vertical-align: top;
104 116
				text-align: center;
@ -107,7 +119,7 @@
107 119
				color: #ddd;
108 120
			}
109 121
			
110
			.msg-item .msg-user-img{
122
			.msg-item .msg-user-img {
111 123
				width: 38px;
112 124
				height: 38px;
113 125
				display: inline-block;
@ -133,9 +145,11 @@
133 145
				min-width: 35px;
134 146
				float: left;
135 147
			}
148
			
136 149
			.msg-item .msg-content .msg-content-inner {
137 150
				overflow-x: hidden;
138 151
			}
152
			
139 153
			.msg-item .msg-content .msg-content-arrow {
140 154
				position: absolute;
141 155
				border: solid 1px #d3d3d3;
@ -149,50 +163,59 @@
149 163
				-webkit-transform: rotateZ(45deg);
150 164
				transform: rotateZ(45deg);
151 165
			}
166
			
152 167
			.msg-item-self .msg-user,
153 168
			.msg-item-self .msg-content {
154 169
				float: right;
155 170
			}
171
			
156 172
			.msg-item-self .msg-content .msg-content-arrow {
157 173
				left: auto;
158 174
				right: -5px;
159 175
				-webkit-transform: rotateZ(225deg);
160 176
				transform: rotateZ(225deg);
161 177
			}
178
			
162 179
			.msg-item-self .msg-content,
163 180
			.msg-item-self .msg-content .msg-content-arrow {
164 181
				background-color: #4CD964;
165 182
				color: #fff;
166 183
				border-color: #2AC845;
167 184
			}
185
			
168 186
			footer .mui-icon {
169 187
				color: #000;
170 188
			}
189
			
171 190
			footer .mui-icon:active {
172 191
				color: #007AFF !important;
173 192
			}
193
			
174 194
			footer .mui-icon-paperplane:before {
175 195
				content: "发送";
176
				color:lightgray;
196
				color: lightgray;
177 197
			}
198
			
178 199
			footer .mui-icon-paperplane.addColor:before {
179 200
				content: "发送";
180
				color:#ff9900;
201
				color: #ff9900;
181 202
			}
203
			
182 204
			footer .mui-icon-paperplane {
183 205
				/*-webkit-transform: rotateZ(45deg);
184 206
				transform: rotateZ(45deg);*/
185
				
186 207
				font-size: 16px;
187 208
				word-break: keep-all;
188 209
				line-height: 100%;
189 210
				padding-top: 6px;
190 211
				color: rgba(0, 135, 250, 1);
191 212
			}
213
			
192 214
			#msg-sound {
193 215
				-webkit-user-select: none !important;
194 216
				user-select: none !important;
195 217
			}
218
			
196 219
			.rprogress {
197 220
				position: absolute;
198 221
				left: 50%;
@ -210,6 +233,7 @@
210 233
				display: none;
211 234
				-webkit-transition: .15s;
212 235
			}
236
			
213 237
			.rschedule {
214 238
				background-color: rgba(0, 0, 0, 0);
215 239
				border: 5px solid rgba(0, 183, 229, 0.9);
@ -228,7 +252,8 @@
228 252
				-webkit-animation: spin 1s infinite linear;
229 253
				animation: spin 1s infinite linear;
230 254
			}
231
			.r-sigh{
255
			
256
			.r-sigh {
232 257
				display: none;
233 258
				border-radius: 50px;
234 259
				box-shadow: 0 0 15px #2187e7;
@ -245,15 +270,19 @@
245 270
				font-weight: bold;
246 271
				color: #2187e7;
247 272
			}
248
			.rprogress-sigh{
273
			
274
			.rprogress-sigh {
249 275
				background-image: none !important;
250 276
			}
251
			.rprogress-sigh .rschedule{
277
			
278
			.rprogress-sigh .rschedule {
252 279
				display: none !important;
253 280
			}
254
			.rprogress-sigh .r-sigh{
281
			
282
			.rprogress-sigh .r-sigh {
255 283
				display: block !important;
256 284
			}
285
			
257 286
			.rsalert {
258 287
				font-size: 12px;
259 288
				color: #bbb;
@ -266,6 +295,7 @@
266 295
				left: 0px;
267 296
				bottom: 0px;
268 297
			}
298
			
269 299
			@-webkit-keyframes spin {
270 300
				0% {
271 301
					-webkit-transform: rotate(0deg);
@ -274,6 +304,7 @@
274 304
					-webkit-transform: rotate(360deg);
275 305
				}
276 306
			}
307
			
277 308
			@keyframes spin {
278 309
				0% {
279 310
					transform: rotate(0deg);
@ -282,6 +313,7 @@
282 313
					transform: rotate(360deg);
283 314
				}
284 315
			}
316
			
285 317
			#h {
286 318
				background: #fff;
287 319
				border: solid 1px #ddd;
@ -296,6 +328,7 @@
296 328
				word-break: break-all;
297 329
				word-wrap: break-word;
298 330
			}
331
			
299 332
			.cancel {
300 333
				background-color: darkred;
301 334
			}
@ -304,40 +337,44 @@
304 337

305 338
	<body contextmenu="return false;">
306 339
		<header class="mui-bar mui-bar-nav toptitbox" style="z-index: 999;">
307
 			<span class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback" id="backBtn">
308
 				<a href="consultlist.html"></a>
340
			<span class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback" id="backBtn">
309 341
 			</span>
310
 			<h1 class="mui-title toptit" id="chatName">
311
 				
342
			<h1 class="mui-title toptit" id="chatName">
312 343
 			</h1>
313
 			<!--<span class="mui-icon mui-icon-contact mui-pull-right personhead"></span>-->
314
 		</header>
344
 			<a class="mui-icon iconfont icon-moreandroid mui-pull-right button topmore" id="BtnMore">...</a>
345
			<!--<span class="mui-icon mui-icon-contact mui-pull-right personhead"></span>-->
346
		</header>
315 347
		<pre id='h'></pre>
316 348
		<script id='msg-template' type="text/template">
317 349
			<% for(var i in record){ var item=record[i]; %>
318
				<div class="msg-item <%= (item.sender=='self'?' msg-item-self':'') %>" msg-type='<%=(item.type)%>' msg-content='<%=(item.content)%>'>
319
					<div style="text-align:center;margin-bottom:5px;"><span style="font-size:12px;border-radius: 5px;background:#d4d4d4;color:white;padding:2px 7px;">5月8号 18:00</span></div>
320
					<% if(item.sender=='self' ) { %>
321
						<img class="msg-user-img msg-user" src="../images/logo.png" alt="" style="border-radius:50%;"/>
322
						<!--<i class="msg-user mui-icon mui-icon-person" style="border-radius:50%;" id="hu"></i>-->
323
					<% } else { %>
324
						<img class="msg-user-img" src="../images/logo.png" alt="" style="border-radius:50%;"/>
325
					<% } %>
326
					<div class="msg-content">
327
						<div class="msg-content-inner">
328
							<% if(item.type=='text' ) { %>
329
								<%=( item.content|| '&nbsp;&nbsp;') %>
330
							<% } else if(item.type=='image' ) { %>
331
								<img class="msg-content-image" src="<%=(item.content)%>" style="max-width: 100px;" />
332
							<% } else if(item.type=='sound' ) { %>
333
								<span class="mui-icon mui-icon-mic" style="font-size: 18px;font-weight: bold;"></span>
334
								<span class="play-state">点击播放</span>
335
							<% } %>
336
						</div>
337
						<div class="msg-content-arrow"></div>
350
			<div class="msg-item <%= (item.sender=='self'?' msg-item-self':'') %>" msg-type='<%=(item.type)%>' msg-content='<%=(item.content)%>'>
351

352
				<% if(item.timeGe ) { %>
353
				<div class="otime" style="text-align:center;margin-bottom:5px;" data-time="<%=(item.timeStr)%>"><span style="font-size:12px;border-radius: 5px;background:#d4d4d4;color:white;padding:2px 7px;"><%=( item.timeGe) %></span></div>
354
				<% } else { %>
355
				<div class="otime" style="text-align:center;margin-bottom:5px;display: none;" data-time="<%=(item.timeStr)%>"><span style="font-size:12px;border-radius: 5px;background:#d4d4d4;color:white;padding:2px 7px;"><%=( item.timeGe) %></span></div>
356
				<% } %>
357
				<% if(item.sender=='self' ) { %>
358
				<img class="msg-user-img msg-user" src="<%=(item.url)%>" alt="" style="border-radius:50%;" />
359
				<!--<i class="msg-user mui-icon mui-icon-person" style="border-radius:50%;" id="hu"></i>-->
360
				<% } else { %>
361
				<img class="msg-user-img" src="<%=(item.url)%>" alt="" style="border-radius:50%;" />
362
				<% } %>
363
				<div class="msg-content">
364
					<div class="msg-content-inner">
365
						<% if(item.type=='text' ) { %>
366
						<%=( item.content|| '&nbsp;&nbsp;') %>
367
						<% } else if(item.type=='image' ) { %>
368
						<img class="msg-content-image" src="<%=(item.content)%>" style="max-width: 100px;" />
369
						<% } else if(item.type=='sound' ) { %>
370
						<span class="mui-icon mui-icon-mic" style="font-size: 18px;font-weight: bold;"></span>
371
						<span class="play-state">点击播放</span>
372
						<% } %>
338 373
					</div>
339
					<div class="mui-item-clear"></div>
374
					<div class="msg-content-arrow"></div>
340 375
				</div>
376
				<div class="mui-item-clear"></div>
377
			</div>
341 378
			<% } %>
342 379
		</script>
343 380
		<div class="mui-content">
@ -361,12 +398,10 @@
361 398
			<div class="r-sigh">!</div>
362 399
			<div id="audio_tips" class="rsalert">手指上滑,取消发送</div>
363 400
		</div>
364
		<script src="../js/mui.min.js"></script>
365
		<script src="../js/mui.imageViewer.js"></script>
366
		<script>
367
			console.log(document.getElementById("hu"));
368
		</script>
369
		<script src="../js/arttmpl.js"></script>
401
		<script src="../js/public/mui.min.js"></script>
402
		<script src="../js/public/mui.imageViewer.js"></script>
403
		<script src="../js/public/arttmpl.js"></script>
404
		<script src="../js/public/base.js"></script>
370 405
		<script type="text/javascript" charset="utf-8">
371 406
			(function($, doc) {
372 407
				var MIN_SOUND_TIME = 800;
@ -387,9 +422,25 @@
387 422
					plus.webview.currentWebview().setStyle({
388 423
						softinputMode: "adjustResize"
389 424
					});
390
					
425
					var professorId = plus.webview.currentWebview().professorId;
426
					document.getElementById("BtnMore").addEventListener("tap",function(){
427
						mui.openWindow({
428
				url: '../html/jubao.html',
429
				id: 'jubao.html',
430
				show: {
431
					autoShow: true,
432
					aniShow: "slide-in-right",
433
				},
434
				extras: {
435
					professorId: professorId
436
				}
437
			})
438
					})
439
					var userid = plus.storage.getItem('userid');
440
					var url1 = baseUrl + '/images/head/' + professorId + '_l.jpg';
441
					var url2 = baseUrl + '/images/head/' + userid + '_l.jpg';
391 442
					var showKeyboard = function() {
392
						if ($.os.ios) {
443
						if($.os.ios) {
393 444
							var webView = plus.webview.currentWebview().nativeInstanceObject();
394 445
							webView.plusCallMethod({
395 446
								"setKeyboardDisplayRequiresUserAction": false
@ -405,17 +456,97 @@
405 456
							//alert("ll");
406 457
						}
407 458
					};
408
					var record = [{
409
						sender: 'zs',
410
						type: 'text',
411
						content: 'Hi,我是 MUI 小管家!'
412
					}];//消息数组
459
					document.getElementById("backBtn").addEventListener("tap",function(){
460
						var web3 = plus.webview.getWebviewById("consultlistNew.html");
461
												mui.fire(web3, "newId");
462
												var web4=plus.webview.getLaunchWebview();
463
							mui.fire(web4, "newId", {
464
								rd: 3
465
							});
466
					})
467
					
468
					var record = []; //消息数组
469
					messageList();
470
					pe()
471

472
					function pe() {
473
						mui.ajax(baseUrl + '/ajax/professor/baseInfo/' + professorId, {
474
							"type": "get",
475
							"async": true,
476
							"success": function(data) {
477
								if(data.success && data.data) {
478
									document.getElementById("chatName").innerHTML = data.data.name;
479
								}
480
							},
481
							"error": function() {
482
								plus.nativeUI.toast("服务器链接超时", toastStyle);
483
							}
484
						});
485
					}
486

487
					function messageList() {
488
						$.ajax(baseUrl + '/ajax/webMsg/cnt/load', {
489
							data: {
490
								sender: professorId,
491
								reciver: userid,
492
								both: true
493
							},
494
							dataType: 'json', //服务器返回json格式数据
495
							type: 'GET', //HTTP请求类型
496
							timeout: 10000, //超时时间设置为10秒;
497
							traditional: true, //传数组必须加这个
498
							success: function(data) {
499
								//plus.nativeUI.closeWaiting();
500
								//plus.webview.currentWebview().show();
501
								if(data.success) {
502

503
									var $data = data.data;
504
									if($data.length) {
505
										for(var i = 0; i < $data.length; i++) {
506
											var time1;
507
											if(i != 0) {
508
												time1 = compareTime($data[i - 1].sendTime, $data[i].sendTime)
509
											} else {
510
												time1 = anTime($data[i].sendTime)
511
											}
512
											if(professorId == $data[i].sender) {
513
												record.push({
514
													sender: 'zs',
515
													type: 'text',
516
													content: $data[i].cnt,
517
													url: url1,
518
													timeStr: $data[i].sendTime,
519
													timeGe: time1
520
												})
521
											} else {
522
												record.push({
523
													sender: 'self',
524
													type: 'text',
525
													content: $data[i].cnt,
526
													url: url2,
527
													timeStr: $data[i].sendTime,
528
													timeGe: time1
529
												})
530
											}
531
										}
532
										bindMsgList();
533
									} else {
534

535
									}
536

537
								}
538
							},
539
							error: function(x) {
540
								plus.nativeUI.toast("服务器链接超时", toastStyle);
541
							}
542
						});
543
					}
413 544
					var ui = {
414 545
						body: doc.querySelector('body'),
415 546
						footer: doc.querySelector('footer'),
416 547
						footerRight: doc.querySelector('.footer-right'),
417 548
						footerLeft: doc.querySelector('.footer-left'),
418
						btnMsgType: doc.querySelector('#msg-type'),//
549
						btnMsgType: doc.querySelector('#msg-type'), //
419 550
						boxMsgText: doc.querySelector('#msg-text'),
420 551
						boxMsgSound: doc.querySelector('#msg-sound'),
421 552
						btnMsgImage: doc.querySelector('#msg-image'),
@ -427,10 +558,12 @@
427 558
					ui.h.style.width = ui.boxMsgText.offsetWidth + 'px';
428 559
					//alert(ui.boxMsgText.offsetWidth );
429 560
					var footerPadding = ui.footer.offsetHeight - ui.boxMsgText.offsetHeight;
561
					//ui.footer.style.height = (ui.h.offsetHeight + footerPadding) + 'px';
562
					//					ui.content.style.paddingBottom = ui.footer.style.height;
430 563
					var msgItemTap = function(msgItem, event) {
431 564
						var msgType = msgItem.getAttribute('msg-type');
432 565
						var msgContent = msgItem.getAttribute('msg-content')
433
						if (msgType == 'sound') {
566
						if(msgType == 'sound') {
434 567
							player = plus.audio.createPlayer(msgContent);
435 568
							var playState = msgItem.querySelector('.play-state');
436 569
							playState.innerText = '正在播放...';
@ -463,15 +596,33 @@
463 596
						imageViewer.findAllImage();
464 597
						ui.areaMsgList.scrollTop = ui.areaMsgList.scrollHeight + ui.areaMsgList.offsetHeight;
465 598
					};
466
					bindMsgList();
599

467 600
					window.addEventListener('resize', function() {
468 601
						ui.areaMsgList.scrollTop = ui.areaMsgList.scrollHeight + ui.areaMsgList.offsetHeight;
469 602
					}, false);
470 603
					var send = function(msg) {
471 604
						record.push(msg);
472 605
						bindMsgList();
473
						toRobot(msg.content);
606
						//toRobot(msg.content);
474 607
					};
608
					window.addEventListener("newId", function(event) {
609
						var oTime = document.querySelectorAll(".otime");
610
						var time1;
611
						if(oTime.length) {
612
							time1 = compareTime(oTime[oTime.length - 1].getAttribute("data-time"), event.detail.sendTime)
613
						} else {
614
							time1 = anTime(event.detail.sendTime)
615
						}
616
						record.push({
617
							sender: 'zs',
618
							type: 'text',
619
							content: event.detail.rd,
620
							url: url1,
621
							timeStr: event.detail.sendTime,
622
							timeGe: time1
623
						})
624
						bindMsgList();
625
					})
475 626
					var toRobot = function(info) {
476 627
						var apiUrl = 'http://www.tuling123.com/openapi/api';
477 628
						$.getJSON(apiUrl, {
@ -490,21 +641,21 @@
490 641
					};
491 642

492 643
					function msgTextFocus() {
644
						ui.boxMsgText.focus();
645
						setTimeout(function() {
493 646
							ui.boxMsgText.focus();
494
							setTimeout(function() {
495
								ui.boxMsgText.focus();
496
							}, 150);
497
						}
498
						//解决长按“发送”按钮,导致键盘关闭的问题;
647
						}, 150);
648
					}
649
					//解决长按“发送”按钮,导致键盘关闭的问题;
499 650
					ui.footerRight.addEventListener('touchstart', function(event) {
500
						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
651
						if(ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
501 652
							msgTextFocus();
502 653
							event.preventDefault();
503 654
						}
504 655
					});
505 656
					//解决长按“发送”按钮,导致键盘关闭的问题;
506 657
					ui.footerRight.addEventListener('touchmove', function(event) {
507
						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
658
						if(ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
508 659
							msgTextFocus();
509 660
							event.preventDefault();
510 661
						}
@ -522,31 +673,63 @@
522 673
					//						}
523 674
					//					});
524 675
					ui.footerRight.addEventListener('release', function(event) {
525
						if (ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
676
						if(ui.btnMsgType.classList.contains('mui-icon-paperplane')) {
526 677
							if(!ui.btnMsgType.classList.contains('addColor')) {
527 678
								return;
528 679
							}
680
							ui.btnMsgType.classList['remove']('addColor');
681
							//return;
529 682
							//showKeyboard();
530 683
							ui.boxMsgText.focus();
531 684
							setTimeout(function() {
532 685
								ui.boxMsgText.focus();
533 686
							}, 150);
687
							//return;
534 688
							//							event.detail.gesture.preventDefault();
535
							send({
536
								sender: 'self',
537
								type: 'text',
538
								content: ui.boxMsgText.value.replace(new RegExp('\n', 'gm'), '<br/>')
689
							$.ajax(baseUrl + '/ajax/webMsg', {
690
								data: {
691
									sender: userid,
692
									reciver: professorId,
693
									cnt: ui.boxMsgText.value.replace(new RegExp('\n', 'gm'), '<br/>')
694
								},
695
								dataType: 'json', //服务器返回json格式数据
696
								type: 'POST', //HTTP请求类型
697
								timeout: 10000, //超时时间设置为10秒;
698
								traditional: true, //传数组必须加这个
699
								success: function(data) {
700
									if(data.success) {
701
										var oTime = document.querySelectorAll(".otime");
702
										var time1;
703
										if(oTime.length) {
704
											time1 = compareTime(oTime[oTime.length - 1].getAttribute("data-time"), data.data)
705
										} else {
706
											time1 = anTime(data.data)
707
										}
708
										send({
709
											sender: 'self',
710
											type: 'text',
711
											content: ui.boxMsgText.value.replace(new RegExp('\n', 'gm'), '<br/>'),
712
											url: url2,
713
											timeStr: data.data,
714
											timeGe: time1
715
										})
716
										ui.boxMsgText.value = '';
717
										$.trigger(ui.boxMsgText, 'input', null);
718
									}
719
								},
720
								error: function(x) {
721
									plus.nativeUI.toast("服务器链接超时", toastStyle);
722
								}
539 723
							});
540
							ui.boxMsgText.value = '';
541
							$.trigger(ui.boxMsgText, 'input', null);
542
						} else if (ui.btnMsgType.classList.contains('mui-icon-mic')) {
724

725
						} else if(ui.btnMsgType.classList.contains('mui-icon-mic')) {
543 726
							ui.btnMsgType.classList.add('mui-icon-compose');
544 727
							ui.btnMsgType.classList.remove('mui-icon-mic');
545 728
							ui.boxMsgText.style.display = 'none';
546 729
							ui.boxMsgSound.style.display = 'block';
547 730
							ui.boxMsgText.blur();
548 731
							document.body.focus();
549
						} else if (ui.btnMsgType.classList.contains('mui-icon-compose')) {
732
						} else if(ui.btnMsgType.classList.contains('mui-icon-compose')) {
550 733
							ui.btnMsgType.classList.add('mui-icon-mic');
551 734
							ui.btnMsgType.classList.remove('mui-icon-compose');
552 735
							ui.boxMsgSound.style.display = 'none';
@ -571,7 +754,7 @@
571 754
							buttons: btnArray
572 755
						}, function(e) {
573 756
							var index = e.index;
574
							switch (index) {
757
							switch(index) {
575 758
								case 0:
576 759
									break;
577 760
								case 1:
@ -595,17 +778,17 @@
595 778
									break;
596 779
							}
597 780
						});
598
					}, false); 
599
					var setSoundAlertVisable=function(show){
600
						if(show){
781
					}, false);
782
					var setSoundAlertVisable = function(show) {
783
						if(show) {
601 784
							ui.boxSoundAlert.style.display = 'block';
602 785
							ui.boxSoundAlert.style.opacity = 1;
603
						}else{
786
						} else {
604 787
							ui.boxSoundAlert.style.opacity = 0;
605 788
							//fadeOut 完成再真正隐藏
606
							setTimeout(function(){
789
							setTimeout(function() {
607 790
								ui.boxSoundAlert.style.display = 'none';
608
							},200);
791
							}, 200);
609 792
						}
610 793
					};
611 794
					var recordCancel = false;
@ -616,12 +799,12 @@
616 799
					var stopTimer = null;
617 800
					ui.boxMsgSound.addEventListener('hold', function(event) {
618 801
						recordCancel = false;
619
						if(stopTimer)clearTimeout(stopTimer);
802
						if(stopTimer) clearTimeout(stopTimer);
620 803
						audio_tips.innerHTML = "手指上划,取消发送";
621 804
						ui.boxSoundAlert.classList.remove('rprogress-sigh');
622 805
						setSoundAlertVisable(true);
623 806
						recorder = plus.audio.getRecorder();
624
						if (recorder == null) {
807
						if(recorder == null) {
625 808
							plus.nativeUI.toast("不能获取录音对象");
626 809
							return;
627 810
						}
@ -629,7 +812,7 @@
629 812
						recorder.record({
630 813
							filename: "_doc/audio/"
631 814
						}, function(path) {
632
							if (recordCancel) return;
815
							if(recordCancel) return;
633 816
							send({
634 817
								sender: 'self',
635 818
								type: 'sound',
@ -641,18 +824,18 @@
641 824
					}, false);
642 825
					ui.body.addEventListener('drag', function(event) {
643 826
						//console.log('drag');
644
						if (Math.abs(event.detail.deltaY) > 50) {
645
							if (!recordCancel) {
827
						if(Math.abs(event.detail.deltaY) > 50) {
828
							if(!recordCancel) {
646 829
								recordCancel = true;
647
								if (!audio_tips.classList.contains("cancel")) {
830
								if(!audio_tips.classList.contains("cancel")) {
648 831
									audio_tips.classList.add("cancel");
649 832
								}
650 833
								audio_tips.innerHTML = "松开手指,取消发送";
651 834
							}
652 835
						} else {
653
							if (recordCancel) {
836
							if(recordCancel) {
654 837
								recordCancel = false;
655
								if (audio_tips.classList.contains("cancel")) {
838
								if(audio_tips.classList.contains("cancel")) {
656 839
									audio_tips.classList.remove("cancel");
657 840
								}
658 841
								audio_tips.innerHTML = "手指上划,取消发送";
@ -661,20 +844,20 @@
661 844
					}, false);
662 845
					ui.boxMsgSound.addEventListener('release', function(event) {
663 846
						//console.log('release');
664
						if (audio_tips.classList.contains("cancel")) {
847
						if(audio_tips.classList.contains("cancel")) {
665 848
							audio_tips.classList.remove("cancel");
666 849
							audio_tips.innerHTML = "手指上划,取消发送";
667 850
						}
668 851
						//
669 852
						stopTimestamp = (new Date()).getTime();
670
						if (stopTimestamp - startTimestamp < MIN_SOUND_TIME) {
853
						if(stopTimestamp - startTimestamp < MIN_SOUND_TIME) {
671 854
							audio_tips.innerHTML = "录音时间太短";
672 855
							ui.boxSoundAlert.classList.add('rprogress-sigh');
673 856
							recordCancel = true;
674
							stopTimer=setTimeout(function(){
857
							stopTimer = setTimeout(function() {
675 858
								setSoundAlertVisable(false);
676
							},800);
677
						}else{
859
							}, 800);
860
						} else {
678 861
							setSoundAlertVisable(false);
679 862
						}
680 863
						recorder.stop();
@ -691,24 +874,67 @@
691 874
						ui.content.style.paddingBottom = ui.footer.style.height;
692 875
					});
693 876
					var focus = false;
877
					var flag = 1;
694 878
					ui.boxMsgText.addEventListener('tap', function(event) {
879
						if(flag) {
880
							ui.footer.style.height = (ui.h.offsetHeight + footerPadding + 15) + 'px';
881
							ui.content.style.paddingBottom = ui.footer.style.height;
882
							flag = 0;
883
						}
884

695 885
						ui.boxMsgText.focus();
696 886
						setTimeout(function() {
697 887
							ui.boxMsgText.focus();
698 888
						}, 0);
699 889
						focus = true;
700
						setTimeout(function () {
890
						setTimeout(function() {
701 891
							focus = false;
702
						},1000);
892
						}, 1000);
703 893
						event.detail.gesture.preventDefault();
704 894
					}, false);
705 895
					//点击消息列表,关闭键盘
706
					ui.areaMsgList.addEventListener('click',function (event) {
707
						if(!focus){
896
					ui.areaMsgList.addEventListener('click', function(event) {
897
						if(!focus) {
708 898
							ui.boxMsgText.blur();
709 899
						}
710 900
					})
711
					
901
					/*超过时间10min*/
902
					function timeC(startTime) {
903
						var startdate = new Date();
904
						startdate.setFullYear(parseInt(startTime.substring(0, 4)));
905
						startdate.setMonth(parseInt(startTime.substring(4, 6)) - 1);
906
						startdate.setDate(parseInt(startTime.substring(6, 8)));
907
						startdate.setHours(parseInt(startTime.substring(8, 10)));
908
						startdate.setMinutes(parseInt(startTime.substring(10, 12)));
909
						startdate.setSeconds(parseInt(startTime.substring(12, 14)));
910
						startdate.setMilliseconds(parseInt(startTime.substring(14, 17)));
911
						return startdate.getTime();
912
					}
913

914
					function compareTime(startTime, secondTime) {
915
						var date3 = timeC(secondTime) - timeC(startTime); //时间差的毫秒数
916
						if(date3 >= 600000) {
917
							if(new Date().getFullYear() == secondTime.substring(0, 4)) {
918

919
								return secondTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + secondTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + secondTime.substring(8, 10) + ":" + secondTime.substring(10, 12);
920
							} else {
921

922
								return secondTime.substring(0, 4) + "年" + secondTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + secondTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + secondTime.substring(8, 10) + ":" + secondTime.substring(10, 12);
923
							}
924
						} else {
925
							return '';
926
						}
927
					}
928

929
					function anTime(secondTime) {
930
						if(new Date().getFullYear() == secondTime.substring(0, 4)) {
931

932
							return secondTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + secondTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + secondTime.substring(8, 10) + ":" + secondTime.substring(10, 12);
933
						} else {
934

935
							return secondTime.substring(0, 4) + "年" + secondTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + secondTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + secondTime.substring(8, 10) + ":" + secondTime.substring(10, 12);
936
						}
937
					}
712 938
				});
713 939
			}(mui, document));
714 940
		</script>

+ 46 - 1
app/index.html

@ -21,7 +21,7 @@
21 21
	         <span class="mui-tab-label">发现</span>
22 22
	    </a>
23 23
	    <a class="mui-tab-item" href="html/consult_home.html" dataid="2">
24
	        <span class="mui-icon iconfontnew icon-messagenew"><span class="mui-badge">56</span></span>
24
	        <span class="mui-icon iconfontnew icon-messagenew" id="meLI"><span class="mui-badge" id="meLInum"></span></span>
25 25
	         <span class="mui-tab-label">消息</span>
26 26
	    </a>
27 27
	    <a class="mui-tab-item" id="isLogin" href="html/myaccount.html" dataid="3">
@ -53,6 +53,51 @@
53 53
				mui.extend(aniShow, temp);
54 54
			}
55 55
			self.append(sub);
56
		}
57
		window.addEventListener("newId", function(event) {
58
			if(event.detail.rd==1) {
59
				document.getElementById("meLInum").style.display="block"
60
				document.getElementById("meLInum").innerHTML=Number(document.getElementById("meLInum").innerHTML)+1;
61
			}else if(event.detail.rd==2) {
62
				var numtt=Number(document.getElementById("meLInum").innerHTML)-Number(event.detailct)
63
				if(numtt>0) {
64
					document.getElementById("meLInum").style.display="block";
65
					ocument.getElementById("meLInum").innerHTML=numtt;
66
				}else{
67
					document.getElementById("meLInum").style.display="none";
68
					ocument.getElementById("meLInum").innerHTML=0;
69
				}
70
			}else{
71
				totalNum();
72
			}
73
			
74
			
75
		})
76
		totalNum()
77
		function totalNum() {
78
			mui.ajax(baseUrl + '/ajax/webMsg/unReadedCount', {
79
						"data":{id:plus.storage.getItem('userid')},
80
						"type": "get",
81
						"async": true,
82
						"context": this,
83
						"success": function(data) {
84
							console.log(123);
85
							console.log(JSON.stringify(data))
86
							if(data.success) {
87
								if(data.data) {
88
									document.getElementById("meLInum").style.display="block"
89
									document.getElementById("meLInum").innerHTML=data.data;
90
								}else{
91
									document.getElementById("meLInum").style.display="none";
92
									document.getElementById("meLInum").innerHTML=0;
93
								}
94
								
95
							}
96
						},
97
						"error": function() {
98
							plus.nativeUI.toast("服务器链接超时", toastStyle);
99
						}
100
					});
56 101
		}
57 102
	});
58 103
	//当前激活选项

+ 150 - 26
app/js/consultlistNew.js

@ -3,6 +3,7 @@ mui.ready(function() {
3 3
		var userid = plus.storage.getItem('userid');
4 4
		var content1 = document.getElementById('logined');
5 5
		var content2 = document.getElementById('unlogin');
6
		//console.log(document.getElementById("meLI").innerHTML)
6 7
		if(userid == null || userid == 'null') {
7 8
			content1.style.display = 'none';
8 9
		} else {
@ -49,25 +50,34 @@ mui.ready(function() {
49 50
		});
50 51
		var ws = new WebSocket("ws://192.168.3.233:8081/portal/websocket/msg?id=" + userid + "&pm=app");
51 52
		ws.onopen = function() {
52
			console.log(userid);
53
			
53 54
		};
55
		window.addEventListener("newId", function(event) {
56
			messageList();
57
		})
54 58
55 59
		function messageList() {
56 60
			mui.ajax(baseUrl + '/ajax/webMsg/idx/qm', {
57 61
				data: {
58 62
					"id": userid
59
				}, 
63
				},
60 64
				dataType: 'json', //服务器返回json格式数据
61 65
				type: 'GET', //HTTP请求类型
62 66
				timeout: 10000, //超时时间设置为10秒;
63 67
				traditional: true, //传数组必须加这个
64 68
				success: function(data) {
65
					console.log(JSON.stringify(data))
69
					
66 70
					if(data.success) {
71
						$("#consultList").html("");
67 72
						var $data = data.data;
68 73
						for(var i = 0; i < $data.length; i++) {
69
							var str = '<li class="mui-table-view-cell" data-id="'+$data[i].id+'">' +
70
								'<div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"><span class="mui-icon  icon-messagenew"><span class="mui-badge">56</span></span></div>' +
74
							if($data[i].num == 0) {
75
								var ostyle = "none";
76
							} else {
77
								var ostyle = "block";
78
							}
79
							var str = '<li class="mui-table-view-cell" data-id="' + $data[i].id + '" data-time="' + $data[i].timeStr + '">' +
80
								'<div class="mui-slider-handle"><div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"><span class="mui-icon  icon-messagenew" style="display:' + ostyle + '"><span class="mui-badge">' + $data[i].num + '</span></span></div>' +
71 81
								'<div class="madiaInfo">' +
72 82
								'<div class="h1Font mui-ellipsis">' +
73 83
								'<span class="userName"></span>' +
@ -75,11 +85,11 @@ mui.ready(function() {
75 85
								'<span class="thistime">' + commenTime($data[i].timeStr) + '</span>' +
76 86
								'</div>' +
77 87
								'<div class="h3Font mui-ellipsis">' + $data[i].cnt + '</div>' +
78
								'</div>' +
88
								'</div></div><div class="mui-slider-right mui-disabled"><a class="mui-btn mui-btn-red">删除</a></div>' +
79 89
								'</li>'
80
								var $info=$(str)
81
								$("#consultList").append($info);
82
								userInformation($data[i].id, $info)
90
							var $info = $(str)
91
							$("#consultList").append($info);
92
							userInformation($data[i].id, $info)
83 93
						}
84 94
					}
85 95
				},
@ -88,13 +98,44 @@ mui.ready(function() {
88 98
				}
89 99
			});
90 100
		}
101
		var btnArray = ['确认', '取消'];
102
		mui('#consultList').on('tap', '.mui-btn', function(event) {
103
			var elem = this;
104
			var li = elem.parentNode.parentNode;
105
			mui.confirm('确认删除该会话?', btnArray, function(e) {
106
				if(e.index == 1) {
107
					mui.ajax(baseUrl + '/ajax/webMsg/disable/show', {
108
						"type": "post",
109
						"async": true,
110
						"data": {
111
							owner:userid,
112
							actor:li.getAttribute("data-id")
113
						},
114
						"context": this,
115
						"success": function(data) {
116
							if(data.success) {
117
								li.parentNode.removeChild(li);
118
							}
119
						},
120
						"error": function() {
121
							plus.nativeUI.toast("服务器链接超时", toastStyle);
122
						}
123
					});
124
125
				} else {
126
					setTimeout(function() {
127
						mui.swipeoutClose(li);
128
					}, 0);
129
				}
130
			});
131
		});
91 132
		/*用户信息*/
92 133
		function userInformation(id, $itemlist) {
93 134
			mui.ajax(baseUrl + '/ajax/professor/baseInfo/' + id, {
94 135
				"type": "get",
95 136
				"async": true,
96 137
				"success": function(data) {
97
					console.log(JSON.stringify(data))
138
					
98 139
					if(data.success && data.data) {
99 140
						$itemlist.find(".userName").text(data.data.name);
100 141
						if(data.data.hasHeadImage == 1) {
@ -112,37 +153,120 @@ mui.ready(function() {
112 153
		ws.onmessage = function(a) {
113 154
			var fol = true;
114 155
			var $info = JSON.parse(a.data);
115
			console.log(1111);
116
			var li=$("#consultList").find("li");
117
			$.each(li,function() {
118
				var $id=$(this).attr("data-id");
119
				if($info.sender==$id) {
120
					$(this).find(".icon-messagenew").show().end().find('.thistime').text(commenTime($info.sendTime)).end().find(".h3Font").text($info.cnt);
121
					if($(this).index()!=0) {
156
			
157
			var li = $("#consultList").find("li");
158
			var cf = 1;
159
			$.each(li, function() {
160
				var $id = $(this).attr("data-id");
161
				if($info.sender == $id) {
162
					cf = 0;
163
					if($(this).index() != 0) {
122 164
						$(this).remove().clone().prependTo($('#consultList'));
123 165
					}
166
167
					var web = plus.webview.getWebviewById("weChat.html");
168
169
					if(web) {
170
						if(web.professorId == $info.sender) {
171
							$(this).find('.thistime').text(commenTime($info.sendTime)).end().find(".h3Font").text($info.cnt);
172
							readed.call($(this), $id, $info.sendTime);
173
							mui.fire(web, "newId", {
174
								rd: $info.cnt,
175
								sendTime: $info.sendTime
176
							});
177
						} else {
178
							$(this).find(".icon-messagenew").show().end().find('.mui-badge').text(Number($(this).find(".mui-badge").text()) + 1).end().find('.thistime').text(commenTime($info.sendTime)).end().find(".h3Font").text($info.cnt);
179
							var web3=plus.webview.getLaunchWebview();
180
							mui.fire(web3, "newId", {
181
								rd: 1
182
							});
183
						}
184
					} else {
185
						$(this).find(".icon-messagenew").show().end().find('.mui-badge').text(Number($(this).find(".mui-badge").text()) + 1).end().find('.thistime').text(commenTime($info.sendTime)).end().find(".h3Font").text($info.cnt);
186
						var web3=plus.webview.getLaunchWebview();
187
							mui.fire(web3, "newId", {
188
								rd: 1
189
							});
190
					}
191
124 192
				}
125 193
			})
126
			console.log(1212)
127
			return;
128
			var web = plus.webview.getWebviewById("1.html");
129
			mui.fire(web, "newId", {
130
				rd: $info.cnt
131
			});
194
195
			if(cf) {
196
197
				var str1 = '<li class="mui-table-view-cell" data-id="' + $info.sender + '" data-time="' + $info.sendTime + '">' +
198
					'<div class="mui-slider-handle"><div class="madiaHead useHead" style="background-image:url(../images/default-photo.jpg)"><span class="mui-icon  icon-messagenew"><span class="mui-badge">1</span></span></div>' +
199
					'<div class="madiaInfo">' +
200
					'<div class="h1Font mui-ellipsis">' +
201
					'<span class="userName"></span>' +
202
					'<span class="authicon "></span>' +
203
					'<span class="thistime">' + commenTime($info.sendTime) + '</span>' +
204
					'</div>' +
205
					'<div class="h3Font mui-ellipsis">' + $info.cnt + '</div>' +
206
					'</div></div><div class="mui-slider-right mui-disabled"><a class="mui-btn mui-btn-red">删除</a></div>' +
207
					'</li>'
208
				var $info1 = $(str1)
209
				$("#consultList").prepend($info1);
210
				var web1 = plus.webview.getWebviewById("weChat.html");
211
				if(web1.professorId == $info.sender) {
212
					mui.fire(web1, "newId", {
213
						rd: $info.cnt,
214
						sendTime: $info.sendTime
215
					});
216
					readed.call($info1, $info.sender, $info.sendTime);
217
				}
218
				userInformation($info.sender, $info1)
219
220
			}
132 221
		}
133 222
		ws.onclose = function() {
134 223
135 224
		}
136
		document.querySelector("#hh").addEventListener("tap", function() {
137
			alert(1234)
225
		mui("#consultList").on("tap", "li", function() {
226
			var opId = this.getAttribute("data-id");
227
			var oTimeStr = this.getAttribute("data-time") //
228
			if($(this).find(".icon-messagenew").css("display") == "block") {
229
				
230
				var web3=plus.webview.getLaunchWebview();
231
							mui.fire(web3, "newId", {
232
								rd: 2,
233
								ct:$(this).find(".mui-badge").text()
234
							});
235
				readed.call($(this), opId, oTimeStr);
236
			}
138 237
			mui.openWindow({
139 238
				url: '../html/weChat.html',
140 239
				id: 'weChat.html',
141 240
				show: {
142 241
					autoShow: true,
143 242
					aniShow: "slide-in-right",
243
				},
244
				extras: {
245
					professorId: opId
144 246
				}
145
			});
247
			})
146 248
		})
249
		//消息制为已读
250
		function readed(pId, timeStr) {
251
			//alert(1)
252
			mui.ajax(baseUrl + '/ajax/webMsg/readed', {
253
				"type": "post",
254
				"async": true,
255
				"data": {
256
					sender: pId,
257
					reciver: userid,
258
					time: timeStr
259
				},
260
				"context": this,
261
				"success": function(data) {
262
					if(data.success) {
263
						this.find(".icon-messagenew").hide().end().find(".mui-badge").text(0);
264
					}
265
				},
266
				"error": function() {
267
					plus.nativeUI.toast("服务器链接超时", toastStyle);
268
				}
269
			});
270
		}
147 271
	})
148 272
})

+ 67 - 0
app/js/jubao.js

@ -0,0 +1,67 @@
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		var professorId = plus.webview.currentWebview().professorId;
4
		userFun();
5
		function userFun() {
6
		
7
			mui.ajax(baseUrl + '/ajax/professor/baseInfo/' + professorId, {
8
				"type": "get",
9
				"async": true,
10
				"success": function(data) {
11
					if(data.success && data.data) {
12
						document.getElementById("name").innerHTML = data.data.name;
13
						if(data.data.hasHeadImage == 1) {
14
							document.getElementById("img").style.backgroundImage = "url(" + baseUrl + "/images/head/" + data.data.id + "_m.jpg)";
15
						}
16
						var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
17
						document.getElementById("authicon").classList.add(userType.sty);
18
						var te = ''
19
						if(data.data.title) {
20
							if(data.data.orgName) {
21
								te = data.data.title + "," + data.data.orgName
22
							} else {
23
								te = data.data.title
24
							}
25
						} else {
26
							if(data.data.office) {
27
								if(data.data.orgName) {
28
									te = data.data.office + "," + data.data.orgName
29
								} else {
30
									te = data.data.office
31
								}
32
							} else {
33
								if(data.data.orgName) {
34
									te = data.data.orgName
35
								}
36
							}
37
						}
38
						document.getElementById("title").innerHTML=te;
39
					}
40
				},
41
				"error": function() {
42
					plus.nativeUI.toast("服务器链接超时", toastStyle);
43
				}
44
			});
45
		}
46
		mui('#table').on('tap', 'li', function() {
47
	
48
	plus.nativeUI.showWaiting(); //显示原生等待框
49
	webviewShow = plus.webview.create("../html/userInforShow.html", 'userInforShow.html', {}, {
50
		proid: professorId
51
	}); 
52
})
53
		document.getElementById("breif").addEventListener("tap",function(){
54
			mui.openWindow({
55
				url: '../html/jubao1.html',
56
				id: 'jubao1.html',
57
				show: {
58
					autoShow: true,
59
					aniShow: "slide-in-right",
60
				},
61
				extras: {
62
					professorId: professorId
63
				}
64
			})
65
		})
66
	})
67
})

+ 40 - 0
app/js/jubao1.js

@ -0,0 +1,40 @@
1
mui.ready(function() {
2
	mui.plusReady(function() {
3
		var professorId = plus.webview.currentWebview().professorId;
4
		var userid = plus.storage.getItem('userid');
5
		document.getElementById("question").addEventListener("input",function(){
6
			if(this.value=="") {
7
				document.getElementById("logun").setAttribute("disabled", "true");
8
			}else{
9
				document.getElementById("logun").removeAttribute("disabled");
10
			}
11
		})
12
		document.getElementById("logun").addEventListener("tap",function(){
13
			userFun()
14
		})
15
		function userFun() {
16
		
17
			mui.ajax(baseUrl + '/ajax/feedback/error/professor', {
18
				"data":{
19
					id: professorId,
20
					cnt:document.getElementById("question").value,
21
					user:userid
22
				},
23
				"type": "post",
24
				"async": true,
25
				"success": function(data) {
26
					console.log(JSON.stringify(data))
27
					if(data.success ) {
28
						document.getElementById("question").value="";
29
						document.getElementById("logun").setAttribute("disabled", "true");
30
						plus.nativeUI.toast("已发送", toastStyle);
31
					}
32
				},
33
				"error": function() {
34
					plus.nativeUI.toast("服务器链接超时", toastStyle);
35
				}
36
			});
37
		}
38
		
39
	})
40
})

+ 4 - 1
app/js/needSearch.js

@ -30,9 +30,11 @@ function pulldownRefresh() {
30 30
mui.plusReady(function() {
31 31
	mui("#demandList").on("tap", "li", function() {
32 32
		var oDemandId = this.getAttribute("data-id");
33
		var poD=this.getAttribute("data-creator");
33 34
		plus.nativeUI.showWaiting();
34 35
		plus.webview.create("../html/needShow.html", 'needShow.html', {}, {
35
			demanid: oDemandId
36
			demanid: oDemandId,
37
			professorId:poD
36 38
		});
37 39
	})
38 40
})
@ -69,6 +71,7 @@ function demandList(pageSize, pageNo) {
69 71
							var liStr=document.createElement("li");
70 72
							liStr.className="mui-table-view-cell";
71 73
							liStr.setAttribute( "data-id",$info[i].id);
74
							liStr.setAttribute( "data-creator",$info[i].creator);
72 75
							document.getElementById("demandList").appendChild(liStr);
73 76
							demandHtml($info[i],liStr);
74 77
						}

+ 14 - 0
app/js/needShow.js

@ -4,6 +4,7 @@ mui.ready(function() {
4 4
		var userid = plus.storage.getItem('userid');
5 5
		var ws = plus.webview.currentWebview();
6 6
		var demandId = ws.demanid;
7
		var professorId=ws.professorId;
7 8
		var mySelf=document.getElementsByClassName("mySelf")[0];
8 9
		var mySelf2=document.getElementsByClassName("mySelf2")[0];
9 10
		var notSelf=document.getElementsByClassName("notSelf")[0];
@ -317,6 +318,19 @@ mui.ready(function() {
317 318
		//点击回复按钮调用函数
318 319
		function replayGo(){
319 320
			if(userid && userid != null && userid != "null") {
321
				mui.openWindow({
322
								url: '../html/weChat.html',
323
								id: 'weChat.html',
324
								show: {
325
									autoShow: true,
326
									aniShow: "slide-in-right",
327
								},
328
								extras: {
329
									professorId: professorId,
330
									flag:1
331
								}
332
							})
333
				return;
320 334
				mui.ajax(baseUrl+"/ajax/consult/byDemand",{
321 335
					"type": "GET",
322 336
					"async": false,

+ 22 - 8
app/js/register.js

@ -27,7 +27,7 @@ mui.ready(function() {
27 27
			}
28 28
		});
29 29
		
30
		phoneName.addEventListener('keyup', function() {
30
		phoneName.addEventListener('input', function() {
31 31
			if(phoneName.value==""){
32 32
				obtainCode.disabled = "disabled";
33 33
			}else{
@ -70,8 +70,8 @@ mui.ready(function() {
70 70
				plus.nativeUI.toast("密码由6-24个字符组成,区分大小写", toastStyle);
71 71
				return;
72 72
			}
73
//			isReg(1);
74
			isReg();
73
			isReg(1);
74
			//completeReg()
75 75
		})
76 76
		
77 77
		/*用户协议*/
@ -85,11 +85,15 @@ mui.ready(function() {
85 85
			});
86 86
		});
87 87
		
88
		changImage.addEventListener("tap",function(){
88
		changImage.addEventListener("tap",function(){ 
89 89
			this.setAttribute("src","http://www.ekexiu.com/ajax/PictureVC?"+new Date().getTime());
90 90
		})
91 91
		/*校验手机号*/
92 92
		function phoneVal() {
93
			if(imgCode.value=="") {
94
				plus.nativeUI.toast("请输入图形验证码", toastStyle);
95
				return;
96
			}
93 97
			var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
94 98
			if(hunPhone.test(phoneName.value)){
95 99
				isReg();
@ -107,12 +111,14 @@ mui.ready(function() {
107 111
				type: 'GET', //http请求类型
108 112
				timeout: 10000, //超时设置
109 113
				success: function(data) {
114
					console.log(JSON.stringify(data))
110 115
					if(data.data == false) {
111 116
						plus.nativeUI.toast("该账号已存在,请直接登录", toastStyle);
112 117
						return;
113 118
					} else {
114 119
						if(oArg==1){
115
							codeVal();
120
							completeReg()
121
							//sendAuthentication(1)
116 122
						}else{	
117 123
							phoneCode = true;
118 124
							if(phoneCode){
@ -127,25 +133,32 @@ mui.ready(function() {
127 133
				}
128 134
			});
129 135
		}
130

136
		
131 137
		/*手机发送验证码*/ 
132 138
		function sendAuthentication() {
133 139
			console.log(phoneName.value)
134 140
			console.log(imgCode.value)
141
			var cookieValue=plus.navigator.getCookie("http://www.ekexiu.com/ajax/PictureVC");
142
			console.log(cookieValue)
143
			//plus.navigator.setCookie( baseUrl + '/ajax/regmobilephone', cookieValue )
135 144
			mui.ajax(baseUrl + '/ajax/regmobilephone', {
145
				header:{
146
					"Cookie":cookieValue
147
				},
136 148
				data: {
137 149
					mobilePhone: phoneName.value,
138 150
					vcode: imgCode.value
139 151
				},
140 152
				dataType: 'json', //数据格式类型
141 153
				type: 'GET', //http请求类型
142
				async: false,
154
				async: true,
143 155
				timeout: 10000, //超时设置
144 156
				success: function(data) {
145 157
					console.log(JSON.stringify(data))
146 158
					if(data.success) {
147 159
						state = data.data;
148
						doClick();
160
							doClick();
161
						
149 162
					}else{
150 163
						if(data.code==20001) {
151 164
							plus.nativeUI.toast("请输入正确的图形验证码", toastStyle);
@ -177,6 +190,7 @@ mui.ready(function() {
177 190
					obtainCode.style.display = "block";
178 191
					getCodeOff.style.display = "none";
179 192
					obtainCode.value = "获取验证码";
193
					changImage.setAttribute("src","http://www.ekexiu.com/ajax/PictureVC?"+new Date().getTime());
180 194
				}
181 195
			}, 1000);
182 196
		}

+ 25 - 17
app/js/resourceShow.js

@ -451,14 +451,19 @@ mui.plusReady(function() {
451 451
			var consulttitle = oresourceName.innerHTML;
452 452
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
453 453
			if(reType=="1"){
454
				webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
455
					'proId': professorId,
456
					'flag': flag,
457
					'consulttitle': consulttitle
458
				});
459
				webviewShow.addEventListener("loaded", function() {
460

461
				}, false);
454
				mui.openWindow({
455
				url: '../html/weChat.html',
456
				id: 'weChat.html',
457
				show: {
458
					autoShow: true,
459
					aniShow: "slide-in-right",
460
				},
461
				extras: {
462
					professorId: professorId,
463
					flag:1
464
				}
465
			})
466
				
462 467
			}else{
463 468
				mui.ajax(baseUrl + '/ajax/resource/qaLinkman', {
464 469
					data: {
@ -470,15 +475,18 @@ mui.plusReady(function() {
470 475
						if(data.success){
471 476
							console.log(JSON.stringify(data))
472 477
							var linkProfirstId = data.data[0].professorId;
473
							var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
474
							webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
475
								'proId': linkProfirstId,
476
								'flag': flag,
477
								'consulttitle': consulttitle
478
							});
479
							webviewShow.addEventListener("loaded", function() {
480
	
481
							}, false);
478
							mui.openWindow({
479
								url: '../html/weChat.html',
480
								id: 'weChat.html',
481
								show: {
482
									autoShow: true,
483
									aniShow: "slide-in-right",
484
								},
485
								extras: {
486
									professorId: linkProfirstId,
487
									flag:1
488
								}
489
							})
482 490
						}
483 491
					},
484 492
					error: function() {

+ 22 - 10
app/js/userInforShow.js

@ -790,16 +790,28 @@ mui.plusReady(function() {
790 790

791 791
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
792 792

793
			var flag = 'professor';
794
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
795
			webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
796
				'proId': proId,
797
				'flag': flag
798
			});
799

800
			webviewShow.addEventListener("loaded", function() {
801

802
			}, false);
793
//			var flag = 'professor';
794
//			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
795
//			webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
796
//				'proId': proId,
797
//				'flag': flag
798
//			});
799
//
800
//			webviewShow.addEventListener("loaded", function() {
801
//
802
//			}, false);
803
			mui.openWindow({
804
				url: '../html/weChat.html',
805
				id: 'weChat.html',
806
				show: {
807
					autoShow: true,
808
					aniShow: "slide-in-right",
809
				},
810
				extras: {
811
					professorId: proId,
812
					flag:1
813
				}
814
			})
803 815

804 816
		} else {
805 817
			mui.openWindow({