edit-profile-sms.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <!DOCTYPE html>
  2. <html lang=zh-cn>
  3. <head>
  4. <meta charset=utf-8>
  5. <title>纵横计量支付系统</title>
  6. <meta name=description content=计量支付>
  7. <meta name=copyright content=smartcost.com.cn>
  8. <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
  9. <link rel=stylesheet href={{rootUrl}}global/css/style.css>
  10. <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
  11. <script src={{rootUrl}}global/js/bootstrap.js></script>
  12. <script src={{rootUrl}}global/js/jl.js></script>
  13. <script src={{rootUrl}}global/js/jquery.cookie.min.js></script>
  14. </head>
  15. <body>
  16. <!-- include "top" -->
  17. <div class="wrapContent">
  18. <!-- include "left" -->
  19. <div class="mainContainer">
  20. <!--内容-->
  21. <div class="mainContent">
  22. <div class="title clearfix">
  23. <div class="fR">
  24. <a class="btn btn-link" href="http://smartcost.com.cn/product/19" target="_blank"><i class="icon-question-sign"></i>&nbsp;帮助</a>
  25. </div>
  26. </div>
  27. <div class="form">
  28. <form class="form-horizontal">
  29. <legend>短信通知</legend>
  30. <!-- if {{smsNoticeSwitch}} < 1 -->
  31. <!--管理员关闭功能-->
  32. <div class="alert alert-error">
  33. 短信通知功能已被关闭。
  34. </div>
  35. <!--管理员关闭功能-->
  36. <!-- else -->
  37. <!-- if {{uprofile.isnotice}} < 1 -->
  38. <!--初次使用-->
  39. <div class="alert alert-info">
  40. 初次使用,请先添加用于接收通知的手机号码。
  41. </div>
  42. <div id="input_error" class="control-group">
  43. <label class="control-label" for="inputEmail">添加手机</label>
  44. <div class="controls">
  45. <input id="mobile" name="mobile" type="text" placeholder="输入您的新手机号码"><span id="help-inline"
  46. class="help-inline hide"></span>
  47. </div>
  48. </div>
  49. <div class="control-group">
  50. <label class="control-label" for="inputEmail">短信校验码</label>
  51. <div class="controls">
  52. <input type="text" id="verifycode" name="verifycode" placeholder="输入验证码" maxlength="11"
  53. class="span2">
  54. <input type="button" class="btn" id="getting" value="获取验证码">
  55. </div>
  56. </div>
  57. <div class="control-group">
  58. <label class="control-label"></label>
  59. <div class="controls">
  60. <i class="icon-ok icon-white"></i><input type="button" id="addMobile"
  61. class="btn btn-primary" value="确定添加"/>
  62. </div>
  63. </div>
  64. <!--初次使用-->
  65. <!-- else -->
  66. <!--正常使用-->
  67. <div class="control-group">
  68. <label class="control-label" for="inputEmail">接收手机</label>
  69. <div class="controls">
  70. <input type="text" value="{{uprofile.mobile}}" disabled="">&nbsp;<a
  71. href="{{rootUrl}}user/profile/sms/edit">修改手机</a>
  72. </div>
  73. </div>
  74. <div class="control-group">
  75. <label class="control-label" for="inputEmail">通知类型</label>
  76. <div class="controls">
  77. <label class="checkbox inline">
  78. <input type="checkbox" checked value="option1" disabled> 到我审批
  79. </label>
  80. <label class="checkbox inline">
  81. <input type="checkbox" checked value="option1" disabled> 标段审批通过(上报人接收)
  82. </label>
  83. <label class="checkbox inline">
  84. <input type="checkbox" checked value="option1" disabled> 标段审批不通过(上报人接收)
  85. </label>
  86. </div>
  87. </div>
  88. <!--正常使用-->
  89. <!-- endif -->
  90. <!-- endif -->
  91. </fieldset>
  92. </form>
  93. </div>
  94. </div>
  95. <!--内容-->
  96. </div>
  97. </div>
  98. <script type="text/javascript">autoFlashHeight();</script>
  99. <script type="text/javascript">
  100. $(document).ready(function () {
  101. $("#mobile").blur(function () {
  102. $.ajax({
  103. type: "POST",
  104. dataType: "json",
  105. cache: false,
  106. data: {"mobile": $(this).val()},
  107. url: "{{rootUrl}}user/profile/check/mobile",
  108. success: function(data){
  109. if (data["mobile"] > 0) {
  110. $("#input_error").addClass('error');
  111. $("#help-inline").html('手机号码已被使用');
  112. $("#help-inline").show();
  113. } else {
  114. $("#input_error").removeClass('error');
  115. $("#help-inline").hide();
  116. }
  117. }
  118. });
  119. });
  120. /*仿刷新:检测是否存在cookie*/
  121. if ($.cookie("sms")) {
  122. var count = $.cookie("sms");
  123. var btn = $('#getting');
  124. btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
  125. var resend = setInterval(function () {
  126. count--;
  127. if (count > 0) {
  128. btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
  129. $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
  130. } else {
  131. clearInterval(resend);
  132. btn.val("获取验证码").removeClass('disabled').removeAttr('disabled style');
  133. }
  134. }, 1000);
  135. }
  136. /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
  137. $('#getting').click(function () {
  138. var btn = $(this);
  139. if ($("#mobile").val() == '') {
  140. $("#input_error").addClass('error');
  141. $("#help-inline").html('手机号码不能为空');
  142. $("#help-inline").show();
  143. return false;
  144. }
  145. $.ajax({
  146. type: "POST",
  147. dataType: "json",
  148. cache: false,
  149. data: {"mobile": $("#mobile").val()},
  150. url: "{{rootUrl}}user/profile/check/mobile",
  151. success: function(data){
  152. if (data["mobile"] > 0) {
  153. $("#input_error").addClass('error');
  154. $("#help-inline").html('手机号码已被使用');
  155. $("#help-inline").show();
  156. return false;
  157. } else {
  158. $("#input_error").removeClass('error');
  159. $("#help-inline").hide();
  160. $.ajax({
  161. type: "POST",
  162. dataType: "json",
  163. cache: false,
  164. data: {"mobile": $("#mobile").val()},
  165. url: "{{rootUrl}}user/profile/sms/send/verify",
  166. success: function(data){
  167. if(data["verify"]==true){
  168. var count = 60;
  169. var resend = setInterval(function () {
  170. count--;
  171. if (count > 0) {
  172. btn.val('重新获取 ' + count + 's');
  173. $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
  174. } else {
  175. clearInterval(resend);
  176. btn.val("获取验证码").removeAttr('disabled style');
  177. }
  178. }, 1000);
  179. btn.attr('disabled', true).css('cursor', 'not-allowed');
  180. }
  181. }
  182. });
  183. }
  184. }
  185. });
  186. });
  187. /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
  188. $('#addMobile').click(function () {
  189. $.ajax({
  190. type: "POST",
  191. dataType: "json",
  192. cache: false,
  193. data: {"mobile": $("#mobile").val(), "verifycode": $("#verifycode").val()},
  194. url: "{{rootUrl}}user/profile/sms",
  195. error: function (err) {
  196. alert(err);
  197. },
  198. success: function () {
  199. window.location.href = "{{rootUrl}}user/profile/sms";
  200. }
  201. });
  202. });
  203. });
  204. </script>
  205. </body>