account-safe.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var userAgent = window.localStorage.getItem(agentName);
  2. var firstUid = window.localStorage.getItem("firstUid");
  3. var d1 = dialog({contentType:'load', skin:'bk-popup',content:'退出中..'});
  4. var jsonstr = $.parseJSON(userAgent);
  5. var openid = jsonstr.openid;
  6. if(firstUid == null || firstUid == undefined){
  7. $('.div-qiehuan-account').hide()
  8. }
  9. appendFamilyMember($('#memberContainer'), function() {
  10. var jsonstr = $.parseJSON(window.localStorage.getItem(agentName));
  11. if(jsonstr.uid == jsonstr.represented) {
  12. $('.div-qiehuan-account').show()
  13. } else {
  14. $('.div-qiehuan-account').hide()
  15. }
  16. }, function() {
  17. //判断有授权家人,修改样式
  18. if($('#memberContainer').is(':hidden')) {
  19. $('#content').css('padding-top', '0px');
  20. } else {
  21. $('#content').css('padding-top', '90px');
  22. }
  23. });
  24. function goPage(url){
  25. window.location.href = url
  26. }
  27. function logout(){
  28. dialog({
  29. content:'您确定继续退出登录吗?',
  30. ok: function (){
  31. d1.show()
  32. sendPost("patient/wxloginout",{},"JSON","POST",function(res){
  33. d1.close()
  34. if (res && res.msg) {
  35. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  36. } else {
  37. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'退出登录失败!'}).show();
  38. }
  39. },function(res){
  40. d1.close()
  41. if(res.status==200){
  42. clearAgent();
  43. window.localStorage.removeItem("isTiXingVideoFaSong");//清除咨询详情移动网络下,用户点击不再提醒后的处理,换账号登陆后,还可以重新提醒
  44. var url = window.location.href;
  45. saveAgentPage(url);
  46. location.replace("../../home/html/login.html?openid="+openid+"&loginType=password");
  47. }else{
  48. if (res && res.msg) {
  49. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  50. } else {
  51. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'退出登录失败!'}).show();
  52. }
  53. }
  54. })
  55. },
  56. cancel: function () {
  57. return;
  58. }
  59. }).showModal();
  60. }