瀏覽代碼

判断搜索需求是否显示

jack 7 年之前
父節點
當前提交
97b1066bcc
共有 3 個文件被更改,包括 51 次插入0 次删除
  1. 25 0
      js/articalList.js
  2. 1 0
      js/myDemand.js
  3. 25 0
      js/resourceList.js

+ 25 - 0
js/articalList.js

@ -27,6 +27,31 @@ $(function() {
27 27
	$(".searchSpan").on("click", function() {
28 28
		articalList(10, 1, true, 2);
29 29
	})
30
	getProfessorData(userid);
31
	function getProfessorData(professorId) {
32
		$.ajax({
33
			"url": "/ajax/professor/editBaseInfo/" + professorId,
34
			"type": "get",
35
			"async": true,
36
			"success": function(data) {
37
				if(data.success) {
38
					var oAuthType=data.data.authType;
39
					if(oAuthType==0){
40
						$("a:contains('需求')").attr("href","myDemand.html");
41
					}else if(oAuthType==1){
42
						$("a:contains('需求')").attr("href","needList.html");
43
					}
44
					
45
					
46
				} else {
47
					$.MsgBox.Alert("消息", "服务器连接失败");
48
				}
49
			},
50
			"error": function() {
51
				$.MsgBox.Alert('message', '服务器连接失败');
52
			}
53
		})
54
	}
30 55

31 56
});
32 57


+ 1 - 0
js/myDemand.js

@ -26,6 +26,7 @@ $(document).ready(function() {
26 26
					//					}
27 27
					$(".workselectitem").html(" ");
28 28
					demandHtml(data.data.data);
29
					if(data.data.data.length==0) return;
29 30
					if(isbind == true) {
30 31
						$(".tcdPageCode").createPage({
31 32
							pageCount: Math.ceil(data.data.total / pageNum),

+ 25 - 0
js/resourceList.js

@ -132,4 +132,29 @@ $(document).ready(function(){
132 132
		$(".aboutRes").append('<div class="tcdPageCode"></div>');
133 133
		getRecourceMe(1,true);
134 134
	})
135
	getProfessorData(userid);
136
	function getProfessorData(professorId) {
137
		$.ajax({
138
			"url": "/ajax/professor/editBaseInfo/" + professorId,
139
			"type": "get",
140
			"async": true,
141
			"success": function(data) {
142
				if(data.success) {
143
					var oAuthType=data.data.authType;
144
					if(oAuthType==0){
145
						$("a:contains('需求')").attr("href","myDemand.html");
146
					}else if(oAuthType==1){
147
						$("a:contains('需求')").attr("href","needList.html");
148
					}
149
					
150
					
151
				} else {
152
					$.MsgBox.Alert("消息", "服务器连接失败");
153
				}
154
			},
155
			"error": function() {
156
				$.MsgBox.Alert('message', '服务器连接失败');
157
			}
158
		})
159
	}
135 160
})