Browse Source

未读总数

jack 7 years ago
parent
commit
f280e534f2
1 changed files with 61 additions and 20 deletions
  1. 61 20
      app/html/weChat.html

+ 61 - 20
app/html/weChat.html

@ -342,7 +342,7 @@
342 342
 			</span>
343 343
			<h1 class="mui-title toptit" id="chatName">
344 344
 			</h1>
345
 			<a class="mui-icon iconfont icon-moreandroid mui-pull-right topmore" id="BtnMore"></a>
345
			<a class="mui-icon iconfont icon-moreandroid mui-pull-right topmore" id="BtnMore"></a>
346 346
			<!--<span class="mui-icon mui-icon-contact mui-pull-right personhead"></span>-->
347 347
		</header>
348 348
		<pre id='h'></pre>
@ -424,18 +424,18 @@
424 424
						softinputMode: "adjustResize"
425 425
					});
426 426
					var professorId = plus.webview.currentWebview().professorId;
427
					document.getElementById("BtnMore").addEventListener("tap",function(){
427
					document.getElementById("BtnMore").addEventListener("tap", function() {
428 428
						mui.openWindow({
429
				url: '../html/jubao.html',
430
				id: 'jubao.html',
431
				show: {
432
					autoShow: true,
433
					aniShow: "slide-in-right",
434
				},
435
				extras: {
436
					professorId: professorId
437
				}
438
			})
429
							url: '../html/jubao.html',
430
							id: 'jubao.html',
431
							show: {
432
								autoShow: true,
433
								aniShow: "slide-in-right",
434
							},
435
							extras: {
436
								professorId: professorId
437
							}
438
						})
439 439
					})
440 440
					var userid = plus.storage.getItem('userid');
441 441
					var url1 = baseUrl + '/images/head/' + professorId + '_l.jpg';
@ -457,18 +457,59 @@
457 457
							//alert("ll");
458 458
						}
459 459
					};
460
					document.getElementById("backBtn").addEventListener("tap",function(){
460
					document.getElementById("backBtn").addEventListener("tap", function() {
461 461
						var web3 = plus.webview.getWebviewById("consultlistNew.html");
462
												mui.fire(web3, "newId");
463
												var web4=plus.webview.getLaunchWebview();
464
							mui.fire(web4, "newId", {
465
								rd: 3
466
							});
462
						mui.fire(web3, "newId");
463
						var web4 = plus.webview.getLaunchWebview();
464
						mui.fire(web4, "newId", {
465
							rd: 3
466
						});
467 467
					})
468
					
468

469 469
					var record = []; //消息数组
470 470
					messageList();
471
					pe()
471
					pe();
472
					if(mui.os.ios) {
473
						totalNum();
474
					}
475
					function sendJava(num) {
476
						var infor=plus.push.getClientInfo();
477
						mui.ajax(baseUrl + '/ajax/webMsg/applyBadge', {
478
							"data": {
479
								badge:num,
480
								cid:infor.clientid,
481
								devtoken :infor.token
482
							},
483
							"type": "get",
484
							"async": true,
485
							"context": this,
486
							"success": function(data) {
487
								if(data.success) {
488
								}
489
							},
490
							"error": function() {
491
								plus.nativeUI.toast("服务器链接超时", toastStyle);
492
							}
493
						});
494
					}
495
					function totalNum() {
496
						mui.ajax(baseUrl + '/ajax/webMsg/unReadedCount', {
497
							"data": {
498
								id: plus.storage.getItem('userid')
499
							},
500
							"type": "get",
501
							"async": true,
502
							"context": this,
503
							"success": function(data) {
504
								if(data.success) {	
505
									sendJava(data.data);
506
								}
507
							},
508
							"error": function() {
509
								plus.nativeUI.toast("服务器链接超时", toastStyle);
510
							}
511
						});
512
					}
472 513

473 514
					function pe() {
474 515
						mui.ajax(baseUrl + '/ajax/professor/baseInfo/' + professorId, {