Pārlūkot izejas kodu

企业浏览及修改企业简称

jack 7 gadi atpakaļ
vecāks
revīzija
bc8160305f
5 mainītis faili ar 107 papildinājumiem un 56 dzēšanām
  1. 10 20
      cmpInforShow.html
  2. 5 1
      e/a.html
  3. 6 1
      e/r.html
  4. 81 33
      js/cmpInforShow.js
  5. 5 1
      js/discover.js

+ 10 - 20
cmpInforShow.html

@ -52,9 +52,9 @@
52 52
			</div>
53 53
			<div class="navconBox">
54 54
				<ul class="clearfix">
55
					<li class="liNow">主页</li>
56
					<li>资源</li>
57
					<li>文章</li>
55
					<li class="liNow" style="display:none">主页</li>
56
					<li style="display:none">资源</li>
57
					<li style="display:none">文章</li>
58 58
					<li>资料</li>
59 59
				</ul>
60 60
			</div>
@ -98,14 +98,9 @@
98 98
								
99 99
							</ul>
100 100
							<!--无搜索结果-->
101
							<div class="nodatabox displayNone">
102
						        <div class="nodata">
103
						            <div class="picbox picNull"></div>
104
						            <div class="txtbox">
105
						            	<p class="noContip"></p>
106
						            </div>
107
						        </div>
108
						    </div>
101
							 <div class="tcdPageCode resoucePageCode">
102
						       	
103
						       </div>
109 104
						</div>
110 105
					</div>
111 106
				</div>
@ -115,15 +110,10 @@
115 110
							<ul id="proArticel">
116 111
								
117 112
							</ul>
118
							<!--无搜索结果-->
119
							<div class="nodatabox displayNone">
120
						        <div class="nodata">
121
						            <div class="picbox picNull"></div>
122
						            <div class="txtbox">
123
						            	<p class="noContip"></p>
124
						            </div>
125
						        </div>
126
						    </div>
113
							<!--无搜索结果-->							
114
						       <div class="tcdPageCode expertPageCode">
115
						       	
116
						       </div>						    
127 117
						</div>
128 118
					</div>
129 119
				</div>

+ 5 - 1
e/a.html

@ -146,7 +146,11 @@
146 146
					},
147 147
					business: function($data) {
148 148
						//console.log(JSON.stringify($data));
149
						document.getElementById('name').innerHTML = $data.name;
149
						if($data.forShort) {
150
							document.getElementById('name').innerHTML = $data.forShort;
151
						}else{
152
							document.getElementById('name').innerHTML = $data.name;
153
						}
150 154
						if($data.hasOrgLogo) {
151 155
							document.getElementById("messImg").style.backgroundImage = "url(../images/org/" + $data.id + ".jpg" + ")";
152 156
						}

+ 6 - 1
e/r.html

@ -185,7 +185,12 @@ $(document).ready(function() {
185 185
						othisInfo.setAttribute("data-id",mydata.organization.id);
186 186
						othisInfo.setAttribute("data-status",mydata.organization.authStatus);
187 187
						othisInfo.setAttribute("data-type",mydata.resourceType);
188
						othisName.innerHTML = mydata.organization.name;
188
						if(mydata.organization.forShort) {
189
							othisName.innerHTML = mydata.organization.forShort;
190
						}else{
191
							othisName.innerHTML = mydata.organization.name;
192
						}
193
						
189 194
						if(mydata.organization.subject){
190 195
							othisOther.innerHTML = (mydata.organization.subject).replace(/,/, " | ");
191 196
						}

+ 81 - 33
js/cmpInforShow.js

@ -7,8 +7,8 @@ $(function() {
7 7
	
8 8
	if(orgId) {
9 9
		getCmpInfo(orgId);//获取个人详细信息
10
		getResource();//获取个人发布的资源
11
		getArticle();//获取个人发布的文章
10
		getResource(1,10,true);//获取个人发布的资源
11
		getArticle(1,10,true);//获取个人发布的文章
12 12
		
13 13
		//点击关注按钮
14 14
//		$("#attentBtn").on('click', function() {
@ -52,7 +52,8 @@ $(function() {
52 52
	}
53 53
		
54 54
	
55
	var subjectShow = function(data) {
55
function subjectShow(data) {
56
		console.log(data)
56 57
		if(data != undefined && data.length != 0) {
57 58
			var subs = new Array();
58 59
			if(data.indexOf(',')) {
@ -67,7 +68,7 @@ $(function() {
67 68
			}
68 69
		}
69 70
	}
70
	var qualificationShow = function(data) {
71
function qualificationShow(data) {
71 72
		if(data != undefined && data.length != 0) {
72 73
			var subs = new Array();
73 74
			if(data.indexOf(',')) {
@ -88,7 +89,7 @@ $(function() {
88 89
		$.ajax({
89 90
			type:"get",
90 91
			url:"/ajax/org/"+ orgId,
91
			async:true,
92
			async:false,
92 93
			success: function(data) {
93 94
				var $info = data.data;
94 95
				//console.log($info)
@ -96,7 +97,11 @@ $(function() {
96 97
					if($info.hasOrgLogo){
97 98
						$("#proHead").css("background-image","url(/images/org/"+ $info.id +".jpg)");
98 99
					}
99
					$("#proName").text($info.name);
100
					if($info.forShort) {
101
						$("#proName").text($info.forShort);
102
					}else{
103
						$("#proName").text($info.name);
104
					}
100 105
					if($info.authStatus=="3"){
101 106
						$("#proAuth").addClass("authicon-com-ok"); 
102 107
						$("#proAuth").attr("title","科袖认证企业");
@ -109,7 +114,7 @@ $(function() {
109 114
						proOther = $info.industry.replace(/,/gi," | ");
110 115
					}
111 116
					$("#proOther").text(proOther);
112
					if($info.orgType){
117
					if($info.orgType=="2"){
113 118
						$("#proTit").html(orgTypeShow[$info.orgType] + "<span style='margin-right:10px;'></span>");
114 119
					}
115 120
					var llqtitle=$info.name + "-" + proOther + "-科袖网";//修改浏览器title信息
@ -117,11 +122,14 @@ $(function() {
117 122
					//简介
118 123
					if($info.descp) {
119 124
						$("#descpS").text($info.descp);
125
						$(".navconBox").find("li:contains('主页')").show();
120 126
					} else {
121 127
						$("#descpS").parents(".coninfobox").hide();
122 128
					}
123
					//学术领域					
129
					//学术领域		
130
					console.log($info.subject)
124 131
					if($info.subject) {
132
						$(".navconBox").find("li:contains('主页')").show();
125 133
						subjectShow($info.subject);
126 134
					} else {
127 135
						$("#subjectShow").parents(".coninfobox").hide();
@ -155,7 +163,7 @@ $(function() {
155 163
					var weibotitle = $info.name;
156 164
					var weibourl = window.location.href;
157 165
					var weibopic ="http://"+window.location.host+"/images/org/"+ $info.id +".jpg";
158
					$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
166
					$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+encodeURIComponent(weibotitle)+"&url="+encodeURIComponent(weibourl)+"&pic="+encodeURIComponent(weibopic)+"&content=utf-8"+"&ralateUid=6242830109&searchPic=false&style=simple");
159 167
				}
160 168
			},
161 169
			error: function() {
@ -164,29 +172,33 @@ $(function() {
164 172
		});
165 173
	}
166 174
	//获取资源
167
	function getResource(){
175
	function getResource(pageSize,pageNo,isbind){
168 176
		$.ajax({
169 177
			"url": "/ajax/resource/qaOrgPublish",
170 178
			"type": "get",
171 179
			"async": false,
172 180
			"data": {
173
				"orgId": orgId
181
				"orgId": orgId,
182
				"pageSize":pageSize,
183
				"pageNo":pageNo
174 184
			},
175 185
			"success": function(data) {
176 186
				//console.log(data);
177 187
				if(data.success) {
178
					var madiaHead ='';
179
					if(data.data.length > 0){
180
						for(var i = 0; i < data.data.length; i++) {
181
							if(data.data[i].images.length) {
182
								madiaHead ='/data/resource/' + data.data[i].images[0].imageSrc ;
188
					if(data.data.data.length > 0){
189
						$(".navconBox").find("li:contains('资源')").show();
190
						$(".navconBox").find("li:contains('主页')").show();
191
						for(var i = 0; i < data.data.data.length; i++) {
192
							var madiaHead ='';
193
							if(data.data.data[i].images.length) {
194
								madiaHead ='/data/resource/' + data.data.data[i].images[0].imageSrc ;
183 195
							}else{
184 196
								madiaHead ='/images/default-resource.jpg';
185 197
							}
186 198
							var strAdd = '';
187
							strAdd += '<li><a href="resourceShow.html?resourceId='+ data.data[i].resourceId +'" class="flexCenter urlgo">';
199
							strAdd += '<li><a href="resourceShow.html?resourceId='+ data.data.data[i].resourceId +'" class="flexCenter urlgo">';
188 200
							strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ madiaHead +')"></div>';
189
							strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ data.data[i].resourceName +'</p><p class="h2Font ellipsisSty">应用用途:'+ data.data[i].supportedServices+'</p></div>';				
201
							strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ data.data.data[i].resourceName +'</p><p class="h2Font ellipsisSty">应用用途:'+ data.data.data[i].supportedServices+'</p></div>';				
190 202
							strAdd += '</a></li>';
191 203
							
192 204
							if(i==0){
@ -194,6 +206,17 @@ $(function() {
194 206
							}
195 207
							$("#proResource").append(strAdd);
196 208
						}
209
						if(isbind==true){
210
						$(".resoucePageCode").createPage({
211
							pageCount: Math.ceil(data.data.total / 10),
212
							current: data.data.pageNo,
213
							backFn: function(p) {
214
								$("#proResource").html("");
215
								getResource(10,p,false);
216
								//document.body.scrollTop = document.documentElement.scrollTop = 0;
217
							}
218
						});
219
					}
197 220
					}else{
198 221
						$("#proResource + .nodatabox").show();
199 222
						$("#proResource + .nodatabox").find(".noContip").text("主人尚未发布任何资源");
@ -207,48 +230,73 @@ $(function() {
207 230
		});
208 231
	}
209 232
	//获取文章
210
	function getArticle(){
233
	function getArticle(pageSize,pageNo,isbind){
211 234
		$.ajax({
212
			url: "/ajax/article/qaOrgPublish",
235
			url: "/ajax/article/pqProPublish",
213 236
			dataType: 'json', //数据格式类型
214 237
			type: 'GET', //http请求类型
215 238
			data: {
216
				"orgId": orgId
239
				"orgId": orgId,
240
				"pageSize":pageSize,
241
				"pageNo":pageNo
217 242
			},
218 243
			timeout: 10000, //超时设置
219 244
			success: function(data) {
220 245
				if(data.success) {
221
					var madiaHead ='/images/default-artical.jpg';
222
					if(data.data.length > 0){
223
						for(var i = 0; i < data.data.length; i++) {
224
							if(data.data[i].articleImg) {
225
								madiaHead ='/data/article/' + data.data[i].articleImg ;
246
					if(data.data.data.length > 0){
247
						$(".navconBox").find("li:contains('文章')").show();
248
						$(".navconBox").find("li:contains('主页')").show();
249
						for(var i = 0; i < data.data.data.length; i++) {
250
							var madiaHead ='/images/default-artical.jpg';
251
							if(data.data.data[i].articleImg) {
252
								madiaHead ='/data/article/' + data.data.data[i].articleImg ;
226 253
							}
227 254
							var strAdd = '';
228
							strAdd += '<li><a href="articalShow.html?articleId='+ data.data[i].articleId +'" class="flexCenter urlgo">';
255
							strAdd += '<li><a href="articalShow.html?articleId='+ data.data.data[i].articleId +'" class="flexCenter urlgo">';
229 256
							strAdd += '<div class="madiaHead artHead" style="background-image:url('+ madiaHead +')"></div>';
230
							strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ data.data[i].articleTitle +'</p>';
257
							strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ data.data.data[i].articleTitle +'</p>';
231 258
							strAdd += '<ul class="h2Font clearfix">';
232
							strAdd += '<li><span class="time">'+ commenTime(data.data[i].publishTime) +'</span></li>';
233
							strAdd += '<li><span id="pageViews">阅读量 '+ data.data[i].pageViews +'</span></li>';
234
							strAdd += '<li><span id="articleAgree">点赞  '+ data.data[i].articleAgree +'</span></li>';
259
							strAdd += '<li><span class="time">'+ commenTime(data.data.data[i].publishTime) +'</span></li>';
260
							strAdd += '<li><span id="pageViews">阅读量 '+ data.data.data[i].pageViews +'</span></li>';
261
							strAdd += '<li><span id="articleAgree">点赞  '+ data.data.data[i].articleAgree +'</span></li>';
235 262
							strAdd += '<li><span id="comment"></span></li>';
236 263
							strAdd += '</ul></div>';
237 264
							strAdd += '</a></li>';
238 265
							
239 266
							var $strAdd = $(strAdd);
240 267
							$("#proArticel").append( $strAdd);
241
							commentnum(data.data[i].articleId, $strAdd) //文章评论数
268
							commentnum(data.data.data[i].articleId, $strAdd) //文章评论数
242 269
							if(i==0){
243 270
								$("#showArticle").append(strAdd);
244
								commentnum(data.data[0].articleId, $strAdd)
271
								commentnum(data.data.data[0].articleId, $strAdd)
245 272
							}
246 273
						
247 274
						}
275
						if(isbind==true){
276
						$(".expertPageCode").createPage({
277
							pageCount: Math.ceil(data.data.total / 10),
278
							current: data.data.pageNo,
279
							backFn: function(p) {
280
								$("#proArticel").html("");
281
								getArticle(10,p,false);
282
								//document.body.scrollTop = document.documentElement.scrollTop = 0;
283
							}
284
						});
285
					}
248 286
					}else{
249 287
						$("#proArticel + .nodatabox").show();
250 288
						$("#proArticel + .nodatabox").find(".noContip").text("主人尚未发布任何文章");
251 289
						$("#showArticle").parents(".coninfobox").hide();
290
						var i=0;
291
						$("#item1user").find('.coninfobox').each(function(){
292
							if($(this).css("display") == "none"){
293
								i++;
294
							}
295
						})
296
						if(	i==4) {
297
							$(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
298
							$("#item6user").show()
299
						}
252 300
					}
253 301
				}
254 302
			},

+ 5 - 1
js/discover.js

@ -140,7 +140,11 @@ $(function() {
140 140
			"success": function(data) {
141 141
				console.log(data);
142 142
				if(data.success && data.data) {
143
					$itemlist.find("#nameSpan").text(data.data.name);
143
					if(data.data.forShort) {
144
						$itemlist.find("#nameSpan").text(data.data.forShort);
145
					}else{
146
						$itemlist.find("#nameSpan").text(data.data.name);
147
					}
144 148
					if(data.data.hasOrgLogo) {
145 149
						$itemlist.find("#userimg").attr("style", "background-image: url(/images/org/" + data.data.id + ".jpg);");
146 150
					}