123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- $(document).ready(function() {
-
- var resourceId = GetQueryString("resourceId");
-
- loginStatus();
-
- var subjectShow = function(data) {
- if(data != undefined && data.length != 0) {
- var subs = new Array();
- if(data.indexOf(',')) {
- subs = data.split(',');
- } else {
- subs[0] = data;
- }
- if(subs.length > 0) {
- for(var i = 0; i < subs.length; i++) {
- $("#subjectList").append("<li>" + subs[i] + "</li>")
- };
- }
- }
- }
-
- var industryShow = function(data) {
- if(data != undefined && data.length != 0) {
- var subs = new Array();
- if(data.indexOf(',')) {
- subs = data.split(',');
- } else {
- subs[0] = data;
- }
- if(subs.length > 0) {
- for(var i = 0; i < subs.length; i++) {
- $("#industryList").append("<li>" + subs[i] + "</li>")
- };
- }
- }
- }
-
- var resourceData = function() {
- $.ajax({
- "url": "/ajax/resource/resourceInfo",
- data: {
- 'resourceId': resourceId
- },
- "type": "get",
- "async": true,
- "success": function(info) {
- if(info.success) {
- var $info = info.data;
- console.log(info);
- $(".h2Font").text($info.resourceName);
- $("#application").text($info.supportedServices);
- if($info.subject) {
- subjectShow($info.subject)
- }else{
- $("span:contains('学术领域')").hide();
- }
- if($info.industry) {
- industryShow($info.industry)
- }else{
- $("span:contains('应用行业')").hide();
- }
- if($info.cooperationNotes) {
- $("#cooperationNote").text($info.cooperationNotes);
- }else{
- $("span:contains('合作备注')").hide();
- }
- if(!$info.subject&&!$info.industry&&!$info.cooperationNotes){
- $(".resAbout").hide();
- }
- if($info.images) {
- $("#resouImg").attr("src", "/images/resource/" + $info.resourceId + ".jpg")
- }
- if($info.descp) {
- $(".resMore").html($info.descp)
- }
- $("#nameS").text($info.professor.name);
- if($info.professor.title) {
- if($info.professor.office) {
- $("#title").text($info.professor.title + ",");
- } else {
- $("#title").text($info.professor.title);
- }
- }
- if($info.professor.office) {
- $("#office").text($info.professor.office);
- }
- if($info.professor.department) {
- $("#department").text($info.professor.department);
- }
- if($info.professor.orgName) {
- $("#orgName").text($info.professor.orgName);
- }
- if($info.professor.address) {
- $("#address").text($info.professor.address);
- }
- if($info.professor.hasHeadImage) {
- $("#headImg").attr("src", "/images/head/" + $info.professorId + "_l.jpg")
- }
- } else {
- $.MsgBox.Alert('消息提醒', "系统异常!");
- }
- },
- "error": function() {
- $.MsgBox.Alert('message', 'failed')
- }
- });
- }
- resourceData();
-
- })
|