You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Mobile/Views/MpService/Regist.aspx

141 lines
5.7 KiB
Plaintext

2 years ago
<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Dispatch/Views/Shared/MP.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Body" runat="server">
<link type="text/css" rel="stylesheet" href="/Areas/Dispatch/Content/MP/css/regist.css" />
<div class="container">
<div class="page form_page js_show">
<header class='demos-header'>
<h2 class="demos-title">注册绑定</h2>
</header>
<div class="clearfix"></div>
<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" type="text" id="iptName" placeholder="请输入您的姓名" value="<%=ViewData["name"] %>" />
</div>
</div>
<div class="weui-cell">
<div class="weui-cell__hd">
<label class="weui-label">公司全称</label>
</div>
<div class="weui-cell__bd">
<input class="weui-input" type="text" id="iptCompName" placeholder="请输入您的公司名称" value="<%=ViewData["company_name"] %>" />
</div>
</div>
<div class="weui-cell">
<div class="weui-cell__hd">
<label class="weui-label">手机号码</label>
</div>
<div class="weui-cell__bd">
<input class="weui-input" type="text" id="iptTel" placeholder="请输入您的手机号码" value="<%=ViewData["mobile"] %>" />
</div>
</div>
<div class="weui-cell">
<div class="weui-cell__hd">
<label class="weui-label">验证码</label>
</div>
<div class="weui-cell__bd weui-code-input">
<input class="weui-input" type="text" id="iptCode" placeholder="请输入手机验证码" value="" />
</div>
<div class="weui-cell__bd weui-code-btn">
<a class="btn" id="btnCode" data-seconds="0">获取验证码</a>
</div>
</div>
</div>
<a class="weui-agree" id="showTooltips">注册绑定</a>
</div>
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FooterScript" runat="server">
<script>
var openid = '<%=ViewData["openid"]%>';
$(function () {
$("#showTooltips").click(function () {
var name = $('#iptName').val();
var tel = $('#iptTel').val();
var regName = $('#iptCompName').val();
var code = $('#iptCode').val();
if (!name || name.length == 0) {
$.toptip('请输入姓名');
}
else if (!tel || !/1[3|4|5|6|7|8]\d{9}/.test(tel)) {
$.toptip('请输入正确的手机号');
}
else if (!regName || regName.length == 0) {
$.toptip('请输入公司名称');
}
else if (!code || code.length == 0) {
$.toptip('请输入手机验证码');
}
else {
var obj = {
openid: openid,
name: name,
tel: tel,
companyName: regName,
code: code
};
$.ajax({
type: "POST",
url: "/Mobile/MpService/RegistSave",
dataType: "json",
data: obj,
success: function (data) {
if (data.Success) {
$.toptip('提交成功', 'success');
} else {
$.toptip(data.Message, 'error');
}
}
});
}
});
$("#btnCode").click(function () {
var tel = $('#iptTel').val();
if (!tel || !/1[3|4|5|6|7|8]\d{9}/.test(tel)) {
$.toptip('请输入正确的手机号');
return;
}
var val = parseInt($(this).data("seconds"));
if (val == 0) {
$.ajax({
type: "POST",
url: "/Mobile/MpService/MobileCode?mobile=" + tel,
dataType: "json",
success: function (data) {
if (data.Success) {
$.toptip('发送成功', 'success');
$("#btnCode").data("seconds", "120")
} else {
$.toptip(data.Message, 'error');
}
}
});
}
})
setInterval("checkSeconds()", 1000);
})
function checkSeconds() {
var s = parseInt($("#btnCode").data("seconds"))
if (s > 0) {
$("#btnCode").data("seconds", s - 1)
$("#btnCode").text((s - 1) + '秒后获取')
} else {
$("#btnCode").text('获取验证码')
}
}
</script>
</asp:Content>