1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- {include file="../application/h5/view/wx_book_dinner/header.html"}
- <style>
- .weui_btn_primary{
- background-color: #6eb7ff;
- }
- .weui-vcode-btn {
- color: #6eb7ff;
- }
- </style>
- <div class="weui-header bg-blue">
- <div class="weui-header-left">
- </div>
- <h1 class="weui-header-title">登陆</h1>
- <div class="weui-header-right"></div>
- </div>
- <form action="loginuser" class="ajax-form" method="post">
- <div class="weui_cells weui_cells_form">
- <div class="weui_cell">
- <div class="weui_cell_hd">
- <label class="weui_label">手机号</label>
- </div>
- <div class="weui_cell_bd">
- <input class="weui_input" placeholder="请输入手机号" type="tel" name="TEL">
- </div>
- </div>
- <div class="weui_cell weui_vcode">
- <div class="weui_cell_hd"><label class="weui_label">验证码</label></div>
- <div class="weui_cell_bd weui_cell_primary">
- <input class="weui_input" placeholder="验证码" type="number" name="VCODE">
- </div>
- <div class="weui_cell_ft">
- <a href="javascript:;" class="weui-vcode-btn" onclick="settime(this);return false;">获取验证码</a>
- </div>
- </div>
- </div>
- <div class="weui_btn_area">
- <button type="button" href="javascript:" class="weui_btn weui_btn_primary">确定</button>
- </div>
- </form>
- <div style="height: 30px;"></div>
- <script type="text/javascript">
- var countdown = 60;
- function settime(obj) {
- var code = $(obj);
- if (countdown == 0) {
- code.removeAttr('disabled');
- code.text("获取验证码");
- countdown = 60;
- return;
- } else {
- if(countdown==60){
- var mobile = $('input[name="TEL"]').val();
- if(mobile == undefined||mobile==''){
- $.toast('手机号不能为空', "cancel");
- return;
- }
- var url = 'sms?tel='+mobile;
- get_data(url,function(result){
- if(result.code ==1){
- $.toast(result.message,"cancel");
- countdown = 0;
- return;
- }
- });
- }
- }
- code.attr('disabled', true);
- countdown--;
- code.text("重新发送(" + countdown + ")");
- setTimeout(function() { settime(obj) }, 1000);
- }
- $('.weui_btn').click(function () {
- $.post('loginuser',$('.ajax-form').serialize(),function (result) {
- if(result.code ==1){
- $.toptips(result.message,'warning');
- }else{
- window.location.href = 'order';
- }
- },'json')
- })
- </script>
|