123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BindCustomerStorePhone.aspx.cs" Inherits="LYFZ.WeixinServers.BindCustomerStorePhone" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>云存储手机号码绑定</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="format-detection" content="telephone=no">
- <link href="/plugins/layui/css/layui.css" rel="stylesheet" />
- <script src="/build/js/jquery-2.1.1.min.js"></script>
- <script src="/plugins/layui/layui.js" type="text/javascript"></script>
- <script type="text/javascript" src="/build/js/jquery-ui.min.js"></script>
- <script type="text/javascript" src='/build/js/stopExecutionOnTimeout.js?t=1'></script>
- <script src="/build/Js/Treatment.js" type="text/javascript"></script>
- <script src="/build/js/jquery.mockjax.js" type="text/javascript"></script>
- <style>
- .layui-header {
- position: relative;
- z-index: 1000;
- height: 100px;
- border: #e6e6e6 1px solid;
- margin: 10px;
- }
- .layui-header img{
- width:80px;
- height:80px;
- margin:10px;
- float:left;
- }
- </style>
- </head>
- <body>
- <section class="layui-larry-box">
- <div class="larry-personal">
- <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
- <legend>号码绑定</legend>
- </fieldset>
- <%if(string.IsNullOrEmpty(userModel.UserPhone))
- { %>
- <div style="padding-right:10px;">
- <div class="larry-personal-body clearfix">
- <form class="layui-form col-lg-5" action="EditUser.aspx" method="post">
- <div class="layui-form-item">
- <label class="layui-form-label">用户名</label>
- <div class="layui-input-block">
- <input type="text" id="username" autocomplete="off" class="layui-input"
- value="<%=userModel.UserName %>" placeholder="用户名" />
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">手机号码</label>
- <div class="layui-input-block">
- <input type="text" id="userphone" autocomplete="off" class="layui-input"
- value="<%=userModel.UserPhone %>" placeholder="手机号码" />
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">验证码</label>
- <div class="layui-input-inline">
- <input type="text" id="usercode" autocomplete="off" class="layui-input"
- value="" placeholder="验证码" />
- </div>
- <div class="layui-input-inline">
- <button class="layui-btn" id="smsCode" type="button" onclick="SendSmsCode()">验证码</button>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="layui-btn" type="button" onclick="VerificationSmsCode()" >立即提交</button>
-
- <a href="BindCustomerStore.aspx?entId=<%=entID%>&openId=<%=openID%>" id="btnBack" class="layui-btn layui-btn-warm">返回</a>
-
- </div>
- </div>
- </form>
- </div>
- </div>
- <%}else{ %>
- <div style="padding-right:10px;">
- <div class="larry-personal-body clearfix" style="text-align:center;">
- <form class="layui-form col-lg-5" method="post">
- <div class="layui-form-item">
- <label class="layui-form-label">用户名</label>
- <div class="layui-input-inline" style="padding:9px 15px;">
- <%=userModel.UserName %>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">手机号码</label>
- <div class="layui-input-inline" style="padding:9px 15px;">
- <%=userModel.UserPhone %>
- </div>
- </div>
- <div class="layui-form-item">
-
- <button class="layui-btn" type="button" onclick="Unbind()" >解除绑定</button>
- <a href="BindCustomerStore.aspx?entId=<%=entID%>&openId=<%=openID%>" class="layui-btn layui-btn-warm">返回</a>
-
- </div>
- </form>
- </div>
- </div>
- <%} %>
- </div>
- </section>
- <script type="text/javascript">
- function Unbind()
- {
- var url = "/api/SmsConfig.ashx?type=UnbindPhone";
- var JsonData = {
- entId: "<%=entID%>",
- openId: "<%=openID%>"
- };
- AjaxPost(url, JsonData,
- function () {
- //ajax加载中
- },
- function (data) {
- //ajax返回
- //认证完成
- setTimeout(function () {
- if (data.code == '200') {
- SuccessAlert(data.data);
- setTimeout("ReloadPage()", 1000);
- //var json = (data.data);
- //$("#ownedOperators").val(json.ownedOperators);
- //$("#signatures").val(json.signatures);
- //$("#balance").val(json.balance);
- } else {
- // AjaxErro(data);
- ErroAlert(data.data);
- }
- }, 500);
- })
- }
- function ReloadPage()
- {
- window.location.reload();
- }
- $(function () {
- layui.use(['form', 'layedit', 'laydate','laypage'], function () {
- var form = layui.form;
- var laypage = layui.laypage;
- })
- });
- function SetTimeOutMethod()
- {
- $("#smsCode").addClass("layui-btn-disabled");
- var time = 60;
- var timer = setInterval(function () {
- time--;
- var str = time.toString();
- $("#smsCode").text(function (i) { return str; });
- if (time == 0) {
- clearInterval(timer);
- $("#smsCode").removeClass("layui-btn-disabled");
- $("#smsCode").text("验证码");
- }
- }, 1000);
- }
- function VerificationSmsCode()
- {
- var url = "/api/SmsConfig.ashx?type=VerificationSmsCode";
- var JsonData = {
- entId: "<%=entID%>",
- openId: "<%=openID%>",
- userphone: $("#userphone").val(),
- usercode: $("#usercode").val(),
- username: $("#username").val()
- };
- AjaxPost(url, JsonData,
- function () {
- //ajax加载中
- },
- function (data) {
- //ajax返回
- //认证完成
- setTimeout(function () {
- if (data.code == '200') {
- SuccessAlert(data.data);
- setTimeout("BackDataList()",1000);
- //var json = (data.data);
- //$("#ownedOperators").val(json.ownedOperators);
- //$("#signatures").val(json.signatures);
- //$("#balance").val(json.balance);
- } else {
- // AjaxErro(data);
- ErroAlert(data.data);
- }
- }, 500);
- })
- }
- function BackDataList()
- {
- window.location.href = "BindCustomerStore.aspx?entId=<%=entID%>&openId=<%=openID%>";
- }
- function SendSmsCode()
- {
- if ($("#smsCode").hasClass("layui-btn-disabled"))
- {
- return;
- }
-
- var url = "/api/SmsConfig.ashx?type=SendSmsCode";
- var JsonData = {
- userphone: $("#userphone").val(),
- entId: "<%=entID%>"
- };
- AjaxPost(url, JsonData,
- function () {
- //ajax加载中
- },
- function (data) {
- //ajax返回
- //认证完成
- setTimeout(function () {
- if (data.code == '200') {
- SuccessAlert("发送成功!");
- SetTimeOutMethod();
- //var json = (data.data);
- //$("#ownedOperators").val(json.ownedOperators);
- //$("#signatures").val(json.signatures);
- //$("#balance").val(json.balance);
- } else {
- // AjaxErro(data);
- ErroAlert(data.data);
- }
- }, 500);
- })
- }
- </script>
- </body>
- </html>
|