portal html css js resource

shareResinfor.html 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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. right: 1%;*/
  187. max-width: 36%;
  188. padding: 0 3%;
  189. text-align: center;
  190. }
  191. </style>
  192. <body>
  193. <div class="contentBody2">
  194. <div class="blockGroup mainbox">
  195. <div class="maincon" style="position: relative;">
  196. <div class="ResImgBox resouimgbox pull-left" style="height:180px;width:180px;max-width:180px;margin:0 6px 0 8px;">
  197. <img class="resImg headRadius" src="images/default-resource.jpg" id="ziyuanimg" data-preview-src data-preview-group="1" />
  198. </div>
  199. <div class="personblock pull-left" id="fess">
  200. <div style="margin:auto; width:80%;position:relative;">
  201. <img class="headRadius" style="width: 64px;height:64px;" src="images/default-photo.jpg" id="proimg">
  202. <p class="listtit clearfix" style="width: 106px;margin: auto;"><span class="floatL" id="proname"></span><em class="authicon authicon-cu" style="margin:3px 0 0 0;" id="promodify"></em></p>
  203. </div>
  204. <!--<p class="listtit clearfix"><span class="floatL" id="proname"></span><em class="authicon authicon-cu" style="height: 16px; width:16px;margin:5px 0 0 2px;" id="promodify"></em></p>-->
  205. <p class="listtit2"><span id="protitle"></span> <span id="prooffice"></span></p>
  206. <p class="listtit3"><span id="proorgName"></span></p>
  207. <p class="listtit3"><span id="proadress"></span></p>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="blockGroup mainbox">
  212. <div class="maincon">
  213. <ul class="resouinfobox">
  214. <li>
  215. <div class="infocontit">基本信息</div>
  216. </li>
  217. <li>
  218. <div class="infocon">
  219. <p style="color:#666666;">
  220. <span>资源名称:</span>
  221. <span class="listtit2" id='resourceName'></span>
  222. </p>
  223. <p style="color:#666666;">
  224. <span>应用用途:</span>
  225. <span class="listtit2" id="yongtu"></span>
  226. </p>
  227. </div>
  228. </li>
  229. </ul>
  230. </div>
  231. </div>
  232. <div class="blockGroup mainbox" id="fielddiv">
  233. <div class="maincon">
  234. <div class="infocontit">学术领域</div>
  235. <div class="infocon">
  236. <ul class="infosubject" id="field">
  237. </ul>
  238. </div>
  239. </div>
  240. </div>
  241. <div class="blockGroup mainbox" id="applydiv">
  242. <div class="maincon">
  243. <div class="infocontit">应用行业</div>
  244. <div class="infocon">
  245. <ul id="apply">
  246. </ul>
  247. </div>
  248. </div>
  249. </div>
  250. <div class="blockGroup mainbox" id="hezuodiv">
  251. <div class="maincon">
  252. <ul class="resouinfobox">
  253. <li>
  254. <div class="infocontit">合作备注</div>
  255. <div class="infocon">
  256. <p class="listtit3" id="hezuo"></p>
  257. </div>
  258. </li>
  259. </ul>
  260. </div>
  261. </div>
  262. <div class="blockGroup mainbox" id="detaildiv">
  263. <div class="maincon">
  264. <ul class="resouinfobox">
  265. <li>
  266. <div class="infocontit">详细描述</div>
  267. <div class="infocon">
  268. <p class="listtit3" id="detail">
  269. 二维码123456789二维码、语音输入、摇一摇摄像头、文件系统、摇一摇摄像头、文件系统、微信分享……不够?Native.JS
  270. </p>
  271. </div>
  272. </li>
  273. </ul>
  274. </div>
  275. </div>
  276. <div class="blockGroup mainbox" style="padding-bottom:40px;">
  277. <div class="maincon alignCenter">
  278. <p style="margin-top: 30px;"><span style="color:#ff9900; font-size: 16px;line-height: 32px;">[ 科袖 ]</span><br />搭建企业与专家的桥梁</p>
  279. <div class="frmbox" style="margin:20px auto;">
  280. <a href="http://www.ekexiu.com/download/com.ekexiu.app_V1.1.1.apk"><button class="frmbtn frmactive">下载安卓客户端</button></a>
  281. </div>
  282. <div>
  283. <img style="width:120px;" src="images/weixin_code.jpg" />
  284. <p style="color:#CCCCCC;font-size:13px;">关注科袖公众号</p>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. <script type="text/javascript" src="js/jquery-1.11.1.js"></script>
  290. <script>
  291. $(document).ready(function() {
  292. var resourceId = GetQueryString("resourceId");
  293. function GetQueryString(name) {
  294. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  295. var r = window.location.search.substr(1).match(reg);
  296. var context = "";
  297. if(r != null)
  298. context = r[2];
  299. reg = null;
  300. r = null;
  301. return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
  302. }
  303. var oproname = document.getElementById("proname"); //专家名称
  304. var oprotitle = document.getElementById("protitle"); //专家职称
  305. var oprooffice = document.getElementById("prooffice"); //专家职务
  306. var oproorgName = document.getElementById("proorgName"); //专家所属机构
  307. var oproadress = document.getElementById("proadress"); //专家所在地
  308. var opromodify = document.getElementById("promodify"); //专家认证
  309. var oproimg = document.getElementById("proimg"); //专家头像
  310. var oresourceName = document.getElementById("resourceName"); //资源名称
  311. var oyongtu = document.getElementById("yongtu"); //应用用途
  312. var oziyuanimg = document.getElementById("ziyuanimg"); //资源图片
  313. var ofield = document.getElementById("field"); //学术领域
  314. var oapply = document.getElementById("apply"); //应用行业
  315. var odetail = document.getElementById("detail"); //详细描述
  316. var ohezuo = document.getElementById("hezuo"); //合作备注
  317. var oEnter = document.getElementById("fess");
  318. var ofielddiv = document.getElementById("fielddiv"); //学术领域容器
  319. var oapplydiv = document.getElementById("applydiv"); //应用行业容器
  320. var odetaildiv = document.getElementById("detaildiv"); //详细描述容器
  321. var ohezuodiv = document.getElementById("hezuodiv"); //合作备注容器
  322. function ziyuaninfo(resourceId) {
  323. $.ajax({
  324. url: '/ajax/resource/resourceInfo',
  325. data: {
  326. 'resourceId': resourceId
  327. },
  328. dataType: 'json', //服务器返回json格式数据
  329. type: 'get', //HTTP请求类型
  330. timeout: 10000, //超时时间设置为10秒;
  331. success: function(data) {
  332. if(data.success) {
  333. console.log(JSON.stringify(data));
  334. var mydata = data.data;
  335. //资源名称
  336. professorId = mydata['editProfessor']['id'];
  337. var userid = GetQueryString('userid');
  338. if(professorId == userid) {
  339. document.getElementsByClassName("footbox")[0].style.display = "none";
  340. }
  341. (mydata['resourceName']) ? oresourceName.innerHTML = mydata['resourceName']: oresourceName.innerHTML = '';
  342. //专家信息
  343. proId = mydata['editProfessor']['id']; //专家id
  344. //专家名字
  345. (mydata['editProfessor']["name"]) ? oproname.innerText = mydata['editProfessor']["name"]: oproname.innerText = '';
  346. //职称
  347. (mydata['editProfessor']["title"]) ? oprotitle.innerHTML = mydata['editProfessor']["title"]: oprotitle.innerHTML = '';
  348. //职位
  349. if(mydata['editProfessor']["office"] == null || mydata['editProfessor']["office"] == undefined) {
  350. oprooffice.innerHTML = '';
  351. } else {
  352. if(mydata['editProfessor']["title"]) {
  353. oprooffice.innerHTML = ',' + mydata['editProfessor']["office"]; //职位
  354. }
  355. oprooffice.innerHTML = mydata['editProfessor']["office"]; //职位
  356. };
  357. //所在机构
  358. (mydata['editProfessor']["orgName"]) ? oproorgName.innerHTML = mydata['editProfessor']["orgName"]: oproorgName.innerHTML = '';
  359. //所在地
  360. (mydata['editProfessor']["address"]) ? oproadress.innerHTML = mydata['editProfessor']["address"]: oproadress.innerHTML = '';
  361. /*是否认证*/
  362. //(mydata['editProfessor']["authentication"] == true) ? opromodify.classList.add('authicon'): opromodify.classList.add('unauthicon');
  363. if(mydata['editProfessor']["authType"]) {
  364. opromodify.classList.add('authicon')
  365. opromodify.classList.add('authicon-cu');
  366. opromodify.style.position = "absolute";
  367. } else {
  368. if(mydata['editProfessor']["authStatus"]) {
  369. if(mydata['editProfessor']["authentication"] == 1) {
  370. opromodify.classList.add('authicon2');
  371. opromodify.classList.add('authicon-mana');
  372. } else if(mydata['editProfessor']["authentication"] == 2) {
  373. opromodify.classList.add('authicon2');
  374. opromodify.classList.add('authicon-staff');
  375. } else {
  376. opromodify.classList.add('authicon2');
  377. opromodify.classList.add('authicon-stu');
  378. }
  379. }
  380. }
  381. /*专家头像*/
  382. (mydata['editProfessor']["hasHeadImage"] == 0) ? oproimg.setAttribute('src', '/images/default-photo.jpg'): oproimg.setAttribute('src', '/images/head/' + mydata['editProfessor']['id'] + '_m.jpg');
  383. //资源基本信息
  384. //(mydata['images']['imageSrc']) ? oziyuanimg.setAttribute('src', mydata['images']['imageSrc']): oziyuanimg.setAttribute('src', '../images/default-resource.jpg'); //资源图片
  385. var imgRes = "/images/resource/" + mydata.resourceId + ".jpg";
  386. if(mydata['images'].length) {
  387. oziyuanimg.setAttribute('src', imgRes)
  388. } else {
  389. oziyuanimg.setAttribute('src', '../images/default-resource.jpg')
  390. }
  391. (mydata['supportedServices']) ? oyongtu.innerHTML = mydata['supportedServices']: oyongtu.innerHTML = ''; //应用用途
  392. //学术领域
  393. if(mydata['subject']) {
  394. if(mydata['subject'].indexOf(',') != -1) { //字符串是否包含,
  395. var fieldlist = mydata['subject'].split(",");
  396. console.log(fieldlist.length);
  397. for(var i = 0; i < fieldlist.length; i++) {
  398. var oli = document.createElement('li');
  399. oli.innerText = fieldlist[i];
  400. ofield.appendChild(oli);
  401. }
  402. } else {
  403. var oli = document.createElement('li');
  404. oli.innerText = mydata['subject'];
  405. ofield.appendChild(oli);
  406. }
  407. } else {
  408. ofielddiv.style.display = 'none';
  409. }
  410. //应用行业
  411. if(mydata['industry']) {
  412. if(mydata['industry'].indexOf(',') != -1) { //字符串是否包含,
  413. var applylist = mydata['industry'].split(",");
  414. console.log(applylist.length);
  415. for(var i = 0; i < applylist.length; i++) {
  416. var oli = document.createElement('li');
  417. oli.innerText = applylist[i];
  418. oapply.appendChild(oli);
  419. }
  420. } else {
  421. var oli = document.createElement('li');
  422. oli.innerText = mydata['industry'];
  423. oapply.appendChild(oli);
  424. }
  425. } else {
  426. oapplydiv.style.display = 'none';
  427. }
  428. //详细描述
  429. if(mydata['descp']) {
  430. odetail.innerHTML = mydata['descp'];
  431. var pWidth = $("#detail").find("p").width();
  432. var leng = $("#detail").find("img").length;
  433. for(var i = 0; i < leng; i++) {
  434. (function(i) {
  435. $("#detail").find("img").eq(i).load(function() {
  436. var imgWidth = $("#detail").find("img").eq(i).width();
  437. if(imgWidth > pWidth) {
  438. $("#detail").find("img").eq(i).css({
  439. "width": "100%"
  440. })
  441. }
  442. })
  443. })(i);
  444. }
  445. } else {
  446. odetaildiv.style.display = 'none';
  447. }
  448. //合作备注
  449. if(mydata['cooperationNotes']) {
  450. ohezuo.innerHTML = mydata['cooperationNotes'];
  451. } else {
  452. ohezuodiv.style.display = 'none';
  453. }
  454. }
  455. },
  456. error: function(e) {
  457. return;
  458. }
  459. });
  460. }
  461. //资源信息
  462. ziyuaninfo(resourceId);
  463. });
  464. </script>
  465. </body>
  466. </html>