|
@@ -1,359 +1,340 @@
|
|
|
<!DOCTYPE html>
|
|
|
-<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
|
|
+<html lang="zh-CN">
|
|
|
|
|
|
<head>
|
|
|
- <meta charset="UTF-8">
|
|
|
- <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/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/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/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>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
+ <title>邀请有礼</title>
|
|
|
+ <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
|
|
|
+ <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
|
|
|
+ <link rel="stylesheet" href="../static/css/invite.css">
|
|
|
+ <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
|
|
|
+ <script src="../static/js/vender/toastr/toastr.min.js"></script>
|
|
|
+ <script src="../static/js/vender/config.js"></script>
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
- <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="invite-container pr">
|
|
|
+ <div class="rules" onclick="handleShow()">活动规则</div>
|
|
|
+ <div class="h658">
|
|
|
+ <img src="../static/img/invite/inviteTop.png" class="bottom-img" alt="">
|
|
|
+ <div class="recv-cont">
|
|
|
+ <div class="title" id="title">
|
|
|
+ </div>
|
|
|
+ <div class="recv-btn-container">
|
|
|
+ <div onclick="appDown()" class="recv-btn"></div>
|
|
|
+ </div>
|
|
|
+ <div class="recv-ipt" id="recv_ipt">
|
|
|
+ <span class="fl">
|
|
|
+ <span>我的邀请码:</span>
|
|
|
+ <span class="fw500" id="invitationCode"></span>
|
|
|
+ </span>
|
|
|
+ <span class="copy-btn-style btn-code-copy fr">点击复制</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <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 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';
|
|
|
- // 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('请填写正确的手机号')
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
+ <div class="load-menu">
|
|
|
+ <div class="center-reward-con">
|
|
|
+ <div class="top-title">我的奖励</div>
|
|
|
+ <div id="goode">
|
|
|
+ <div class="reward-second-title"></div>
|
|
|
+ <ul class="goodFriend-title-list">
|
|
|
+ <li class="tac">被邀好友帐号</li>
|
|
|
+ <li class="tac">获时长数(小时)</li>
|
|
|
+ <li class="tac">邀请时间</li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="center-reward-con mt40">
|
|
|
+ <div class="top-title">邀请榜TOP10</div>
|
|
|
+ <div id="rank">
|
|
|
+ <ul class="goodFriend-title-list">
|
|
|
+ <li class="tac">排名</li>
|
|
|
+ <li class="tac">用户名</li>
|
|
|
+ <li class="tac">邀请数量</li>
|
|
|
+ <li class="tac">奖励(时长)</li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mask">
|
|
|
+ <div class="dialog">
|
|
|
+ <div class="code-title-font"></div>
|
|
|
+ <div class="tb-codes">
|
|
|
+ <p class="fw500">好友购机,买一送一</p>
|
|
|
+ <p>被邀好友购买任意套餐,您可获其等额时长返现(仅限首单);邀请越多返现越多,返现无上限。请用户参与活动前认真阅读规则,若因未按规则参与活动而造成的损失,由用户自行承担。</p>
|
|
|
+ <p class="fw500">规则</p>
|
|
|
+ <p>1、好友购机前,邀请人账户内无云手机(无云手机购买记录者),或仅有免费试用时长的用户,则无法获时长奖励;</p>
|
|
|
+ <p>2、邀请成功后,双方自动成为好友,邀请奖励将通过好友消息的方式进行发放,邀请方需要点击【领取】,才可领取成功,时长奖励返现至您账户内时长最多的云手机。邀请奖励领取期限为24小时,超过领取期限则无法领取奖励。</p>
|
|
|
+ <p>3、如发现有刷单等行为用户,将对该账号及其所关联账号进行冻结处理;</p>
|
|
|
+ <p>4、本活动最终解释权归双子星云手机所有。</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="close" onclick="handleClose()"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="passwordCopy" value="">
|
|
|
+ <input type="text" style="opacity: 0;z-index: -10;position: fixed;" id="inviteCopy" value="">
|
|
|
+ <script>
|
|
|
+ toastr.options.positionClass = 'toast-center-center';
|
|
|
+ toastr.options.timeOut = '1500';
|
|
|
+ </script>
|
|
|
+ <script type="text/javascript">
|
|
|
+ let timer, flag = true;
|
|
|
+ var url = window.location.href;
|
|
|
+ url = url.split('/')
|
|
|
+ // var baseUrl = url[0] + '//' + url[2]
|
|
|
+ var loc = window.location.search;
|
|
|
+ var n1 = loc.length;//地址的总长度
|
|
|
+ var n2 = loc.indexOf("=");//取得=号的位置
|
|
|
+ // var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
|
|
|
+ var id = loc.substr(n2 + 1, n1 - n2);//从=号后面的内容
|
|
|
+ var u = navigator.userAgent;
|
|
|
+ var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
|
+ var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
|
|
+ if (!id) {
|
|
|
+ if (isAndroid) {
|
|
|
+ window.native.toGame('noToken');
|
|
|
+ } else if (isiOS) {
|
|
|
+ window.webkit.messageHandlers.getPackageName.postMessage('noToken');
|
|
|
+ } else {
|
|
|
+ toastr.error('请登录')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/activity/v3/invitation/getInvitationInfo',
|
|
|
+ type: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ $('#invitationCode').text(res.data.invitationCode)
|
|
|
+ //加载数据
|
|
|
+ $('#passwordCopy').val($('#invitationCode').text());
|
|
|
+ //复制按钮
|
|
|
+ $('.btn-code-copy').on('click', function () {
|
|
|
+ stopManyClick(() => {
|
|
|
+ var input = document.getElementById("passwordCopy");
|
|
|
+ // 选中文本
|
|
|
+ input.select();
|
|
|
+ // 执行浏览器复制命令
|
|
|
+ // document.activeElement.blur();
|
|
|
+ document.execCommand("copy");
|
|
|
+ toastr.error('复制成功', 0)
|
|
|
+ })
|
|
|
+ });
|
|
|
+ if (res.data.friendList.length > 0) {
|
|
|
+ var str = ''
|
|
|
+ for (var i = 0; i < res.data.friendList.length; i++) {
|
|
|
+ var phone = res.data.friendList[i].newPhone
|
|
|
+ var inviteMsg = res.data.friendList[i].duration
|
|
|
+ var registerTime = res.data.friendList[i].createTime
|
|
|
+ var nPhone = phone.substr(0, 3) + '****' + phone.substring(7, 11)
|
|
|
+ str += '<div class="goodFriend-item">'
|
|
|
+ str += '<span class="tal">' + nPhone + '</span>'
|
|
|
+ str += Number(inviteMsg) && inviteMsg > 0 ? '<span class="tac cF04646">' + inviteMsg + '</span>' : '<span class="tac">' + inviteMsg + '</span>'
|
|
|
+ str += '<span class="tar">' + registerTime + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ }
|
|
|
+ } else if (res.data.friendList.length === 0) {
|
|
|
+ str = '<div class="no-data">还没有邀请到好友哦~</div>'
|
|
|
+ }
|
|
|
+ $('#goode').append(str);
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ str = '<div class="no-data">还没有邀请到好友哦~</div>'
|
|
|
+ $('#goode').append(str)
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- function validate() {
|
|
|
- $('#mpanel2').slideVerify({
|
|
|
- baseUrl: baseUrl + '/api/activity', //服务器请求地址, 默认地址为安吉服务器;
|
|
|
- mode: 'pop', //展示模式
|
|
|
- containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
|
|
|
- imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
|
|
|
- width: imgWidth,
|
|
|
- height: imgHeight
|
|
|
- },
|
|
|
- barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
|
|
|
- width: imgWidth,
|
|
|
- height: barHeight
|
|
|
- },
|
|
|
- beforeCheck: () => {
|
|
|
- return true
|
|
|
- },
|
|
|
- ready: () => {
|
|
|
- }, //加载完毕的回调
|
|
|
- success: (params) => { //成功的回调
|
|
|
- setTimeout(() => {
|
|
|
- submit(params.captchaVerification);
|
|
|
- },1000)
|
|
|
- },
|
|
|
- error: function () {}
|
|
|
- });
|
|
|
- }
|
|
|
+ $("#recv_ipt").bind('input propertychange', function (e) {
|
|
|
+ stopManyClick(() => {
|
|
|
+ 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);
|
|
|
+ toastr.error('请输入正确的手机号')
|
|
|
+ }
|
|
|
+ if (ipt_phones.length >= 12) {
|
|
|
+ toastr.error('请输入正确的手机号')
|
|
|
+ var recvstr = ipt_phones.substring(0, 11)
|
|
|
+ $("#recv_ipt").val(recvstr);
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- 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) {
|
|
|
- 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
|
|
|
- }
|
|
|
- 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)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- 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);
|
|
|
- }
|
|
|
- </script>
|
|
|
+ });
|
|
|
+ function handleShow() {
|
|
|
+ $('.dialog').animate({ top: '2.4rem' }, "fast");
|
|
|
+ $('.close').animate({ top: '10.56rem' }, "fast");
|
|
|
+ $('.mask').show();
|
|
|
+ document.documentElement.style.overflow = 'hidden';
|
|
|
+ }
|
|
|
+ function handleClose() {
|
|
|
+ $('.dialog').animate({ top: '-6.96rem' }, "fast");
|
|
|
+ $('.close').animate({ top: '-0.68rem' }, "fast");
|
|
|
+ $('.mask').hide();
|
|
|
+ document.documentElement.style.overflow = 'auto';
|
|
|
+ }
|
|
|
+ function appDown() {
|
|
|
+ var u = navigator.userAgent;
|
|
|
+ var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
|
|
+ var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
|
|
+ if (!id) {
|
|
|
+ if (isAndroid) {
|
|
|
+ window.native.toGame('noToken');
|
|
|
+ } else if (isiOS) {
|
|
|
+ window.webkit.messageHandlers.getPackageName.postMessage('noToken');
|
|
|
+ } else {
|
|
|
+ toastr.error('请登录')
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/activity/v1/promote/getImPromoteUrl',
|
|
|
+ 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)
|
|
|
+ if (isiOS) {
|
|
|
+ // WKWebView使用
|
|
|
+ // 使用下方方法,会报错,为使界面执行逻辑通畅,因此使用try-catch
|
|
|
+ try {
|
|
|
+ getMessage(jsonObj);
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ window.webkit.messageHandlers.getMessage.postMessage(jsonObj)
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ } else if (isAndroid) {
|
|
|
+ window.native.onClikWebView()
|
|
|
+ } else {
|
|
|
+ stopManyClick(() => {
|
|
|
+ //加载数据
|
|
|
+ var copyBefore = JSON.stringify(res.data.url);
|
|
|
+ var copyUrl = copyBefore.split('"');
|
|
|
+ console.log(copyUrl[1])
|
|
|
+ $('#inviteCopy').val(copyUrl[1]);
|
|
|
+ var input = document.getElementById("inviteCopy");
|
|
|
+ // 选中文本
|
|
|
+ input.select();
|
|
|
+ // 执行浏览器复制命令
|
|
|
+ document.execCommand("copy");
|
|
|
+ toastr.error('复制成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 查询季度排行榜
|
|
|
+ function getInvitationRankList() {
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/activity/v3/invitation/getInvitationRankList',
|
|
|
+ type: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ var str = '';
|
|
|
+ if (res.status === 0) {
|
|
|
+ res.data.forEach(function (item, index) {
|
|
|
+ var surfaceName = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(item.surfaceName) ? item.surfaceName.substr(0, 3) + '****' + item.surfaceName.substring(7, 11) : item.surfaceName
|
|
|
+ if (index === 0) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no1.png" alt=""></span>'
|
|
|
+ str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ } else if (index === 1) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no2.png" alt=""></span>'
|
|
|
+ str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ } else if (index === 2) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac h52"><img class="icon" src="../static/img/invite/no3.png" alt=""></span>'
|
|
|
+ str += '<span class="tac cF04646">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac cF04646">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ } else if (index < 10) {
|
|
|
+ str += '<div class="rank-item">';
|
|
|
+ str += '<span class="tac c333">' + (index + 1) + '</span>'
|
|
|
+ str += '<span class="tac">' + surfaceName + '</span>'
|
|
|
+ str += '<span class="tac">' + item.invitationNum + '</span>'
|
|
|
+ str += '<span class="tac">' + item.duration + '</span>'
|
|
|
+ str += '</div>';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ $('#rank').append(str);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ getInvitationRankList()
|
|
|
+ // 查询最新获得奖励
|
|
|
+ function getInvitationRecently() {
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/activity/v3/invitation/getInvitationRecently',
|
|
|
+ type: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.status === 0) {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.data.length <= 10) {
|
|
|
+ let datas = ['173', '134', '152', '136', '138', '173', '134', '152', '136', '138'];
|
|
|
+ var str = '<ul class="list">'
|
|
|
+ datas.forEach(function (item) {
|
|
|
+ str += '<li>恭喜' + item + '*******成功获得时长' + (item - 100) + '小时</li>'
|
|
|
+ })
|
|
|
+ str += '</ul>'
|
|
|
+ } else {
|
|
|
+ var str = '<ul class="list">'
|
|
|
+ res.data.forEach(function (item) {
|
|
|
+ str += '<li>恭喜' + item.username.substr(0, 3) + '*******成功获得时长' + item.duration + '小时</li>'
|
|
|
+ })
|
|
|
+ str += '</ul>'
|
|
|
+ }
|
|
|
+ $('#title').append(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ getInvitationRecently()
|
|
|
+ //防止提示一秒内重复显示
|
|
|
+ function stopManyClick(fn) {
|
|
|
+ if (flag) {
|
|
|
+ fn();
|
|
|
+ }
|
|
|
+ flag = false;
|
|
|
+ if (timer) { clearTimeout(timer); }
|
|
|
+ timer = setTimeout(() => { flag = true }, 1500);
|
|
|
+ }
|
|
|
+ </script>
|
|
|
</body>
|
|
|
-<style>
|
|
|
- #toast-container>.toast-error {
|
|
|
- background-image: none !important;
|
|
|
- }
|
|
|
-
|
|
|
- .toast-error {
|
|
|
- background-color: rgba(0, 0, 0, 0.8);
|
|
|
- }
|
|
|
-
|
|
|
- #toast-container>div {
|
|
|
- font-size: 14px;
|
|
|
- min-width: 80px !important;
|
|
|
- padding: 12px !important;
|
|
|
- box-shadow: none;
|
|
|
- }
|
|
|
-
|
|
|
- .toast-center-center {
|
|
|
- position: fixed;
|
|
|
- min-width: 220px;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- text-align: center;
|
|
|
- transform: translateX(-50%);
|
|
|
- color: #FFFFFF;
|
|
|
- border-radius: 0.2rem;
|
|
|
- }
|
|
|
-
|
|
|
- @media (max-width: 480px) and (min-width: 241px) {
|
|
|
- #toast-container>div {
|
|
|
- min-width: 80px !important;
|
|
|
- width: auto;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @media only screen and (min-width: 640px) {
|
|
|
- .toast-center-center {
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @media only screen and (max-width: 640px) {
|
|
|
- .toast-center-center {
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- input::-webkit-input-placeholder {
|
|
|
- color: #BBBBBB;
|
|
|
- }
|
|
|
-
|
|
|
- input::-moz-placeholder {
|
|
|
- /* Mozilla Firefox 19+ */
|
|
|
- color: #BBBBBB;
|
|
|
- }
|
|
|
-
|
|
|
- input:-moz-placeholder {
|
|
|
- /* Mozilla Firefox 4 to 18 */
|
|
|
- color: #BBBBBB;
|
|
|
- }
|
|
|
-
|
|
|
- input:-ms-input-placeholder {
|
|
|
- /* Internet Explorer 10-11 */
|
|
|
- color: #BBBBBB;
|
|
|
- }
|
|
|
-</style>
|
|
|
|
|
|
</html>
|