BindCustomerStorePhone.aspx 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BindCustomerStorePhone.aspx.cs" Inherits="LYFZ.WeixinServers.BindCustomerStorePhone" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>云存储手机号码绑定</title>
  7. <meta name="renderer" content="webkit">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  9. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11. <meta name="apple-mobile-web-app-capable" content="yes">
  12. <meta name="format-detection" content="telephone=no">
  13. <link href="/plugins/layui/css/layui.css" rel="stylesheet" />
  14. <script src="/build/js/jquery-2.1.1.min.js"></script>
  15. <script src="/plugins/layui/layui.js" type="text/javascript"></script>
  16. <script type="text/javascript" src="/build/js/jquery-ui.min.js"></script>
  17. <script type="text/javascript" src='/build/js/stopExecutionOnTimeout.js?t=1'></script>
  18. <script src="/build/Js/Treatment.js" type="text/javascript"></script>
  19. <script src="/build/js/jquery.mockjax.js" type="text/javascript"></script>
  20. <style>
  21. .layui-header {
  22. position: relative;
  23. z-index: 1000;
  24. height: 100px;
  25. border: #e6e6e6 1px solid;
  26. margin: 10px;
  27. }
  28. .layui-header img{
  29. width:80px;
  30. height:80px;
  31. margin:10px;
  32. float:left;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <section class="layui-larry-box">
  38. <div class="larry-personal">
  39. <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  40. <legend>号码绑定</legend>
  41. </fieldset>
  42. <%if(string.IsNullOrEmpty(userModel.UserPhone))
  43. { %>
  44. <div style="padding-right:10px;">
  45. <div class="larry-personal-body clearfix">
  46. <form class="layui-form col-lg-5" action="EditUser.aspx" method="post">
  47. <div class="layui-form-item">
  48. <label class="layui-form-label">用户名</label>
  49. <div class="layui-input-block">
  50. <input type="text" id="username" autocomplete="off" class="layui-input"
  51. value="<%=userModel.UserName %>" placeholder="用户名" />
  52. </div>
  53. </div>
  54. <div class="layui-form-item">
  55. <label class="layui-form-label">手机号码</label>
  56. <div class="layui-input-block">
  57. <input type="text" id="userphone" autocomplete="off" class="layui-input"
  58. value="<%=userModel.UserPhone %>" placeholder="手机号码" />
  59. </div>
  60. </div>
  61. <div class="layui-form-item">
  62. <label class="layui-form-label">验证码</label>
  63. <div class="layui-input-inline">
  64. <input type="text" id="usercode" autocomplete="off" class="layui-input"
  65. value="" placeholder="验证码" />
  66. </div>
  67. <div class="layui-input-inline">
  68. <button class="layui-btn" id="smsCode" type="button" onclick="SendSmsCode()">验证码</button>
  69. </div>
  70. </div>
  71. <div class="layui-form-item">
  72. <div class="layui-input-block">
  73. <button class="layui-btn" type="button" onclick="VerificationSmsCode()" >立即提交</button>
  74. <a href="BindCustomerStore.aspx?entId=<%=entID%>&openId=<%=openID%>" id="btnBack" class="layui-btn layui-btn-warm">返回</a>
  75. </div>
  76. </div>
  77. </form>
  78. </div>
  79. </div>
  80. <%}else{ %>
  81. <div style="padding-right:10px;">
  82. <div class="larry-personal-body clearfix" style="text-align:center;">
  83. <form class="layui-form col-lg-5" method="post">
  84. <div class="layui-form-item">
  85. <label class="layui-form-label">用户名</label>
  86. <div class="layui-input-inline" style="padding:9px 15px;">
  87. <%=userModel.UserName %>
  88. </div>
  89. </div>
  90. <div class="layui-form-item">
  91. <label class="layui-form-label">手机号码</label>
  92. <div class="layui-input-inline" style="padding:9px 15px;">
  93. <%=userModel.UserPhone %>
  94. </div>
  95. </div>
  96. <div class="layui-form-item">
  97. <button class="layui-btn" type="button" onclick="Unbind()" >解除绑定</button>
  98. <a href="BindCustomerStore.aspx?entId=<%=entID%>&openId=<%=openID%>" class="layui-btn layui-btn-warm">返回</a>
  99. </div>
  100. </form>
  101. </div>
  102. </div>
  103. <%} %>
  104. </div>
  105. </section>
  106. <script type="text/javascript">
  107. function Unbind()
  108. {
  109. var url = "/api/SmsConfig.ashx?type=UnbindPhone";
  110. var JsonData = {
  111. entId: "<%=entID%>",
  112. openId: "<%=openID%>"
  113. };
  114. AjaxPost(url, JsonData,
  115. function () {
  116. //ajax加载中
  117. },
  118. function (data) {
  119. //ajax返回
  120. //认证完成
  121. setTimeout(function () {
  122. if (data.code == '200') {
  123. SuccessAlert(data.data);
  124. setTimeout("ReloadPage()", 1000);
  125. //var json = (data.data);
  126. //$("#ownedOperators").val(json.ownedOperators);
  127. //$("#signatures").val(json.signatures);
  128. //$("#balance").val(json.balance);
  129. } else {
  130. // AjaxErro(data);
  131. ErroAlert(data.data);
  132. }
  133. }, 500);
  134. })
  135. }
  136. function ReloadPage()
  137. {
  138. window.location.reload();
  139. }
  140. $(function () {
  141. layui.use(['form', 'layedit', 'laydate','laypage'], function () {
  142. var form = layui.form;
  143. var laypage = layui.laypage;
  144. })
  145. });
  146. function SetTimeOutMethod()
  147. {
  148. $("#smsCode").addClass("layui-btn-disabled");
  149. var time = 60;
  150. var timer = setInterval(function () {
  151. time--;
  152. var str = time.toString();
  153. $("#smsCode").text(function (i) { return str; });
  154. if (time == 0) {
  155. clearInterval(timer);
  156. $("#smsCode").removeClass("layui-btn-disabled");
  157. $("#smsCode").text("验证码");
  158. }
  159. }, 1000);
  160. }
  161. function VerificationSmsCode()
  162. {
  163. var url = "/api/SmsConfig.ashx?type=VerificationSmsCode";
  164. var JsonData = {
  165. entId: "<%=entID%>",
  166. openId: "<%=openID%>",
  167. userphone: $("#userphone").val(),
  168. usercode: $("#usercode").val(),
  169. username: $("#username").val()
  170. };
  171. AjaxPost(url, JsonData,
  172. function () {
  173. //ajax加载中
  174. },
  175. function (data) {
  176. //ajax返回
  177. //认证完成
  178. setTimeout(function () {
  179. if (data.code == '200') {
  180. SuccessAlert(data.data);
  181. setTimeout("BackDataList()",1000);
  182. //var json = (data.data);
  183. //$("#ownedOperators").val(json.ownedOperators);
  184. //$("#signatures").val(json.signatures);
  185. //$("#balance").val(json.balance);
  186. } else {
  187. // AjaxErro(data);
  188. ErroAlert(data.data);
  189. }
  190. }, 500);
  191. })
  192. }
  193. function BackDataList()
  194. {
  195. window.location.href = "BindCustomerStore.aspx?entId=<%=entID%>&openId=<%=openID%>";
  196. }
  197. function SendSmsCode()
  198. {
  199. if ($("#smsCode").hasClass("layui-btn-disabled"))
  200. {
  201. return;
  202. }
  203. var url = "/api/SmsConfig.ashx?type=SendSmsCode";
  204. var JsonData = {
  205. userphone: $("#userphone").val(),
  206. entId: "<%=entID%>"
  207. };
  208. AjaxPost(url, JsonData,
  209. function () {
  210. //ajax加载中
  211. },
  212. function (data) {
  213. //ajax返回
  214. //认证完成
  215. setTimeout(function () {
  216. if (data.code == '200') {
  217. SuccessAlert("发送成功!");
  218. SetTimeOutMethod();
  219. //var json = (data.data);
  220. //$("#ownedOperators").val(json.ownedOperators);
  221. //$("#signatures").val(json.signatures);
  222. //$("#balance").val(json.balance);
  223. } else {
  224. // AjaxErro(data);
  225. ErroAlert(data.data);
  226. }
  227. }, 500);
  228. })
  229. }
  230. </script>
  231. </body>
  232. </html>