portal html css js resource

shareResinfor.html 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link rel="stylesheet" href="css/reset.css" />
  8. <link rel="stylesheet" href="css/common.css" />
  9. </head>
  10. <style>
  11. html,
  12. body {
  13. background: #efeff4;
  14. }
  15. /*input输入相关*/
  16. .frmbox {
  17. width: 100%;
  18. margin: 2% auto;
  19. border-radius: 6px;
  20. }
  21. .frmtype {
  22. width: 100%;
  23. margin: auto;
  24. line-height: 30px;
  25. padding: 1% 2%;
  26. font-size: 14px;
  27. line-height: 20px;
  28. }
  29. .frmbtn {
  30. width: 100%;
  31. margin: 4% auto;
  32. font-size: 14px;
  33. line-height: 24px;
  34. padding: 1% 2%;
  35. border: 1px solid #FF9900;
  36. border-radius: 6px;
  37. color: #FF9900;
  38. }
  39. .frmbox {
  40. border: none;
  41. width: 90%;
  42. height: 100%;
  43. }
  44. .frmactive {
  45. color: #fff;
  46. background-color: #FF9900;
  47. border: 1px solid #FF9900;
  48. }
  49. .pull-right {
  50. float: right!important
  51. }
  52. .pull-left {
  53. float: left!important
  54. }
  55. .alignCenter {
  56. text-align: center;
  57. }
  58. /*圆角*/
  59. /*头像、资源圆角*/
  60. .headRadius {
  61. border-radius: 4px;
  62. }
  63. .blockGroup {
  64. background: #fff;
  65. }
  66. .mainbox {
  67. width: 96%;
  68. margin: 2% auto;
  69. }
  70. .maincon {
  71. padding: 4% 2%;
  72. overflow: hidden;
  73. }
  74. .listtit {
  75. font-size: 14px;
  76. line-height: 26px;
  77. color: #333333;
  78. }
  79. /*中标题*/
  80. .listtit2 {
  81. font-size: 13px;
  82. line-height: 20px;
  83. color: #666666;
  84. }
  85. /*较小标题*/
  86. .listtit3 {
  87. font-size: 12px;
  88. line-height: 18px;
  89. color: #888888;
  90. }
  91. /*小标题*/
  92. .mui-ellipsis {
  93. overflow: hidden;
  94. white-space: nowrap;
  95. text-overflow: ellipsis;
  96. }
  97. /*资源图片*/
  98. .ResImgBox {
  99. display: inline-block;
  100. text-align: center;
  101. max-width: 64px;
  102. width: 64px;
  103. height: 60px;
  104. padding: 1px;
  105. background: #FAFAFA;
  106. border: 1px solid #F8F8F8;
  107. overflow: hidden;
  108. padding: 2px;
  109. margin: 6px 0;
  110. border-radius: 4px;
  111. }
  112. .ResImgBox2 {
  113. margin: 6px 0 6px 10px;
  114. }
  115. .ResImgBox .resImg {
  116. max-width: 100%;
  117. max-height: 100%;
  118. vertical-align: middle;
  119. position: relative;
  120. }
  121. .ResImgBox:before {
  122. content: ' ';
  123. display: inline-block;
  124. vertical-align: middle;
  125. width: 0;
  126. height: 100%;
  127. overflow: hidden;
  128. margin-left: -5px;
  129. }
  130. /*专家相关信息*/
  131. .personinfo .listtit3 {
  132. font-size: 14px;
  133. line-height: 24px;
  134. color: #AAAAAA;
  135. margin: 0;
  136. }
  137. .personinfo .listtit {
  138. font-size: 18px;
  139. line-height: 30px;
  140. color: #333333;
  141. }
  142. .personinfo .listtit3 {
  143. font-size: 14px;
  144. line-height: 24px;
  145. color: #AAAAAA;
  146. margin: 0;
  147. }
  148. .headbox .headimg {
  149. width: 100px;
  150. overflow: hidden;
  151. margin: auto;
  152. }
  153. .infocontit {
  154. font-size: 14px;
  155. position: relative;
  156. }
  157. .infocon {
  158. padding: 6px 10px;
  159. /*text-align: justify;*/
  160. font-size: 13px;
  161. line-height: 27px;
  162. color: #888888;
  163. }
  164. .infocon ul {
  165. padding: 0;
  166. margin: 0;
  167. overflow: hidden;
  168. }
  169. .infocon .infoapply li {
  170. padding-left: 6px;
  171. padding-right: 2px;
  172. list-style: disc inside;
  173. width: 46%;
  174. float: left;
  175. }
  176. .infocon .infosubject li {
  177. list-style: none;
  178. padding: 2px 16px;
  179. margin: 4px;
  180. border: 1px solid #BBBBBB;
  181. border-radius: 6px;
  182. float: left;
  183. }
  184. .personblock {
  185. position: absolute;
  186. left: 198px;
  187. padding: 0 3%;
  188. text-align: center;
  189. }
  190. .personbox{
  191. margin:auto;
  192. width:80%;
  193. position:relative;
  194. }
  195. .authicon2{
  196. width: 48px;
  197. height: 16px;
  198. }
  199. @media only screen and (min-width: 100px) and (max-width: 360px) {
  200. div[class="personbox"]{width:100%;}
  201. }
  202. </style>
  203. <body>
  204. <div class="contentBody2">
  205. <div class="blockGroup mainbox">
  206. <div class="maincon" style="position: relative;">
  207. <div class="ResImgBox resouimgbox pull-left" style="height:180px;width:180px;max-width:180px;margin:0 6px 0 8px;">
  208. <img class="resImg headRadius" src="images/default-resource.jpg" id="ziyuanimg" data-preview-src data-preview-group="1" />
  209. </div>
  210. <div class="personblock pull-left" id="fess">
  211. <div class="personbox">
  212. <img class="headRadius" style="width: 64px;height:64px;" src="images/default-photo.jpg" id="proimg">
  213. <p class="listtit clearfix" style="display: inline-block;margin:0 0 0 10px;"><span class="floatL" id="proname"></span><em class="authicon authicon-cu" style="margin:6px 0 0 -2px;" id="promodify"></em></p>
  214. </div>
  215. <p class="listtit2"><span id="protitle"></span> <span id="prooffice"></span></p>
  216. <p class="listtit3"><span id="proorgName"></span></p>
  217. <p class="listtit3"><span id="proadress"></span></p>
  218. </div>
  219. </div>
  220. </div>
  221. <div class="blockGroup mainbox">
  222. <div class="maincon">
  223. <ul class="resouinfobox">
  224. <li>
  225. <div class="infocontit">基本信息</div>
  226. </li>
  227. <li>
  228. <div class="infocon">
  229. <p style="color:#666666;">
  230. <span>资源名称:</span>
  231. <span class="listtit2" id='resourceName'></span>
  232. </p>
  233. <p style="color:#666666;">
  234. <span>应用用途:</span>
  235. <span class="listtit2" id="yongtu"></span>
  236. </p>
  237. </div>
  238. </li>
  239. </ul>
  240. </div>
  241. </div>
  242. <div class="blockGroup mainbox" id="fielddiv">
  243. <div class="maincon">
  244. <div class="infocontit">学术领域</div>
  245. <div class="infocon">
  246. <ul class="infosubject" id="field">
  247. </ul>
  248. </div>
  249. </div>
  250. </div>
  251. <div class="blockGroup mainbox" id="applydiv">
  252. <div class="maincon">
  253. <div class="infocontit">应用行业</div>
  254. <div class="infocon">
  255. <ul id="apply">
  256. </ul>
  257. </div>
  258. </div>
  259. </div>
  260. <div class="blockGroup mainbox" id="hezuodiv">
  261. <div class="maincon">
  262. <ul class="resouinfobox">
  263. <li>
  264. <div class="infocontit">合作备注</div>
  265. <div class="infocon">
  266. <p class="listtit3" id="hezuo"></p>
  267. </div>
  268. </li>
  269. </ul>
  270. </div>
  271. </div>
  272. <div class="blockGroup mainbox" id="detaildiv">
  273. <div class="maincon">
  274. <ul class="resouinfobox">
  275. <li>
  276. <div class="infocontit">详细描述</div>
  277. <div class="infocon">
  278. <p class="listtit3" id="detail">
  279. </p>
  280. </div>
  281. </li>
  282. </ul>
  283. </div>
  284. </div>
  285. <div class="blockGroup mainbox" style="padding-bottom:40px;">
  286. <div class="maincon alignCenter">
  287. <p style="margin-top: 30px;"><span style="color:#ff9900; font-size: 16px;line-height: 32px;">[ 科袖 ]</span><br />搭建企业与专家的桥梁</p>
  288. <div class="frmbox" style="margin:20px auto;">
  289. <a href="http://www.ekexiu.com/download/com.ekexiu.app_V1.1.1.apk"><button class="frmbtn frmactive">下载安卓客户端</button></a>
  290. </div>
  291. <div>
  292. <img style="width:120px;" src="images/weixin_code.jpg" />
  293. <p style="color:#CCCCCC;font-size:13px;">关注科袖公众号</p>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. <script type="text/javascript" src="js/jquery-1.11.1.js"></script>
  299. <script>
  300. $(document).ready(function() {
  301. var resourceId = GetQueryString("resourceId");
  302. function GetQueryString(name) {
  303. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  304. var r = window.location.search.substr(1).match(reg);
  305. var context = "";
  306. if(r != null)
  307. context = r[2];
  308. reg = null;
  309. r = null;
  310. return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
  311. }
  312. var oproname = document.getElementById("proname"); //专家名称
  313. var oprotitle = document.getElementById("protitle"); //专家职称
  314. var oprooffice = document.getElementById("prooffice"); //专家职务
  315. var oproorgName = document.getElementById("proorgName"); //专家所属机构
  316. var oproadress = document.getElementById("proadress"); //专家所在地
  317. var opromodify = document.getElementById("promodify"); //专家认证
  318. var oproimg = document.getElementById("proimg"); //专家头像
  319. var oresourceName = document.getElementById("resourceName"); //资源名称
  320. var oyongtu = document.getElementById("yongtu"); //应用用途
  321. var oziyuanimg = document.getElementById("ziyuanimg"); //资源图片
  322. var ofield = document.getElementById("field"); //学术领域
  323. var oapply = document.getElementById("apply"); //应用行业
  324. var odetail = document.getElementById("detail"); //详细描述
  325. var ohezuo = document.getElementById("hezuo"); //合作备注
  326. var oEnter = document.getElementById("fess");
  327. var ofielddiv = document.getElementById("fielddiv"); //学术领域容器
  328. var oapplydiv = document.getElementById("applydiv"); //应用行业容器
  329. var odetaildiv = document.getElementById("detaildiv"); //详细描述容器
  330. var ohezuodiv = document.getElementById("hezuodiv"); //合作备注容器
  331. function ziyuaninfo(resourceId) {
  332. $.ajax({
  333. url: '/ajax/resource/resourceInfo',
  334. data: {
  335. 'resourceId': resourceId
  336. },
  337. dataType: 'json', //服务器返回json格式数据
  338. type: 'get', //HTTP请求类型
  339. timeout: 10000, //超时时间设置为10秒;
  340. success: function(data) {
  341. if(data.success) {
  342. console.log(JSON.stringify(data));
  343. var mydata = data.data;
  344. //资源名称
  345. professorId = mydata['editProfessor']['id'];
  346. var userid = GetQueryString('userid');
  347. if(professorId == userid) {
  348. document.getElementsByClassName("footbox")[0].style.display = "none";
  349. }
  350. (mydata['resourceName']) ? oresourceName.innerHTML = mydata['resourceName']: oresourceName.innerHTML = '';
  351. //专家信息
  352. proId = mydata['editProfessor']['id']; //专家id
  353. //专家名字
  354. (mydata['editProfessor']["name"]) ? oproname.innerText = mydata['editProfessor']["name"]: oproname.innerText = '';
  355. //职称
  356. (mydata['editProfessor']["title"]) ? oprotitle.innerHTML = mydata['editProfessor']["title"]: oprotitle.innerHTML = '';
  357. //职位
  358. if(mydata['editProfessor']["office"] == null || mydata['editProfessor']["office"] == undefined) {
  359. oprooffice.innerHTML = '';
  360. } else {
  361. if(mydata['editProfessor']["title"]) {
  362. oprooffice.innerHTML = ',' + mydata['editProfessor']["office"]; //职位
  363. }
  364. oprooffice.innerHTML = mydata['editProfessor']["office"]; //职位
  365. };
  366. //所在机构
  367. (mydata['editProfessor']["orgName"]) ? oproorgName.innerHTML = mydata['editProfessor']["orgName"]: oproorgName.innerHTML = '';
  368. //所在地
  369. (mydata['editProfessor']["address"]) ? oproadress.innerHTML = mydata['editProfessor']["address"]: oproadress.innerHTML = '';
  370. /*是否认证*/
  371. //(mydata['editProfessor']["authentication"] == true) ? opromodify.classList.add('authicon'): opromodify.classList.add('unauthicon');
  372. if(mydata['editProfessor']["authType"]) {
  373. opromodify.classList.add('authicon')
  374. opromodify.classList.add('authicon-cu');
  375. opromodify.style.margin = "3px 0 0 3px";
  376. } else {
  377. if(mydata['editProfessor']["authStatus"]) {
  378. if(mydata['editProfessor']["authentication"] == 1) {
  379. opromodify.classList.add('authicon2');
  380. opromodify.classList.add('authicon-mana');
  381. } else if(mydata['editProfessor']["authentication"] == 2) {
  382. opromodify.classList.add('authicon2');
  383. opromodify.classList.add('authicon-staff');
  384. } else {
  385. opromodify.classList.add('authicon2');
  386. opromodify.classList.add('authicon-stu');
  387. }
  388. }
  389. }
  390. /*专家头像*/
  391. (mydata['editProfessor']["hasHeadImage"] == 0) ? oproimg.setAttribute('src', '/images/default-photo.jpg'): oproimg.setAttribute('src', '/images/head/' + mydata['editProfessor']['id'] + '_m.jpg');
  392. //资源基本信息
  393. //(mydata['images']['imageSrc']) ? oziyuanimg.setAttribute('src', mydata['images']['imageSrc']): oziyuanimg.setAttribute('src', '../images/default-resource.jpg'); //资源图片
  394. var imgRes = "/images/resource/" + mydata.resourceId + ".jpg";
  395. if(mydata['images'].length) {
  396. oziyuanimg.setAttribute('src', imgRes)
  397. } else {
  398. oziyuanimg.setAttribute('src', '../images/default-resource.jpg')
  399. }
  400. (mydata['supportedServices']) ? oyongtu.innerHTML = mydata['supportedServices']: oyongtu.innerHTML = ''; //应用用途
  401. //学术领域
  402. if(mydata['subject']) {
  403. if(mydata['subject'].indexOf(',') != -1) { //字符串是否包含,
  404. var fieldlist = mydata['subject'].split(",");
  405. console.log(fieldlist.length);
  406. for(var i = 0; i < fieldlist.length; i++) {
  407. var oli = document.createElement('li');
  408. oli.innerText = fieldlist[i];
  409. ofield.appendChild(oli);
  410. }
  411. } else {
  412. var oli = document.createElement('li');
  413. oli.innerText = mydata['subject'];
  414. ofield.appendChild(oli);
  415. }
  416. } else {
  417. ofielddiv.style.display = 'none';
  418. }
  419. //应用行业
  420. if(mydata['industry']) {
  421. if(mydata['industry'].indexOf(',') != -1) { //字符串是否包含,
  422. var applylist = mydata['industry'].split(",");
  423. console.log(applylist.length);
  424. for(var i = 0; i < applylist.length; i++) {
  425. var oli = document.createElement('li');
  426. oli.innerText = applylist[i];
  427. oapply.appendChild(oli);
  428. }
  429. } else {
  430. var oli = document.createElement('li');
  431. oli.innerText = mydata['industry'];
  432. oapply.appendChild(oli);
  433. }
  434. } else {
  435. oapplydiv.style.display = 'none';
  436. }
  437. //详细描述
  438. if(mydata['descp']) {
  439. odetail.innerHTML = mydata['descp'];
  440. var pWidth = $("#detail").find("p").width();
  441. var leng = $("#detail").find("img").length;
  442. for(var i = 0; i < leng; i++) {
  443. (function(i) {
  444. $("#detail").find("img").eq(i).load(function() {
  445. var imgWidth = $("#detail").find("img").eq(i).width();
  446. if(imgWidth > pWidth) {
  447. $("#detail").find("img").eq(i).css({
  448. "width": "100%"
  449. })
  450. }
  451. })
  452. })(i);
  453. }
  454. } else {
  455. odetaildiv.style.display = 'none';
  456. }
  457. //合作备注
  458. if(mydata['cooperationNotes']) {
  459. ohezuo.innerHTML = mydata['cooperationNotes'];
  460. } else {
  461. ohezuodiv.style.display = 'none';
  462. }
  463. }
  464. },
  465. error: function(e) {
  466. return;
  467. }
  468. });
  469. }
  470. //资源信息
  471. ziyuaninfo(resourceId);
  472. });
  473. </script>
  474. </body>
  475. </html>