service.js 975 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. var service = {
  2. hasUnfinishedConsult: function(doctor, callBack){
  3. sendPost("doctor/consult/hasUnfinished",
  4. {doctorCode: doctor}, null, function(res){
  5. if(res.status==200){
  6. if(callBack) callBack(res);
  7. } else {
  8. mui.toast("程序开了点小差, 请稍后重试!");
  9. }
  10. })
  11. },
  12. isConsultFinished: function(consult, callBack){
  13. sendPost("doctor/consult/isConsultFinished",
  14. {consult: consult}, function(res){
  15. if(res=="timeout"){//超时
  16. if(callBack) callBack(res);
  17. }
  18. }, function(res){
  19. if(res.status==200){
  20. if(callBack) callBack(res);
  21. } else {
  22. mui.toast("程序开了点小差, 请稍后重试!");
  23. }
  24. },undefined,10000)
  25. },
  26. //添加快捷回复
  27. replyAdd: function(content, callBack){
  28. sendPost("doctor/reply/add",
  29. {content: content}, null, function(res){
  30. if(res.status==200){
  31. callBack? callBack(res) : mui.toast("添加成功!");
  32. } else {
  33. mui.toast("添加失败!");
  34. }
  35. })
  36. }
  37. }