Browse Source

企业资源及个人资源

jack 7 years ago
parent
commit
3f71810754
6 changed files with 127 additions and 66 deletions
  1. 5 1
      cmp-portal/js/resourceIssue.js
  2. 1 1
      cmp-portal/resourceIssue.html
  3. 50 22
      js/resourcePreview.js
  4. 61 23
      js/resourceShow.js
  5. 9 18
      resourcePreview.html
  6. 1 1
      resourceShow.html

+ 5 - 1
cmp-portal/js/resourceIssue.js

378
		var $len = $("#fileList").find("img").length;
378
		var $len = $("#fileList").find("img").length;
379
		var reName = $("#resourceName").val();
379
		var reName = $("#resourceName").val();
380
		var oIndustry = $("#application").val();
380
		var oIndustry = $("#application").val();
381
		var oLen=$("#expertli").find(".selectAdd").length
381
		if($len == 0) {
382
		if($len == 0) {
382
			$.MsgBox.Alert('提示', '请上传资源图片。');
383
			$.MsgBox.Alert('提示', '请上传资源图片。');
383
			return 0;
384
			return 0;
390
			$.MsgBox.Alert('提示', '请输入应用用途。');
391
			$.MsgBox.Alert('提示', '请输入应用用途。');
391
			return 0;
392
			return 0;
392
		}
393
		}
394
		if(oLen==0) {
395
			$.MsgBox.Alert('提示', '至少选择一个负责人');
396
			return 0;
397
		}
393
	}
398
	}
394
	/*发布函数*/
399
	/*发布函数*/
395
	function ajsPost(pa1, pa2) {
400
	function ajsPost(pa1, pa2) {
434
					} else {
439
					} else {
435
						$.MsgBox.Alert('提示', '资源发布成功!');
440
						$.MsgBox.Alert('提示', '资源发布成功!');
436
						$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
441
						$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
437
						return;
438
						location.href = "resourceList.html"
442
						location.href = "resourceList.html"
439
					}
443
					}
440

444


+ 1 - 1
cmp-portal/resourceIssue.html

144
				</div>
144
				</div>
145
				<div class="conItem">
145
				<div class="conItem">
146
					<div class="form-item otherBlock">
146
					<div class="form-item otherBlock">
147
						<div class="aboutTit">负责人/联系人<span class="frmconmsg" id="linkman"></span></div>
147
						<div class="aboutTit">负责人/联系人<em class="requiredcon">*</em><span class="frmconmsg" id="linkman"></span></div>
148
						<div class="form-result addexpertRe">
148
						<div class="form-result addexpertRe">
149
							<ul class="addexpert" id="expertli">
149
							<ul class="addexpert" id="expertli">
150
								<li id="usid" data-id="7F26E3C720064AE8A10C7357BBBD239B">
150
								<li id="usid" data-id="7F26E3C720064AE8A10C7357BBBD239B">

+ 50 - 22
js/resourcePreview.js

21
			"success": function(data) {
21
			"success": function(data) {
22
				console.log(data);
22
				console.log(data);
23
				if(data.success) {
23
				if(data.success) {
24
					//resourceHtml(data.data);
24
					resourceHtml(data.data);
25
				}
25
				}
26
			},
26
			},
27
			"data": {
27
			"data": {
50
	function resourceHtml($da) {
50
	function resourceHtml($da) {
51
		$("#resourceName").text($da.resourceName); //名字
51
		$("#resourceName").text($da.resourceName); //名字
52
		$("#application").text($da.supportedServices); //应用用途
52
		$("#application").text($da.supportedServices); //应用用途
53
		if($da.editProfessor.orgName) { //所属机构
54
			$("#organizationName").text($da.editProfessor.orgName).parents("li").show();
55
		}
56
		$("#nameS").text($da.editProfessor.name); //"office": "", //职位 "title": "", //职称
57
		if($da.editProfessor.title) {
58
			$("#titleOffice").text($da.editProfessor.title);
59
		} else {
60
			if($da.editProfessor.office) {
61
				$("#titleOffice").text($da.editProfessor.office);
53
		if($da.editProfessor) {
54
			$("#person,#orgName").show();
55
			if($da.editProfessor.orgName) { //所属机构
56
				$("#organizationName").text($da.editProfessor.orgName).parents("li").show();
62
			}
57
			}
63
		}
64
		if($da.editProfessor.orgName) {
65
			$("#orgType").text($da.editProfessor.orgName);
66
		}
67
		professorId = $da.editProfessor.id;
68
		/*if(userid!=professorId) {
69
			$(".goSpan").show();
70
		}*/
71
		var professorFlag = autho($da.editProfessor.authType, $da.editProfessor.orgAuth, $da.editProfessor.authStatus);
72
		$("#authFlag").addClass(professorFlag.sty).attr("title", professorFlag.title);
73
		if($da.editProfessor.hasHeadImage == 1) {
74
			$("#headImg").css("background-image", 'url(/images/head/' + $da.editProfessor.id + '_l.jpg)');
58
			$("#nameS").text($da.editProfessor.name); //"office": "", //职位 "title": "", //职称
59
			if($da.editProfessor.title) {
60
				$("#titleOffice").text($da.editProfessor.title);
61
			} else {
62
				if($da.editProfessor.office) {
63
					$("#titleOffice").text($da.editProfessor.office);
64
				}
65
			}
66
			if($da.editProfessor.orgName) {
67
				$("#orgType").text($da.editProfessor.orgName);
68
			}
69
			professorId = $da.editProfessor.id;
70
			/*if(userid!=professorId) {
71
				$(".goSpan").show();
72
			}*/
73
			var professorFlag = autho($da.editProfessor.authType, $da.editProfessor.orgAuth, $da.editProfessor.authStatus);
74
			$("#authFlag").addClass(professorFlag.sty).attr("title", professorFlag.title);
75
			if($da.editProfessor.hasHeadImage == 1) {
76
				$("#headImg").css("background-image", 'url(/images/head/' + $da.editProfessor.id + '_l.jpg)');
77
			}
78
		}else {
79
			$("#enterprise,#resPerson").show();
80
			if($da.organization.hasOrgLogo) {
81
						$("#Qimg").attr("style", "background-image: url(/images/org/" + $da.organization.id + ".jpg);");
82
					}
83
					if($da.organization.authStatus==3){
84
						$("#QauthFlag").addClass("authicon-com-ok").attr("title", "认证企业");	
85
					}
86
					$("#Qname").text($da.organization.name);
87
					$("#Qindustry").text($da.organization.subject);
88
					if($da.organization.orgType==2){
89
						$("#QorgType").text("上市企业");
90
					}else if($da.organization.orgType==3){
91
						$("#QorgType").text("国有企业");
92
					}else if($da.organization.orgType==4){
93
						$("#QorgType").text("合资企业");
94
					}else if($da.organization.orgType==5){
95
						$("#QorgType").text("私人企业");
96
					}else if($da.organization.orgType==6){
97
						$("#QorgType").text("外资企业");
98
					}else if($da.organization.orgType==7){
99
						$("#QorgType").text("初创企业");
100
					}else{
101
						$("#QorgType").text("");
102
					}
75
		}
103
		}
76
		if($da.spec) { //厂商型号
104
		if($da.spec) { //厂商型号
77
			$("#modelNumber").text($da.spec).parents("li").show();
105
			$("#modelNumber").text($da.spec).parents("li").show();

+ 61 - 23
js/resourceShow.js

52
		$("#resourceName").text($da.resourceName); //名字
52
		$("#resourceName").text($da.resourceName); //名字
53
		$("#application").text($da.supportedServices); //应用用途
53
		$("#application").text($da.supportedServices); //应用用途
54
		if($da.editProfessor) {
54
		if($da.editProfessor) {
55
			$("#person").show();
55
			$("#person,#orgName").show();
56
			if($da.orgName) { //所属机构
56
			if($da.orgName) { //所属机构
57
				$("#organizationName").text($da.orgName).parents("li").show();
57
				$("#organizationName").text($da.orgName).parents("li").show();
58
			}
58
			}
81
			}
81
			}
82
		}else{
82
		}else{
83
			$("#enterprise,#resPerson").show();
83
			$("#enterprise,#resPerson").show();
84
			if(data.data.organization.hasOrgLogo) {
85
						$("#Qimg").attr("style", "background-image: url(/images/org/" + data.data.organization.id + ".jpg);");
84
			if($da.organization.hasOrgLogo) {
85
						$("#Qimg").attr("style", "background-image: url(/images/org/" + $da.organization.id + ".jpg);");
86
					}
86
					}
87
					if(data.data.organization.authStatus==3){
87
					if($da.organization.authStatus==3){
88
						$("#QauthFlag").addClass("authicon-com-ok").attr("title", "认证企业");	
88
						$("#QauthFlag").addClass("authicon-com-ok").attr("title", "认证企业");	
89
					}
89
					}
90
					$("#Qindustry").text( data.data.organization.subject);
91
					if(data.data.organization.orgType==2){
90
					$("#Qname").text($da.organization.name);
91
					$("#Qindustry").text($da.organization.subject);
92
					if($da.organization.orgType==2){
92
						$("#QorgType").text("上市企业");
93
						$("#QorgType").text("上市企业");
93
					}else if(data.data.organization.orgType==3){
94
					}else if($da.organization.orgType==3){
94
						$("#QorgType").text("国有企业");
95
						$("#QorgType").text("国有企业");
95
					}else if(data.data.organization.orgType==4){
96
					}else if($da.organization.orgType==4){
96
						$("#QorgType").text("合资企业");
97
						$("#QorgType").text("合资企业");
97
					}else if(data.data.organization.orgType==5){
98
					}else if($da.organization.orgType==5){
98
						$("#QorgType").text("私人企业");
99
						$("#QorgType").text("私人企业");
99
					}else if(data.data.organization.orgType==6){
100
					}else if($da.organization.orgType==6){
100
						$("#QorgType").text("外资企业");
101
						$("#QorgType").text("外资企业");
101
					}else if(data.data.organization.orgType==7){
102
					}else if($da.organization.orgType==7){
102
						$("#QorgType").text("初创企业");
103
						$("#QorgType").text("初创企业");
103
					}else{
104
					}else{
104
						$("#QorgType").text("");
105
						$("#QorgType").text("");
115
		}
116
		}
116
		if($da.subject) {
117
		if($da.subject) {
117
			var oSub = $da.subject.split(",");
118
			var oSub = $da.subject.split(",");
118
			interestingResources(oSub);
119
			if($da.resourceType==1) {
120
				interestingResources(oSub,$da.professorId,0);
121
			}else{
122
				interestingResources(oSub,$da.orgId,1);
123
			}
119
			var oSt = "";
124
			var oSt = "";
120
			for(var i = 0; i < oSub.length; i++) {
125
			for(var i = 0; i < oSub.length; i++) {
121
				oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
126
				oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
203
	function relatedArticlesHtml($html) {
208
	function relatedArticlesHtml($html) {
204
		for(var i = 0; i < $html.length; i++) {
209
		for(var i = 0; i < $html.length; i++) {
205
			(function(n) {
210
			(function(n) {
211
				var oURL;
212
				if($html[i].article.articleType==1) {
213
					oURL="/ajax/professor/baseInfo/" + $html[i].article.professorId;
214
				}else{
215
					oURL="/ajax/org/" + $html[i].article.orgId;
216
				}
206
				$.ajax({
217
				$.ajax({
207
					"url": "/ajax/professor/baseInfo/" + $html[i].article.professorId,
218
					"url":oURL,
208
					"type": "GET",
219
					"type": "GET",
209
					"success": function(data) {
220
					"success": function(data) {
210
						if(data.success) {
221
						if(data.success) {
211
							var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
222
							if($html[n].article.articleType==1) {
223
								var stl = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
224
							}else {
225
								if(data.data.authStatus==3) {
226
									var stl={};
227
									stl.sty="authicon-com-ok";
228
									stl.title="认证企业";
229
								}
230
							}
212
							var str = ""
231
							var str = ""
213
							str += '<li data-id="' + $html[n].article.articleId + '">'
232
							str += '<li data-id="' + $html[n].article.articleId + '">'
214
							if($html[n].article.articleImg) {
233
							if($html[n].article.articleImg) {
237
		location.href = "articalShow.html?articleId=" + $(this).attr("data-id");
256
		location.href = "articalShow.html?articleId=" + $(this).attr("data-id");
238
	})
257
	})
239
	/*感兴趣的资源*/
258
	/*感兴趣的资源*/
240
	function interestingResources(arry) {
259
	function interestingResources(arry,oId,oNu) {
260
		var oUrl;
261
		var $in={};
262
		$in.keys= arry;
263
		$in.resourceId= resourceId;
264
		
265
		if(oNu==0) {
266
				$in.professorId= oId;
267
				oUrl="/ajax/resource/ralateRes";
268
		}else {
269
			$in.orgId= oId;
270
			oUrl="/ajax/resource/orgRalateRes";
271
		}
241
		$.ajax({
272
		$.ajax({
242
			"url": "/ajax/resource/ralateRes",
273
			"url": oUrl,
243
			"type": "GET",
274
			"type": "GET",
244
			"success": function(data) {
275
			"success": function(data) {
245
				console.log(data);
276
				console.log(data);
251
					interestingResourcesHtml(data.data);
282
					interestingResourcesHtml(data.data);
252
				}
283
				}
253
			},
284
			},
254
			"data": {
255
				"keys": arry,
256
				"resourceId": resourceId,
257
				"professorId": professorId
258
			},
285
			"data":$in,
259
			"traditional": true,
286
			"traditional": true,
260
			dataType: "json",
287
			dataType: "json",
261
			'error': function() {
288
			'error': function() {
266
	/*感兴趣资源的html*/
293
	/*感兴趣资源的html*/
267
	function interestingResourcesHtml($respond) {
294
	function interestingResourcesHtml($respond) {
268
		for(var i = 0; i < $respond.length; i++) {
295
		for(var i = 0; i < $respond.length; i++) {
269
			var stl = autho($respond[i].editProfessor.authType, $respond[i].editProfessor.orgAuth, $respond[i].editProfessor.authStatus);
296
			if($respond[i].organization) {
297
				if($respond[i].organization.authStatus==3) {
298
					var stl={};
299
					stl.sty="authicon-com-ok";
300
					stl.title="认证企业";
301
				}
302
				var name= $respond[i].organization.name;
303
			}else {
304
				var stl = autho($respond[i].editProfessor.authType, $respond[i].editProfessor.orgAuth, $respond[i].editProfessor.authStatus);
305
				var name= $respond[i].editProfessor.name;
306
			}
307
			
270
			var oStr = '';
308
			var oStr = '';
271
			if($respond[i].images.length) {
309
			if($respond[i].images.length) {
272
				oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"style="background-image: url(/data/resource/' + $respond[i].images[0].imageSrc + ')"></div>'
310
				oStr += '<li data-id="' + $respond[i].resourceId + '"><div class="madiaHead resouseHead"style="background-image: url(/data/resource/' + $respond[i].images[0].imageSrc + ')"></div>'
275
			}
313
			}
276
			oStr += '<div class="madiaInfo">'
314
			oStr += '<div class="madiaInfo">'
277
			oStr += '<p class="h1Font">' + $respond[i].resourceName + '</p>'
315
			oStr += '<p class="h1Font">' + $respond[i].resourceName + '</p>'
278
			oStr += '<p><span class="h1Font">' + $respond[i].editProfessor.name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
316
			oStr += '<p><span class="h1Font">' + name + '</span><em class="authiconNew ' + stl.sty + '" title="' + stl.title + '"></em></p>'
279
			oStr += '<p class="h2Font ellipsisSty">用途:<span>' + $respond[i].supportedServices + '</span></p>'
317
			oStr += '<p class="h2Font ellipsisSty">用途:<span>' + $respond[i].supportedServices + '</span></p>'
280
			oStr += '</div></li>'
318
			oStr += '</div></li>'
281
			$("#resourceList").append(oStr);
319
			$("#resourceList").append(oStr);

+ 9 - 18
resourcePreview.html

66
						<!--资源详情区-->
66
						<!--资源详情区-->
67
						<div class="showMain showMain2">
67
						<div class="showMain showMain2">
68
							<ul>
68
							<ul>
69
								<li>
69
								<li class="displayNone" id="orgName">
70
									<div class="showTit">所属机构:</div>
70
									<div class="showTit">所属机构:</div>
71
									<div class="showCon" id="organizationName">
71
									<div class="showCon" id="organizationName">
72
									</div>
72
									</div>
101
				</div>
101
				</div>
102
			</div>
102
			</div>
103
			<div class="rightconBox floatR">
103
			<div class="rightconBox floatR">
104
				<div class="conItem conItemG alignCenter" style="border:none;padding:30px;">
104
				<div class="conItem conItemG alignCenter displayNone" style="border:none;padding:30px;" id="person">
105
					<div class="madiaHead useHead" id="headImg" style="cursor:pointer"></div>
105
					<div class="madiaHead useHead" id="headImg" style="cursor:pointer"></div>
106
					<div class="proInfo">
106
					<div class="proInfo">
107
						<div class="h3Font clearfix">
107
						<div class="h3Font clearfix">
116
						<span class="attenSpan">关注</span>
116
						<span class="attenSpan">关注</span>
117
					</div>
117
					</div>
118
				</div>
118
				</div>
119
				<div class="conItem conItemG" id="enterprise" style="border:none;padding:30px;">
120
					<a href="companybrowinfor.html?orgId=A93B9348F2094D12A6DC9A23F16E1246" class="qiyego"><div class="madiaHead cmpHead" id="Qimg" style="background-image: url(/images/org/A93B9348F2094D12A6DC9A23F16E1246.jpg);"></div></a>
119
				<div class="conItem conItemG displayNone" id="enterprise" style="border:none;padding:30px;">
120
					<a href="" class="qiyego"><div class="madiaHead cmpHead" id="Qimg" style=""></div></a>
121
					<div class="proInfo alignCenter">
121
					<div class="proInfo alignCenter">
122
						<div class="h3Font clearfix">
122
						<div class="h3Font clearfix">
123
							<a href="companybrowinfor.html?orgId=A93B9348F2094D12A6DC9A23F16E1246" class="h1Font qiyego" id="Qname">北京科袖科技有限公司</a>
124
							<span class="authiconNew authicon-com-ok" title="认证企业" id="QauthFlag"></span>
123
							<a href="companybrowinfor.html?orgId=A93B9348F2094D12A6DC9A23F16E1246" class="h1Font qiyego" id="Qname"></a>
124
							<span class="authiconNew" title="" id="QauthFlag"></span>
125
						</div>
125
						</div>
126
						<p class="h2Font ellipsisSty" id="Qindustry"></p>
126
						<p class="h2Font ellipsisSty" id="Qindustry"></p>
127
						<p class="h2Font" id="QorgType"></p>
127
						<p class="h2Font" id="QorgType"></p>
128
					</div>
128
					</div>
129
				</div>
129
				</div>
130
				<div class="conItem">
130
				<div class="conItem displayNone" id="resPerson">
131
					<div class="form-item otherBlock">
131
					<div class="form-item otherBlock">
132
						<div class="aboutTit">负责人/联系人</div>
132
						<div class="aboutTit">负责人/联系人</div>
133
						<div class="form-result">
133
						<div class="form-result addexpertRe">
134
							<ul class="addexpert" id="expertli">
134
							<ul class="addexpert" id="expertli">
135
								<li id="usid" data-id="7F26E3C720064AE8A10C7357BBBD239B">
136
									<div class="madiaHead useHead" id="userimg" style="background-image: url(/images/head/7F26E3C720064AE8A10C7357BBBD239B_l.jpg);"></div>
137
									<div class="madiaInfo">
138
										<p class="ellipsisSty">
139
											<span class="h1Font" id="name">李潇远2</span><em class="authicon authicon-staff-ok" title="企业认证员工"></em>
140
										</p>
141
										<p class="h2Font ellipsisSty">职称只为</p>
142
									</div>
143
									<div class="selectAdd"></div>
144
								</li>
135
								
145
							</ul>
136
							</ul>
146
						</div>
137
						</div>
147
					</div>
138
					</div>

+ 1 - 1
resourceShow.html

66
						<!--资源详情区-->
66
						<!--资源详情区-->
67
						<div class="showMain showMain2">
67
						<div class="showMain showMain2">
68
							<ul>
68
							<ul>
69
								<li>
69
								<li class="displayNone" id="orgName">
70
									<div class="showTit">所属机构:</div>
70
									<div class="showTit">所属机构:</div>
71
									<div class="showCon" id="organizationName">
71
									<div class="showCon" id="organizationName">
72
									</div>
72
									</div>