123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <!DOCTYPE html>
- <html lang=zh-cn>
- <head>
- <meta charset=utf-8>
- <title>纵横计量支付系统</title>
- <meta name=description content=计量支付>
- <meta name=copyright content=smartcost.com.cn>
- <link rel=stylesheet href="{{rootUrl}}global/css/bootstrap.css">
- <link rel=stylesheet href={{rootUrl}}global/css/style.css>
- <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
- <script src={{rootUrl}}global/js/bootstrap.js></script>
- <script src={{rootUrl}}global/js/jl.js></script>
- <script src={{rootUrl}}global/js/jquery.cookie.min.js></script>
- </head>
- <body>
- <!-- include "top" -->
- <div class="wrapContent">
- <!-- include "left" -->
- <div class="mainContainer">
- <!--内容-->
- <div class="mainContent">
- <div class="title clearfix">
- <div class="fR">
- <a class="btn btn-link" href="http://smartcost.com.cn/product/19" target="_blank"><i class="icon-question-sign"></i> 帮助</a>
- </div>
- </div>
- <div class="form">
- <form class="form-horizontal">
- <legend>短信通知</legend>
- <!-- if {{smsNoticeSwitch}} < 1 -->
- <!--管理员关闭功能-->
- <div class="alert alert-error">
- 短信通知功能已被关闭。
- </div>
- <!--管理员关闭功能-->
- <!-- else -->
- <!-- if {{uprofile.isnotice}} < 1 -->
- <!--初次使用-->
- <div class="alert alert-info">
- 初次使用,请先添加用于接收通知的手机号码。
- </div>
- <div id="input_error" class="control-group">
- <label class="control-label" for="inputEmail">添加手机</label>
- <div class="controls">
- <input id="mobile" name="mobile" type="text" placeholder="输入您的新手机号码"><span id="help-inline"
- class="help-inline hide"></span>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="inputEmail">短信校验码</label>
- <div class="controls">
- <input type="text" id="verifycode" name="verifycode" placeholder="输入验证码" maxlength="11"
- class="span2">
- <input type="button" class="btn" id="getting" value="获取验证码">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label"></label>
- <div class="controls">
- <i class="icon-ok icon-white"></i><input type="button" id="addMobile"
- class="btn btn-primary" value="确定添加"/>
- </div>
- </div>
- <!--初次使用-->
- <!-- else -->
- <!--正常使用-->
- <div class="control-group">
- <label class="control-label" for="inputEmail">接收手机</label>
- <div class="controls">
- <input type="text" value="{{uprofile.mobile}}" disabled=""> <a
- href="{{rootUrl}}user/profile/sms/edit">修改手机</a>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="inputEmail">通知类型</label>
- <div class="controls">
- <label class="checkbox inline">
- <input type="checkbox" checked value="option1" disabled> 到我审批
- </label>
- <label class="checkbox inline">
- <input type="checkbox" checked value="option1" disabled> 标段审批通过(上报人接收)
- </label>
- <label class="checkbox inline">
- <input type="checkbox" checked value="option1" disabled> 标段审批不通过(上报人接收)
- </label>
- </div>
- </div>
- <!--正常使用-->
- <!-- endif -->
- <!-- endif -->
- </fieldset>
- </form>
- </div>
- </div>
- <!--内容-->
- </div>
- </div>
- <script type="text/javascript">autoFlashHeight();</script>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#mobile").blur(function () {
- $.ajax({
- type: "POST",
- dataType: "json",
- cache: false,
- data: {"mobile": $(this).val()},
- url: "{{rootUrl}}user/profile/check/mobile",
- success: function(data){
- if (data["mobile"] > 0) {
- $("#input_error").addClass('error');
- $("#help-inline").html('手机号码已被使用');
- $("#help-inline").show();
- } else {
- $("#input_error").removeClass('error');
- $("#help-inline").hide();
- }
- }
- });
- });
- /*仿刷新:检测是否存在cookie*/
- if ($.cookie("sms")) {
- var count = $.cookie("sms");
- var btn = $('#getting');
- btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
- var resend = setInterval(function () {
- count--;
- if (count > 0) {
- btn.val('重新获取 ' + count + 's').attr('disabled', true).css('cursor', 'not-allowed');
- $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
- } else {
- clearInterval(resend);
- btn.val("获取验证码").removeClass('disabled').removeAttr('disabled style');
- }
- }, 1000);
- }
- /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
- $('#getting').click(function () {
- var btn = $(this);
- if ($("#mobile").val() == '') {
- $("#input_error").addClass('error');
- $("#help-inline").html('手机号码不能为空');
- $("#help-inline").show();
- return false;
- }
- $.ajax({
- type: "POST",
- dataType: "json",
- cache: false,
- data: {"mobile": $("#mobile").val()},
- url: "{{rootUrl}}user/profile/check/mobile",
- success: function(data){
- if (data["mobile"] > 0) {
- $("#input_error").addClass('error');
- $("#help-inline").html('手机号码已被使用');
- $("#help-inline").show();
- return false;
- } else {
- $("#input_error").removeClass('error');
- $("#help-inline").hide();
- $.ajax({
- type: "POST",
- dataType: "json",
- cache: false,
- data: {"mobile": $("#mobile").val()},
- url: "{{rootUrl}}user/profile/sms/send/verify",
- success: function(data){
- if(data["verify"]==true){
- var count = 60;
- var resend = setInterval(function () {
- count--;
- if (count > 0) {
- btn.val('重新获取 ' + count + 's');
- $.cookie("sms", count, {path: '/', expires: (1 / 86400) * count});
- } else {
- clearInterval(resend);
- btn.val("获取验证码").removeAttr('disabled style');
- }
- }, 1000);
- btn.attr('disabled', true).css('cursor', 'not-allowed');
- }
- }
- });
- }
- }
- });
- });
- /*点击改变按钮状态,已经简略掉ajax发送短信验证的代码*/
- $('#addMobile').click(function () {
- $.ajax({
- type: "POST",
- dataType: "json",
- cache: false,
- data: {"mobile": $("#mobile").val(), "verifycode": $("#verifycode").val()},
- url: "{{rootUrl}}user/profile/sms",
- error: function (err) {
- alert(err);
- },
- success: function () {
- window.location.href = "{{rootUrl}}user/profile/sms";
- }
- });
- });
- });
- </script>
- </body>
|