Browse Source

修改企业和文章,添加相关产品

luyanan 6 years ago
parent
commit
8a90684233

+ 3 - 0
app/css/app.css

1218
/*单webview*/
1218
/*单webview*/
1219
.singleView .mui-scroll-wrapper{top: 44px;}
1219
.singleView .mui-scroll-wrapper{top: 44px;}
1220
.singleView #pullDownTips{margin:auto}
1220
.singleView #pullDownTips{margin:auto}
1221

1222
/*附件提示*/
1223
.atachList{color:#017eb8;background:#e7f5fb;padding:10px 20px;text-align: center;font-size:12px;}

+ 40 - 0
app/html/cmpInforShow-product.html

1
<!DOCTYPE html>
2
<html>
3
4
	<head>
5
		<meta charset="UTF-8">
6
		<title>企业浏览-产品列表</title>
7
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
8
		<link href="../css/mui.min.css" rel="stylesheet" />
9
		<link href="../css/iconfont.css" rel="stylesheet" />
10
		<link href="../css/app.css" rel="stylesheet" />
11
	</head>
12
13
	<body>
14
		<div class="maskBlack" id="maskBlack"></div>
15
		<header class="mui-bar mui-bar-nav toptitbox">
16
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a>
17
			<h1 class="mui-title toptit">企业产品</h1>
18
		</header>
19
20
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh">
21
		 	<div class="mui-scroll">
22
				<div class="mui-input-group mainbox madiaBlock">
23
					<div class="infocon">
24
						<ul class="mui-table-view" id="productShow">
25
					        
26
					    </ul>
27
					</div>
28
				</div>
29
			</div>
30
		</div>
31
		
32
		<script src="../js/public/mui.min.js"></script>
33
		<script src="../js/public/base.js"></script>
34
		<script src="../js/public/mui.pullToRefresh.js"></script>
35
		<script src="../js/public/mui.pullToRefresh.material.js"></script>
36
		<script src="../js/cmpInforShow-product.js"></script>
37
		
38
	</body>
39
40
</html>

+ 17 - 2
app/html/cmpInforShow.html

15
			.showCardI{background-image: url(../images/enterprise_img_bg_nor@3x.png)}
15
			.showCardI{background-image: url(../images/enterprise_img_bg_nor@3x.png)}
16
			.infocontit:before{background: #28b8fa;}
16
			.infocontit:before{background: #28b8fa;}
17
			.establishments{display: none;}
17
			.establishments{display: none;}
18
			.productions{display: none;}
18
		</style>
19
		</style>
19
	</head>
20
	</head>
20
21
29
		<!--主页面底部菜单-->
30
		<!--主页面底部菜单-->
30
		<nav class="mui-bar mui-bar-tab footbox">
31
		<nav class="mui-bar mui-bar-tab footbox">
31
			<div class="mui-row artfoot">
32
			<div class="mui-row artfoot">
32
				<div class="mui-col-xs-9">
33
					<div class="consultdiv notopen">更多功能即将开放</div>
33
				<!--<div class="mui-col-xs-9">
34
					<div class="consultdiv notopen">更多功能即将开放</div>
35
				</div>-->
36
				<div class="mui-col-xs-9" id="consultBtn">
37
					<div class="consultdiv">联系</div>
34
				</div>
38
				</div>
35
				<div class="mui-col-xs-2" id="collectBtn">
39
				<div class="mui-col-xs-2" id="collectBtn">
36
					<span class="mui-icon iconfontnew icon-shoucang" id="ifAttend"></span><!--已收藏 icon-yishoucang-->
40
					<span class="mui-icon iconfontnew icon-shoucang" id="ifAttend"></span><!--已收藏 icon-yishoucang-->
81
					<div class="seeMore displayNone" id="seeMoreResource"><em>查看全部 <span id="resourceNum">0</span>个</em></div>
85
					<div class="seeMore displayNone" id="seeMoreResource"><em>查看全部 <span id="resourceNum">0</span>个</em></div>
82
				</div>
86
				</div>
83
			</div>
87
			</div>
88
			<div class="productions">
89
				<div class="mui-input-group mainbox displayNone">
90
					<div class="infocontit">我们的产品</div>
91
					<div class="infocon infoconM madiaBlock">
92
						<ul class="mui-table-view" id="productShow">
93
					        
94
					    </ul>
95
					</div>
96
					<div class="seeMore displayNone" id="seeMoreProduct"><em>查看全部 <span id="productNum">0</span>个</em></div>
97
				</div>
98
			</div>
84
			<div class="mui-input-group mainbox" id="goCmpBrief">
99
			<div class="mui-input-group mainbox" id="goCmpBrief">
85
				<div class="infocontit mui-navigate-right mui-clearfix">企业介绍 </div>
100
				<div class="infocontit mui-navigate-right mui-clearfix">企业介绍 </div>
86
				<div class="infocon infoconM">
101
				<div class="infocon infoconM">

+ 10 - 8
app/html/guide.html

3

3

4
	<head>
4
	<head>
5
		<meta charset="UTF-8">
5
		<meta charset="UTF-8">
6
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
7
		<link href="../css/mui.min.css" rel="stylesheet" />
6
		<title>app开屏广告</title>
8
		<title>app开屏广告</title>
7
		<style>
9
		<style>
8
			.box {position: absolute;z-index: 2;top: 0;bottom: 0;left: 0;right:0;overflow: hidden;background: #ffffff;}			
10
			.box {position: absolute;z-index: 2;top: 0;bottom: 0;left: 0;right:0;overflow: hidden;background: #ffffff;}			
9
			.footer {width:100%;height:18%;background:#fff;display: flex;align-items: center;justify-content: center;position: fixed;bottom: 0;}
11
			.footer {width:100%;height:18%;background:#fff;display: flex;align-items: center;justify-content: center;position: fixed;bottom: 0;}
10
			.skip {position: fixed;top: 3%;right: 5%;background: rgba(0, 0, 0, 0.15);text-align: center;color: #fff;z-index:3;border-radius: 60px;}
12
			.skip {font-size:16px;padding:10px 20px;position: fixed;top: 3%;right: 5%;background: rgba(0, 0, 0, 0.15);text-align: center;color: #fff;z-index:3;border-radius: 60px;}
11
			.skip:after{content: "跳过广告";}
13
			.skip:after{content: "跳过广告";}
12
		</style>
14
		</style>
13
	</head>
15
	</head>
29
		var footer=document.getElementsByClassName("footer")[0]
31
		var footer=document.getElementsByClassName("footer")[0]
30
		var skip=document.getElementsByClassName("skip")[0]
32
		var skip=document.getElementsByClassName("skip")[0]
31
		var closet=document.getElementById("close")
33
		var closet=document.getElementById("close")
32
		if(anos==0){//android
33
			skip.style.fontSize="36px";
34
			skip.style.padding="18px 36px";
35
		}else{
36
			skip.style.fontSize="16px";
37
			skip.style.padding="10px 20px";
38
		}
34
//		if(anos==0){//android
35
//			skip.style.fontSize="16px";
36
//			skip.style.padding="10px 20px";
37
//		}else{
38
//			skip.style.fontSize="16px";
39
//			skip.style.padding="10px 20px";
40
//		}
39
		
41
		
40
		addscript("ad_opening_app");
42
		addscript("ad_opening_app");
41
		mui.init();
43
		mui.init();

+ 10 - 0
app/html/professorArticle.html

76
				    	<!--文章内容区-->
76
				    	<!--文章内容区-->
77
					<div class="showMain" id="articleContent">
77
					<div class="showMain" id="articleContent">
78
						</div>
78
						</div>
79
					<!--附件模块-->
80
					<div class="atachList displayNone">
81
						本文章包含的附件内容需登录PC端科袖网进行下载
82
					</div>
79
			    		<!--标签模块-->
83
			    		<!--标签模块-->
80
					<ul class="tagList displayNone">
84
					<ul class="tagList displayNone">
81
					</ul>
85
					</ul>
85
					       
89
					       
86
					    </ul>
90
					    </ul>
87
					</div>
91
					</div>
92
					<div class="madiaBlock displayNone" id="correlationProduct">
93
						<div class="madiaTit">相关产品</div>
94
						<ul class="mui-table-view" id="productList">
95
					       
96
					    </ul>
97
					</div>
88
					<div class="madiaBlock displayNone" id="correlationService">
98
					<div class="madiaBlock displayNone" id="correlationService">
89
						<div class="madiaTit">相关服务</div>
99
						<div class="madiaTit">相关服务</div>
90
						<ul class="mui-table-view" id="serviceList">
100
						<ul class="mui-table-view" id="serviceList">

BIN
app/images/default-product.jpg


+ 128 - 49
app/js/articleShow.js

50
				}
50
				}
51
			});
51
			});
52
		},
52
		},
53
		queryFileAtach:function(){
54
			oArticleModule.oAjaxGet(baseUrl + "/ajax/article/files/byArticleId",{
55
				"id":oArticleModule.articleId
56
			}, "get", function(data){
57
				if(data){
58
					if(data.length>0){
59
						document.getElementsByClassName('atachList')[0].style.display='block';
60
					}
61
				}
62
			});
63
		},
53
		articleMess: function($data) {
64
		articleMess: function($data) {
54
			plus.nativeUI.closeWaiting();
65
			plus.nativeUI.closeWaiting();
55
			plus.webview.currentWebview().show("slide-in-right", 150);
66
			plus.webview.currentWebview().show("slide-in-right", 150);
68
			if($data.articleImg){
79
			if($data.articleImg){
69
				stt = $data.articleImg.substring(0, 9);
80
				stt = $data.articleImg.substring(0, 9);
70
			}
81
			}
71
			console.log(stt)
72
			if($data.articleContent) {
82
			if($data.articleContent) {
73
				document.getElementById("articleContent").innerHTML = $data.articleContent;
83
				document.getElementById("articleContent").innerHTML = $data.articleContent;
74
				var oImg = document.getElementById("articleContent").getElementsByTagName("img");
84
				var oImg = document.getElementById("articleContent").getElementsByTagName("img");
150
			
160
			
151
		},
161
		},
152
		professorMess: function($data) {
162
		professorMess: function($data) {
153
			//console.log(JSON.stringify($data));
154
			document.getElementById('name').innerHTML = $data.name;
163
			document.getElementById('name').innerHTML = $data.name;
155
			if($data.hasHeadImage == 1) {
164
			if($data.hasHeadImage == 1) {
156
				document.getElementById("messImg").style.backgroundImage = "url(" + baseUrl + "/images/head/" + $data.id + "_l.jpg" + ")";
165
				document.getElementById("messImg").style.backgroundImage = "url(" + baseUrl + "/images/head/" + $data.id + "_l.jpg" + ")";
159
			document.getElementById("auth").classList.add(userType.sty);
168
			document.getElementById("auth").classList.add(userType.sty);
160
		},
169
		},
161
		business: function($data) {
170
		business: function($data) {
162
			//console.log(JSON.stringify($data));
163
			if($data.forShort){
171
			if($data.forShort){
164
				document.getElementById('name').innerHTML = $data.forShort;
172
				document.getElementById('name').innerHTML = $data.forShort;
165
			}else{
173
			}else{
186
					}
194
					}
187
				});
195
				});
188
			})
196
			})
197
			if(!$data.colMgr && !$data.resMgr) {
198
				oArticleModule.correlationProduct();
199
			}
200
			if($data.colMgr) {
201
				oArticleModule.queryFileAtach();
202
			}
189
		},
203
		},
190
		platform: function($data) {
204
		platform: function($data) {
191
			console.log(JSON.stringify($data));
205
			console.log(JSON.stringify($data));
196
				document.getElementById("platImg").src= baseUrl + "/data/platform" + $data.logo;
210
				document.getElementById("platImg").src= baseUrl + "/data/platform" + $data.logo;
197
			}
211
			}
198
		},
212
		},
199
		correlationExpert: function($data) {
200
			if($data.length == 0) {
201
				return;
202
			}
203
			document.getElementById("correlationExpert").style.display = "block";
204
			for(var i = 0; i < $data.length; i++) {
205
				(function(n) {
206
					oArticleModule.oAjaxGet(baseUrl + "/ajax/professor/editBaseInfo/" + $data[n].professorId, "", "get", oArticleModule.expertList);
207
				})(i)
208

209
			}
210

213
		correlationExpert: function() {
214
			oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralatePro", {
215
				"articleId": oArticleModule.articleId
216
			}, "get", function($data){
217
				if($data.length == 0) {
218
					return;
219
				}
220
				document.getElementById("correlationExpert").style.display = "block";
221
				for(var i = 0; i < $data.length; i++) {
222
					(function(n) {
223
						oArticleModule.oAjaxGet(baseUrl + "/ajax/professor/editBaseInfo/" + $data[n].professorId, "", "get", oArticleModule.expertList);
224
					})(i)
225
	
226
				}
227
			})
211
		},
228
		},
212
		expertList: function($data) {
229
		expertList: function($data) {
213
			var os = "";
230
			var os = "";
247
				'</div>'
264
				'</div>'
248
			document.getElementById("expertList").appendChild(li);
265
			document.getElementById("expertList").appendChild(li);
249
		},
266
		},
250
		correlationResource: function($data) {
251
			//console.log(JSON.stringify($data));
252
			if($data.length == 0) {
253
				return;
254
			}
255
			document.getElementById("resource").style.display = "block";
256
			for(var i = 0; i < $data.length; i++) {
257
				oArticleModule.oAjaxGet(baseUrl + "/ajax/resource/queryOne", {
258
					"resourceId": $data[i].resourceId
259
				}, "get", oArticleModule.rsourceList);
260
			}
261

267
		correlationResource: function() {
268
			oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralateRes", {
269
				"articleId": oArticleModule.articleId
270
			}, "get", function($data){
271
				if($data.length == 0) {
272
					return;
273
				}
274
				document.getElementById("resource").style.display = "block";
275
				for(var i = 0; i < $data.length; i++) {
276
					oArticleModule.oAjaxGet(baseUrl + "/ajax/resource/queryOne", {
277
						"resourceId": $data[i].resourceId
278
					}, "get", oArticleModule.rsourceList);
279
				}
280
			})
262
		},
281
		},
263
		rsourceList: function($data) {
282
		rsourceList: function($data) {
264
			var namepo, userType;
283
			var namepo, userType;
324
						'<div class="madiaInfo OmadiaInfo">' +
343
						'<div class="madiaInfo OmadiaInfo">' +
325
						'<p class="mui-ellipsis-2 h1Font">' + $data[i].name + '</p>' +
344
						'<p class="mui-ellipsis-2 h1Font">' + $data[i].name + '</p>' +
326
						'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
345
						'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
327
						//'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
346
//						'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
328
						'</div>' +
347
						'</div>' +
329
						'</div>'
348
						'</div>'
330
					document.getElementById("serviceList").appendChild(li);
349
					document.getElementById("serviceList").appendChild(li);
337
				}
356
				}
338
			});
357
			});
339
		},
358
		},
359
		correlationProduct: function() {
360
			oArticleModule.oAjaxGet(baseUrl + "/ajax/article/product",{
361
				"id": oArticleModule.articleId,
362
				"rows":5
363
			}, "get", function(res){
364
				var $data=res
365
				console.log(JSON.stringify(res));
366
				if($data.length == 0) {
367
					return;
368
				}
369
				document.getElementById("correlationProduct").style.display = "block";
370
				for(var i = 0; i < $data.length; i++) {
371
					oArticleModule.oAjaxGet(baseUrl + "/ajax/product/qo", {
372
						"id": $data[i].product
373
					}, "get", oArticleModule.productList);
374
				}
375
			});
376
		},
377
		productList: function($data) {
378
			var cnt="", rImg="../images/default-product.jpg"
379
			if($data.images) {
380
				var subs = strToAry($data.images)
381
				if(subs.length > 0) {
382
					rImg=baseUrl+"/data/product" + subs[0]
383
				}
384
			}
385
			if($data.cnt){
386
				cnt="简介:"+$data.cnt
387
			}
388
			var li = document.createElement("li");
389
			li.setAttribute("data-id",$data.id);
390
			li.className = "mui-table-view-cell";
391
			li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
392
				' <div class="madiaHead resouseHead" style="background-image:url(' + rImg + ')"></div>' +
393
				'<div class="madiaInfo OmadiaInfo">' +
394
				'<p class="mui-ellipsis-2 h1Font">' + $data.name + '</p>' +
395
				'<p><span class="h2Font ownerName"></span><em class="authicon ownerSty"></em></p>' +
396
				'</div>' +
397
				'</div>'
398
			document.getElementById("productList").appendChild(li);
399
			var $li=$(li)
400
			oArticleModule.orgSigInfo($data.owner,$li)
401
		},
340
		correlationArticle: function($data) {
402
		correlationArticle: function($data) {
341
				if($data.total) {
342
					if($data.data.length == 0) {
343
						return;
344
					}
345
				}else{
346
					if($data.length == 0) {
347
						return;
348
					}
403
			if($data.total) {
404
				if($data.data.length == 0) {
405
					return;
349
				}
406
				}
350
				var oo=1;
407
			}else{
408
				if($data.length == 0) {
409
					return;
410
				}
411
			}
412
			var oo=1;
351
			if($data.total) {
413
			if($data.total) {
352
				var $data=$data.data;
414
				var $data=$data.data;
353
				
415
				console.log(JSON.stringify($data))
354
				document.getElementById('newarticle').style.display = "block";
416
				document.getElementById('newarticle').style.display = "block";
355
				oo=0;
417
				oo=0;
356
			}else{
418
			}else{
359
			}
421
			}
360
			
422
			
361
			for(var i = 0; i < $data.length; i++) {
423
			for(var i = 0; i < $data.length; i++) {
362
				var ourl, of ;
424
				var ourl, of,dataSt;
363
				if($data[i].articleType == '1') {
425
				if($data[i].articleType == '1') {
364
					ourl = baseUrl + "/ajax/professor/editBaseInfo/" + $data[i].ownerId; of = 1;
426
					ourl = baseUrl + "/ajax/professor/editBaseInfo/" + $data[i].ownerId; of = 1;
365
				} else if($data[i].articleType == '2'){
427
				} else if($data[i].articleType == '2'){
366
					ourl = baseUrl + "/ajax/org/" + $data[i].ownerId; of = 2;
428
					ourl = baseUrl + "/ajax/org/" + $data[i].ownerId; of = 2;
367
				} else if($data[i].articleType == '3'){
429
				} else if($data[i].articleType == '3'){
368
					ourl = baseUrl + "/ajax/platform/info"; of = 3;
430
					ourl = baseUrl + "/ajax/platform/info"; of = 3;
431
					dataSt ={ id:$data[i].ownerId };
369
				}
432
				}
370
				var arImg = "../images/default-artical.jpg";
433
				var arImg = "../images/default-artical.jpg";
371
				if($data[i].articleImg) {
434
				if($data[i].articleImg) {
374
				var title = $data[i].articleTitle;
437
				var title = $data[i].articleTitle;
375
				mui.ajax(ourl, {
438
				mui.ajax(ourl, {
376
					dataType: 'json', //服务器返回json格式数据
439
					dataType: 'json', //服务器返回json格式数据
440
					data: dataSt,
377
					type: "get", //HTTP请求类型
441
					type: "get", //HTTP请求类型
378
					timeout: 10000, //超时时间设置为10秒;
442
					timeout: 10000, //超时时间设置为10秒;
379
					async: false,
443
					async: false,
387
								var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
451
								var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
388
								li.setAttribute("owner-id", data.data.id);
452
								li.setAttribute("owner-id", data.data.id);
389
								li.setAttribute("data-type", 1);
453
								li.setAttribute("data-type", 1);
390
							} else {
454
							} else if(of == 2){
391
								if(data.data.forShort){
455
								if(data.data.forShort){
392
									namepo = data.data.forShort;
456
									namepo = data.data.forShort;
393
								}else{
457
								}else{
401
								}
465
								}
402
								li.setAttribute("owner-id", data.data.id);
466
								li.setAttribute("owner-id", data.data.id);
403
								li.setAttribute("data-type", 2);
467
								li.setAttribute("data-type", 2);
468
							}else if(of == 3){
469
								namepo = data.data.name;
470
								
471
								li.setAttribute("owner-id", data.data.id);
472
								li.setAttribute("data-type", 3);
404
							}
473
							}
405
							li.setAttribute("data-id", $data[i].articleId);
474
							li.setAttribute("data-id", $data[i].articleId);
406
							li.className = "mui-table-view-cell";
475
							li.className = "mui-table-view-cell";
414
							
483
							
415
							if(oo==0){
484
							if(oo==0){
416
								document.getElementById("newarticleList").appendChild(li)
485
								document.getElementById("newarticleList").appendChild(li)
417
							}else{document.getElementById("articleList").appendChild(li);}
486
							}else{
487
								document.getElementById("articleList").appendChild(li);
488
							}
418
						}
489
						}
419
					},
490
					},
420
					error: function(xhr, type, errorThrown) {
491
					error: function(xhr, type, errorThrown) {
485
				}
556
				}
486
			});
557
			});
487
		}
558
		}
559
		
488
	}
560
	}
489
	pageViewLog(oArticleModule.articleId, 3)
561
	pageViewLog(oArticleModule.articleId, 3)
490
	wlog("article", oArticleModule.articleId, "2")
562
	wlog("article", oArticleModule.articleId, "2")
493
		articleId: oArticleModule.articleId
565
		articleId: oArticleModule.articleId
494
	}, "get", oArticleModule.articleMess);
566
	}, "get", oArticleModule.articleMess);
495
	
567
	
496
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/find", {pageSize:5}, "get", oArticleModule.correlationArticle);
497
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralatePro", {
498
		"articleId": oArticleModule.articleId
499
	}, "get", oArticleModule.correlationExpert);
500
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/ralateRes", {
501
		"articleId": oArticleModule.articleId
502
	}, "get", oArticleModule.correlationResource);
503
	oArticleModule.correlationService()
568
	oArticleModule.oAjaxGet(baseUrl + "/ajax/article/find", {
569
		"pageSize":5,
570
		"exclude":oArticleModule.articleId
571
	}, "get", oArticleModule.correlationArticle);
572
	oArticleModule.correlationExpert();
573
	oArticleModule.correlationResource();
574
	oArticleModule.correlationService();
575
	oArticleModule.correlationProduct()
504
	//相关企业
576
	//相关企业
505
	function companylist() {
577
	function companylist() {
506
		mui.ajax(baseUrl+"/ajax/article/ralateOrg",{
578
		mui.ajax(baseUrl+"/ajax/article/ralateOrg",{
594
			serviceId: serviceId
666
			serviceId: serviceId
595
		});
667
		});
596
	})
668
	})
669
	mui("#productList").on('tap', 'li', function() {
670
		var Id = this.getAttribute("data-id");
671
		plus.nativeUI.showWaiting();
672
		plus.webview.create("../html/productShow.html", 'productShow.html', {}, {
673
			productId: Id
674
		});
675
	})
597
	mui('#articleList,#newarticleList').on('tap', 'li', function() {
676
	mui('#articleList,#newarticleList').on('tap', 'li', function() {
598
		var id = this.getAttribute("data-id");
677
		var id = this.getAttribute("data-id");
599
		plus.nativeUI.showWaiting();
678
		plus.nativeUI.showWaiting();

+ 147 - 0
app/js/cmpInforShow-product.js

1
var deceleration = mui.os.ios ? 0.003 : 0.0009;
2
mui('.mui-scroll-wrapper').scroll({
3
    bounce: false,
4
    indicators: true, //是否显示滚动条
5
    deceleration: deceleration
6
});
7
mui.ready(function() {
8
	mui.plusReady(function() {
9
		var self = plus.webview.currentWebview();
10
		var orgId = self.cmpId;
11
		var rows = 10,
12
			pullRefreshEl,
13
			currentIndex,
14
			currentSelf,
15
			dataO = {
16
				prdModifyTime: ""
17
			}
18
		var oAjax = function(url, dataS, otype, oFun) {
19
				mui.ajax(baseUrl + url, {
20
					dataType: 'json',
21
					type: otype,
22
					data: dataS,
23
					traditional: true,
24
					success: function(res) {
25
						if(res.success) {
26
							oFun(res)
27
						}
28
					}
29
				});
30
			},
31
			insertNodata = function(targetE, newStr) {
32
				var parent = document.getElementById(targetE).parentNode;
33
				var kong = document.createElement("div");
34
				kong.className = "con-kong";
35
				kong.innerHTML = '<div class="picbox picNull"></div>' +
36
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
37
				if(newStr) {
38
					kong.querySelector(".txtbox").innerHTML = newStr;
39
				}
40
				if(parent.firstChild.className == "con-kong") {
41
					return
42
				} else {
43
					parent.insertBefore(kong, parent.firstChild);
44
				}
45
			},
46
			removeNodata = function (targetE) {
47
	            var parent = document.getElementById(targetE).parentNode;
48
	            if (parent.firstChild.className == "con-kong") {
49
	                parent.removeChild(parent.firstChild);
50
	            } else {
51
	                return
52
	            }
53
	        },
54
			productListVal = function(tabIndex) {
55
				var aimId = "productShow",
56
					newStr = "企业尚未发布任何产品"
57
				oAjax("/ajax/product/publish",{
58
					"owner":orgId,
59
					"modifyTime":dataO.prdModifyTime,
60
					"rows": rows
61
				}, "get", function(res){
62
					plus.nativeUI.closeWaiting();
63
					plus.webview.currentWebview().show("slide-in-right", 150);
64
					console.log(JSON.stringify(res))
65
					var obj = res.data;
66
					if(obj.length > 0) {
67
						dataO.prdModifyTime = obj[obj.length - 1].modifyTime;
68
						
69
						for(var i = 0; i < obj.length; i++) {
70
							var cnt = "",
71
								hasImg = "../images/default-product.jpg"
72
							if(obj[i].images) {
73
								var subs = strToAry(obj[i].images)
74
								if(subs.length > 0) {
75
									hasImg = baseUrl + "/data/product" + subs[0]
76
								}
77
							}
78
							if(obj[i].cnt) {
79
								cnt = "简介:" + obj[i].cnt
80
							}
81
							var li = document.createElement("li");
82
							li.setAttribute("data-id", obj[i].id);
83
							li.className = "mui-table-view-cell";
84
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
85
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
86
								'<div class="madiaInfo OmadiaInfo">' +
87
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
88
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
89
								'</div>' +
90
								'</div>'
91
							document.getElementById(aimId).appendChild(li);
92
						}
93
					}
94
					if (currentIndex != tabIndex) {
95
		                currentIndex = tabIndex;
96
		                mui.each(document.querySelectorAll('.mui-scroll'), function ($_index, pullRefreshEl) {
97
		                    if ($_index == tabIndex) {
98
		                        currentSelf = mui(pullRefreshEl).pullToRefresh({
99
		                            up: {
100
		                                callback: function () {
101
		                                	if(currentSelf.loading){
102
			                                    setTimeout(function () {
103
			                                         serviceListVal(tabIndex)
104
			                                         currentSelf.endPullUpToRefresh();
105
			                                    }, 1000);
106
		                                    }
107
		                                }
108
		                            }
109
		                        });
110
		                    }
111
		                })
112
		            }
113
					var liLen = document.getElementById(aimId).querySelectorAll("li").length;
114
					removeNodata(aimId);
115
					if(obj.length == 0 && liLen == 0) {
116
						document.getElementById(aimId).style.display="none";
117
						insertNodata(aimId, newStr);
118
					}
119
					if(obj.length < rows) {
120
						currentSelf.endPullUpToRefresh(true);
121
					} else {
122
						currentSelf.endPullUpToRefresh(false);
123
					}
124
				})
125
			},
126
			bindClikFun=function(){
127
				mui('#productShow').on('tap', 'li', function() {
128
					var id = this.getAttribute("data-id");
129
					plus.nativeUI.showWaiting();
130
					plus.webview.create("../html/productShow.html", 'productShow.html', {}, {
131
						productId: id,
132
					});
133
				})
134
				document.getElementsByClassName("topback")[0].addEventListener("tap", function() {
135
					var web = plus.webview.getWebviewById("cmpInforShow.html");
136
					if(web)
137
						mui.fire(web, "newId", {
138
							rd: 1
139
						});
140
				})
141
			}
142
			
143
		productListVal(0)
144
		bindClikFun()
145
		
146
	})
147
})

+ 124 - 8
app/js/cmpInforShow.js

5
		var self = plus.webview.currentWebview();
5
		var self = plus.webview.currentWebview();
6
		var orgId = self.cmpId;
6
		var orgId = self.cmpId;
7

7

8
		var rows = 1
8
		var rows = 1,ifHasDefaultUser=false,firstLinkman;
9
		var oAjax = function(url, dataS, otype, oFun) {
9
		var oAjax = function(url, dataS, otype, oFun) {
10
				mui.ajax(baseUrl + url, {
10
				mui.ajax(baseUrl + url, {
11
					dataType: 'json',
11
					dataType: 'json',
158
					}
158
					}
159
				})
159
				})
160
			},
160
			},
161
			productListVal = function() {
162
				var aimId = "productShow"
163
				oAjax("/ajax/product/publish", {
164
					"owner":orgId,
165
					"rows": rows
166
				}, "get", function(res) {
167
					var obj = res.data;
168
					if(obj.length > 0) {
169
						document.getElementById(aimId).parentNode.parentNode.classList.remove("displayNone");
170
						for(var i = 0; i < obj.length; i++) {
171
							var cnt = "",
172
								hasImg = "../images/default-product.jpg"
173
							if(obj[i].images) {
174
								var subs = strToAry(obj[i].images)
175
								if(subs.length > 0) {
176
									hasImg = baseUrl + "/data/product" + subs[0]
177
								}
178
							}
179
							if(obj[i].cnt) {
180
								cnt = "简介:" + obj[i].cnt
181
							}
182
							var li = document.createElement("li");
183
							li.setAttribute("data-id", obj[i].id);
184
							li.className = "mui-table-view-cell";
185
							li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
186
								'<div class="madiaHead resouseHead" style="background-image:url(' + hasImg + ')"></div>' +
187
								'<div class="madiaInfo OmadiaInfo">' +
188
								'<p class="mui-ellipsis-2 h1Font">' + obj[i].name + '</p>' +
189
								'<p class="mui-ellipsis h2Font">' + cnt + '</p>' +
190
								'</div>' +
191
								'</div>'
192
							document.getElementById(aimId).appendChild(li);
193
						}
194
					}
195
				})
196
			},
161
			queryPubCount = function() {
197
			queryPubCount = function() {
162
				oAjax("/ajax/article/count/publish", { //文章总数
198
				oAjax("/ajax/article/count/publish", { //文章总数
163
					"owner": orgId,
199
					"owner": orgId,
186
						$("#serviceNum").text(data.data);
222
						$("#serviceNum").text(data.data);
187
					}
223
					}
188
				});
224
				});
225
				oAjax("/ajax/product/count/publish", { //产品总数
226
					"owner": orgId
227
				}, "GET", function(data) {
228
					if(data.data > rows) {
229
						$("#seeMoreProduct").removeClass("displayNone")
230
						$("#productNum").text(data.data);
231
					}
232
				});
233
			},
234
			getDefaultLink=function(){
235
				oAjax("/ajax/org/linkman/queryAll",{
236
					"oid": orgId
237
				}, "GET", function(data){
238
					if(data.success) {
239
						var $data = data.data;
240
						if($data.length>0){
241
							firstLinkman=$data[0].pid
242
							ifHasDefaultUser = true;
243
						}
244
					}
245
				});
189
			},
246
			},
190
			bindClickFun = function() {
247
			bindClickFun = function() {
191
				//点击收藏按钮
248
				//点击收藏按钮
202
						isLogin();
259
						isLogin();
203
					}
260
					}
204
				});
261
				});
262
				document.getElementById("consultBtn").addEventListener('tap', function() {
263
					if(userid && userid != null && userid != "null") {
264
						oAjax("/ajax/professor/baseInfo/"+userid, {}, "get", function(res) {
265
							var obj = res.data;
266
							if(obj.orgId === orgId){
267
								document.getElementsByClassName('footbox')[0].style.display = "none";
268
							}else{
269
								if(ifHasDefaultUser){
270
									var wechat=plus.webview.getWebviewById('weChat.html');
271
									var jubao=plus.webview.getWebviewById('jubao.html');
272
									
273
									if(wechat) {
274
										wechat.close();
275
									}
276
									if(jubao) {
277
										jubao.close();
278
									}
279
									setTimeout(function() {
280
										mui.openWindow({
281
											url: '../html/weChat.html',
282
											id: 'weChat.html',
283
											show: {
284
												autoShow: true,
285
												aniShow: "slide-in-right",
286
											},
287
											extras: {
288
												professorId: firstLinkman,
289
												flag:1
290
											}
291
										})
292
									},100);
293
								}else{
294
									plus.nativeUI.toast("暂时无法取得联系", toastStyle);
295
								}
296
							}
297
						})
298
					} else {
299
						isLogin();
300
					}
301
				});
205
				//详细页面
302
				//详细页面
206
				document.getElementById("goCmpBrief").addEventListener("tap", function() {
303
				document.getElementById("goCmpBrief").addEventListener("tap", function() {
207
					var nwaiting = plus.nativeUI.showWaiting();
304
					var nwaiting = plus.nativeUI.showWaiting();
231
					});
328
					});
232
					web.addEventListener("loaded", function() {}, false);
329
					web.addEventListener("loaded", function() {}, false);
233
				});
330
				});
331
				document.getElementById("seeMoreProduct").addEventListener("tap", function() {
332
					var nwaiting = plus.nativeUI.showWaiting();
333
					var web = plus.webview.create("../html/cmpInforShow-product.html", "cmpInforShow-product.html", {}, {
334
						cmpId: orgId
335
					});
336
					web.addEventListener("loaded", function() {}, false);
337
				});
234
				mui('#articelShow,#relateArt').on('tap', 'li', function() {
338
				mui('#articelShow,#relateArt').on('tap', 'li', function() {
235
					var id = this.getAttribute("data-id");
339
					var id = this.getAttribute("data-id");
236
					plus.nativeUI.showWaiting();
340
					plus.nativeUI.showWaiting();
238
						articleId: id,
342
						articleId: id,
239
					});
343
					});
240
				})
344
				})
241
				mui('#serviceShow').on('tap', 'li', function() {
242
					var id = this.getAttribute("data-id");
243
					plus.nativeUI.showWaiting();
244
					plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
245
						serviceId: id,
246
					});
247
				})
248
				mui('#resourceShow').on('tap', 'li', function() {
345
				mui('#resourceShow').on('tap', 'li', function() {
249
					var id = this.getAttribute("data-id");
346
					var id = this.getAttribute("data-id");
250
					plus.nativeUI.showWaiting();
347
					plus.nativeUI.showWaiting();
259
						demanid: dId
356
						demanid: dId
260
					});
357
					});
261
				})
358
				})
359
				mui('#serviceShow').on('tap', 'li', function() {
360
					var id = this.getAttribute("data-id");
361
					plus.nativeUI.showWaiting();
362
					plus.webview.create("../html/serviceShow.html", 'serviceShow.html', {}, {
363
						serviceId: id,
364
					});
365
				})
366
				mui('#productShow').on('tap', 'li', function() {
367
					var id = this.getAttribute("data-id");
368
					plus.nativeUI.showWaiting();
369
					plus.webview.create("../html/productShow.html", 'productShow.html', {}, {
370
						productId: id,
371
					});
372
				})
262
				mui('#likePro').on('tap', 'li', function() {
373
				mui('#likePro').on('tap', 'li', function() {
263
					var id = this.getAttribute("data-id");
374
					var id = this.getAttribute("data-id");
264
					plus.nativeUI.showWaiting();
375
					plus.nativeUI.showWaiting();
277

388

278
		pageViewLog(orgId, 6)
389
		pageViewLog(orgId, 6)
279
		companyMessage(orgId);
390
		companyMessage(orgId);
391
		getDefaultLink();
280
		relevantarticalList(); //相关文章
392
		relevantarticalList(); //相关文章
281
		likeExperts(); //感兴趣企业	
393
		likeExperts(); //感兴趣企业	
282
		
394
		
300
							serviceListVal();
412
							serviceListVal();
301
							document.getElementsByClassName("establishments")[0].style.display="block"
413
							document.getElementsByClassName("establishments")[0].style.display="block"
302
						}
414
						}
415
						if(!$data.colMgr && !$data.resMgr){
416
							productListVal();
417
							document.getElementsByClassName("productions")[0].style.display="block"
418
						}
303
						if(demandListVal()) {
419
						if(demandListVal()) {
304
							document.getElementById("companyNameT").innerText = $data.forShort;
420
							document.getElementById("companyNameT").innerText = $data.forShort;
305
							document.getElementById("companyName").innerText = $data.forShort;
421
							document.getElementById("companyName").innerText = $data.forShort;