|
@@ -1,337 +1,96 @@
|
|
|
<!DOCTYPE html>
|
|
|
-<html lang="zh-CN">
|
|
|
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
- <title>免费换机</title>
|
|
|
+ <title>双子星</title>
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
|
|
|
<link rel="stylesheet" href="../static/js/vender/bootstrap/css/bootstrap.min.css">
|
|
|
- <link rel="stylesheet" href="../static/css/verify.css">
|
|
|
+ <link rel="stylesheet" href="../static/css/normalize.css">
|
|
|
+ <link rel="stylesheet" href="../static/css/experience.css">
|
|
|
<link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
|
|
|
- <link rel="stylesheet" href="../static/css/replacementActivities.css">
|
|
|
- <script>
|
|
|
- (function () {
|
|
|
- if (!window.Promise) {
|
|
|
- document.writeln('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.min.js"><' + '/' + 'script>');
|
|
|
- }
|
|
|
- })();
|
|
|
- </script>
|
|
|
+ <link rel="stylesheet" href="../static/css/verify.css">
|
|
|
<script src="../static/js/vender/jquery-3.4.1.min.js"></script>
|
|
|
+ <script src="../static/js/vender/bootstrap/js/bootstrap.min.js"></script>
|
|
|
<script src="../static/js/vender/toastr/toastr.min.js"></script>
|
|
|
<script src="../static/js/vender/config.js"></script>
|
|
|
<script src="../static/js/vender/crypto-js.js"></script>
|
|
|
- <script src="../static/js/vender/ase.js"></script>
|
|
|
+ <script src="../static/js/vender/base64.js"></script>
|
|
|
<script src="../static/js/vender/verify.js"></script>
|
|
|
+ <script src="../static/js/vender/ase.js"></script>
|
|
|
+ <script>
|
|
|
+ toastr.options.positionClass = 'toast-center-center';
|
|
|
+ </script>
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
- <div class="container">
|
|
|
- <div class="share-node">
|
|
|
- <img class="share" onclick="share()" src="../static/img/replacementActivities/share.png" alt="">
|
|
|
- <div class="line"></div>
|
|
|
- <img class="qq" onclick="urlToQQ()" src="../static/img/replacementActivities/qq.png" alt="">
|
|
|
- <!-- <div class="line"></div>
|
|
|
- <a href="qq://mqqwpa://im/chat?chat_type=wpa&uin=800183764&version=1&src_type=web&web_src=oicqzone.com"><img
|
|
|
- class="cs" src="../static/img/replacementActivities/cs.png" alt=""></a> -->
|
|
|
- </div>
|
|
|
- <div class="date">2022.1.4-2022.2.8</div>
|
|
|
- <div class="header">
|
|
|
- <div class="login-container">
|
|
|
- <div class="login-bar">仅限2000份</div>
|
|
|
- <div class="ipt"></div>
|
|
|
- <div class="input-container">
|
|
|
- <div class="login-row-select">
|
|
|
- <div class="login-row-title">选择</div>
|
|
|
- <input class="login-row-ipt" id="select" placeholder="请选择平台" readonly />
|
|
|
- <img class="icon-down-img" src="../static/img/replacementActivities/arrow.png" />
|
|
|
- </div>
|
|
|
- <div class="options">
|
|
|
- <div class="icon-down-second">红手指</div>
|
|
|
- <div class="icon-down-first">多多云</div>
|
|
|
- <div class="icon-down-third">爱云兔</div>
|
|
|
- </div>
|
|
|
- <div class="login-row-account">
|
|
|
- <div class="login-row-title">账户</div>
|
|
|
- <input class="login-row-ipt" id="account" placeholder="请输入11位手机号码" />
|
|
|
- </div>
|
|
|
- <div class="tip-text1"></div>
|
|
|
- <div class="login-row-password">
|
|
|
- <div class="login-row-title">密码</div>
|
|
|
- <input class="login-row-ipt" type="password" id="password" placeholder="请输入密码" />
|
|
|
- </div>
|
|
|
- <div class="tip-text2"></div>
|
|
|
- <div class="login-row-password">
|
|
|
- <div class="login-row-title">确认密码</div>
|
|
|
- <input class="login-row-ipt" type="password" id="check" placeholder="请重新输入密码" />
|
|
|
- </div>
|
|
|
- <div class="tip-text3"></div>
|
|
|
- <div class="form-btn" id="form-btn" onclick="handleOnClick()"></div>
|
|
|
- <div id="mpanel2"></div>
|
|
|
+ <div id="mpanel2"></div>
|
|
|
+ <div id="form-btn"></div>
|
|
|
+ <div class="top free-code-con" style="position:relative;">
|
|
|
+ <div>
|
|
|
+ <img src="../static/img/register/bg.png" alt="" class="bottom-img">
|
|
|
+ <div class="user-info">
|
|
|
+ <div class="head"><img src="" alt="" /></div>
|
|
|
+ <div class="username"></div>
|
|
|
+ <div class="txt">
|
|
|
+ <div style="width: 2.97rem;"><img src="../static/img/register/tuoguan_icon.png" class="icon" alt="">7*24h智能托管</div>
|
|
|
+ <div style="width: 1.76rem;"><img src="../static/img/register/haodian_icon.png" class="icon" alt="">0耗电</div>
|
|
|
+ <div><img src="../static/img/register/liuliang_icon.png" class="icon" alt="">0流量</div>
|
|
|
+ <div style="width: 2.97rem;"><img src="../static/img/register/wang_icon.png" class="icon" alt="">应用 24h 不断网</div>
|
|
|
+ <div><img src="../static/img/register/shou_icon.png" class="icon" alt="">解放双手</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mt55">
|
|
|
- <img class="w666h874" src="../static/img/replacementActivities/activityReward.png" alt="">
|
|
|
- </div>
|
|
|
- <div class="mt50">
|
|
|
- <img class="w670h476" src="../static/img/replacementActivities/inviteeReward.png" alt="">
|
|
|
- </div>
|
|
|
- <div class="mt50" style="margin-bottom: 0.71rem;">
|
|
|
- <img class="w666h864" src="../static/img/replacementActivities/mattersNeedAttention.png" alt="">
|
|
|
- </div>
|
|
|
- <div class="mask1">
|
|
|
- <div class="dialog1">
|
|
|
- <img class="dialog-bg" src="../static/img/replacementActivities/dialog.png" />
|
|
|
- <div class="title1">已经注册过双子星</div>
|
|
|
- <img class="register-btn" src="../static/img/replacementActivities/register-btn.png" />
|
|
|
- <div class="register-text">您已是注册用户,可分享活动邀请有奖</div>
|
|
|
- <img class="close" onclick="registerHandle()" src="../static/img/replacementActivities/close.png" alt="">
|
|
|
- </div>
|
|
|
- <div class="tip">
|
|
|
- <img class="dialog2-bg" src="../static/img/replacementActivities/dialog2.png" />
|
|
|
- <div class="title1" style="left: 1.77rem;">已提交兑换申请</div>
|
|
|
- <div class="register-text">审核通过者,将在3个工作日内收到短<br />信通知并发放奖励,请留意短信消息。</div>
|
|
|
- <img class="close" onclick="handleClose('tip')" src="../static/img/replacementActivities/close.png" alt="">
|
|
|
- </div>
|
|
|
- <div class="tip1">
|
|
|
- <img class="dialog3-bg" src="../static/img/replacementActivities/dialog3.png" />
|
|
|
- <div class="title1" style="left: 1.75rem;text-align: center;">该账号已经申请<br />请等待审核</div>
|
|
|
- <img class="close" onclick="handleClose('tip1')" src="../static/img/replacementActivities/close.png" alt="">
|
|
|
+
|
|
|
+ <div class="center-pic">
|
|
|
+ <div class="recv-cont" id="recv_cont">
|
|
|
+ <div style="position: relative;">
|
|
|
+ <input type="tel" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码">
|
|
|
+ <div class="tip">该手机号仅用于验证并绑定账号</div>
|
|
|
+ </div>
|
|
|
+ <div onclick="handleClick()" style="position: relative">
|
|
|
+ <div class="recv-btn" id="recv_btn">立即加入</div>
|
|
|
+ </div>
|
|
|
+ <div class="bottom">
|
|
|
+ <div class="mb8">双子星</div>
|
|
|
+ <div class="wl">云智能 · 享未来</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <script>
|
|
|
- toastr.options.positionClass = 'toast-center-center';
|
|
|
- toastr.options.timeOut = '1500';
|
|
|
- </script>
|
|
|
- <script type="text/javascript">
|
|
|
- Date.prototype.Format = function (fmt) { // author: meizz
|
|
|
- var o = {
|
|
|
- "M+": this.getMonth() + 1, // 月份
|
|
|
- "d+": this.getDate(), // 日
|
|
|
- "h+": this.getHours(), // 小时
|
|
|
- "m+": this.getMinutes(), // 分
|
|
|
- "s+": this.getSeconds(), // 秒
|
|
|
- "q+": Math.floor((this.getMonth() + 3) / 3), // 季度
|
|
|
- "S": this.getMilliseconds() // 毫秒
|
|
|
- };
|
|
|
- if (/(y+)/.test(fmt))
|
|
|
- fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
|
- for (var k in o)
|
|
|
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
|
- return fmt;
|
|
|
- }
|
|
|
- let timer, flag = true;
|
|
|
- let entryPageTime = new Date().Format("yyyy-MM-dd hh:mm:ss");
|
|
|
- let fromType = 0, account = '', password = '', checkPass = '';
|
|
|
- var url = window.location.href;
|
|
|
- url = url.split('/')
|
|
|
-
|
|
|
- var loc = window.location.search,
|
|
|
- n1 = loc.length,//地址的总长度
|
|
|
- n2 = loc.indexOf("="),//取得=号的位置
|
|
|
- id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
|
|
|
- u = navigator.userAgent,
|
|
|
- ua = navigator.userAgent.toLowerCase(),
|
|
|
- isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
|
|
|
- isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
|
|
- //埋点
|
|
|
- operate('dt_yhs_活动页面浏览');
|
|
|
- function operate(pointName, type, captchaVerification) {
|
|
|
- $.ajax({
|
|
|
- url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
|
|
|
- type: 'post',
|
|
|
- data: JSON.stringify({
|
|
|
- pointName: pointName
|
|
|
- }),
|
|
|
- contentType: "application/json",
|
|
|
- dataType: 'json',
|
|
|
- cache: false,
|
|
|
- success: function (res) {
|
|
|
- if (type === 'click') {
|
|
|
- changePhone(captchaVerification);
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
- }
|
|
|
- // 跳转至QQ群
|
|
|
- function urlToQQ() {
|
|
|
- stopManyClick(() => {
|
|
|
- var oInput = document.createElement('input'); //创建一个input
|
|
|
- oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
|
|
|
- oInput.value = '595757816';
|
|
|
- $('.ipt')[0].appendChild(oInput);//将input插入到body
|
|
|
- // oInput.select(); // 选择对象 ios不支持
|
|
|
- selectText(oInput, 0, oInput.value.length);
|
|
|
- document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
- toastr.error('QQ群号复制成功');
|
|
|
- oInput.style.display = 'none'; // 将input隐藏
|
|
|
- oInput.blur();
|
|
|
- oInput.remove(); // 将input销毁
|
|
|
- // window.location.href = 'https://jq.qq.com/?_wv=1027&k=6KwBYb7o';
|
|
|
- })
|
|
|
- }
|
|
|
- //点击分享
|
|
|
- $('.register-btn')[0].addEventListener('click', () => {
|
|
|
- if (!id) {
|
|
|
- copyUrl();
|
|
|
- } else if (isiOS) {
|
|
|
- $.ajax({
|
|
|
- url: baseUrl + '/api/user/v1/promote',
|
|
|
- type: 'get',
|
|
|
- headers: {
|
|
|
- 'Authorization': id //id
|
|
|
- },
|
|
|
- contentType: "application/json",
|
|
|
- dataType: 'json',
|
|
|
- cache: false,
|
|
|
- success: function (res) {
|
|
|
- var jsonStr = JSON.stringify(res.data)
|
|
|
- var jsonObj = JSON.parse(jsonStr)
|
|
|
- // WKWebView使用
|
|
|
- // 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
|
|
|
- try {
|
|
|
- getMessage(jsonObj);
|
|
|
- } catch (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- try {
|
|
|
- window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
|
|
|
- } catch (error) {
|
|
|
- copyUrl();
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (isAndroid) {
|
|
|
- if (window.native) {
|
|
|
- window.native.onClikWebView()
|
|
|
- } else {
|
|
|
- copyUrl();
|
|
|
- }
|
|
|
- } else {
|
|
|
- copyUrl();
|
|
|
- }
|
|
|
- }, false);
|
|
|
- function share() {
|
|
|
- if (!id) {
|
|
|
- copyUrl();
|
|
|
- } else if (isiOS) {
|
|
|
- $.ajax({
|
|
|
- url: baseUrl + '/api/user/v1/promote',
|
|
|
- type: 'get',
|
|
|
- headers: {
|
|
|
- 'Authorization': id //id
|
|
|
- },
|
|
|
- contentType: "application/json",
|
|
|
- dataType: 'json',
|
|
|
- cache: false,
|
|
|
- success: function (res) {
|
|
|
- var jsonStr = JSON.stringify(res.data)
|
|
|
- var jsonObj = JSON.parse(jsonStr)
|
|
|
- // WKWebView使用
|
|
|
- // 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
|
|
|
- try {
|
|
|
- getMessage(jsonObj);
|
|
|
- } catch (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- try {
|
|
|
- window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
|
|
|
- } catch (error) {
|
|
|
- copyUrl();
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (isAndroid) {
|
|
|
- if (window.native) {
|
|
|
- window.native.onClikWebView()
|
|
|
- } else {
|
|
|
- copyUrl();
|
|
|
- }
|
|
|
- } else {
|
|
|
- copyUrl();
|
|
|
- }
|
|
|
- }
|
|
|
- //复制
|
|
|
- function copyUrl() {
|
|
|
- stopManyClick(() => {
|
|
|
- var oInput = document.createElement('input'); //创建一个input
|
|
|
- oInput.setAttribute("readonly", "readonly");//设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
|
|
|
- oInput.value = window.location.href || 'https://client.androidscloud.com/h5/microserviceUserH5/vcloud/invite.html';
|
|
|
- $('.ipt')[0].appendChild(oInput);//将input插入到body
|
|
|
- // oInput.select(); // 选择对象 ios不支持
|
|
|
- selectText(oInput, 0, oInput.value.length);
|
|
|
- document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
- toastr.error('复制当前网址成功!');
|
|
|
- oInput.style.display = 'none'; // 将input隐藏
|
|
|
- oInput.blur();
|
|
|
- oInput.remove(); // 将input销毁
|
|
|
- })
|
|
|
- }
|
|
|
- // input自带的select()方法在苹果端无法进行选择,所以需要自己去写一个类似的方法
|
|
|
- // 选择文本。createTextRange(setSelectionRange)是input方法
|
|
|
- function selectText(textbox, startIndex, stopIndex) {
|
|
|
- if (textbox.createTextRange) {//ie
|
|
|
- const range = textbox.createTextRange();
|
|
|
- range.collapse(true);
|
|
|
- range.moveStart('character', startIndex);//起始光标
|
|
|
- range.moveEnd('character', stopIndex - startIndex);//结束光标
|
|
|
- range.select();//不兼容苹果
|
|
|
- } else {//firefox/chrome
|
|
|
- textbox.setSelectionRange(startIndex, stopIndex);
|
|
|
- textbox.focus();
|
|
|
- }
|
|
|
- }
|
|
|
- // 默认选中红手指
|
|
|
- function handleClick() {
|
|
|
- $('.options')[0].className = 'options';
|
|
|
- $('#select').val('红手指');
|
|
|
- fromType = 2;
|
|
|
- };
|
|
|
- handleClick();
|
|
|
- //点击选择框
|
|
|
- $('.login-row-select')[0].addEventListener('click', () => {
|
|
|
- $('.options')[0].className = 'options show';
|
|
|
- }, false);
|
|
|
- //点击多多云
|
|
|
- $('.icon-down-first')[0].addEventListener('click', () => {
|
|
|
- $('.options')[0].className = 'options';
|
|
|
- $('#select').val('多多云');
|
|
|
- fromType = 1;
|
|
|
- }, false);
|
|
|
- //点击红手指
|
|
|
- $('.icon-down-second')[0].addEventListener('click', handleClick, false);
|
|
|
- //点击爱云兔
|
|
|
- $('.icon-down-third')[0].addEventListener('click', () => {
|
|
|
- $('.options')[0].className = 'options';
|
|
|
- $('#select').val('爱云兔');
|
|
|
- fromType = 3;
|
|
|
- }, false);
|
|
|
- //点击弹窗关闭按钮
|
|
|
- function handleClose(str) {
|
|
|
- $('.' + str).animate({ top: '-6.96rem' }, "fast");
|
|
|
- $('.mask1').hide();
|
|
|
- document.documentElement.style.overflow = 'auto';
|
|
|
- }
|
|
|
- //点击关闭
|
|
|
- function registerHandle() {
|
|
|
- $('.dialog1').animate({ top: '-6.96rem' }, "fast");
|
|
|
- $('.mask1').hide();
|
|
|
- document.documentElement.style.overflow = 'auto';
|
|
|
- }
|
|
|
+ <script type="text/javascript" th:inline="javascript">
|
|
|
+ var parameters = GetRequest();
|
|
|
+ var phone = parameters["phone"];
|
|
|
+ var timer, flag = true;
|
|
|
var html = document.documentElement;
|
|
|
var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
|
|
|
var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
|
|
|
var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
|
|
|
- // validate(); // 生成验证码
|
|
|
- function handleOnClick() {
|
|
|
- console.log(595757816)
|
|
|
- stopManyClick(()=>{toastr.error('活动已结束!')})
|
|
|
- }
|
|
|
+ // var baseUrl = 'http://14.18.190.141:24380'
|
|
|
+ $("#recv_ipt").val(phone ? phone : '');
|
|
|
+ $("#recv_ipt").bind('input propertychange', function (e) {
|
|
|
+ var ipt_phones = $('#recv_ipt').val();
|
|
|
+ var c = $(this);
|
|
|
+ if (/[^\d]/.test(c.val())) {//替换非数字字符
|
|
|
+ var temp_amount = c.val().replace(/[^\d]/g, '');
|
|
|
+ $(this).val(temp_amount);
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('请填写正确的手机号')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (ipt_phones.length >= 12) {
|
|
|
+ var recvstr = ipt_phones.substring(0, 11)
|
|
|
+ $("#recv_ipt").val(recvstr);
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('请填写正确的手机号')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
function validate() {
|
|
|
$('#mpanel2').slideVerify({
|
|
|
- baseUrl: baseUrl + '/api/user', //服务器请求地址, 默认地址为安吉服务器;
|
|
|
+ baseUrl: baseUrl + '/api/activity', //服务器请求地址, 默认地址为安吉服务器;
|
|
|
mode: 'pop', //展示模式
|
|
|
containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
|
|
|
imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
|
|
@@ -342,111 +101,188 @@
|
|
|
width: imgWidth,
|
|
|
height: barHeight
|
|
|
},
|
|
|
- beforeCheck: function () {
|
|
|
- account = $('#account').val();
|
|
|
- account = account.replace(/\s+/g, "");
|
|
|
- password = $('#password').val();
|
|
|
- password = password.replace(/\s+/g, "");
|
|
|
- checkPass = $('#check').val();
|
|
|
- checkPass = checkPass.replace(/\s+/g, "");
|
|
|
- if (!account) {
|
|
|
- $('.tip-text1').text('账号格式不正确,请重新输入!');
|
|
|
- $('#account').addClass('br');
|
|
|
- return false
|
|
|
- } else {
|
|
|
- $('.tip-text1').text('');
|
|
|
- $('#account').removeClass('br')
|
|
|
- }
|
|
|
- if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(account)) {
|
|
|
- $('.tip-text1').text('账号格式不正确,请重新输入!');
|
|
|
- $('#account').addClass('br');
|
|
|
- return false
|
|
|
- } else {
|
|
|
- $('.tip-text1').text('');
|
|
|
- $('#account').removeClass('br')
|
|
|
- }
|
|
|
- if (!password) {
|
|
|
- $('.tip-text2').text('密码为空,请重新输入');
|
|
|
- $('#password').addClass('br');
|
|
|
- return false
|
|
|
- } else {
|
|
|
- $('.tip-text2').text('');
|
|
|
- $('#password').removeClass('br');
|
|
|
- }
|
|
|
- if (checkPass !== password) {
|
|
|
- $('.tip-text3').text('两次密码不一致,请重新输入!');
|
|
|
- $('#check').addClass('br');
|
|
|
- return false
|
|
|
- } else {
|
|
|
- $('.tip-text3').text('');
|
|
|
- $('#check').removeClass('br');
|
|
|
- return true
|
|
|
- }
|
|
|
+ beforeCheck: () => {
|
|
|
+ return true
|
|
|
},
|
|
|
- ready: function () { }, //加载完毕的回调
|
|
|
- success: function (params) { //成功的回调
|
|
|
- operate('dt_yhs_点击免费换机按钮', 'click', params.captchaVerification);
|
|
|
+ ready: () => {
|
|
|
+ }, //加载完毕的回调
|
|
|
+ success: (params) => { //成功的回调
|
|
|
+ setTimeout(() => {
|
|
|
+ submit(params.captchaVerification);
|
|
|
+ },1000)
|
|
|
},
|
|
|
error: function () {}
|
|
|
});
|
|
|
}
|
|
|
- //调用免费换机接口
|
|
|
- function changePhone(captchaVerification) {
|
|
|
- let data = {
|
|
|
- inviteTime: entryPageTime,
|
|
|
- type: fromType,
|
|
|
- account: account,
|
|
|
- password: password,
|
|
|
- captchaVerification: captchaVerification
|
|
|
- }
|
|
|
- if (!id) {
|
|
|
- delete data.inviteTime
|
|
|
- }
|
|
|
- let ajaxObj = {
|
|
|
- url: baseUrl + '/api/public/v1/activity/change/phone',
|
|
|
- type: 'post',
|
|
|
- headers: {
|
|
|
- 'Authorization': id //id
|
|
|
- },
|
|
|
+
|
|
|
+ function submit(captchaVerification){
|
|
|
+ var data = {}
|
|
|
+ data.userName = parameters['username'] ? parameters['username'] : null
|
|
|
+ data.type = parameters['type'] ? parameters['type'] : null
|
|
|
+ data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
|
|
|
+ data.newPhone = $('#recv_ipt').val();
|
|
|
+ data.captchaVerification = captchaVerification;
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/activity/v1/promote',
|
|
|
data: JSON.stringify(data),
|
|
|
+ type: 'post',
|
|
|
contentType: "application/json",
|
|
|
dataType: 'json',
|
|
|
cache: false,
|
|
|
success: function (res) {
|
|
|
if (res.status === 0) {
|
|
|
- $('.tip').animate({ top: '46vh' }, "fast");
|
|
|
- $('.mask1').show();
|
|
|
- $('.dialog1').animate({ top: '-6.96rem' }, "fast");
|
|
|
- $('.tip1').animate({ top: '-6.96rem' }, "fast");
|
|
|
- document.documentElement.style.overflow = 'hidden';
|
|
|
- } else if (res.status === 2002) {
|
|
|
- $('.tip1').animate({ top: '48vh' }, "fast");
|
|
|
- $('.mask1').show();
|
|
|
- $('.dialog1').animate({ top: '-6.96rem' }, "fast");
|
|
|
- $('.tip').animate({ top: '-6.96rem' }, "fast");
|
|
|
- document.documentElement.style.overflow = 'hidden';
|
|
|
- } else if (res.status === 2001) {
|
|
|
- $('.dialog1').animate({ top: '48vh' }, "fast");
|
|
|
- $('.mask1').show();
|
|
|
- $('.tip').animate({ top: '-6.96rem' }, "fast");
|
|
|
- $('.tip1').animate({ top: '-6.96rem' }, "fast");
|
|
|
- document.documentElement.style.overflow = 'hidden';
|
|
|
+ toastr.error('领取成功')
|
|
|
+ $(window).attr('location', res.data);
|
|
|
+ } else if (res.status === 1) {
|
|
|
+ toastr.error(res.msg)
|
|
|
+ setTimeout(function() {
|
|
|
+ $(window).attr('location', 'http://www.androidscloud.com/');
|
|
|
+ }, 1000)
|
|
|
+ } else if(res.status === 11){
|
|
|
+ $('#mpanel2').eq(0).text('');
|
|
|
+ validate(); // 生成验证码
|
|
|
+ setTimeout(() => {
|
|
|
+ document.getElementById('form-btn').click();
|
|
|
+ },500)
|
|
|
+ } else {
|
|
|
+ toastr.error(res.msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function getUserInfo() {
|
|
|
+ var userName = parameters['username'] ? parameters['username'] : null
|
|
|
+ userName = Base64.decode(userName)
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/activity/v3/invitation/getNickname?username=' + userName,
|
|
|
+ type: 'get',
|
|
|
+ cache: false,
|
|
|
+ dataType: 'text',
|
|
|
+ success: function (res) {
|
|
|
+ var result = JSON.parse(res)
|
|
|
+ if (result.status === 0) {
|
|
|
+ $(".username").text(result.data.nickName)
|
|
|
+ getHead(result.data.fileId)
|
|
|
}
|
|
|
}
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function getHead(fileId) {
|
|
|
+ $('.head img').attr('src', '../static/img/invite/header-img.png');
|
|
|
+ var timestamp = new Date().getTime()
|
|
|
+ var encrypts = encrypt(
|
|
|
+ 'RuiChiSecurityGo' + timestamp,
|
|
|
+ 'RuiChiSecurityGo'
|
|
|
+ )
|
|
|
+ var data = {
|
|
|
+ keyType: 2,
|
|
|
+ security: encrypts
|
|
|
}
|
|
|
- if (!id) {
|
|
|
- delete ajaxObj.headers
|
|
|
+ let urls = baseUrl == 'http://14.18.190.141:24380'?'http://110.53.221.195:8210':'https://wjzx.androidscloud.com:9091';
|
|
|
+ $.ajax({
|
|
|
+ url: `${urls}/document/newFile/download/0/3dn9b4585511476691c6?fileKey=`+fileId,
|
|
|
+ type: 'get',
|
|
|
+ headers: data,
|
|
|
+ xhrFields: { responseType: "blob" },
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ var xhr = new XMLHttpRequest();
|
|
|
+ var imageType = xhr.getResponseHeader("Content-Type");
|
|
|
+ var blob = new Blob([res], { type: imageType });
|
|
|
+ var imageUrl = (window.URL || window.webkitURL).createObjectURL(blob);
|
|
|
+ $('.head img').attr('src', imageUrl);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function encrypt(word, keyStr) {
|
|
|
+ keyStr = keyStr || 'RuiChiSecurityGo' // 判断是否存在ksy,不存在就用定义好的key
|
|
|
+ var key = CryptoJS.enc.Utf8.parse(keyStr)
|
|
|
+ var srcs = CryptoJS.enc.Utf8.parse(word)
|
|
|
+ var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
|
|
|
+ return encrypted.toString()
|
|
|
+ }
|
|
|
+
|
|
|
+ getUserInfo();
|
|
|
+ function handleClick() {
|
|
|
+ stopManyClick(result);
|
|
|
+ }
|
|
|
+ function result() {
|
|
|
+ var time = new Date().getTime()
|
|
|
+ var data = {}
|
|
|
+ data.userName = parameters['username'] ? parameters['username'] : null
|
|
|
+ data.type = parameters['type'] ? parameters['type'] : null
|
|
|
+ data.extensionType = parameters['extensionType'] ? parameters['extensionType'] : '2'
|
|
|
+ toastr.options = {
|
|
|
+ positionClass: "toast-center-center",
|
|
|
+ timeOut: 1500
|
|
|
+ };
|
|
|
+ var ipt_phone = $('#recv_ipt').val();
|
|
|
+ var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
|
|
|
+ var res = validator.test(ipt_phone)
|
|
|
+ var downLoaderCount = Number(localStorage.getItem('downLoaderCount'))
|
|
|
+ downLoaderCount ? localStorage.setItem('downLoaderCount', downLoaderCount + 1) : localStorage.setItem('downLoaderCount', 1)
|
|
|
+ if (!ipt_phone) {
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('请填写正确的手机号')
|
|
|
+ })
|
|
|
+ } else if (!res) {
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('请填写正确的手机号')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ data.newPhone = ipt_phone
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/activity/v1/promote',
|
|
|
+ data: JSON.stringify(data),
|
|
|
+ type: 'post',
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.status === 0) {
|
|
|
+ toastr.error('领取成功')
|
|
|
+ $(window).attr('location', res.data);
|
|
|
+ } else if (res.status === 1) {
|
|
|
+ toastr.error(res.msg)
|
|
|
+ setTimeout(function() {
|
|
|
+ $(window).attr('location', 'http://www.androidscloud.com/');
|
|
|
+ }, 1000)
|
|
|
+ } else if(res.status === '0011'){
|
|
|
+ $('#mpanel2').eq(0).text('');
|
|
|
+ validate(); // 生成验证码
|
|
|
+ setTimeout(() => {
|
|
|
+ document.getElementById('form-btn').click();
|
|
|
+ },500)
|
|
|
+ } else {
|
|
|
+ toastr.error(res.msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- $.ajax(ajaxObj)
|
|
|
}
|
|
|
+ function visit() {
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/user/v3/invitation/client/addInviteData',
|
|
|
+ type: 'get',
|
|
|
+ cache: false,
|
|
|
+ dataType: 'text',
|
|
|
+ success: function () {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // visit()
|
|
|
//防止提示一秒内重复显示
|
|
|
function stopManyClick(fn) {
|
|
|
if (flag) {
|
|
|
fn();
|
|
|
}
|
|
|
flag = false;
|
|
|
- if (timer) { clearTimeout(timer); }
|
|
|
- timer = setTimeout(() => { flag = true }, 1500);
|
|
|
+ if(timer){clearTimeout(timer);}
|
|
|
+ timer = setTimeout(() => {flag = true}, 1500);
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|