Problemi 0 Pull Requests 0 Commit 1523 Rilasci 0 Wiki

40 Commits (14be9cd417462f01eeac69c5cefb898aff1f142e)

Autore SHA1 Messaggio Data
  luyanan 0f66043158 反馈的bug 6 anni fa
  LIPENGTAO1313 eed809a50d 1 6 anni fa
  LIPENGTAO1313 19c4bea962 xiuz 6 anni fa
  luyanan 11bc56c74a 浏览页企业信息显示bug,企业工作台中相关列表样式统一 6 anni fa
  luyanan ad6b065b34 修改工作台菜单权限 6 anni fa
  luyanan b73ac29a1c 改版员工,修改企业主页、,修改文章发布、新增上传附件 6 anni fa
  XMTT 84cebf3dc1 文章接口变动 6 anni fa
  luyanan 51d486a199 删除之前废弃咨询模块 6 anni fa
  luyanan 807ab1da13 修改留言样式 6 anni fa
  luyanan 90b4a3d853 专利ad显示 6 anni fa
  luyanan 8b3e9002c0 广告统一整理,右侧广告滚动效果 6 anni fa
  li 5ffb74897f 留言收尾 6 anni fa
  li b6d1335b3b 接口参数更改 6 anni fa
  li c858b5fef0 企业上传执照bug 7 anni fa
  li 4ae65acbad 去掉请求超时 7 anni fa
  luyanan ba09a20057 广告位模块的提取,便于维护更新 7 anni fa
  jack f566467ae9 1 7 anni fa
  jack e516767fff 11 7 anni fa
  luyanan c8773b04cf h5 首页搜索以及各个页面判断是否为移动端跳转H5页面 7 anni fa
  jack f8efc336e4 11 7 anni fa
  jack 4dee309962 1 7 anni fa
  jack fd2463dfbc 1 7 anni fa
  jack 2a9cd21221 1 7 anni fa
  jack df593361ea 1 7 anni fa
  jack 5fc459cf3f 1 7 anni fa
  jack 790260ba4d 1 7 anni fa
  jack 8fa891a58c 1 7 anni fa
  jack c009de9d9a 1 7 anni fa
  jack 29cb670643 1 7 anni fa
  jack 98b34378a3 11 7 anni fa
  jack c6cbb65612 1 7 anni fa
  jack 92e8c9b091 1 7 anni fa
  jack 9d440d0582 11 7 anni fa
  jack 0b08d35892 1 7 anni fa
  jack c995257df9 111 7 anni fa
  jack 99a6c97de8 11 7 anni fa
  jack a0858baae8 1 7 anni fa
  jack 47b1ac40f8 11 7 anni fa
  jack f144da22cf 11 7 anni fa
  jack 66667ac865 yy 7 anni fa
ekexiu.app - Gogs: Go Git Service

暂无描述

consultlist.js 11KB

    //咨询 mui.ready(function() { var pageIndex = 1; // 页数 var allPages = 1; // 总页数 var listContainer = document.getElementById("listContainer");//咨询列表容器 var oneedval = document.getElementById("needval");//咨询/需求 var otypeval = document.getElementById("typeval");//咨询类型 var ostateval = document.getElementById("stateval");//咨询状态 var osortval = document.getElementById("sortval");//时间排序 mui.plusReady(function(){ var userid = plus.storage.getItem('userid'); allData(userid,0,'',0,0);//默认加载 /*全部的咨询列表*/ function allData(userid,consultOrNeed,consultType,status,timeType) { var params = { "professorId":userid, //专家ID "consultOrNeed":consultOrNeed, //接受咨询或咨询别人的状态值,0-全部,1-别人咨询我的,2-我咨询别人的 默认为0 "consultType":consultType, //咨询类型(技术咨询、资源咨询、其他事务) "status":status, //查询状态 0-全部,1-进行中,2-未感谢,3-未评价,4-已完成, 可以不传,默认为0 "timeType":timeType, //排序类型 0-按发起时间正序,1-按最后回复时间倒序,2-按完成时间倒序 默认为1 "pageSize":5, //每页记录数 默认为5 "pageNo":pageIndex //当前页码 默认为1 }; mui.ajax(baseUrl +'/ajax/consult/pq',{ data:params, dataType:'json',//服务器返回json格式数据 type:'get',//HTTP请求类型 async:false, timeout:10000,//超时时间设置为10秒; success:function(data){ if(data.success){ var nwaiting = plus.nativeUI.showWaiting();//显示原生等待框 /*listContainer.innerHTML = '';*/ if(pageIndex == 1) { //下拉刷新需要先清空数据 listContainer.innerHTML = ''; // 在这里清空可以防止刷新时白屏 } var myData = data.data.data; var allStr = handleData(userid,myData,'all'); if(allStr){ nwaiting.close(); } listContainer.innerHTML = allStr; } }, error:function(xhr,type,errorThrown){ mui.toast('加载失败'); } }); }; mui.init({ pullRefresh : { container:'#refreshContainer', up : { auto:true,//可选,默认false.自动上拉加载一次 contentrefresh : "正在加载...", callback :pullfresh } } }); function pullfresh() { console.log('pullupRefresh'); pageIndex = ++pageIndex; console.log(oneedval.value+otypeval.value+ostateval.value+osortval.value); setTimeout(function() { allData(userid,oneedval.value,otypeval.value,ostateval.value,osortval.value); }, 1000); this.endPullupToRefresh(true|false); }; //点击选择 function checkedFun(i){ mui("#middlePopover"+i).on('tap','.mui-navigate-right',function(e){ document.getElementById("headck"+i).innerHTML = this.innerHTML; var value = this.getAttribute("ck"+i); document.getElementById("headck"+i).setAttribute('headck',value); document.querySelector('.mui-backdrop').style.display = 'none'; document.getElementById("middlePopover"+i).style.display = 'none'; var consultType; if(document.getElementById("headck2").getAttribute('headck') == 0){ consultType = ''; }else { consultType = document.getElementById("headck2").innerHTML; } //去掉样式类mui-active,要不然会多点击一次 oneedval.value = document.getElementById("headck1").getAttribute('headck'); otypeval.value = consultType; ostateval.value = document.getElementById("headck3").getAttribute('headck'); osortval.value = document.getElementById("headck4").getAttribute('headck'); /*allData(userid,consultOrNeed,consultType,status,timeType) * userid:专家id * consultOrNeed:接受咨询或咨询别人的状态值,0-全部,1-别人咨询我的,2-我咨询别人的 默认为0 * consultType:咨询类型(技术咨询、资源咨询、其他事务) * status:查询状态 0-全部,1-进行中,2-未感谢,3-未评价,4-已完成, 可以不传,默认为0 * timeType:排序类型 0-按发起时间正序,1-按最后回复时间倒序,2-按完成时间倒序 默认为1 */ /*var listdata = allData(userid,oneedval.value,otypeval.value,ostateval.value,osortval.value);*/ allData(userid,oneedval.value,otypeval.value,ostateval.value,osortval.value); }); }; checkedFun(1); checkedFun(2); checkedFun(3); checkedFun(4); /*咨询数据处理*/ function handleData(userid,data,manFlag) { var htmlStr = ''; for(var i = 0; i < data.length;i++){ var title, zhicehng, zhiwei, address, lastReply, status, lastReplyTime, lastReplyCon, unreadCount, unreadStyle, proModify, photoUrl, consultType; //咨询类型和状态 if(data[i]['consultantId'] != userid){//收到咨询 title = "回复:关于" + data[i]["consultTitle"] + "的咨询"; if(data[i]["consultStatus"] == 0){ status = "进行中"; }else if(data[i]["consultStatus"] == 1){ status = "已完成"; } }else if(data[i]['consultantId'] == userid){//我的需求 title = "关于" + data[i]["consultTitle"] + "的咨询"; if(data[i]["consultStatus"] == 0){ status = "进行中"; }else if(data[i]["consultStatus"] == 1){ if(data[i]["assessStatus"] == 0){ status = '待评价'; }else { status = '已完成'; } } } //专家职称 if(!data[i]["professor"]["title"]){ zhicehng = ''; }else { zhicehng = data[i]["professor"]["title"]+','; } //专家职位 if(!data[i]["professor"]["office"]){ zhiwei = ''; }else { zhiwei = data[i]["professor"]["office"] + ','; } //专家所在地 if(!data[i]["professor"]["address"]){ address = ''; }else { address = '|'+ data[i]["professor"]["address"]; } //专家认证 if(data[i]["professor"]["authentication"] == true){ proModify = 'authicon'; }else { proModify = 'unauthicon'; } //专家头像 if(data[i]["professor"]["hasHeadImage"] == 0){ photoUrl = "../images/default-photo.jpg"; }else{ photoUrl = "../images/head/"+data[i]["professor"]["id"]+"_m.jpg"; }; //咨询类型,只取两个字 if(data[i]["consultType"]) { consultType = data[i]["consultType"].substr(0,2); } //最后回复 lastReplyTime = lastReplyFn(userid,data[i]["consultId"]).lastReplyTime; lastReplyCon = lastReplyFn(userid,data[i]["consultId"]).lastReplyCon; if(lastReplyCon == undefined){ lastReplyCon = ''; } if(lastReplyTime == undefined){ lastReplyTime = ''; } //未读消息 unreadCount = unreadConsultFn(userid,data[i]["consultId"],i).unreadCount; unreadStyle = unreadConsultFn(userid,data[i]["consultId"],i).style; htmlStr += '<li class="mui-table-view-cell mui-media"><div class="coutopicbox">'; htmlStr += '<span class="coutheme mui-ellipsis mui-pull-left">'+title+'</span>'; htmlStr += '<div class="coustatus mui-pull-right"><span class="aimlabel">'+consultType+'</span>'; htmlStr += '<span class="status-1">'+status+'</span></div></div>'; htmlStr += '<a class="proinfor itemBtn" consultId="'+data[i]["consultId"]+'" consultantId="'+data[i]["consultantId"]+'" manFlag="'+manFlag+'">'; htmlStr += '<span class="mui-badge mui-badge-danger" style="'+unreadStyle+'">'+unreadCount+'</span>'; htmlStr += '<img class="mui-media-object mui-pull-left headimg headRadius" src="'+photoUrl+'">'; htmlStr += '<div class="mui-media-body">'; htmlStr += '<span class="listtit">'+data[i]["professor"]["name"]+'<em class="mui-icon iconfont icon-vip '+proModify+'"></em><span class="thistime">'+lastReplyTime+'</span></span>'; htmlStr += '<p class="listtit2"><span>'+zhicehng+'</span><span>'+zhiwei+'</span><span>'+data[i]["professor"]["orgName"]+'</span><span>'+address+'</span></p>'; htmlStr += '<p class="listtit3">'+lastReplyCon+'</p>'; htmlStr += '</div></a></li>'; }; return htmlStr; }; /*最后回复*/ function lastReplyFn(sendId,consultId){ var lastReplyTimeData,lastReplyTime,lastReplyCon; mui.ajax(baseUrl + '/ajax/tidings/qaLastRevovery',{ data:{ "consultId":consultId, //咨询ID "senderId":sendId //登录者ID }, dataType:'json',//服务器返回json格式数据 type:'get',//HTTP请求类型 timeout:10000,//超时时间设置为10秒; async:false, success:function(data){ /*console.log(data);*/ if(data["data"] == null || data["data"] == "" || data["data"] == undefined){ lastReplyTimeData = ''; lastReplyTime = ''; lastReplyCon = ''; } else{ lastReplyTimeData = data["data"]["createTime"]; lastReplyTime =lastReplyTimeData.substr(0,4) + "-" + lastReplyTimeData.substr(4,2) + "-" + lastReplyTimeData.substr(6,2) + " " + lastReplyTimeData.substr(8,2)+ ":" +lastReplyTimeData.substr(10,2); lastReplyCon = data["data"]["tidingsContant"]; } }, error:function(xhr,type,errorThrown){ } }); return { "lastReplyTime":lastReplyTime, "lastReplyCon":lastReplyCon }; }; /*未读消息*/ function unreadConsultFn (senderId,consultId,i){ var unreadCount,style; mui.ajax(baseUrl +'/ajax/tidings/qaNotReadTidings',{ data:{ "senderId":senderId, //发送者ID "consultId":consultId //咨询ID }, dataType:'json',//服务器返回json格式数据 type:'get',//HTTP请求类型 timeout:10000,//超时时间设置为10秒; async:false, success:function(data){ unreadCount = data["data"]; if(unreadCount == 0){ style = "display:none;" }else{ style = "display:block;" } }, error:function(xhr,type,errorThrown){ } }); return {"unreadCount":unreadCount, "style":style } }; //打开新页面 mui("#listContainer").on('tap','.itemBtn',function(){ /*console.log(this.getAttribute("consultId")); var nwaiting = plus.nativeUI.showWaiting(); var consultId = this.getAttribute("consultId"); var consultantId = this.getAttribute("consultantId"); console.log(consultId); console.log(consultantId); webviewShow = plus.webview.create("../html/chats.html",{consultId:consultId,consultantId:consultantId}); webviewShow.addEventListener("loaded", function() { nwaiting.close(); //新webview的载入完毕后关闭等待框 webviewShow.show("slide-in-right",150); //把新webview窗体显示出来,显示动画效果为速度150毫秒的右侧移入动画 }, false);*/ mui.openWindow({ id:'chats.html', url:'chats.html', extras:{ 'manFlag':this.getAttribute("manFlag"), 'consultId':this.getAttribute("consultId"),//自定义扩展参数,可以用来处理页面间传值 'consultantId':this.getAttribute("consultantId")//咨询者id } }); }); }); });