var d = dialog({contentType:'load', skin:'bk-popup'}); var request = GetRequest(), type = request.type, // 1-申诉,2-反馈 code = request.fdCode; var pagetype = 0; if(type == 1){ document.title = "申诉详情"; }else{ document.title = "反馈详情"; } $(function(){ if(type == 2){ checkUserAgent(); }else{ queryInit(); } }); function queryInit(){ getDetail(); getTemplateHelper(); bindEvents() } function getDetail(){ d.show(); var url = "/patient/feedback/findByCode"; if(type == 1){ url = "/patientFeedback/feedback/findByCode"; } var params = {code: code}; sendPost(url, params, 'json', 'get', queryFailed, function(res){ if(res.status == 200){ var feedbackName = "申诉"; if(type == 2){ feedbackName = "反馈"; } $.extend(res.data, {feedbackName: feedbackName, feedbackType: type}); if(res.data.images){ var imgList = res.data.images.split(","); res.data.imgList = imgList; } var html = template('tmp', res.data); $("#content").empty().append(html); d.close(); }else{ queryFailed(res); } }); } //查看图片 function viewImg(dom) { var $img = $(dom); var thissrc = $img.attr("src"); var mWid = $(window).width(); var mHei = $(window).height(); var nHtml = '
'; $("body").append(nHtml); $(".delimgpop").click(function() { $(this).remove() }); } function bindEvents(){ $("#content").on("click", "#applyAgain", function(){ if(type == 1){ window.location.href = "account_back.html"; }else{ window.location.href = "feedback.html"; } }); } function getTemplateHelper(){ template.helper('getTypeValue', function(type, fdType){ if(fdType == 1){ switch(type){ case 1: return "手机号变更"; break; case 2: return "重置密码"; break; case 3: return "其他"; break; default: return ""; break; } }else if(fdType == 2){ switch(type){ case 1: return "优化建议"; break; case 2: return "提交bug"; break; case 3: return "新功能建议"; break; case 4: return "其他"; break; default: return ""; break; } } }); template.helper("getStatus", function(status){ switch(status){ case 0: return "未读"; break; case 1: return "待处理"; break; case 2: return "已处理"; break; } }) template.helper('getImgUrl', function(url){ return getImgUrl(url); }) } function queryFailed(res){ d.close(); if (res && res.msg) { dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show(); }else{ dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show(); } }