123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- var feedbackType, //记录是申诉,还是反馈
- code;
- mui.init();
- mui.plusReady(function(){
- var self = plus.webview.currentWebview();
- feedbackType = self.type;
- code = self.code;
- getDetail();
- createTemplateHelper();
- bindEvents();
- });
- function getDetail(){
- var url = "";
- if(feedbackType == 1){
- url = "/doctorFeedback/feedback/findByCode";
- $("#header").text('申诉详情');
- }else if(feedbackType == 2){
- url = "/doctor/feedback/findByCode";
- $("#header").text('反馈详情');
- }
- plus.nativeUI.showWaiting();
- var params = {code : code};
- sendGet(url, params, null, function(res){
- if(res.status == 200){
- var feedbackName = "申诉";
- if(feedbackType == 2){
- feedbackName = "反馈";
- }
- if(res.data){
- $.extend(res.data, {feedbackName: feedbackName, feedbackType: feedbackType});
- if(res.data.images){
- var imgList = res.data.images.split(",");
- res.data.imgList = imgList;
- }
- var html = template('tmp', res.data);
- $("#content").empty().append(html);
- mui.previewImage();
- }else{
- mui.toast("程序出了点小问题")
- }
- }else{
- mui.toast(res.msg)
- }
- plus.nativeUI.closeWaiting();
- }, true)
- }
- function bindEvents(){
- $("#content").on('click', '#applyAgain', function(){
- if(feedbackType == 1){
- openWebview('account_back.html');
- }else{
- // openWebview('feedback.html');
- mui.openWindow({
- url: 'feedback.html',
- id: 'feedback2.html', //区分之前打开的反馈填写页面
- extras: {
- noList: true
- }
- })
- }
-
- })
- }
- function createTemplateHelper(){
- template.helper('getTypeValue', function(type){
- if(feedbackType == 1){
- switch(type){
- case 1:
- return "手机号变更";
- break;
- case 2:
- return "重置密码";
- break;
- case 3:
- return "其他";
- break;
- default:
- return "";
- break;
- }
- }else if(feedbackType == 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);
- })
- }
|