|
@@ -0,0 +1,210 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
|
|
+ <meta name="misapplication-tap-highlight" content="no"/>
|
|
|
+ <meta name="HandheldFriendly" content="true"/>
|
|
|
+ <meta name="MobileOptimized" content="320"/>
|
|
|
+ <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
|
|
|
+ <script typet="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="container">
|
|
|
+ <div class="loginTitle">欢迎注册随心购</div>
|
|
|
+ <div class="loginText">请认真填写个人信息</div>
|
|
|
+ <div class="login-box">
|
|
|
+ <div class="username">账号</div>
|
|
|
+ <input class="input-box" type="email" id="phone" name="phone" placeholder="请输入手机号"/>
|
|
|
+ </div>
|
|
|
+ <div class="login-box">
|
|
|
+ <div class="username">验证码</div>
|
|
|
+ <div class="flex">
|
|
|
+ <input class="input-box" style="width: 50%" id="code" type="number" name="code" placeholder="请输入验证码">
|
|
|
+ <div class="code" id="daojishi" onclick="verification()">发送验证码</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="login-box">
|
|
|
+ <div class="username">登录密码</div>
|
|
|
+ <input class="input-box" id="loginPass" type="password" name="loginPass" placeholder="请输入登录密码">
|
|
|
+ </div>
|
|
|
+ <div class="login-box">
|
|
|
+ <div class="username">邀请码</div>
|
|
|
+ <input class="input-box" id="invitation" type="text" disabled="disabled" name="invitation" placeholder="请输入邀请码">
|
|
|
+ </div>
|
|
|
+ <div class="flex">
|
|
|
+ <div class="login" onclick="fnLogin()">注册</div>
|
|
|
+ <div class="login"><a href="{:url('down')}">下载APP</a></div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+</body>
|
|
|
+<script type="text/javascript">
|
|
|
+ var url = location.search;
|
|
|
+ if (url.indexOf("?") != -1) {
|
|
|
+ var str = url.substr(1);
|
|
|
+ strs = str.split("=");
|
|
|
+ var invitation = strs[1];
|
|
|
+ document.getElementById('invitation').value = invitation;
|
|
|
+ }
|
|
|
+
|
|
|
+ function fnLogin() {
|
|
|
+ var phone = document.getElementById("phone").value;
|
|
|
+ var loginPass = document.getElementById("loginPass").value;
|
|
|
+ var code = document.getElementById("code").value;
|
|
|
+ var invitation = document.getElementById("invitation").value;
|
|
|
+ if (phone == '') {
|
|
|
+ window.alert("请输入账号");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (code == '') {
|
|
|
+ window.alert("请输入验证码");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (loginPass == '') {
|
|
|
+ window.alert("请输入登录密码");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (invitation == '') {
|
|
|
+ window.alert("请输入邀请码");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: "http://sxg.frp.liuniu946.com/api/register",
|
|
|
+ data: {account: phone, captcha: code, password: loginPass, spread: invitation},
|
|
|
+ dataType: "json",
|
|
|
+ success: function (data) {
|
|
|
+ window.alert(data.msg);
|
|
|
+ if (data.msg === '注册成功')
|
|
|
+ window.location.href = "{:url('down')}"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function verification() {
|
|
|
+ var phone = document.getElementById("phone").value;
|
|
|
+ if (phone == '') {
|
|
|
+ window.alert("请输入手机号");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!/^1[3|4|5|6|7|8|9]\d{9}$/.test(phone)) {
|
|
|
+ window.alert('请输入正确的手机号');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var timer = null;
|
|
|
+ var count = 60;
|
|
|
+ var codeText = $('#daojishi').text();
|
|
|
+
|
|
|
+ if (codeText == '发送验证码') {
|
|
|
+ timer = setInterval(function () {
|
|
|
+ count--;
|
|
|
+ $('#daojishi').text(count);
|
|
|
+ if (count <= 0) {
|
|
|
+ clearInterval(timer);
|
|
|
+ $('#daojishi').text('发送验证码');
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ if (codeText != '发送验证码') {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: "http://store.duolio.cn/api/register/verify",
|
|
|
+ data: {phone: phone, type: 'register'},
|
|
|
+ dataType: "json",
|
|
|
+ success: function (data) {
|
|
|
+ window.alert(data.msg);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style type="text/css">
|
|
|
+ * {
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ font-family: 微软雅黑;
|
|
|
+ font-size: 12px;
|
|
|
+ min-height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .container {
|
|
|
+ padding: 10% 30px 0px 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .loginTitle {
|
|
|
+ font-weight: bold;
|
|
|
+ color: #32baff;
|
|
|
+ font-size: 29px;
|
|
|
+ padding-bottom: 25px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .loginText {
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333333;
|
|
|
+ font-size: 17px;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .login-box {
|
|
|
+ width: 100%;
|
|
|
+ font-size: 16px;
|
|
|
+ padding-top: 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .username {
|
|
|
+ display: block;
|
|
|
+ padding-bottom: 12px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333333;
|
|
|
+ font-size: 16px;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .input-box {
|
|
|
+ border: none;
|
|
|
+ padding: 10px 8px;
|
|
|
+ outline: none;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #F5F5F5;
|
|
|
+ border-radius: 9px;
|
|
|
+ color: #32baff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .input-box::placeholder {
|
|
|
+ color: #bbbbbb;
|
|
|
+ }
|
|
|
+
|
|
|
+ .code {
|
|
|
+ background-color: #32baff;
|
|
|
+ border-radius: 5px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #FFFFFF;
|
|
|
+ font-size: 13px;
|
|
|
+ padding: 6px 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .login {
|
|
|
+ background-color: #32baff;
|
|
|
+ color: #FFFFFF;
|
|
|
+ text-align: center;
|
|
|
+ width: 130px;
|
|
|
+ line-height: 40px;
|
|
|
+ border-radius: 25px;
|
|
|
+ margin-top: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .login > a {
|
|
|
+ color: #FFFFFF;
|
|
|
+ text-decoration: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .flex {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+</html>
|