|
@ -21,7 +21,7 @@ mui('#discoverBox').on('tap', '.newsurl', function() {
|
21
|
21
|
ownerid: ownerid,
|
22
|
22
|
}
|
23
|
23
|
});
|
24
|
|
}else if(datatype == 2){
|
|
24
|
} else if(datatype == 2) {
|
25
|
25
|
mui.openWindow({
|
26
|
26
|
url: '../html/professorArticle.html',
|
27
|
27
|
id: 'html/professorArticle.html',
|
|
@ -32,7 +32,7 @@ mui('#discoverBox').on('tap', '.newsurl', function() {
|
32
|
32
|
extras: {
|
33
|
33
|
articleId: id,
|
34
|
34
|
ownerid: ownerid,
|
35
|
|
oFlag:1
|
|
35
|
oFlag: 1
|
36
|
36
|
}
|
37
|
37
|
});
|
38
|
38
|
} else if(datatype == 3) {
|
|
@ -198,127 +198,144 @@ function getOnePase() {
|
198
|
198
|
/*数据遍历*/
|
199
|
199
|
function datalistEach(datalist) {
|
200
|
200
|
mui.each(datalist, function(index, item) {
|
201
|
|
var itemlist = '';
|
202
|
|
var itemlist = '<li class="mui-table-view-cell">';
|
203
|
|
itemlist += '<div class="table-item-media mui-clearfix userurl" >';
|
204
|
|
itemlist += '<div class="table-item-logo gouserurl" id="userimg"></div>';
|
205
|
|
itemlist += '<div class="table-item-name mui-clearfix positionR"><span id="nameSpan" class="gouserurl"></span><em class="authicon"></em></div>';
|
206
|
|
itemlist += '</div><div class="flexCenter table-item-cell newsurl">';
|
207
|
|
itemlist += '<div class="table-item-img artical-default" id="newsimg"></div>';
|
208
|
|
itemlist += '<div class="table-item-body"><p class="listtit mui-ellipsis-2" id="centent"></p></div>';
|
209
|
|
itemlist += '</div><div><em class="cmpLable" id="newstype"></em>';
|
210
|
|
itemlist += '<span class="timeLabel" id="time"></span></div></li>';
|
211
|
|
$itemlist = $(itemlist);
|
212
|
|
$("#discoverBox").append($itemlist);
|
213
|
|
var type = item.type;
|
214
|
|
$itemlist.find("#centent").text(item.name);
|
215
|
|
$itemlist.find("#time").text(Time(item.createTime));
|
216
|
|
$itemlist.find(".newsurl").attr("data-id", item.id);
|
217
|
|
$itemlist.find(".newsurl").attr("data-type", item.type);
|
218
|
|
$itemlist.find(".newsurl").attr("owner-id", item.owner);
|
219
|
|
if(item.image) {
|
220
|
|
$itemlist.find("#newsimg").attr("style", "background-image: url(" + baseUrl + "/data/article/" + item.image + ");");
|
221
|
|
}
|
222
|
|
if(type == 1) { //专家文章
|
223
|
|
$itemlist.find("#newstype").text("文章");
|
224
|
|
$itemlist.find("#newstype").addClass("articalLabel");
|
225
|
|
$itemlist.find("#newsimg").addClass("artical-default");
|
226
|
|
$itemlist.find("#userimg").addClass("userhead");
|
227
|
|
userFun(item.owner, $itemlist);
|
228
|
|
} else if(type == 2) { //企业文章
|
229
|
|
$itemlist.find("#newstype").text("文章");
|
230
|
|
$itemlist.find("#newstype").addClass("articalLabel");
|
231
|
|
$itemlist.find("#newsimg").addClass("artical-default");
|
232
|
|
$itemlist.find("#userimg").addClass("cmplogo");
|
233
|
|
cmpFun(item.owner, $itemlist)
|
234
|
|
} else if(type == 3) { //专家资源
|
235
|
|
$itemlist.find("#newstype").text("资源");
|
236
|
|
$itemlist.find("#newstype").addClass("resourceLabel");
|
237
|
|
$itemlist.find("#newsimg").addClass("resource-default");
|
238
|
|
$itemlist.find("#userimg").addClass("userhead");
|
239
|
|
userFun(item.owner, $itemlist);
|
240
|
|
}
|
241
|
|
|
242
|
|
});
|
243
|
|
|
244
|
|
}
|
245
|
|
|
246
|
|
/*用户信息*/
|
247
|
|
function userFun(id, $itemlist) {
|
248
|
|
mui.ajax(baseUrl + '/ajax/professor/baseInfo/' + id, {
|
249
|
|
"type": "get",
|
250
|
|
"async": true,
|
251
|
|
"success": function(data) {
|
252
|
|
console.log(data);
|
253
|
|
if(data.success && data.data) {
|
254
|
|
$itemlist.find("#nameSpan").text(data.data.name);
|
255
|
|
if(data.data.hasHeadImage == 1) {
|
256
|
|
$itemlist.find("#userimg").attr("style", "background-image: url(" + baseUrl + "/images/head/" + data.data.id + "_m.jpg);");
|
|
201
|
var itemlist = '';
|
|
202
|
var itemlist = '<li class="mui-table-view-cell">';
|
|
203
|
itemlist += '<div class="table-item-media mui-clearfix userurl" >';
|
|
204
|
itemlist += '<div class="table-item-logo gouserurl" id="userimg"></div>';
|
|
205
|
itemlist += '<div class="table-item-name mui-clearfix positionR"><span id="nameSpan" class="gouserurl"></span><em class="authicon"></em></div>';
|
|
206
|
itemlist += '</div><div class="flexCenter table-item-cell newsurl">';
|
|
207
|
itemlist += '<div class="table-item-img artical-default" id="newsimg"></div>';
|
|
208
|
itemlist += '<div class="table-item-body"><p class="listtit mui-ellipsis-2" id="centent"></p></div>';
|
|
209
|
itemlist += '</div><div><em class="cmpLable" id="newstype"></em>';
|
|
210
|
itemlist += '<span class="timeLabel" id="time"></span></div></li>';
|
|
211
|
$itemlist = $(itemlist);
|
|
212
|
$("#discoverBox").append($itemlist);
|
|
213
|
var type = item.type;
|
|
214
|
$itemlist.find("#centent").text(item.name);
|
|
215
|
$itemlist.find("#time").text(Time(item.createTime));
|
|
216
|
$itemlist.find(".newsurl").attr("data-id", item.id);
|
|
217
|
$itemlist.find(".newsurl").attr("data-type", item.type);
|
|
218
|
$itemlist.find(".newsurl").attr("owner-id", item.owner);
|
|
219
|
if(item.image) {
|
|
220
|
$itemlist.find("#newsimg").attr("style", "background-image: url(" + baseUrl + "/data/article/" + item.image + ");");
|
|
221
|
}
|
|
222
|
if(type == 1) { //专家文章
|
|
223
|
$itemlist.find("#newstype").text("文章");
|
|
224
|
$itemlist.find("#newstype").addClass("articalLabel");
|
|
225
|
$itemlist.find("#newsimg").addClass("artical-default");
|
|
226
|
$itemlist.find("#userimg").addClass("userhead");
|
|
227
|
userFun(item.owner, $itemlist);
|
|
228
|
} else if(type == 2) { //企业文章
|
|
229
|
$itemlist.find("#newstype").text("文章");
|
|
230
|
$itemlist.find("#newstype").addClass("articalLabel");
|
|
231
|
$itemlist.find("#newsimg").addClass("artical-default");
|
|
232
|
$itemlist.find("#userimg").addClass("cmplogo");
|
|
233
|
cmpFun(item.owner, $itemlist)
|
|
234
|
} else if(type == 3) { //专家资源
|
|
235
|
$itemlist.find("#newstype").text("资源");
|
|
236
|
$itemlist.find("#newstype").addClass("resourceLabel");
|
|
237
|
$itemlist.find("#newsimg").addClass("resource-default").addClass("hand-resource-img").attr("hand-id", item.id);
|
|
238
|
$itemlist.find("#userimg").addClass("userhead");
|
|
239
|
userFun(item.owner, $itemlist);
|
|
240
|
$(".hand-resource-img").each(function() {
|
|
241
|
var $this = $(this),
|
|
242
|
rid = $this.attr("hand-id");
|
|
243
|
mui.ajax(baseUrl + "/ajax/resource/resourceInfo", {
|
|
244
|
data: {
|
|
245
|
'resourceId': rid
|
|
246
|
},
|
|
247
|
"type": "get",
|
|
248
|
"async": true,
|
|
249
|
"success": function(info) {
|
|
250
|
if(info.success) {
|
|
251
|
var $info = info.data;
|
|
252
|
if($info.images.length) {
|
|
253
|
$this.attr("style", "background-image: url(/images/resource/" + rid + ".jpg);");
|
|
254
|
}
|
|
255
|
}
|
|
256
|
},
|
|
257
|
"error": function() {}
|
|
258
|
});
|
|
259
|
});
|
257
|
260
|
}
|
258
|
|
$itemlist.find(".userurl").attr("data-id", data.data.id);
|
259
|
|
var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
|
260
|
|
$itemlist.find(".authicon").attr("title", userType.title);
|
261
|
|
$itemlist.find(".authicon").addClass(userType.sty);
|
262
|
261
|
|
263
|
|
}
|
264
|
|
},
|
265
|
|
"error": function() {
|
266
|
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
267
|
|
}
|
268
|
|
});
|
269
|
|
}
|
|
262
|
/*用户信息*/
|
|
263
|
function userFun(id, $itemlist) {
|
|
264
|
mui.ajax(baseUrl + '/ajax/professor/baseInfo/' + id, {
|
|
265
|
"type": "get",
|
|
266
|
"async": true,
|
|
267
|
"success": function(data) {
|
|
268
|
console.log(data);
|
|
269
|
if(data.success && data.data) {
|
|
270
|
$itemlist.find("#nameSpan").text(data.data.name);
|
|
271
|
if(data.data.hasHeadImage == 1) {
|
|
272
|
$itemlist.find("#userimg").attr("style", "background-image: url(" + baseUrl + "/images/head/" + data.data.id + "_m.jpg);");
|
|
273
|
}
|
|
274
|
$itemlist.find(".userurl").attr("data-id", data.data.id);
|
|
275
|
var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
|
|
276
|
$itemlist.find(".authicon").attr("title", userType.title);
|
|
277
|
$itemlist.find(".authicon").addClass(userType.sty);
|
270
|
278
|
|
271
|
|
/*企业用户信息*/
|
272
|
|
function cmpFun(id, $itemlist) {
|
273
|
|
mui.ajax(baseUrl + '/ajax/org/' + id, {
|
274
|
|
"type": "get",
|
275
|
|
"async": true,
|
276
|
|
"success": function(data) {
|
277
|
|
console.log(data);
|
278
|
|
if(data.success && data.data) {
|
279
|
|
if(data.data.forShort) {
|
280
|
|
$itemlist.find("#nameSpan").text(data.data.forShort);
|
281
|
|
} else {
|
282
|
|
$itemlist.find("#nameSpan").text(data.data.name);
|
283
|
|
}
|
284
|
|
if(data.data.hasOrgLogo) {
|
285
|
|
$itemlist.find("#userimg").attr("style", "background-image: url(" + baseUrl + "/images/org/" + data.data.id + ".jpg);");
|
|
279
|
}
|
|
280
|
},
|
|
281
|
"error": function() {
|
|
282
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
|
283
|
}
|
|
284
|
});
|
286
|
285
|
}
|
287
|
|
$itemlist.find(".userurl").attr("data-id", data.data.id);
|
288
|
|
$itemlist.find(".userurl").attr("data-iftauth", data.data.authStatus);
|
289
|
|
if(data.data.authStatus==3){
|
290
|
|
$itemlist.find(".authicon").addClass("authicon-com-ok").attr("title", "认证企业");;
|
291
|
|
}/*else{
|
292
|
|
$itemlist.find(".authicon").addClass("authicon-com-no").attr("title", "未认证企业");;
|
293
|
|
}*/
|
294
|
|
}
|
295
|
|
},
|
296
|
|
"error": function() {
|
297
|
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
298
|
|
}
|
299
|
|
});
|
300
|
|
}
|
301
|
286
|
|
302
|
|
/*标志*/
|
303
|
|
function autho() {
|
304
|
|
if(arguments[0] == 1) {
|
305
|
|
return {
|
306
|
|
"sty": "authicon-pro",
|
307
|
|
"title": "科袖认证专家"
|
308
|
|
}
|
309
|
|
} else {
|
310
|
|
if(arguments[1] == 1) {
|
311
|
|
return {
|
312
|
|
"sty": "authicon-staff-ok",
|
313
|
|
"title": "企业认证员工"
|
314
|
|
}
|
315
|
|
} else {
|
316
|
|
if(arguments[2] == 3) {
|
317
|
|
return {
|
318
|
|
"sty": "authicon-real",
|
319
|
|
"title": "实名认证用户"
|
|
287
|
/*企业用户信息*/
|
|
288
|
function cmpFun(id, $itemlist) {
|
|
289
|
mui.ajax(baseUrl + '/ajax/org/' + id, {
|
|
290
|
"type": "get",
|
|
291
|
"async": true,
|
|
292
|
"success": function(data) {
|
|
293
|
console.log(data);
|
|
294
|
if(data.success && data.data) {
|
|
295
|
if(data.data.forShort) {
|
|
296
|
$itemlist.find("#nameSpan").text(data.data.forShort);
|
|
297
|
} else {
|
|
298
|
$itemlist.find("#nameSpan").text(data.data.name);
|
|
299
|
}
|
|
300
|
if(data.data.hasOrgLogo) {
|
|
301
|
$itemlist.find("#userimg").attr("style", "background-image: url(" + baseUrl + "/images/org/" + data.data.id + ".jpg);");
|
|
302
|
}
|
|
303
|
$itemlist.find(".userurl").attr("data-id", data.data.id);
|
|
304
|
$itemlist.find(".userurl").attr("data-iftauth", data.data.authStatus);
|
|
305
|
if(data.data.authStatus == 3) {
|
|
306
|
$itemlist.find(".authicon").addClass("authicon-com-ok").attr("title", "认证企业");;
|
|
307
|
}
|
|
308
|
/*else{
|
|
309
|
$itemlist.find(".authicon").addClass("authicon-com-no").attr("title", "未认证企业");;
|
|
310
|
}*/
|
|
311
|
}
|
|
312
|
},
|
|
313
|
"error": function() {
|
|
314
|
plus.nativeUI.toast("服务器链接超时", toastStyle);
|
|
315
|
}
|
|
316
|
});
|
320
|
317
|
}
|
321
|
|
}
|
322
|
|
}
|
323
|
|
}
|
324
|
|
}
|
|
318
|
|
|
319
|
/*标志*/
|
|
320
|
function autho() {
|
|
321
|
if(arguments[0] == 1) {
|
|
322
|
return {
|
|
323
|
"sty": "authicon-pro",
|
|
324
|
"title": "科袖认证专家"
|
|
325
|
}
|
|
326
|
} else {
|
|
327
|
if(arguments[1] == 1) {
|
|
328
|
return {
|
|
329
|
"sty": "authicon-staff-ok",
|
|
330
|
"title": "企业认证员工"
|
|
331
|
}
|
|
332
|
} else {
|
|
333
|
if(arguments[2] == 3) {
|
|
334
|
return {
|
|
335
|
"sty": "authicon-real",
|
|
336
|
"title": "实名认证用户"
|
|
337
|
}
|
|
338
|
}
|
|
339
|
}
|
|
340
|
}
|
|
341
|
}
|