> Code Issues 0 Pull-Requests 0 Commits 1521 Releases 0 Wiki

54 Commits (6c1c3d4e5b40e484413ac2c95344bea90571c102)

Autor SHA1 Nachricht Datum
  lyn7568 cacd17f521 h5修复bug vor 5 Jahren
  lyn7568 8fccf28e0b 修复用户登录、非专利查询、消息通知等bug vor 5 Jahren
  lyn7568 79fd2445f1 团队模块全部完成 vor 5 Jahren
  luyanan 21cdd3ab58 企业、文章 vor 6 Jahren
  luyanan 06cd94e6fa 搜索,检索。为空是默认搜索条件为上次关键词 vor 6 Jahren
  luyanan 8efbb04397 h5搜索左右滑动bug vor 6 Jahren
  luyanan 08604fd946 h5搜索, vor 6 Jahren
  luyanan 12e29f56e8 问题点击h5 vor 6 Jahren
  luyanan f3431b1d9a 完善问答 vor 6 Jahren
  luyanan 3c79709d53 问答分享H5留言样式 vor 6 Jahren
  luyanan ef33cb1535 问答点赞 vor 6 Jahren
  luyanan b244f9791b 用户页面 vor 6 Jahren
  luyanan 28ecbe95ef 提取留言样式 vor 6 Jahren
  luyanan 45810a4e20 h5问答 vor 6 Jahren
  luyanan b3b8f6ad8f 分享广告位 vor 7 Jahren
  luyanan ba09a20057 广告位模块的提取,便于维护更新 vor 7 Jahren
  luyanan f228bf7541 筛选条件的滚动,以及在微信中定位被遮挡的问题 vor 7 Jahren
  luyanan a74072d6d6 下拉加载提示文字位置 vor 7 Jahren
  luyanan 691931e398 h5搜索加载问题 vor 7 Jahren
  luyanan c8773b04cf h5 首页搜索以及各个页面判断是否为移动端跳转H5页面 vor 7 Jahren
  luyanan 6f77d067cf 144141 vor 7 Jahren
  luyanan a43b47d657 在H5分享页面中,所有点击跳转app下载页面的按钮,增加判断:当前手机是否已下载科袖app: vor 7 Jahren
  luyanan 5e585f7cd0 微信公众号中添加加入科袖链接页面 vor 7 Jahren
  luyanan 17da2e1dc5 添加需求 h5,企业和用户需求模块 vor 7 Jahren
  luyanan 81cc9c3227 需求分享h5 vor 7 Jahren
  luyanan ee34e7e7b8 发现接口调整 vor 7 Jahren
  luyanan da2b4077c9 修改文章感兴趣的文章显示不出来 vor 7 Jahren
  luyanan a057269b8b H5页面相关内容修改完善 vor 7 Jahren
  luyanan 1eb0cd17dc 专家和企业浏览页面额度一些bug vor 7 Jahren
  luyanan e741a31faf 文本两端对齐 vor 7 Jahren
  luyanan d3505389aa 搜索相关调整 vor 7 Jahren
  luyanan 7dcdc8e443 H5分享相关 vor 7 Jahren
  luyanan cc8b36e7f9 资源的相关文章和感兴趣的 vor 7 Jahren
  luyanan cb2fffe403 资源文章分享 vor 7 Jahren
  luyanan e81e3a8bb5 文章资源分享页面 vor 7 Jahren
  luyanan c82b2efb68 去掉移动端点击的时候出现灰色背景bug vor 7 Jahren
  luyanan f78d965791 分享邀请页面尽量一屏展示 vor 7 Jahren
  jack 3b26544526 分享 vor 7 Jahren
  jack 1644430331 6 vor 7 Jahren
  jack 918d261d75 5 vor 7 Jahren
  jack e76eae4eb4 4 vor 7 Jahren
  jack 92af6d604a 33 vor 7 Jahren
  luyanan ccb8e4013c 专利二维码生成 vor 7 Jahren
  luyanan 04d3baee55 专利论文添加作者的相关操作邀请 vor 7 Jahren
  luyanan 8e64be01bb 邀请论文专利作者和发明人 vor 7 Jahren
  luyanan ad652b4f1a 分享页面地址样式 vor 7 Jahren
  luyanan 6c1fa46f7f 修改专家学术领域字段限制 vor 7 Jahren
  luyanan f99c067f7c 分享论文、专利、企业、个人 vor 7 Jahren
  luyanan ccfd5397d2 新版资源分享和文章分享 vor 7 Jahren
  luyanan a2e775138b 新版邀请注册页面 vor 7 Jahren
ekexiu.app - Gogs: Go Git Service

Aucune description

proinfobrow.js 15KB

    var ozixun = document.getElementById("zixun"); var yesExpert = document.getElementById("yesExpert"); var noExpert = document.getElementById("noExpert"); var personalMaterial = document.getElementsByClassName('personalMaterial'); var personSummary = document.getElementsByClassName("breifinfo")[0]; mui.plusReady(function() { var userid = plus.storage.getItem('userid'); var self = plus.webview.currentWebview(); var proId = self.proid; console.log(userid); /*点击咨询*/ //判断是否登录,登录才可咨询,否则登录 function isLogin(){ var userid = plus.storage.getItem('userid'); if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined'){ var flag = 'professor'; var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框 webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, { 'proId': proId, 'flag': flag }); webviewShow.addEventListener("loaded", function() { }, false); }else { mui.openWindow({ url:'../html/login.html', id:'login.html' }) } } ozixun.addEventListener('tap', function() { isLogin(); }); //查询学术领域 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) { var html = []; for(var i = 0; i < subs.length; i++) { html.push("<li>" + subs[i] + "</li>"); }; document.getElementsByClassName("infosubject")[0].innerHTML = html.join(''); } } } //查询研究方向 var getRecords = function($researchAreaLogs, caption) { var ret = []; var t = 0; for(var i = 0; i < $researchAreaLogs.length; i++) { if(caption == $researchAreaLogs[i].caption) { ret[t] = { id: $researchAreaLogs[i].opreteProfessorId, img: $researchAreaLogs[i].hasHeadImage } t++; } } return ret; } var researchAreaShow = function($datas, $datarecords) { if($datas != undefined && $datas.length != 0) { var html = []; for(var i = 0; i < $datas.length; ++i) { var $data = $datas[i]; var $photos = []; //获取头像 if($datarecords.length > 0) { $photos = getRecords($datarecords, $data.caption); } var isAgree = -1; for(var j = 0; j < $photos.length; j++) { if(userid == $photos[j].id) isAgree++; } if(isAgree) { var showDiv = "<div class='listbox'><div class='listbrowse mui-ellipsis'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class=' mui-icon iconfont plusbtn icon-appreciate' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='likenum'>"; } else { var showDiv = "<div class='listbox'><div class='listbrowse mui-ellipsis'><span class='like'>" + $data.count + "</span>" + $data.caption + "</div><span class=' mui-icon iconfont plusbtn icon-appreciatefill' data-pid='" + $data.professorId + "' data-caption='" + $data.caption + "' data-isagree='" + isAgree + "' ></span><div class='likenum'>"; } if($photos.length < 4) { for(var j = 0; j < $photos.length; ++j) { if($photos[j].img) { showDiv += "<span class='likepeople headRadius'><img class='like-h' src='" + baseUrl + "/images/head/" + $photos[j].id + "_s.jpg'></span>"; } else { showDiv += "<span class='likepeople headRadius'><img class='like-h' src='../images/default-photo.jpg'></span>"; } } } else { for(var j = $photos.length - 2; j < $photos.length; ++j) { if($photos[j].img) { showDiv += "<span class='likepeople headRadius'><img class='like-h' src='" + baseUrl + "/images/head/" + $photos[j].id + "_s.jpg'></span>"; } else { showDiv += "<span class='likepeople headRadius'><img class='like-h' src='../images/default-photo.jpg'></span>"; } } showDiv += "<span class='mui-icon iconfont icon-more likepeople likemore headRadius'></span>"; } showDiv += "</div></div></div>"; html.push(showDiv); } document.getElementsByClassName("reserachMess")[0].innerHTML = html.join('') } } //查询应用行业 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) { var html = []; for(var i = 0; i < subs.length; i++) { html.push("<li>" + subs[i] + "</li>"); }; document.getElementsByClassName("infoapply")[0].innerHTML = html.join(''); } } } var professorResource = function(odata) { var $data = odata; var html = []; for(var i = 0; i < odata.length; i++) { var string = '<li class="mui-table-view-cell mui-media listitem" resouseId=' + $data[i].resourceId + '>' string += '<a class="proinfor"><div class="mui-media-object mui-pull-left ResImgBox ResImgBox2">' if($data[i].images.length) { string += '<img class="resImg headRadius" src="' + baseUrl + '/images/resource/' + $data[i].resourceId + '.jpg">' } else { string += '<img class="resImg headRadius" src="../images/default-resource.jpg">' } string += '</div><div class="mui-media-body">' string += '<span class="listtit">' + $data[i].resourceName + '</span>' string += '<p class="listtit2">' + $data[i].supportedServices + '</p>' string += '<p class="listtit3 resbrief">' if($data[i].descp) { string += $data[i].descp; } string += '</p></div></a></li>' html.push(string); } document.getElementById("resourceList").innerHTML = html.join(''); } /*获取个人信息*/ function personalMessage() { mui.ajax(baseUrl + "/ajax/professor/info/" + proId, { dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 timeout: 10000, //超时设置 success: function(data) { plus.nativeUI.closeWaiting(); plus.webview.currentWebview().show("slide-in-right", 150); var $data = data.data; personalMaterial[0].innerText = $data.name; //基本信息 if($data.consultCount){ document.getElementsByClassName("consultCount")[0].innerText = $data.consultCount; }else{ document.getElementById("accessHistory").style.display="none"; } var startLeval = parseInt($data.starLevel); var start = document.getElementsByClassName("start"); for(var i = 0; i < startLeval; i++) { start[i].classList.add("icon-favorfill"); start[i].classList.remove("icon-favor"); } if($data.hasHeadImage) { document.getElementsByClassName("headimg")[0].src = baseUrl + "/images/head/" + $data.id + "_l.jpg"; } else { document.getElementsByClassName("headimg")[0].src = "../images/default-photo.jpg"; } if($data.authType) { nameli.classList.add('icon-vip'); nameli.classList.add('authicon-cu'); } else { if($data.authStatus){ if($data.authentication==1){ nameli.classList.add('icon-renzheng'); nameli.classList.add('authicon-mana'); //nameli.innerHTML="<span>科研</span>"; }else if($data.authentication==2){ nameli.classList.add('icon-renzheng'); nameli.classList.add('authicon-staff'); //nameli.innerHTML="<span>企业</span>"; }else{ nameli.classList.add('icon-renzheng'); nameli.classList.add('authicon-stu'); //nameli.innerHTML="<span>学生</span>"; } } } if($data.office) { if($data.title) { personalMaterial[1].innerText = $data.office + ","; } else { personalMaterial[1].innerText = $data.office; } } if($data.title) { personalMaterial[2].innerText = $data.title; } if($data.orgName) { if($data.department) { personalMaterial[3].innerText = $data.orgName + " , "; } else { personalMaterial[3].innerText = $data.orgName; } } if($data.department) { if($data.address) { personalMaterial[4].innerText = $data.department + " | "; } else { personalMaterial[4].innerText = $data.department; } } if($data.address) { personalMaterial[5].innerText = $data.address; } //个人简介 if($data.descp) { personSummary.innerHTML = $data.descp; } else { document.getElementById("professorBreifinfo").style.display = "none"; } //学术领域 if($data.subject) { subjectShow($data.subject); } else { document.getElementById("professorInfosubject").style.display = "none"; } //研究方向 if($data.researchAreas.length) { researchAreaShow($data.researchAreas, $data.editResearchAreaLogs); } else { document.getElementById("professorReserachMess").style.display = "none"; } //应用行业 if($data.industry) { industryShow($data.industry); } else { document.getElementById("professorinfoapply").style.display = "none"; } //专家资源 if($data.resources.length) { professorResource($data.resources); } else { document.getElementById("professorresourceList").style.display = "none"; } //如无详细内容数据,隐藏详细点击的按钮 if(!$data.edus.length && !$data.jobs.length && !$data.projects.length && !$data.papers.length && !$data.patents.length && !$data.honors.length) { document.getElementById("detailProfessor").style.display = "none"; } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); return; } }); } //修改详细页面 document.getElementsByClassName("gotonext")[0].addEventListener("tap", function() { var nwaiting = plus.nativeUI.showWaiting(); var web = plus.webview.create("../html/proinforbrow-more.html", "proinforbrow-more.html", {}, { pro: proId }); //后台创建webview并打开show.html web.addEventListener("loaded", function() {}, false); }); //点赞 var clFlag = 1; mui(".reserachMess").on("click", ".plusbtn", function() { if(userid && userid != null && userid != "null") { if(clFlag) { clFlag = 0; } else { return; } if(this.getAttribute("data-isagree") > -1) { this.classList.remove("icon-appreciatefill"); this.classList.add("icon-appreciate"); } else { this.classList.add("icon-appreciatefill"); //this.classlist.remove("plusbtn"); } mui.ajax(this.getAttribute("data-isagree") > -1 ? baseUrl + "/ajax/researchArea/unAgree" : baseUrl + "/ajax/researchArea/agree", { "type": "POST", "data": { "targetId": this.getAttribute("data-pid"), "targetCaption": this.getAttribute("data-caption"), "opId": userid }, "contentType": "application/x-www-form-urlencoded", "success": function($data) { if($data.success) { mui.ajax(baseUrl + "/ajax/professor/info/" + proId, { dataType: 'json', //数据格式类型 type: 'GET', //http请求类型 timeout: 10000, //超时设置 success: function(data) { clFlag = 1; var $data = data.data; //研究方向 document.getElementsByClassName("reserachMess")[0].innerHTML = ""; if($data.researchAreas.length) { researchAreaShow($data.researchAreas, $data.editResearchAreaLogs); } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); return; } }); } } }) } else { plus.nativeUI.toast("请先登录"); } }) personalMessage(); /*进入资源详细页面*/ mui("#resourceList").on('tap', 'li', function() { var resouId = this.getAttribute("resouseId"); plus.nativeUI.showWaiting(); plus.webview.create("../html/resinforbrow.html", 'resinforbrow.html', {}, { resourceId: resouId }); }); /*咨询成功,返回专家信息*/ window.addEventListener('backproinfo', function(event) { var proid = event.detail.proId; console.log(proid); /*ozixun.classList.add('displayNone');*/ }); ifCollection(); yesExpert.addEventListener('tap', function() { var $this = this; if(userid && userid != null && userid != "null") { collectionExpert($this); } else { plus.nativeUI.toast("请先登录"); } }); noExpert.addEventListener('tap', function() { var $this = this; cancelCollectionExpert($this); }); /*判断是非收藏专家*/ function ifCollection() { mui.ajax(baseUrl + '/ajax/watch/hasWatch', { data: { "professorId": userid, "watchObject": proId }, dataType: 'json', //数据格式类型 type: 'get', //http请求类型 timeout: 10000, async: false, success: function(data) { if(data.success && data.data != null) { yesExpert.style.display = "none"; noExpert.style.display = "block"; returnId = data.data.watchObject; } else { yesExpert.style.display = "block"; noExpert.style.display = "none"; } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); } }); } /*收藏专家*/ function collectionExpert($this) { mui.ajax(baseUrl + '/ajax/watch', { data: { "professorId": userid, "watchObject": proId, "watchType": 1 }, dataType: 'json', //数据格式类型 type: 'POST', //http请求类型 timeout: 10000, async: false, success: function(data) { console.log(data.success) if(data.success) { $this.style.display = "none"; noExpert.style.display = "block"; returnId = data.data; //console.log(returnId) plus.nativeUI.toast("专家关注成功", toastStyle); } }, error: function() { plus.nativeUI.toast("服务器链接超时", toastStyle); } }); } /*取消收藏专家*/ function cancelCollectionExpert($this) { //console.log(returnId) // console.log(userid) mui.ajax({ url: baseUrl + '/ajax/watch/delete', data: { professorId: userid, watchObject: returnId }, dataType: 'json', //数据格式类型 type: 'post', //http请求类型 timeout: 10000, async: true, success: function(data) { console.log(data.success) if(data.success) { $this.style.display = "none"; yesExpert.style.display = "block"; plus.nativeUI.toast("取消关注成功", toastStyle); } }, error: function(data) { plus.nativeUI.toast("服务器链接超时", toastStyle); } }); } /*专家的历史和评价*/ document.getElementById("accessHistory").addEventListener('tap', function() { mui.openWindow({ url: '../html/coophistory-other.html', id: 'html/coophistory-other.html', show: { autoShow: false, }, extras: { professorId: proId } }); }) });