xiugaidizhi.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>修改详细地址</title>
  6. <meta name="author" content="yihu.com" />
  7. <meta name="format-detection" content="telephone=no" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  9. <meta name="apple-mobile-web-app-capable" content="yes" />
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  11. <link rel="stylesheet" href="../../../css/cross.css">
  12. <link rel="stylesheet" href="../../../css/cross.ui.css">
  13. <link rel="stylesheet" href="../css/shenfenyanzheng.css" type="text/css" />
  14. </head>
  15. <body style="background: #f3f3f3;">
  16. <div class="c-main mui-content">
  17. <ul class="n-list edit-list c-border-tb mt10">
  18. <li class="n-list-cover">
  19. <div class="n-list-key w3em c-f16">详细地址</div>
  20. <div class="n-list-info pl10 mui-input-row">
  21. <input id='address' type="text" class="ajax c-input width-100 mui-input-clear pr40 c-f16" placeholder="" />
  22. </div>
  23. </li>
  24. </ul>
  25. <div class="plr10 mt15 pb20">
  26. <a onclick="submit()" class="c-btn c-btn-full c-btn-4dcd70 border-radius-rounded" id="next_step">确认提交</a>
  27. </div>
  28. </div>
  29. <script src="../../../js/jquery/2.1.3/jquery.js"></script>
  30. <script type="text/javascript" src="../../../js/mui.min.js"></script>
  31. <script type="text/javascript" src="../../../js/app.js" ></script>
  32. <script type="text/javascript" src="../../../js/weixin_common.js" ></script>
  33. <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  34. <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
  35. <script src="../../../js/security.js" type="text/javascript" charset="utf-8"></script>
  36. <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
  37. <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
  38. <script>
  39. var dd = dialog({contentType:'load', skin:'bk-popup', content:'保存中...'});
  40. var Request = new Object();
  41. Request = GetRequest();
  42. var openid = Request["openid"];
  43. var type = Number(Request["type"]);
  44. var mobile1 = Request["mobile"];
  45. $(function (){
  46. var paramAgent = $.parseJSON(window.localStorage.getItem("paramAgent", paramAgent));
  47. $('#address').val(decodeURI(paramAgent.address));
  48. var userAgent = window.localStorage.getItem(agentName);
  49. if(userAgent){
  50. var paurl = "";
  51. if(type == 0){
  52. paurl = "wx/html/home/html/login.html?type=0&openid=" + openid;
  53. }
  54. else{
  55. if(mobile1){
  56. paurl = "wx/html/home/html/login.html?type=" + type + "&openid=" + openid + "&mobile=" + mobile1;
  57. }
  58. else{
  59. paurl = "wx/html/home/html/login.html?type=" + type + "&openid=" + openid;
  60. }
  61. }
  62. //从后台那边获取签名等信息
  63. var params = {};
  64. params.pageUrl = window.location.href;
  65. $.ajax(server + "weixin/getSign", {
  66. data: params,
  67. dataType: "json",
  68. type: "post",
  69. success: function(res){
  70. if (res.status == 200) {
  71. var t = res.data.timestamp;
  72. var noncestr = res.data.noncestr;
  73. var signature = res.data.signature;
  74. wx.config({
  75. //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  76. appId: appId, // 必填,公众号的唯一标识
  77. timestamp: t, // 必填,生成签名的时间戳
  78. nonceStr: noncestr, // 必填,生成签名的随机串
  79. signature: signature,// 必填,签名,见附录1
  80. jsApiList: [
  81. // 'closeWindow'
  82. ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  83. });
  84. }
  85. }
  86. });
  87. }
  88. else{
  89. if(!openid){
  90. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'openid获取失败'}).show();
  91. }
  92. }
  93. })
  94. function submit(){
  95. dd.showModal();
  96. var params = {};
  97. params.address = $("#address").val();
  98. sendPost('patient/save', params, 'json', 'post', operateFailed, operateSuccesss);
  99. }
  100. //失败
  101. function operateFailed(res) {
  102. dd.close();
  103. if (res && res.msg) {
  104. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
  105. } else {
  106. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'修改地址失败'}).show();
  107. }
  108. }
  109. //成功调用登录接口
  110. function operateSuccesss(res) {
  111. if (res.status == 200) {
  112. dd.close();
  113. dialog({
  114. content: '修改地址成功',
  115. okValue:'确定',
  116. ok: function (){
  117. window.location.href = "my-detail.html?type=" + type + "&openid=" + openid;
  118. }
  119. }).showModal();
  120. } else {
  121. //非200则为失败
  122. operateFailed(res);
  123. }
  124. }
  125. </script>
  126. </body>
  127. </html>