123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- 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 = '<div class="delimgpop"><div class="del-img-box"><div class="del-img-con"><img class="del-pop-img" src="' + thissrc + '" style="max-width:' + mWid + 'px; max-height:' + mHei + 'px;"></div></div></div>';
- $("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;
- case 5:
- return "举报";
- break;
- case 6:
- return "投诉";
- break;
- case 7:
- 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();
- }
- }
|