Browse Source

Merge branch 'dev' of http://121.42.53.174:3000/jiapeng/portal-front.git into dev

luyanan 7 years ago
parent
commit
d3ccaddae3

+ 17 - 17
cmp-portal/cmp-updateinfo.html

@ -140,30 +140,30 @@
140 140
										<li>
141 141
											<span class="col-w-2 lableSpan">企业地址:</span>
142 142
											<div class="col-w-10">
143
												<input type="text" class="frmcontype" placeholder="如:北京市海淀区学院路方兴大厦" />
143
												<input type="text" class="frmcontype" placeholder="如:北京市海淀区学院路方兴大厦" id="cmpAddress"/>
144 144
											</div>
145 145
										</li>
146 146
										<li>
147 147
											<span class="col-w-2 lableSpan">联系电话:</span>
148 148
											<div class="col-w-5">
149
												<input type="tel" class="frmcontype" placeholder="请填写办公电话" />
149
												<input type="tel" class="frmcontype" placeholder="请填写办公电话" id="phone"/>
150 150
											</div>
151 151
										</li>
152 152
										<li>
153 153
											<span class="col-w-2 lableSpan">联系邮箱:</span>
154 154
											<div class="col-w-5">
155
												<input type="email" class="frmcontype" placeholder="请填写客服邮箱" />
155
												<input type="email" class="frmcontype" placeholder="请填写客服邮箱" id="mail"/>
156 156
											</div>
157 157
										</li>
158 158
										<li class="form-item">
159 159
											<span class="col-w-2 lableSpan">所属行业:</span>
160 160
											<div class="col-w-10">
161 161
												<div class="col-w-12" style="position: relative;">
162
													<input type="text" class="frmcontype" placeholder="请填写企业所属的行业,如:制造业、互联网、服务业" />
163
													<button type="button" class="frmcontype btnModel frmadd">添加</button>
162
													<input type="text" class="frmcontype oinput" placeholder="请填写企业所属的行业,如:制造业、互联网、服务业" />
163
													<button type="button" class="frmcontype btnModel frmadd" style="display:none;">添加</button>
164 164
													<div class="form-drop keydrop">
165 165
														<ul>
166
															<li>2233</li>
166
															
167 167
														</ul>
168 168
													</div>
169 169
												</div>
@ -178,11 +178,11 @@
178 178
											<span class="col-w-2 lableSpan">专注领域:</span>
179 179
											<div class="col-w-10">
180 180
												<div class="col-w-12" style="position: relative;">
181
													<input type="text" class="frmcontype" placeholder="请填写企业专注的领域,如:腐蚀防护、石墨烯、纳米材料" />
182
													<button type="button" class="frmcontype btnModel frmadd">添加</button>
181
													<input type="text" class="frmcontype oinput" placeholder="请填写企业专注的领域,如:腐蚀防护、石墨烯、纳米材料" />
182
													<button type="button" class="frmcontype btnModel frmadd" style="display:none;">添加</button>
183 183
													<div class="form-drop keydrop">
184 184
														<ul>
185
															<li>2233</li>
185
															
186 186
														</ul>
187 187
													</div>
188 188
												</div>
@ -204,8 +204,8 @@
204 204
											<span class="col-w-2 lableSpan">企业资质:</span>
205 205
											<div class="col-w-10">
206 206
												<div class="col-w-12" style="position: relative;">
207
													<input type="text" class="frmcontype" placeholder="请填写企业获得的资质,如:ISO9000认证、高新技术企业认证" />
208
													<button type="button" class="frmcontype btnModel frmadd">添加</button>
207
													<input type="text" class="frmcontype oinput" placeholder="请填写企业获得的资质,如:ISO9000认证、高新技术企业认证" />
208
													<button type="button" class="frmcontype btnModel frmadd" style="display:none">添加</button>
209 209
												</div>
210 210
												<div class="form-result keyResult" style="margin-right: -10px;">
211 211
													<ul class="ulspace editUlistC clearfix" id="subjectList">
@ -218,11 +218,11 @@
218 218
											<span class="col-w-2 lableSpan">供应商领域:</span>
219 219
											<div class="col-w-10">
220 220
												<div class="col-w-12" style="position: relative;">
221
													<input type="text" class="frmcontype" placeholder="请填写企业上游所涉及的领域" />
222
													<button type="button" class="frmcontype btnModel frmadd">添加</button>
221
													<input type="text" class="frmcontype oinput" placeholder="请填写企业上游所涉及的领域" />
222
													<button type="button" class="frmcontype btnModel frmadd" style="display:none;">添加</button>
223 223
													<div class="form-drop keydrop">
224 224
														<ul>
225
															<li>2233</li>
225
															
226 226
														</ul>
227 227
													</div>
228 228
												</div>
@ -237,11 +237,11 @@
237 237
											<span class="col-w-2 lableSpan">客户领域:</span>
238 238
											<div class="col-w-10">
239 239
												<div class="col-w-12" style="position: relative;">
240
													<input type="text" class="frmcontype" placeholder="请填写企业下游所涉及的领域" />
241
													<button type="button" class="frmcontype btnModel frmadd">添加</button>
240
													<input type="text" class="frmcontype oinput" placeholder="请填写企业下游所涉及的领域" />
241
													<button type="button" class="frmcontype btnModel frmadd" style="display:none;">添加</button>
242 242
													<div class="form-drop keydrop">
243 243
														<ul>
244
															<li>2233</li>
244
															
245 245
														</ul>
246 246
													</div>
247 247
												</div>

+ 3 - 3
cmp-portal/js/articalIssue.js

@ -11,14 +11,14 @@ $(function() {
11 11
	//校验标题
12 12
	$("#newstitle").on({
13 13
		focus: function() {
14
			$(this).prev().find("span").text("30字以内");
14
			$(this).prev().find("span").text("50字以内");
15 15
		},
16 16
		blur: function() {
17 17
			$(this).prev().find("span").text("");
18 18
		},
19 19
		keyup: function() {
20
			if($(this).val().length > 30) {
21
				$(this).val($(this).val().substr(0, 30));
20
			if($(this).val().length > 50) {
21
				$(this).val($(this).val().substr(0, 50));
22 22
			}
23 23
		}
24 24
	})

+ 5 - 4
cmp-portal/js/articalModify.js

@ -16,14 +16,14 @@ $(function() {
16 16
	//校验标题
17 17
	$("#newstitle").on({
18 18
		focus: function() {
19
			$(this).prev().find("span").text("30字以内");
19
			$(this).prev().find("span").text("50字以内");
20 20
		},
21 21
		blur: function() {
22 22
			$(this).prev().find("span").text("");
23 23
		},
24 24
		keyup: function() {
25
			if($(this).val().length > 30) {
26
				$(this).val($(this).val().substr(0, 30));
25
			if($(this).val().length > 50) {
26
				$(this).val($(this).val().substr(0, 50));
27 27
			}
28 28
		}
29 29
	})
@ -485,7 +485,8 @@ $(function() {
485 485
			imgflase = true;
486 486
		}*/
487 487
		if(newstitle==""){
488
			$("#aboutTit span").text("请输入文章标题");
488
			$.MsgBox.Alert('提示', '请输入文章标题')
489
			return;
489 490
		}else{
490 491
			$("#aboutTit span").text("");
491 492
			titleflase = true;

+ 277 - 116
cmp-portal/js/cmp-updateinfo.js

@ -1,9 +1,9 @@
1 1
$(document).ready(function() {
2 2
	$(".onlogin .headnavbtn li").eq(0).addClass("navcurrent");
3 3
	var id = $.cookie('orgId');
4
	if(id == "" || id == null || id == "null"){
5
    	location.href = "cmp-settled-log.html";
6
    }
4
	if(id == "" || id == null || id == "null") {
5
		location.href = "cmp-settled-log.html";
6
	}
7 7
	var fileId = null;
8 8
	var cacheImageKey = null;
9 9
	/*企业信息*/
@ -64,17 +64,32 @@ $(document).ready(function() {
64 64
						indu($data.subject, '#subjectList')
65 65
					}
66 66
					if($data.qualification) {
67
						indu($data.qualification, '.editUlistC ')
67
						indu($data.qualification, '.editUlistC')
68
					}
69
					if($data.fieldOfSupplier) {
70
						indu($data.fieldOfSupplier, '#subjectListOut')
71
					}
72
					if($data.fieldOfCustomer) {
73
						indu($data.fieldOfCustomer, '#subjectListIn')
74
					}
75
					if($data.addr) {
76
						$("#cmpAddress").val($data.addr);
77
					}
78
					if($data.contactNum) {
79
						$("#phone").val($data.contactNum);
80
					}
81
					if($data.email) {
82
						$("#mail").val($data.email);
68 83
					}
69 84
					//省份城市颜色
70
					if($("#oprovince").text()=="请选择企业总部所在省或直辖市"){
85
					if($("#oprovince").text() == "请选择企业总部所在省或直辖市") {
71 86
						$("#oprovince").removeClass("mr_select");
72
					}else{
87
					} else {
73 88
						$("#oprovince").addClass("mr_select");
74 89
					}
75
					if($("#ocity").text()=="请选择企业总部所在城市"){
90
					if($("#ocity").text() == "请选择企业总部所在城市") {
76 91
						$("#ocity").removeClass("mr_select");
77
					}else{
92
					} else {
78 93
						$("#ocity").addClass("mr_select");
79 94
					}
80 95
				}
@ -85,7 +100,7 @@ $(document).ready(function() {
85 100
		})
86 101
	}
87 102
	companyInformation()
88
		/*时间格式*/
103
	/*时间格式*/
89 104
	function timeGeshi(otm) {
90 105
		var otme = otm.substring(0, 4) + "-" + otm.substring(4, 6) + "-" + otm.substring(6, 8);
91 106
		return otme;
@ -119,7 +134,7 @@ $(document).ready(function() {
119 134
		},
120 135
		keyup: function(e) {
121 136
			if($("textarea").val().length > 500) {
122
				$("textarea").val($("textarea").val().substring(0,500));
137
				$("textarea").val($("textarea").val().substring(0, 500));
123 138
				e.preventDefault();
124 139
			}
125 140
			setTimeout(function() {
@ -127,6 +142,114 @@ $(document).ready(function() {
127 142
			}, 1);
128 143
		}
129 144
	});
145

146
	$(".oinput").bind({
147
		paste: function(e) {
148
			var pastedText;
149
			if (window.clipboardData  &&  window.clipboardData.getData)  {  // IE
150
				            
151
				pastedText  = $(this).val() +  window.clipboardData.getData('Text');          
152
153
			else  {            
154
				pastedText  = $(this).val() +  e.originalEvent.clipboardData.getData('Text'); //e.clipboardData.getData('text/plain');
155
				          
156
			}
157
			$(this).val(pastedText.substring(0, 10));
158

159
			var $this = $(this);
160
			setTimeout(function() {
161
				if($this.val().trim()) {
162
					$this.siblings("button").show();
163
				} else {
164
					$this.siblings("button").hide();
165
				}
166
			}, 1);
167
			e.preventDefault();
168
		},
169
		cut: function(e) {
170
			var $this = $(this);
171
			setTimeout(function() {
172
				if($this.val().trim()) {
173
					$this.siblings("button").show();
174
				} else {
175
					$this.siblings("button").hide();
176
				}
177
			}, 1);
178
		},
179
		blur:function(){
180
			var $this=$(this);
181
		setTimeout(function(){
182
			$this.siblings(".keydrop").hide();
183
		},500)
184
		},
185
		focus:function(){
186
			$(this).siblings(".keydrop").show();
187
		},
188
		keyup: function(e) {
189
			if($(this).val().trim()) {
190
				$(this).siblings("button").show();
191
				var lNum = $.trim($(this).val()).length;
192
				if(lNum > 10) {
193
					$(this).val($(this).val().substr(0, 10));
194
				} else if(0 < lNum && lNum < 10) {
195
					var $this = $(this)
196
					$("#addKeyword").show();
197
					$.ajax({
198
						"url": "/ajax/dataDict/qaHotKey",
199
						"type": "GET",
200
						"success": function(data) {
201
							console.log(data);
202
							if(data.success) {
203
								if(data.data.length == 0) {
204
									$this.siblings(".keydrop").addClass("displayNone");
205
									$this.siblings(".keydrop").find("ul").html("");
206
								} else {
207
									$this.siblings(".keydrop").removeClass("displayNone");
208
									var oSr = "";
209
									for(var i = 0; i < data.data.length; i++) {
210
										oSr += '<li>' + data.data[i].caption + '<div class="closeThis"></div></li>';
211
									}
212
									$this.siblings(".keydrop").find("ul").html(oSr);
213
								}
214
							} else {
215
								$this.siblings(".keydrop").addClass("displayNone");
216
								$this.siblings(".keydrop").find("ul").html("");
217
							}
218
						},
219
						"data": {
220
							"key": $(this).val()
221
						},
222
						dataType: "json",
223
						'error': function() {
224
							$.MsgBox.Alert('提示', '服务器连接超时!');
225
						}
226
					});
227
				}
228
			} else {
229
				$(this).siblings("button").hide();
230
				$(this).siblings(".keydrop").addClass("displayNone");
231
				$(this).siblings(".keydrop").find("ul").html("");
232
			}
233
		}
234
	})
235
	$(".keydrop").on("click","li",function(){
236
		var oValue = $(this).text();
237
		var oJudge = $(this).parents(".col-w-12").siblings().find("ul.ulspace li");
238
		for(var i = 0; i < oJudge.length; i++) {
239
			if(oValue == oJudge[i].innerText) {
240
				$.MsgBox.Alert('提示', '添加内容不能重复');
241
				return;
242
			}
243
		}
244
		$(this).parents(".col-w-12").siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
245
		$(this).parents(".keydrop").siblings("input").val("");
246
		$(this).parents(".keydrop").siblings("button").hide();
247
		if(oJudge.length == 4) {
248
			$(this).parents(".keydrop").siblings("input").val("");
249
			$(this).parents(".col-w-12").hide();
250
		}
251
		$(this).parent("ul").html("")
252
	})
130 253
	/*应用行业及领域及企业资质*/
131 254
	function indu(oString, oSelector) {
132 255
		var arr = oString.split(",");
@ -139,123 +262,161 @@ $(document).ready(function() {
139 262
	}
140 263
	/*删除*/
141 264
	$("body").on("click", ".closeThis", function() {
142
			$(this).parent().remove();
143
		})
265
		if($(this).parent().length < 5) {
266
			$(this).parents(".keyResult").siblings("div").show();
267
		}
268
		$(this).parent().remove();
269

270
	})
144 271
	/*添加*/
145 272
	$("button:contains('添加')").click(function() {
146
			var oValue = $(this).siblings("input").val().trim();
147
			var oJudge = $(this).parent().siblings().find("ul.ulspace li");
148
			if(!oValue) {
149
				$.MsgBox.Alert('提示', '请先填写内容');
150
				return;
151
			}
152
			if(oValue.length > 10) {
153
				$.MsgBox.Alert('提示', '添加内容不能超过10个字');
273
		var oValue = $(this).siblings("input").val().trim();
274
		var oJudge = $(this).parent().siblings().find("ul.ulspace li");
275
		if(!oValue) {
276
			$.MsgBox.Alert('提示', '请先填写内容');
277
			return;
278
		}
279
		if(oValue.length > 10) {
280
			$.MsgBox.Alert('提示', '添加内容不能超过10个字');
281
			return;
282
		}
283
		for(var i = 0; i < oJudge.length; i++) {
284
			if(oValue == oJudge[i].innerText) {
285
				$.MsgBox.Alert('提示', '添加内容不能重复');
154 286
				return;
155 287
			}
156
			for(var i = 0; i < oJudge.length; i++) {
157
				if(oValue == oJudge[i].innerText) {
158
					$.MsgBox.Alert('提示', '添加内容不能重复');
159
					return;
160
				}
161
			}
162
			$(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
163
			$(this).siblings("input").val("");
164
		})
288
		}
289
		$(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
290
		$(this).hide();
291
		$(this).siblings("input").val("");
292
		if(oJudge.length == 4) {
293
			$(this).val("").parents(".col-w-12").hide();
294
		}
295
		$(this).siblings(".keydrop").find("ul").html("");
296
	})
165 297

166 298
	/*保存*/
167 299
	$("button:contains('保存')").click(function() {
168 300
		var oBusinessAbbreviation = $("#businessAbbreviation").val().trim();
169 301
		if(!oBusinessAbbreviation) {
170
				$.MsgBox.Alert('提示', '企业简称不能为空');
171
				return;
172
			}
173
			if(oBusinessAbbreviation.length > 10) {
174
				$.MsgBox.Alert('提示', '企业简称不能超过10个字');
175
				return;
176
			}
177
			/*
178
			var oTextArea = $("textarea").val().trim();
179
			var oBusinessType = $("#orgType").find("option").length;
180
			var oBusinessDimensions = $("#qualificationList").find("li.cmpBg.listactive").length;
181
			var oIndustryNumber = $("#industryList").find("li").length;
182
			var oSubjectNumber = $("#subjectList").find("li").length;
183
			var oEditUlistCNumber = $(".editUlistC ").find("li").length;
302
			$.MsgBox.Alert('提示', '企业简称不能为空');
303
			return;
304
		}
305
		if(oBusinessAbbreviation.length > 10) {
306
			$.MsgBox.Alert('提示', '企业简称不能超过10个字');
307
			return;
308
		}
309
		/*
310
		var oTextArea = $("textarea").val().trim();
311
		var oBusinessType = $("#orgType").find("option").length;
312
		var oBusinessDimensions = $("#qualificationList").find("li.cmpBg.listactive").length;
313
		var oIndustryNumber = $("#industryList").find("li").length;
314
		var oSubjectNumber = $("#subjectList").find("li").length;
315
		var oEditUlistCNumber = $(".editUlistC ").find("li").length;
184 316
			
185
			if(!oTextArea) {
186
				$.MsgBox.Alert('提示', '企业简介不能为空');
187
				return;
188
			}
189
			if(oBusinessType == 0) {
190
				$.MsgBox.Alert('提示', '请选择企业类型');
191
				return;
192
			}
193
			if(oIndustryNumber == 0) {
194
				$.MsgBox.Alert('提示', '企业所属行业必填一项');
317
		if(!oTextArea) {
318
			$.MsgBox.Alert('提示', '企业简介不能为空');
319
			return;
320
		}
321
		if(oBusinessType == 0) {
322
			$.MsgBox.Alert('提示', '请选择企业类型');
323
			return;
324
		}
325
		if(oIndustryNumber == 0) {
326
			$.MsgBox.Alert('提示', '企业所属行业必填一项');
327
			return;
328
		}
329
		if(oSubjectNumber == 0) {
330
			$.MsgBox.Alert('提示', '企业所属领域必填一项');
331
			return;
332
		}
333
		if(oBusinessDimensions == 0) {
334
			$.MsgBox.Alert('提示', '请选择企业规模');
335
			return;
336
		}
337
		if(oEditUlistCNumber == 0) {
338
			$.MsgBox.Alert('提示', '企业资质必填一项');
339
			return;
340
		}*/
341
		var $info = {};
342
		$info.id = id;
343
		if(cacheImageKey != null) {
344
			$info.fn = cacheImageKey;
345
		}
346
		$info.forShort = $("#businessAbbreviation").val();
347
		if($("#orgType").find("option:selected").text() != "请选择最符合的一项") {
348
			$info.orgType = $("#orgType").find("option:selected").text()
349
		}
350
		if($("#qualificationList").find("option:selected").text() != "请选择员工数量范围") {
351
			$info.orgSize = $("#qualificationList").find("option:selected").text();
352
		}
353
		if($("#inteAddress").val().trim()) {
354
			if($("#inteAddress").val().trim().length > 20) {
355
				$.MsgBox.Alert('提示', '企业官网 20个字之内!');
195 356
				return;
196 357
			}
197
			if(oSubjectNumber == 0) {
198
				$.MsgBox.Alert('提示', '企业所属领域必填一项');
358
			$info.orgUrl = $("#inteAddress").val();
359
		}
360
		if($("#oprovince").text() != "请选择企业总部所在省或直辖市") {
361
			$info.province = $("#oprovince").text();
362
		}
363
		if($("#ocity").text() != "请选择企业总部所在城市") {
364
			$info.city = $("#ocity").text();
365
		}
366
		if($("#createTime").val()) {
367
			$info.foundTime = st6($("#createTime").val());
368
		}
369
		if($("#cmpAddress").val().trim()) {
370
			if($("#cmpAddress").val().trim().length > 20) {
371
				$.MsgBox.Alert('提示', '企业地址 20个字之内!');
199 372
				return;
373
			} else {
374
				$info.addr = $("#cmpAddress").val();
200 375
			}
201
			if(oBusinessDimensions == 0) {
202
				$.MsgBox.Alert('提示', '请选择企业规模');
376
		}
377
		if($("#phone").val().trim()) {
378
			if($("#phone").val().trim().length > 50) {
379
				$.MsgBox.Alert('提示', '办公电话50个字之内!');
203 380
				return;
381
			} else {
382
				$info.contactNum = $("#cmpAddress").val();
204 383
			}
205
			if(oEditUlistCNumber == 0) {
206
				$.MsgBox.Alert('提示', '企业资质必填一项');
384
		}
385
		if($("#mail").val().trim()) {
386
			if($("#mail").val().trim().indexOf("@")) {
387
				$info.email = $("#mail").val();
388
			} else {
389
				$.MsgBox.Alert('提示', '邮箱格式不正确');
207 390
				return;
208
			}*/
209
			var $info = {};
210
			$info.id = id;
211
			if(cacheImageKey != null) {
212
				$info.fn = cacheImageKey;
213 391
			}
214
			$info.forShort = $("#businessAbbreviation").val();
215
			$info.orgType = $("#orgType").val();
216
			$info.orgSize = $("#qualificationList").val();
217

218
			if($("#inteAddress").val().trim()) {
219
				if($("#inteAddress").val().trim().length>20) {
220
						$.MsgBox.Alert('提示', '企业官网 20个字之内!');
221
						return;
392
		}
393
		$info.descp = $("textarea").val();
394
		$info.industry = oString("#industryList");
395
		$info.subject = oString("#subjectList");
396
		$info.qualification = oString(".editUlistC");
397
		$info.fieldOfCustomer=oString(subjectListIn);
398
		$info.fieldOfSupplier==oString(subjectListOut);
399
		$.ajax({
400
			url: "/ajax/org/update",
401
			type: "POST",
402
			data: $info,
403
			timeout: 10000,
404
			dataType: "json",
405
			beforeSend: function() {},
406
			success: function(data, textState) {
407
				if(data.success) {
408
					$.MsgBox.Alert('提示', '修改成功');
409
					$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
410
					setTimeout(function() {
411
						location.reload(false)
412
					}, 500);
222 413
				}
223
				$info.orgUrl = $("#inteAddress").val();
224
			}
225
			if($("#oprovince").text() != "请选择企业总部所在省或直辖市") {
226
				$info.province = $("#oprovince").text();
227
			}
228
			if($("#ocity").text() != "请选择企业总部所在城市") {
229
				$info.city = $("#ocity").text();
230
			}
231
			if($("#createTime").val()) {
232
				$info.foundTime = st6($("#createTime").val());
414
			},
415
			error: function(XMLHttpRequest, textStats, errorThrown) {
416
				$.MsgBox.Alert('提示', '服务器请求失败')
233 417
			}
234
			$info.descp = $("textarea").val();
235
			$info.industry = oString("#industryList");
236
			$info.subject = oString("#subjectList");
237
			$info.qualification = oString(".editUlistC");
238
			$.ajax({
239
				url: "/ajax/org/update",
240
				type: "POST",
241
				data: $info,
242
				timeout: 10000,
243
				dataType: "json",
244
				beforeSend: function() {},
245
				success: function(data, textState) {
246
					if(data.success) {
247
						$.MsgBox.Alert('提示', '修改成功');
248
						$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
249
						setTimeout(function(){
250
							location.reload(false)
251
						},500);
252
					}
253
				},
254
				error: function(XMLHttpRequest, textStats, errorThrown) {
255
					$.MsgBox.Alert('提示', '服务器请求失败')
256
				}
257
			})
258 418
		})
419
	})
259 420
	/*应用行业,学术领域,企业纸质生成字符串*/
260 421
	function oString(sele) {
261 422
		var len = $(sele).find("li");
@ -306,9 +467,9 @@ $(document).ready(function() {
306 467
		}*/
307 468

308 469
	});
309
	 uploader.onError = function( code ) {
310
        	$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过5M')
311
        };
470
	uploader.onError = function(code) {
471
		$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过5M')
472
	};
312 473
	uploader.on('uploadSuccess', function(file, data) {
313 474
		uploader.removeFile(fileId);
314 475
		cacheImageKey = data.data[0].cacheKey;
@ -316,18 +477,18 @@ $(document).ready(function() {
316 477
	});
317 478
	/*取消*/
318 479
	$("#Ocancel").click(function() {
319
		location.href="cmp-workspaces.html"
480
		location.href = "cmp-workspaces.html"
320 481
	})
321 482
	/*选择省份*/
322 483
	$(document).on("click", "#Province li a", function() {
323 484
		var aVal = $(this).text();
324 485
		$(this).parent().parent().parent().find('.mr_show').text(aVal);
325 486
		$(this).parent().parent().parent().find('input[name=cho_Province]').val(aVal);
326
		
327
		if($("#oprovince").text()=="请选择企业总部所在省或直辖市"){
487

488
		if($("#oprovince").text() == "请选择企业总部所在省或直辖市") {
328 489
			$("#oprovince").removeClass("mr_select");
329 490
			$("#ocity").removeClass("mr_select");
330
		}else{
491
		} else {
331 492
			$("#oprovince").addClass("mr_select");
332 493
			$("#ocity").removeClass("mr_select");
333 494
		}
@ -337,11 +498,11 @@ $(document).ready(function() {
337 498
		var aVal = $(this).text();
338 499
		$(this).parent().parent().parent().find('.mr_show').text(aVal);
339 500
		$(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
340
		if($("#ocity").text()=="请选择企业总部所在城市"){
501
		if($("#ocity").text() == "请选择企业总部所在城市") {
341 502
			$("#ocity").removeClass("mr_select");
342
		}else{
503
		} else {
343 504
			$("#ocity").addClass("mr_select");
344 505
		}
345 506
	});
346
	
507

347 508
})

+ 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>

+ 34 - 1
e/a.html

@ -110,6 +110,7 @@
110 110
						console.log($data);
111 111
						document.getElementById("articleName").innerHTML = $data.articleTitle;
112 112
						shareTitle=$data.articleTitle;
113
						$("#oTime").text(commenTime($data.createTime))
113 114
						document.title=$data.articleTitle;
114 115
						stt = $data.articleImg.substring(0, 9);
115 116
						imgUrl="http://www.ekexiu.com/data/article/" + stt + $data.articleId + "_s.jpg";
@ -145,7 +146,11 @@
145 146
					},
146 147
					business: function($data) {
147 148
						//console.log(JSON.stringify($data));
148
						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
						}
149 154
						if($data.hasOrgLogo) {
150 155
							document.getElementById("messImg").style.backgroundImage = "url(../images/org/" + $data.id + ".jpg" + ")";
151 156
						}
@ -274,6 +279,34 @@
274 279

275 280
					}
276 281
				});
282
			function commenTime(startTime){
283
	var nowTimg =  new Date();
284
	var startdate = new Date(); 
285
	startdate.setFullYear(parseInt(startTime.substring(0,4)));
286
	startdate.setMonth(parseInt(startTime.substring(4,6))-1);
287
	startdate.setDate(parseInt(startTime.substring(6,8)));
288
	startdate.setHours(parseInt(startTime.substring(8,10)));
289
	startdate.setMinutes(parseInt(startTime.substring(10,12)));
290
	startdate.setSeconds(parseInt(startTime.substring(12,14)));
291
	var date3=nowTimg.getTime()-startdate.getTime();  //时间差的毫秒数
292
    var hours = parseInt((date3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
293
    var minutes = parseInt((date3 % (1000 * 60 * 60)) / (1000 * 60));
294
    if(date3 < 60000){
295
    	return "刚刚";
296
    }else if(date3 >= 60000 && date3 < 3600000){
297
    	return minutes + "分钟前";
298
    }else if(date3 >= 3600000 && date3 < 86400000){
299
    	return hours + "小时前";
300
    }else if(date3 >= 86400000 && date3 < 172800000){
301
    	return "昨天 " + startTime.substring(8,10) + ":" +startTime.substring(10,12);
302
    	
303
    }else if(date3 >= 172800000 && date3 < 31536000000){
304
    	return startTime.substring(4,6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6,8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8,10) + ":" + startTime.substring(10,12);
305
    }
306
    else{
307
    	return startTime.substring(0,4)  + "年" + startTime.substring(4,6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6,8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8,10) + ":" + startTime.substring(10,12);
308
    }
309
}
277 310
			})
278 311
		</script>
279 312


+ 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
						}

+ 3 - 3
js/articalIssue.js

@ -10,14 +10,14 @@ $(function() {
10 10
	//校验标题
11 11
	$("#newstitle").on({
12 12
		focus: function() {
13
			$(this).prev().find("span").text("30字以内");
13
			$(this).prev().find("span").text("50字以内");
14 14
		},
15 15
		blur: function() {
16 16
			$(this).prev().find("span").text("");
17 17
		},
18 18
		keyup: function() {
19
			if($(this).val().length > 30) {
20
				$(this).val($(this).val().substr(0, 30));
19
			if($(this).val().length > 50) {
20
				$(this).val($(this).val().substr(0, 50));
21 21
			}
22 22
		}
23 23
	})

+ 5 - 4
js/articalModify.js

@ -15,14 +15,14 @@ $(function() {
15 15
	//校验标题
16 16
	$("#newstitle").on({
17 17
		focus: function() {
18
			$(this).prev().find("span").text("30字以内");
18
			$(this).prev().find("span").text("50字以内");
19 19
		},
20 20
		blur: function() {
21 21
			$(this).prev().find("span").text("");
22 22
		},
23 23
		keyup: function() {
24
			if($(this).val().length > 30) {
25
				$(this).val($(this).val().substr(0, 30));
24
			if($(this).val().length > 50) {
25
				$(this).val($(this).val().substr(0, 50));
26 26
			}
27 27
		}
28 28
	})
@ -482,7 +482,8 @@ $(function() {
482 482
			imgflase = true;
483 483
		}*/
484 484
		if(newstitle==""){
485
			$("#aboutTit span").text("请输入文章标题");
485
			$.MsgBox.Alert('提示', '请输入文章标题')
486
			return;
486 487
		}else{
487 488
			$("#aboutTit span").text("");
488 489
			titleflase = true;

+ 1 - 2
js/articalShow.js

@ -50,7 +50,7 @@ $(function() {
50 50
					var weibotitle = data.data.articleTitle;
51 51
					var weibourl =window.location.href;
52 52
					var weibopic ="http://"+window.location.host+"/data/article/" + data.data.articleImg;
53
					$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
53
					$("#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");
54 54
				}
55 55
				
56 56
				var articletitle = data.data.articleTitle + "-科袖网";
@ -217,7 +217,6 @@ $(function() {
217 217
						$itemlist.find(".authiconNew").addClass(userType.sty);
218 218
						
219 219
				}else{
220
					alert(0)
221 220
					$("#relevantExperts").parent().parent().style.display="none";
222 221
				}
223 222
			},

+ 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
					}

+ 1 - 1
js/resourceShow.js

@ -176,7 +176,7 @@ $(document).ready(function() {
176 176
				"rel": '../images/default-resource.jpg'
177 177
			});
178 178
		}
179
		$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + weibotitle + "&url=" + weibourl + "&pic=" + weibopic + "&ralateUid=6242830109&searchPic=false&style=simple");
179
		$("#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");
180 180
	}
181 181
	/*点击名字及头像跳转个人浏览页面*/
182 182
	$("#nameS,#headImg").click(function() {