Browse Source

企业、文章

luyanan 6 years ago
parent
commit
21cdd3ab58
5 changed files with 143 additions and 15 deletions
  1. 1 3
      cmp-portal/js/cmpInformation.js
  2. 2 0
      css/share.css
  3. 75 7
      e/a.html
  4. 64 2
      e/c.html
  5. 1 3
      js/cmpInforShow.js

+ 1 - 3
cmp-portal/js/cmpInformation.js

@ -469,7 +469,6 @@ $(function() {
469 469
		productListVal=function(isbind){
470 470
			var aimId="proProduct",aimIdF="showProduct",newStr="企业尚未发布任何产品"
471 471
			oAjax("/ajax/product/publish",{
472
				"category":"2",
473 472
				"owner":orgId,
474 473
				"modifyTime":dataO.prdModifyTime,
475 474
				"rows": rows
@ -571,8 +570,7 @@ $(function() {
571 570
				}
572 571
			});
573 572
			oAjax("/ajax/product/count/publish",{//产品总数
574
				"owner": orgId,
575
				"category":"2"
573
				"owner": orgId
576 574
			}, "GET", function(data){
577 575
				if(data.data>0 && data.data<99){
578 576
					$("#productCount").text(data.data);

+ 2 - 0
css/share.css

@ -482,3 +482,5 @@ ul.mui-table-view>li:last-child:after{background: none;}
482 482
.item-btn li>span{display: inline-block;width: 100%;text-align: center;color:#666;font-size:14px;padding:8px 0;}
483 483
.item-btn li.answered>span{color:#FF0000}
484 484
.item-btn li.collectBtn>span{position:absolute;width:20px;left:50%;margin-left:-10px;top:8px;height:4px;}
485
/*附件提示*/
486
.atachList{color:#017eb8;background:#e7f5fb;padding:10px 20px;text-align: center;font-size:12px;}

+ 75 - 7
e/a.html

@ -59,6 +59,10 @@
59 59
		<!--文章内容区-->
60 60
		<div class="showMain" id="articleContent">
61 61
		</div>
62
		<!--附件模块-->
63
		<div class="atachList displayNone">
64
			本文章包含的附件内容需登录PC端科袖网进行下载
65
		</div>
62 66
		<!--标签模块-->
63 67
		<ul class="tagList displayNone">
64 68
			<!--<li>
@ -71,6 +75,12 @@
71 75
		       
72 76
		    </ul>
73 77
		</div>
78
		<div class="madiaBlock displayNone" id="correlationProduct">
79
			<div class="madiaTit">相关产品</div>
80
			<ul class="mui-table-view" id="productList">
81
		       
82
		    </ul>
83
		</div>
74 84
		<div class="madiaBlock displayNone" id="correlationService">
75 85
			<div class="madiaTit">相关服务</div>
76 86
			<ul class="mui-table-view" id="serviceList">
@ -170,6 +180,11 @@
170 180
			var OdataId=this.getAttribute("data-id");
171 181
			location.href="http://" + window.location.host + "/e/c.html?id=" + OdataId;
172 182
			
183
		})
184
		$("#productList").on("click","li", function() {
185
			var OdataId=this.getAttribute("data-id");
186
			location.href="http://" + window.location.host + "/e/pr.html?id=" + OdataId;
187
			
173 188
		})
174 189
		$(".tagList").on("click", "li", function() {
175 190
			var keyCon=$(this).find(".h2Font").text();
@ -196,14 +211,23 @@
196 211
					}
197 212
				});
198 213
			},
214
			queryFileAtach:function(){
215
				oArticleModule.oAjaxGet("/ajax/article/files/byArticleId",{
216
					"id":oArticleModule.articleId
217
				}, "get", function(data){
218
					if(data){
219
						if(data.length>0){
220
							document.getElementsByClassName('atachList')[0].style.display='block';
221
						}
222
					}
223
				});
224
			},
199 225
			articleMess: function($data) {
200
				console.log($data);
201 226
				document.getElementById("articleName").innerHTML = $data.articleTitle;
202 227
				shareTitle=$data.articleTitle;
203 228
				document.title=$data.articleTitle;
204 229
				stt = $data.articleImg.substring(0, 9);
205 230
				imgUrl="http://www.ekexiu.com/data/article/" + stt + $data.articleId + "_s.jpg";
206
				console.log(stt)
207 231
				if($data.articleContent) {
208 232
					document.getElementById("articleContent").innerHTML = $data.articleContent;
209 233
					
@ -252,7 +276,6 @@
252 276
				
253 277
			},
254 278
			professorMess: function($data) {
255
				console.log($data);
256 279
				document.getElementById('name').innerHTML = $data.name;
257 280
				if($data.hasHeadImage == 1) {
258 281
					document.getElementById("messImg").style.backgroundImage = "url(../images/head/" + $data.id + "_l.jpg" + ")";
@ -276,6 +299,12 @@
276 299
				if($data.authStatus == 3) {
277 300
					document.getElementById("auth").classList.add("authicon-com-ok");
278 301
				}
302
				if(!$data.colMgr && !$data.resMgr) {
303
					oArticleModule.correlationProduct();
304
				}
305
				if($data.colMgr) {
306
					oArticleModule.queryFileAtach();
307
				}
279 308
			},
280 309
			platform: function($data) {
281 310
				document.getElementById('name').innerHTML = $data.name;
@ -339,7 +368,6 @@
339 368
				document.getElementById("expertList").appendChild(li);
340 369
			},
341 370
			correlationResource: function($data) {
342
				console.log($data);
343 371
				if($data.length == 0) {
344 372
					return;
345 373
				}
@ -388,7 +416,6 @@
388 416
					"id": oArticleModule.articleId,
389 417
					"rows":5
390 418
				}, "get", function(res){
391
					console.log(JSON.stringify(res));
392 419
					var $data=res
393 420
					if($data.length == 0) {
394 421
						return;
@ -519,7 +546,6 @@
519 546
				}
520 547
			},
521 548
			correlationCompany: function($data) {
522
				console.log($data);
523 549
				if($data.length == 0) {
524 550
					return;
525 551
				}
@ -563,6 +589,48 @@
563 589
					'</div>'
564 590
				document.getElementById("companyList").appendChild(li);
565 591
			},
592
			correlationProduct: function() {
593
				oArticleModule.oAjaxGet("/ajax/article/product",{
594
					"id": oArticleModule.articleId,
595
					"rows":5
596
				}, "get", function(res){
597
					var $data=res
598
					if($data.length == 0) {
599
						return;
600
					}
601
					document.getElementById("correlationProduct").style.display = "block";
602
					for(var i = 0; i < $data.length; i++) {
603
						oArticleModule.oAjaxGet("/ajax/product/qo", {
604
							"id": $data[i].product
605
						}, "get", oArticleModule.productList);
606
					}
607
				});
608
			},
609
			productList: function($data) {
610
				var cnt="", rImg="../images/default-product.jpg"
611
				if($data.images) {
612
					var subs = strToAry($data.images)
613
					if(subs.length > 0) {
614
						rImg="/data/product" + subs[0]
615
					}
616
				}
617
				if($data.cnt){
618
					cnt="简介:"+$data.cnt
619
				}
620
				var li = document.createElement("li");
621
				li.setAttribute("data-id",$data.id);
622
				li.className = "mui-table-view-cell";
623
				li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
624
					' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
625
					'<div class="madiaInfo OmadiaInfo">' +
626
					'<p class="mui-ellipsis-2 h1Font">' + $data.name + '</p>' +
627
					'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
628
					'</div>' +
629
					'</div>'
630
				document.getElementById("productList").appendChild(li);
631
				var $li=$(li)
632
				oArticleModule.orgSigInfo($data.owner,$li)
633
			},
566 634
			proSigInfo:function(id,$list){
567 635
				oArticleModule.oAjaxGet( "/ajax/professor/baseInfo/"+id,{
568 636
				}, "get", function(data){
@ -606,7 +674,7 @@
606 674
			"exclude":oArticleModule.articleId
607 675
		}, "get", oArticleModule.correlationArticle);
608 676
		oArticleModule.correlationService()
609
	
677
		oArticleModule.correlationProduct()
610 678
		/*微信分享*/
611 679
		$.ajax({
612 680
			url: "../ajax/weixin/jsapiTicket",

+ 64 - 2
e/c.html

@ -60,6 +60,17 @@
60 60
				<div class="seeMore displayNone" id="seeMoreResource"><em>查看全部 <span id="resourceNum">0</span>个</em></div>
61 61
			</div>
62 62
		</div>
63
		<div class="productions">
64
			<div class="mainbox displayNone">
65
				<div class="infocontit">我们的产品</div>
66
				<div class="infocon infoconM madiaBlock">
67
					<ul class="mui-table-view" id="productShow">
68
				        
69
				    </ul>
70
				</div>
71
				<div class="seeMore displayNone" id="seeMoreProduct"><em>查看全部 <span id="productNum">0</span>个</em></div>
72
			</div>
73
		</div>
63 74
		<div class="mainbox" style="cursor: pointer;" id="goCmpBrief">
64 75
			<div class="infocontit clearfix">企业介绍 <em></em></div>
65 76
			<div class="infocon">
@ -138,7 +149,6 @@ $(document).ready(function() {
138 149
				'oname':par,
139 150
				"pageSize": 5
140 151
			}, "get", function(res) {
141
				console.log(JSON.stringify(res));
142 152
				var obj = res.data.data;
143 153
				if(obj.length > 0) {
144 154
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
@ -270,6 +280,42 @@ $(document).ready(function() {
270 280
				}
271 281
			})
272 282
		},
283
		productListVal = function() {
284
			var aimId = "productShow"
285
			oAjax("/ajax/product/publish", {
286
				"owner":orgId,
287
				"rows": rows
288
			}, "get", function(res) {
289
				var obj = res.data;
290
				if(obj.length > 0) {
291
					document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
292
					for(var i = 0; i < obj.length; i++) {
293
						var cnt = "",
294
							hasImg = "../images/default-product.jpg"
295
						if(obj[i].images) {
296
							var subs = strToAry(obj[i].images)
297
							if(subs.length > 0) {
298
								hasImg = baseUrl + "/data/product" + subs[0]
299
							}
300
						}
301
						if(obj[i].cnt) {
302
							cnt = "简介:" + obj[i].cnt
303
						}
304
						var li = document.createElement("li");
305
						li.setAttribute("data-id", obj[i].id);
306
						li.className = "mui-table-view-cell";
307
						li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
308
							'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
309
							'<div class="madiaInfo OmadiaInfo">' +
310
							'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
311
							'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
312
							'</div>' +
313
							'</div>'
314
						document.getElementById(aimId).appendChild(li);
315
					}
316
				}
317
			})
318
		},
273 319
		queryPubCount = function() {
274 320
			oAjax("/ajax/article/count/publish", { //文章总数
275 321
				"owner": orgId,
@ -298,6 +344,14 @@ $(document).ready(function() {
298 344
					$("#serviceNum").text(data.data);
299 345
				}
300 346
			});
347
			oAjax("/ajax/product/count/publish", { //产品总数
348
				"owner": orgId
349
			}, "GET", function(data) {
350
				if(data.data > rows) {
351
					$("#seeMoreProduct").removeClass("displayNone")
352
					$("#productNum").text(data.data);
353
				}
354
			});
301 355
		},
302 356
		bindClickFun = function() {
303 357
			var this_="../html/cmpInforShow.html?cmpId="+orgId;
@ -324,7 +378,11 @@ $(document).ready(function() {
324 378
				location.href="http://" + window.location.host + "/e/s.html?id=" + id;
325 379
				$(this).addClass("activeThis");
326 380
			})
327
381
			$('#productShow').on('click', 'li', function() {
382
				var id = this.getAttribute("data-id");
383
				location.href="http://" + window.location.host + "/e/pr.html?id=" + id;
384
				$(this).addClass("activeThis");
385
			})
328 386
		}
329 387
	
330 388
	pageViewLog(orgId,6)
@ -350,6 +408,10 @@ $(document).ready(function() {
350 408
						serviceListVal();
351 409
						document.getElementsByClassName("establishments")[0].style.display="block"
352 410
					}
411
					if(!$data.colMgr && !$data.resMgr){
412
						productListVal();
413
						document.getElementsByClassName("productions")[0].style.display="block"
414
					}
353 415
					if($data.forShort){
354 416
						document.getElementById("companyName").innerText = $data.forShort;
355 417
					}else{

+ 1 - 3
js/cmpInforShow.js

@ -470,7 +470,6 @@ $(function() {
470 470
		productListVal=function(isbind){
471 471
			var aimId="proProduct",aimIdF="showProduct",newStr="企业尚未发布任何产品"
472 472
			oAjax("/ajax/product/publish",{
473
				"category":"2",
474 473
				"owner":orgId,
475 474
				"modifyTime":dataO.prdModifyTime,
476 475
				"rows": rows
@ -636,8 +635,7 @@ $(function() {
636 635
				}
637 636
			});
638 637
			oAjax("/ajax/product/count/publish",{//产品总数
639
				"owner": orgId,
640
				"category":"2"
638
				"owner": orgId
641 639
			}, "GET", function(data){
642 640
				if(data.data>0 && data.data<99){
643 641
					$("#productCount").text(data.data);