123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>中联区卫问题登记</title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="~/Content/Scripts/plugins/mui/css/mui.css" rel="stylesheet" />
- <script src="~/Content/Scripts/jquery.min.js"></script>
- <script src="~/Content/Scripts/plugins/mui/js/mui.js"></script>
- <script src="~/Content/Scripts/vue.js"></script>
- </head>
- <body>
- <style>
- .mui-btn{
- line-height:0.8
- }
- .mui-bar-nav {
- background-color: #00aaff;
- }
- .mui-btn-positive, .mui-btn-success, .mui-btn-green {
- color: #fff;
- border: 1px solid #00aaff;
- background-color: #00aaff;
- }
- html,
- body,
- #vue,
- .mui-content{
- height:100%!important
- }
- .mui-input-group{
- top:5%;
- }
- .success{
- position: absolute;
- top: 0;
- font-size:40px;
- right: 0;
- }
- .mui-icon-clear{
- right:30px!important
- }
- </style>
- <div id="vue">
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-back mui-pull-left" style="color:white"></a>
- <h1 class="mui-title" style="color:white">手机号码验证</h1>
- <button class="mui-btn mui-btn-link mui-pull-right" style="color:white" v-on:click="Register">注册</button>
- </header>
- <div class="mui-content ">
- <form class="mui-input-group" >
- <div class="mui-input-row">
- <input v-model="telephone" v-on:keyup="IsAccountExist" type="number" class="mui-input-clear " placeholder="请输入手机号码">
- <span v-if="successStatus" class="mui-icon mui-icon-checkmarkempty mui-active success"></span>
- </div>
- <div class="mui-input-row">
- <input v-model="Code" type="text" style="width:60%" class="mui-input" placeholder="请输入验证码">
- <button v-on:click="GetSMS" v-bind:disabled="SMS!='获取验证码'" type="button" class="mui-btn mui-btn-success" style="margin-top:5px;margin-right:5px;width:110px">{{SMS}}</button>
- </div>
- <button type="button" style="margin-top: 10px;" class="mui-btn mui-btn-success mui-btn-block btn_2" v-on:click="ModifyPassword">提交</button>
- </form>
- </div>
- </div>
- <script>
- var vm = new Vue({
- el: '#vue',
- data: {
- SMS: '获取验证码',
- telephone: '',
- Code: '',
- successStatus:false
- },
- methods: {
- GetSMS: function () {
- var that = this;
- /* if (!/^(13[0-9]|15[012356789]|17[0-9]|18[0-9]|14[57])[0-9]{8}|(170[059])[0-9]{6}$/i.test(this.telephone))*/
- if (!/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/.test(this.telephone)) {
- mui.toast('请输入正确的手机号码', { duration: 'long', type: 'div' });
- this.telephone = '';
- return;
- }
- var validCode = true;
- var time = 60;
- if (validCode) {
- validCode = false;
- var t = setInterval(function () {
- time--;
- that.SMS = '重新获取(' + time + 's)';
- if (time == 0) {
- clearInterval(t);
- that.SMS = '获取验证码';
- validCode = true;
- }
- }, 1000);
- }
- $.post("/MobileAccount/GetSMSCode", { "tele": that.telephone }, function (data) {
- if (data.code == "200") {
- mui.toast('短信发送成功', { duration: 'long', type: 'div' });
- } else {
- mui.toast('短信发送失败【' + data.msg + "】", { duration: 'long', type: 'div' });
- }
- }).error(function (xhr, type, errorThrown) {
- mui.toast('系统错误', { duration: 'long', type: 'div' });
- })
- },
- ModifyPassword: function () {
- var that = this;
- if (!this.telephone || !this.Code) {
- mui.toast('请填写完整信息', { duration: 'long', type: 'div' });
- return;
- }
- var t = mui.showLoading("验证中..", "div");
- $.post("/MobileAccount/WechatVerification", { telephone: that.telephone, Code: that.Code }, function (data) {
- mui.hideLoading(t);
- if (data.code == 200) {
- mui.showLoading("验证成功,正在跳转..", "div");
-
- window.location.href = "/MobileProblem/Home";
- } else {
- mui.toast('验证失败,'+data.msg, { duration: 'long', type: 'div' });
- }
- })
-
- },
- IsAccountExist: function () {
- var that = this;
- this.successStatus = false;
- if (this.telephone.length == 11) {
- var t= mui.showLoading("...", "div");
- $.post("/MobileAccount/IsAccountExist", { tele: this.telephone }, function (data) {
- mui.hideLoading(t);
- if (data == '1') {
- that.successStatus = true;
- } else {
- mui.toast('账户不存在,请联系管理员及右上角注册,或BH扫码注册!', { duration: 'long', type: 'div' });
- }
- })
- }
- },
- Register: function () {
- window.location = "/MobileAccount/Register";
- }
- },
- mounted: function () {
- mui.back = function (event) {
- window.location.href = '/MobileAccount/MobileProblemLogin?isOpenWechatLgoin=0';
- }
- }
- });
- </script>
- </body>
- </html>
|