284 lines
12 KiB
HTML
284 lines
12 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||
<meta content='seemore.club' name='author'>
|
||
<title>注册领心钻</title>
|
||
<link rel="canonical" href="http://seemore.club/invite/invite.html">
|
||
<link href="../SeeMore.ico" rel="shortcut icon" type="image/x-icon"/>
|
||
<link rel="stylesheet" href="../css/bootstrap.min.css">
|
||
<link rel="stylesheet" href="../css/invite.less" type="text/less">
|
||
<script src="../js/less.min.js"></script>
|
||
<script src="../js/jquery.min.js"></script>
|
||
<script src="../js/vali.js"></script>
|
||
<script src="../js/api.js"></script>
|
||
<script>
|
||
var timer = 60;
|
||
|
||
$(function () {
|
||
get_invite_diamond();
|
||
// 创建Base64对象
|
||
var Base64 = {
|
||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||
encode: function (e) {
|
||
var t = "";
|
||
var n, r, i, s, o, u, a;
|
||
var f = 0;
|
||
e = Base64._utf8_encode(e);
|
||
while (f < e.length) {
|
||
n = e.charCodeAt(f++);
|
||
r = e.charCodeAt(f++);
|
||
i = e.charCodeAt(f++);
|
||
s = n >> 2;
|
||
o = (n & 3) << 4 | r >> 4;
|
||
u = (r & 15) << 2 | i >> 6;
|
||
a = i & 63;
|
||
if (isNaN(r)) {
|
||
u = a = 64
|
||
} else if (isNaN(i)) {
|
||
a = 64
|
||
}
|
||
t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a)
|
||
}
|
||
return t
|
||
},
|
||
decode: function (e) {
|
||
var t = "";
|
||
var n, r, i;
|
||
var s, o, u, a;
|
||
var f = 0;
|
||
e = e.replace(/[^A-Za-z0-9+/=]/g, "");
|
||
while (f < e.length) {
|
||
s = this._keyStr.indexOf(e.charAt(f++));
|
||
o = this._keyStr.indexOf(e.charAt(f++));
|
||
u = this._keyStr.indexOf(e.charAt(f++));
|
||
a = this._keyStr.indexOf(e.charAt(f++));
|
||
n = s << 2 | o >> 4;
|
||
r = (o & 15) << 4 | u >> 2;
|
||
i = (u & 3) << 6 | a;
|
||
t = t + String.fromCharCode(n);
|
||
if (u != 64) {
|
||
t = t + String.fromCharCode(r)
|
||
}
|
||
if (a != 64) {
|
||
t = t + String.fromCharCode(i)
|
||
}
|
||
}
|
||
t = Base64._utf8_decode(t);
|
||
return t
|
||
},
|
||
_utf8_encode: function (e) {
|
||
e = e.replace(/rn/g, "n");
|
||
var t = "";
|
||
for (var n = 0; n < e.length; n++) {
|
||
var r = e.charCodeAt(n);
|
||
if (r < 128) {
|
||
t += String.fromCharCode(r)
|
||
} else if (r > 127 && r < 2048) {
|
||
t += String.fromCharCode(r >> 6 | 192);
|
||
t += String.fromCharCode(r & 63 | 128)
|
||
} else {
|
||
t += String.fromCharCode(r >> 12 | 224);
|
||
t += String.fromCharCode(r >> 6 & 63 | 128);
|
||
t += String.fromCharCode(r & 63 | 128)
|
||
}
|
||
}
|
||
return t
|
||
},
|
||
_utf8_decode: function (e) {
|
||
var t = "";
|
||
var n = 0;
|
||
var r = c1 = c2 = 0;
|
||
while (n < e.length) {
|
||
r = e.charCodeAt(n);
|
||
if (r < 128) {
|
||
t += String.fromCharCode(r);
|
||
n++
|
||
} else if (r > 191 && r < 224) {
|
||
c2 = e.charCodeAt(n + 1);
|
||
t += String.fromCharCode((r & 31) << 6 | c2 & 63);
|
||
n += 2
|
||
} else {
|
||
c2 = e.charCodeAt(n + 1);
|
||
c3 = e.charCodeAt(n + 2);
|
||
t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
||
n += 3
|
||
}
|
||
}
|
||
return t
|
||
}
|
||
}
|
||
|
||
// 定义字符串
|
||
var string = getUrlParam('id');
|
||
// console.log(string);
|
||
if (string){
|
||
var decodedString = Base64.decode(string);
|
||
} else {
|
||
alert('分享链接数据错误,请确认地址正确')
|
||
}
|
||
// 加密
|
||
// var encodedString = Base64.encode(string);
|
||
// console.log(encodedString);
|
||
|
||
// 解密
|
||
|
||
// console.log(decodedString);
|
||
|
||
$('#inviteId').val(decodedString);
|
||
// $('.dialog').show();
|
||
|
||
var temp = Math.floor(document.body.clientWidth / 375 * 100) / 100;
|
||
//对话框按钮
|
||
// $('.dialog .btn_ok').css('height', $('.dialog .btn_ok').height() * temp + 'px');
|
||
// $('.btn_regist').css('height', $('.btn_regist').height() * temp + 'px');
|
||
|
||
if (!isMobile()) {
|
||
$('.invite').css('width', '375px');
|
||
$('.invite .container').css('width', '375px');
|
||
}
|
||
|
||
});
|
||
|
||
function isMobile() {
|
||
let flag = false
|
||
const sUserAgent = navigator.userAgent.toLowerCase();
|
||
const bIsIpad = sUserAgent.match(/ipad/i) == 'ipad';
|
||
const bIsIphone = sUserAgent.match(/iphone os/i) == 'iphone os';
|
||
const bIsMidp = sUserAgent.match(/midp/i) == 'midp';
|
||
const bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == 'rv:1.2.3.4';
|
||
const bIsUc = sUserAgent.match(/ucweb/i) == 'web';
|
||
const bIsCE = sUserAgent.match(/windows ce/i) == 'windows ce';
|
||
const bIsWM = sUserAgent.match(/windows mobile/i) == 'windows mobile';
|
||
const bIsAndroid = sUserAgent.match(/android/i) == 'android';
|
||
if (bIsIpad || bIsIphone || bIsMidp || bIsUc7 || bIsUc || bIsCE || bIsWM || bIsAndroid) {
|
||
flag = true
|
||
} else {
|
||
flag = false
|
||
}
|
||
return flag;
|
||
}
|
||
|
||
function getUrlParam(name) {
|
||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); // 构造一个含有目标参数的正则表达式对象
|
||
var r = window.location.search.substr(1).match(reg); // 匹配目标参数
|
||
if (r != null) return unescape(r[2]);
|
||
return null; // 返回参数值
|
||
}
|
||
|
||
function elErrText(text) {
|
||
$('.errText').text(text);
|
||
}
|
||
|
||
function vali_Phone() {
|
||
var phoneNumber = $('#phoneNumber').val();
|
||
if (phoneNumber != '') {
|
||
if (phoneNumber.length === 11 && /^((13|14|15|17|18)[0-9]{1}\d{8})$/.test(phoneNumber)) {
|
||
if (timer == 60) {
|
||
$('.btn_code').removeAttr('disabled');
|
||
$('.btn_code').addClass('on');
|
||
}
|
||
elErrText('');
|
||
return true;
|
||
} else {
|
||
if (timer == 60) {
|
||
$('.btn_code').removeClass('on');
|
||
$('.btn_code').attr('disabled', 'disabled');
|
||
}
|
||
elErrText('手机号格式错误');
|
||
return false;
|
||
}
|
||
} else {
|
||
elErrText('手机号不能为空');
|
||
}
|
||
}
|
||
|
||
function vali_code() {
|
||
var code = $('#code').val();
|
||
if (code != '') {
|
||
if (/^\d{4}$/.test(code)) {
|
||
elErrText('');
|
||
return true;
|
||
} else {
|
||
elErrText('验证码格式错误,4位数字');
|
||
return false;
|
||
}
|
||
} else {
|
||
elErrText('验证码不能为空');
|
||
}
|
||
}
|
||
|
||
function vali_pwd() {
|
||
var pwd = $('#password').val();
|
||
if (pwd != '') {
|
||
if (/^[0-9A-Za-z]{6,16}$/.test(pwd)) {
|
||
elErrText('');
|
||
return true;
|
||
} else {
|
||
elErrText('登录密码格式错误,6-16位数字或字母');
|
||
return false;
|
||
}
|
||
} else {
|
||
elErrText('登录密码不能为空');
|
||
}
|
||
}
|
||
|
||
function vali_checkInput() {
|
||
var flag = $('#checkInput').is(':checked');
|
||
if (flag) {
|
||
elErrText('');
|
||
} else {
|
||
elErrText('请勾选用户协议和隐私条款');
|
||
}
|
||
return flag;
|
||
}
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<div class="invite">
|
||
<div class="container">
|
||
<div class="logo"></div>
|
||
<div class="inputForm">
|
||
<!--<div class="banner"></div>-->
|
||
<input type="hidden" id="inviteId">
|
||
<img src="../img/invite_banner.png" width="100%" alt="" style="margin-bottom: 25px;">
|
||
<div class="row">
|
||
<div class="col-xs-12 mb15">
|
||
<input id="phoneNumber" type="text" placeholder="请输入手机号" onkeyup="vali_Phone()">
|
||
</div>
|
||
<div class="col-xs-7 mb15">
|
||
<input id="code" type="text" placeholder="请输入验证码" onblur="vali_code()">
|
||
</div>
|
||
<div class="col-xs-5 pl0">
|
||
<button class="btn_code" onclick="getCode()" disabled="disabled">获取验证码</button>
|
||
</div>
|
||
<div class="col-xs-12">
|
||
<input id="password" type="password" placeholder="请设置登录密码" onblur="vali_pwd()">
|
||
</div>
|
||
<div class="col-xs-12 errText"></div>
|
||
<div class="col-xs-12 c_gray"><input id="checkInput" type="checkbox" onclick="vali_checkInput()"><label
|
||
for="checkInput">注册成为会员即为同意以下</label><a
|
||
href="http://www.seemore.club/mobile/privacy/privacy.html">用户协议和隐私条款</a></div>
|
||
|
||
<div class="col-xs-12">
|
||
<button class="btn_regist" onclick="inviteRegist()">立即注册</button>
|
||
</div>
|
||
<div class="col-xs-12 registTip">*新用户注册后,系统将奖励<span class="invite_diamond">0</span>心钻,心钻可用于购买APP内的任何服务和礼物
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="dialog" id="dialog_register">
|
||
<div class="dialog_box">
|
||
<div class="dialog_title"><span>注册成功</span></div>
|
||
<div class="dialog_content">注册成功,系统已奖励<span class="invite_diamond">0</span>心钻到您的心钻账户,请安装登录私慕APP后查看使用</div>
|
||
<div class="dialog_btn">
|
||
<!--<button class="btn_ok" onclick="$('.dialog').hide()">下载APP立即体验</button>-->
|
||
<button class="btn_ok" onclick="window.location.href='http://fir.defshare.org/f8x1'">下载APP立即体验</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |