sso

create_app.js 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. $(function() {
  2. $("#create_patient_manage_btn").click(function() {
  3. if ($("#create_patient_manage_btn").prop("disabled") == true) {
  4. return;
  5. }
  6. var postData = {
  7. app_type: 1
  8. }
  9. postRequest("/org/app/create/submit", postData, doSuccess, doFail);
  10. function doSuccess(res) {
  11. if (res.state == 0) {
  12. serverErrorMsg(res);
  13. return;
  14. }
  15. layer.msg("开通成功");
  16. var patient_manage_address = "http://jk.kuyicloud.com";
  17. $("#create_patient_manage_btn").attr("disabled", true);
  18. $("#create_patient_manage_btn").addClass("btn_enter");
  19. $("#create_patient_manage_btn").removeClass("btn_primary");
  20. $("#create_patient_manage_btn").hide();
  21. $("#patient_manage_link").attr("href", patient_manage_address);
  22. $("#patient_manage_link").addClass("btn_primary");
  23. $("#patient_manage_link").removeClass("btn_enter");
  24. $("#patient_manage_link").show();
  25. }
  26. });
  27. $("#create_dialysis_manage_btn").click(function() {
  28. if ($("#create_dialysis_manage_btn").prop("disabled") == true) {
  29. return;
  30. }
  31. var postData = {
  32. app_type: 3
  33. }
  34. postRequest("/org/app/create/submit", postData, doSuccess, doFail);
  35. function doSuccess(res) {
  36. if (res.state == 0) {
  37. serverErrorMsg(res);
  38. return;
  39. }
  40. layer.msg("开通成功");
  41. var dialysis_manage_address = "http://xt.test.sgjyun.com";
  42. $("#create_dialysis_manage_btn").attr("disabled", true);
  43. $("#create_dialysis_manage_btn").addClass("btn_enter");
  44. $("#create_dialysis_manage_btn").removeClass("btn_primary");
  45. $("#create_dialysis_manage_btn").hide();
  46. $("#dialysis_manage_link").attr("href", dialysis_manage_address);
  47. $("#dialysis_manage_link").addClass("btn_primary");
  48. $("#dialysis_manage_link").removeClass("btn_enter");
  49. $("#dialysis_manage_link").show();
  50. }
  51. });
  52. });
  53. function doFail(res) {
  54. serverErrorMsg(res);
  55. }