Browse Source

搜索条件完善

luyanan 8 years ago
parent
commit
59d3911d1f
5 changed files with 55 additions and 30 deletions
  1. 5 5
      app/html/professorArticle.html
  2. 6 6
      app/js/articleShow.js
  3. 37 17
      app/js/searchFilters.js
  4. 6 1
      app/js/searchListNew.js
  5. 1 1
      app/js/searchfirst.js

+ 5 - 5
app/html/professorArticle.html

@ -9,8 +9,8 @@
9 9
		<link href="../css/iconfont.css" rel="stylesheet" />
10 10
		<link href="../css/app.css" rel="stylesheet" />
11 11
		<style>
12
			html,body{height: 100%;margin:0;padding:0px;overflow: hidden;background: #FFFFFF;}
13
			.mui-content{min-height:100%;overflow: auto;background: #FFFFFF;}
12
			html,body{height:100%;margin:0;padding:0px;overflow: hidden;background: #FFFFFF;}
13
			.mui-content{height:100%;overflow: auto;background: #FFFFFF;}
14 14
		</style>
15 15
	</head>
16 16
@ -43,8 +43,8 @@
43 43
				</div>
44 44
			</div>
45 45
		</nav>
46
		<div class="mui-content" id="pullrefresh" style="padding-bottom:50px;">
47
			<div class="">
46
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh" style="padding-bottom:50px;">
47
			<div class="mui-scroll">
48 48
			    <div class="showDetail">
49 49
			    		<div class="h1Font hWeight" id="articleName"></div>
50 50
			    		<div class="madiaBlock">
@ -126,7 +126,7 @@
126 126
		<script src="../js/public/jquery-1.11.1.js"></script>
127 127
		<script type="text/javascript"> 
128 128
			document.getElementById("listenClick").addEventListener("tap",function(){
129
				$("body,html").animate({"scrollTop": document.getElementById("olisten").offsetTop+"px"}, 400); 
129
				$(".mui-content").animate({"scrollTop": document.getElementById("olisten").offsetTop+"px"}, 400); 
130 130
			})
131 131
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
132 132
		    iosheader();

+ 6 - 6
app/js/articleShow.js

@ -639,9 +639,9 @@ mui.plusReady(function() {
639 639
			success: function(data) {
640 640
				if(data.success) {
641 641
					document.getElementById("textInputThis").value = "";
642
					createTime = "";
643
					orderKey = "";
644
					mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
642
//					createTime = "";
643
//					orderKey = "";
644
//					mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
645 645
					document.getElementById('textInput').style.display="none";
646 646
					document.getElementById('operCol').style.display="block";
647 647
					leword(1, 1);
@ -671,9 +671,9 @@ mui.plusReady(function() {
671 671
			success: function(data) {
672 672
				if(data.success) {
673 673
					document.getElementsByClassName("commentBlock")[0].removeChild($this.parentNode.parentNode.parentNode);
674
					createTime = "";
675
					orderKey = "";
676
					mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
674
//					createTime = "";
675
//					orderKey = "";
676
//					mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
677 677
					leword(1, 1);
678 678
					oArticleModule.oAjaxGet(baseUrl + "/ajax/leaveWord/lwCount", {
679 679
						"articleId": oArticleModule.articleId

+ 37 - 17
app/js/searchFilters.js

@ -1,5 +1,16 @@
1 1
mui.plusReady(function() {
2

2
	var oweb = plus.webview.currentWebview();
3
	function lag(se1, se2,num) {
4
		var oaddress = document.getElementById(se1).getElementsByTagName("li");
5
		for(var i = 0; i < oaddress.length; i++) {
6
			if(oaddress[i].innerHTML == se2) {
7
				oaddress[i].classList.add("filterCurrent");
8
				document.getElementsByClassName("orangeColor")[num].innerHTML=se2
9
			} else {
10
				oaddress[i].classList.remove("filterCurrent");
11
			}
12
		}
13
	}
3 14
	//筛选条件的选择
4 15
	mui(".filterUl").on("tap", "li", function() {
5 16
		this.parentNode.querySelector('li.filterCurrent').classList.remove("filterCurrent");
@ -40,7 +51,7 @@ mui.plusReady(function() {
40 51
					},
41 52
					error: function(xhr, type, errorThrown) {
42 53
						//异常处理;
43
						console.log(type);
54
						plus.nativeUI.toast("服务器链接超时", toastStyle);
44 55
					}
45 56
				});
46 57
			})
@ -58,6 +69,9 @@ mui.plusReady(function() {
58 69
				li.innerHTML = $data[i].caption;
59 70
				document.getElementById('industry').appendChild(li);
60 71
			}
72
			if(oweb.industry) {
73
				lag("industry", oweb.industry,2);
74
			}
61 75
		},
62 76
		sub: function($data) {
63 77
			if($data.length == 0) {
@ -72,6 +86,9 @@ mui.plusReady(function() {
72 86
				li.innerHTML = $data[i].caption;
73 87
				document.getElementById('subject').appendChild(li);
74 88
			}
89
			if(oweb.subject) {
90
				lag("subject", oweb.subject,1);
91
			}
75 92
		},
76 93
		add: function($data) {
77 94
			if($data.length == 0) {
@ -86,6 +103,9 @@ mui.plusReady(function() {
86 103
				li.innerHTML = $data[i].caption;
87 104
				document.getElementById('address').appendChild(li);
88 105
			}
106
			if(oweb.address) {
107
				lag("address", oweb.address,0);
108
			}
89 109
		},
90 110
		res: function(aa) {
91 111
			var t = document.getElementById(aa).getElementsByTagName("li");
@ -96,10 +116,10 @@ mui.plusReady(function() {
96 116
					t[i].className = ""
97 117
				}
98 118
			}
99
			for(var n=0;n<3;n++) {
100
				document.getElementsByClassName('orangeColor')[n].innerHTML="不限";
119
			for(var n = 0; n < 3; n++) {
120
				document.getElementsByClassName('orangeColor')[n].innerHTML = "不限";
101 121
			}
102
			
122

103 123
		}
104 124
	}
105 125
	expertProfessor.oAjaxGet(baseUrl + '/ajax/dataDict/qaDictCode', {
@ -111,19 +131,19 @@ mui.plusReady(function() {
111 131
	expertProfessor.oAjaxGet(baseUrl + '/ajax/dataDict/qaCity', {
112 132
		"dictCode": "ADDRESS"
113 133
	}, "get", expertProfessor.add);
114
	document.getElementById("com").addEventListener('tap',function(){
115
		var arr=[];
116
		for(var n=0;n<3;n++) {
117
				if(document.getElementsByClassName('orangeColor')[n].innerHTML=="不限") {
118
					arr[n]="";
119
				}else{
120
					arr[n]=document.getElementsByClassName('orangeColor')[n].innerHTML
121
				}
134
	document.getElementById("com").addEventListener('tap', function() {
135
		var arr = [];
136
		for(var n = 0; n < 3; n++) {
137
			if(document.getElementsByClassName('orangeColor')[n].innerHTML == "不限") {
138
				arr[n] = "";
139
			} else {
140
				arr[n] = document.getElementsByClassName('orangeColor')[n].innerHTML
122 141
			}
142
		}
123 143
		var web = plus.webview.getWebviewById("../html/searchListNew.html");
124
			mui.fire(web, "newId",{
125
				arry:arr
126
			});
127
			mui.back();
144
		mui.fire(web, "newId", {
145
			arry: arr
146
		});
147
		mui.back();
128 148
	})
129 149
})

+ 6 - 1
app/js/searchListNew.js

@ -64,7 +64,7 @@ var search = {
64 64
				},
65 65
				error: function(xhr, type, errorThrown) {
66 66
					//异常处理;
67
					console.log(type);
67
					plus.nativeUI.toast("服务器链接超时", toastStyle);
68 68
				}
69 69
			});
70 70
		})
@ -161,6 +161,11 @@ var search = {
161 161
			show: {
162 162
				autoShow: false,
163 163
				aniShow: "fade-in",
164
			},
165
			extras:{
166
				subject 	:subject,
167
				industry :industry,
168
				address :address
164 169
			}
165 170
		});
166 171
	},

+ 1 - 1
app/js/searchfirst.js

@ -35,7 +35,7 @@ mui.plusReady(function() {
35 35
				},
36 36
				error: function(xhr, type, errorThrown) {
37 37
					//异常处理;
38
					console.log(type);
38
					plus.nativeUI.toast("服务器链接超时", toastStyle);
39 39
				}
40 40
			});
41 41
		},