|
@ -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
|
},
|