浏览代码

功能修改及bug修订

luyanan 7 年之前
父节点
当前提交
388d4585aa
共有 9 个文件被更改,包括 83 次插入11 次删除
  1. 1 1
      app/html/updateProfile.html
  2. 5 1
      app/js/articleShow.js
  3. 4 1
      app/js/index.js
  4. 4 1
      app/js/patentShow.js
  5. 60 0
      app/js/public/base.js
  6. 4 0
      app/js/setup.js
  7. 3 3
      app/js/updateJob.js
  8. 0 2
      app/js/updateProfile.js
  9. 2 2
      app/js/updateProject.js

+ 1 - 1
app/html/updateProfile.html

21
		<script>
21
		<script>
22
			function autoGrow(oField) {
22
			function autoGrow(oField) {
23
				document.getElementById("tt").style.width=oField.scrollWidth+"px";
23
				document.getElementById("tt").style.width=oField.scrollWidth+"px";
24
				document.getElementById("tt").value=oField.value.substr(0,500);
24
				document.getElementById("tt").value=oField.value;
25
				oField.style.height=document.getElementById("tt").scrollHeight+"px";
25
				oField.style.height=document.getElementById("tt").scrollHeight+"px";
26
			}
26
			}
27
		</script>
27
		</script>

+ 5 - 1
app/js/articleShow.js

727
		var length = trim(this.value);
727
		var length = trim(this.value);
728
		if(length) {
728
		if(length) {
729
			document.getElementsByClassName("mui-btn")[0].removeAttribute("disabled");
729
			document.getElementsByClassName("mui-btn")[0].removeAttribute("disabled");
730
			this.value=this.value.substr(0,200);
730
			
731
		} else {
731
		} else {
732
			document.getElementsByClassName("mui-btn")[0].setAttribute("disabled", "true")
732
			document.getElementsByClassName("mui-btn")[0].setAttribute("disabled", "true")
733
		}
733
		}
734
		
734
		
735
	})
735
	})
736
	document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
736
	document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
737
		if(document.getElementById("textInputThis").value.length>200) {
738
				plus.nativeUI.toast("留言不得超过200个字", toastStyle);
739
				return;
740
			}
737
		mui.ajax(baseUrl + "/ajax/leaveWord", {
741
		mui.ajax(baseUrl + "/ajax/leaveWord", {
738
			data: {
742
			data: {
739
				"articleId": plus.webview.currentWebview().articleId,
743
				"articleId": plus.webview.currentWebview().articleId,

+ 4 - 1
app/js/index.js

8
	plus.nativeUI.showWaiting();
8
	plus.nativeUI.showWaiting();
9
	checkVersion();
9
	checkVersion();
10
})
10
})
11
document.addEventListener("resume", function(){
12
	checkVersion();
13
}, false)
11
document.getElementById("demandP").addEventListener("tap", function() {
14
document.getElementById("demandP").addEventListener("tap", function() {
12
	var userid = plus.storage.getItem('userid');
15
	var userid = plus.storage.getItem('userid');
13
	if(userid == null) {
16
	if(userid == null) {
383
		table.appendChild(li, table.firstChild);
386
		table.appendChild(li, table.firstChild);
384

387

385
	});
388
	});
386
}
389
}

+ 4 - 1
app/js/patentShow.js

747
		var length = trim(this.value);
747
		var length = trim(this.value);
748
		if(length) {
748
		if(length) {
749
			document.getElementsByClassName("mui-btn")[0].removeAttribute("disabled");
749
			document.getElementsByClassName("mui-btn")[0].removeAttribute("disabled");
750
			this.value=this.value.substr(0,200);
751
		} else {
750
		} else {
752
			document.getElementsByClassName("mui-btn")[0].setAttribute("disabled", "true")
751
			document.getElementsByClassName("mui-btn")[0].setAttribute("disabled", "true")
753
		}
752
		}
754
	})
753
	})
755
document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
754
document.getElementsByClassName("mui-btn")[0].addEventListener("tap", function() {
755
	if(document.getElementById("textInputThis").value.length>200) {
756
				plus.nativeUI.toast("留言不得超过200个字", toastStyle);
757
				return;
758
			}
756
		mui.ajax(baseUrl + "/ajax/leaveWord/patent", {
759
		mui.ajax(baseUrl + "/ajax/leaveWord/patent", {
757
			data: {
760
			data: {
758
				"patentId": patentId,
761
				"patentId": patentId,

+ 60 - 0
app/js/public/base.js

373
	});
373
	});
374

374

375
}
375
}
376
function checkVersion(){
377
		mui.plusReady(function(){
378
			if(!plus.webview.currentWebview()) return;
379
			// 获取本地应用资源版本号
380
		    plus.runtime.getProperty(plus.runtime.appid,function(inf){
381
			    wgtVer=inf.version;
382
			    console.log("当前应用版本:"+wgtVer);
383
			    mui.ajax(baseUrl + "/data/manager/version.json", {
384
					dataType: 'json', //数据格式类型
385
					type: 'GET', //http请求类型
386
					timeout: 10000, //超时设置
387
					async: false,
388
					success: function(data) {
389
						if (data.version > wgtVer) {
390
							var btn = ["立即更新", "取消更新"];
391
							mui.confirm("新版本上线了,为了不影响您的正常使用,赶快更新吧", "提示", btn, function(e) {
392
								if(e.index == 0) {
393
									if(mui.os.ios) {
394
										plus.runtime.openURL('https://itunes.apple.com/cn/app/ke-xiu-da-jian-qi-ye-yu-zhuan/id1197110983?l=en&mt=8');
395
										return;
396
									}
397
								try {
398
									     plus.nativeUI.showWaiting("检测更新...");
399
									     //var d="http://192.168.3.233/download/app1.0.6.apk";
400
										 plus.downloader.createDownload( data.wgt, {filename:"_doc/update/"}, function(d,status){
401
									        if ( status == 200 ) { 
402
									            plus.runtime.install(d.filename, {}, function() {
403
													console.log("安装新版本文件成功!");
404
													/*plus.nativeUI.alert("应用资源更新完成,程序需要立即重启", function() {
405
														plus.runtime.restart();
406
													});*/
407
												}, function(e) {
408
													console.log("安装新版文件失败[" + e.code + "]:" + e.message);
409
													plus.nativeUI.toast("安装新版文件失败[" + e.code + "]:" + e.message);
410
												});
411
									            
412
									        } else {
413
									            console.log("下载新版本失败!");
414
									            plus.nativeUI.toast("下载新版本失败!");
415
									        }
416
							       			plus.nativeUI.closeWaiting();
417
							    		}).start();
418
						    		} catch (e) {
419
										console.log(e.message);
420
									}	
421
								}
422
							});
423
						}else{
424
							//plus.nativeUI.toast("您使用的是最新版本,请放心使用!", toastStyle);
425
						}
426
					},
427
					error: function() {
428
						plus.nativeUI.toast("服务器链接超时", toastStyle);
429
						return;
430
					}
431
				});
432
			});
433
		})
434
	}
435


+ 4 - 0
app/js/setup.js

107
							var btn = ["确定更新", "取消更新"];
107
							var btn = ["确定更新", "取消更新"];
108
							mui.confirm("检测到新版本,是否更新?", "提示", btn, function(e) {
108
							mui.confirm("检测到新版本,是否更新?", "提示", btn, function(e) {
109
								if(e.index == 0) {
109
								if(e.index == 0) {
110
									if(mui.os.ios) {
111
										plus.runtime.openURL('https://itunes.apple.com/cn/app/ke-xiu-da-jian-qi-ye-yu-zhuan/id1197110983?l=en&mt=8');
112
										return;
113
									}
110
								try {
114
								try {
111
									     plus.nativeUI.showWaiting("检测更新...");
115
									     plus.nativeUI.showWaiting("检测更新...");
112
									     //var d="http://192.168.3.233/download/app1.0.6.apk";
116
									     //var d="http://192.168.3.233/download/app1.0.6.apk";

+ 3 - 3
app/js/updateJob.js

10
				var arr = [];
10
				var arr = [];
11
				for(var i = 0; i < obj.data.length; i++) {
11
				for(var i = 0; i < obj.data.length; i++) {
12
					if(obj.flag == 1) {
12
					if(obj.flag == 1) {
13
						var str = '<li class="mui-table-view-cell listitem" data-o="'+i+'">'
13
						var str = '<li class="mui-table-view-cell listitemExit" data-o="'+i+'">'
14
						var name = obj.data[i].name;
14
						var name = obj.data[i].name;
15
					} else {
15
					} else {
16
						var str = '<li class="mui-table-view-cell listitem" data-o="'+i+'">'
16
						var str = '<li class="mui-table-view-cell listitemExit" data-o="'+i+'">'
17
						var name = obj.data[i].company;
17
						var name = obj.data[i].company;
18
					}
18
					}
19
					oarr[i]=obj.data[i];
19
					oarr[i]=obj.data[i];
23
					}else{
23
					}else{
24
						odescp = obj.data[i].title
24
						odescp = obj.data[i].title
25
					}
25
					}
26
					var os = '<div class="h4Tit listtit2" style="margin-right:40px;">' + name + '<span class="updatebox mui-clearfix" style="top:0;margin-right:-40px;"><em></em>修改</span></div>' +
26
					var os = '<div class="listtit2" style="margin-right:40px;">' + name + '<span class="updatebox mui-clearfix" style="top:5px;"><em></em>修改</span></div>' +
27
						 ' <p class="listtit3">'+odescp+'</p>'+
27
						 ' <p class="listtit3">'+odescp+'</p>'+
28
						' <p class="listtit3">' + timeT({
28
						' <p class="listtit3">' + timeT({
29
							startMonth: obj.data[i].startMonth,
29
							startMonth: obj.data[i].startMonth,

+ 0 - 2
app/js/updateProfile.js

15
				document.getElementById("fontAdd").innerHTML = web.descp.length;
15
				document.getElementById("fontAdd").innerHTML = web.descp.length;
16
			}
16
			}
17
			document.getElementById("title").addEventListener("input", function() {
17
			document.getElementById("title").addEventListener("input", function() {
18
				
19
					this.value = this.value.substring(0, 500);
20
					document.getElementById("fontAdd").innerHTML = this.value.length;
18
					document.getElementById("fontAdd").innerHTML = this.value.length;
21
			})
19
			})
22
		}
20
		}

+ 2 - 2
app/js/updateProject.js

11
				var arr = [];
11
				var arr = [];
12
				for(var i = 0; i < obj.data.length; i++) {
12
				for(var i = 0; i < obj.data.length; i++) {
13
					if(obj.flag == 1) {
13
					if(obj.flag == 1) {
14
						var str = '<li class="mui-table-view-cell listitem" data-o="'+i+'">'
14
						var str = '<li class="mui-table-view-cell listitemExit" data-o="'+i+'">'
15
						var name = obj.data[i].name;
15
						var name = obj.data[i].name;
16
					} else {
16
					} else {
17
						var str = '<li class="mui-table-view-cell listitem" style="margin-right:40px;"data-o="'+i+'">'
17
						var str = '<li class="mui-table-view-cell listitem" style="margin-right:40px;"data-o="'+i+'">'
22
					if(obj.data[i].descp) {
22
					if(obj.data[i].descp) {
23
						odescp = obj.data[i].descp
23
						odescp = obj.data[i].descp
24
					}
24
					}
25
					var os = '<div class="h4Tit listtit2" style="margin-right:40px;">' + name + '<span class="updatebox mui-clearfix" style="top:0;margin-right:-40px;"><em></em>修改</span></div>' +
25
					var os = '<div class="listtit2" style="margin-right:40px;">' + name + '<span class="updatebox mui-clearfix" style="top:5px;"><em></em>修改</span></div>' +
26
						' <p class="listtit3">' + timeT({
26
						' <p class="listtit3">' + timeT({
27
							startMonth: obj.data[i].startMonth,
27
							startMonth: obj.data[i].startMonth,
28
							stopMonth: obj.data[i].stopMonth
28
							stopMonth: obj.data[i].stopMonth