|
|
@@ -0,0 +1,208 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="zh-CN">
|
|
|
+
|
|
|
+<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>
|
|
|
+ <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 class="invite-container">
|
|
|
+ <div class="pr">
|
|
|
+ <picture>
|
|
|
+ <source media="(max-width: 640px)" srcset="../static/img/inviteTop.png 640w" />
|
|
|
+ <source media="(min-width: 640px)" srcset="../static/img/inviteTop.png 1366w" />
|
|
|
+ <img src="../static/img/inviteTop.png" class="bottom-img" alt="">
|
|
|
+ </picture>
|
|
|
+ <div class="recv-cont">
|
|
|
+ <div class="recv-ipt" id="recv_ipt">
|
|
|
+ <span id="invitationCode"></span>
|
|
|
+ <span class="copy-btn-style btn-code-copy">复制</span>
|
|
|
+ </div>
|
|
|
+ <div onclick="appDown()" class="mt40">
|
|
|
+ <div class="recv-btn" id="recv_btn"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="load-menu">
|
|
|
+ <div class="center-reward-con">
|
|
|
+ <div class="top-title">你的奖励</div>
|
|
|
+ <div class="reward-second-title">好友购机,返时长奖励</div>
|
|
|
+ <div id="goode"></div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div style="display: flex;justify-content: center;">
|
|
|
+ <div class="code-title-font"></div>
|
|
|
+ </div>
|
|
|
+ <div class="tb-codes">
|
|
|
+ <p class="fw500 fs28">好友购机,买一送一</p>
|
|
|
+ <p class="fs26">被邀好友购买任意套餐,您可获其等额时长返现(仅限首单);邀请越多返现越多,返现无上限;</p>
|
|
|
+ <p class="fs26 mb45">请在参与活动前认真阅读规则,因未按规则参与活动而造成的损失,由用户自行承担</p>
|
|
|
+ <p class="fw500 fs26">规则</p>
|
|
|
+ <p class="fs26">1. 好友购机前,邀请人账户内无云手机(无云机购买记录者),或仅有2小时免费体验时长的用户,则无法获时长奖励;</p>
|
|
|
+ <p class="fs26">2. 邀请成功后,双方自动成为好友,邀请奖励将通过好友消息的方式进行发放,邀请方需要点击【领取】,才可领取成功。邀请奖励领取期限为24小时,超过领取期限则无法领取奖励。</p>
|
|
|
+ <p class="fs26">3. 如发现有刷单等行为用户,将对该账号及其所关联账号进行冻结处理;</p>
|
|
|
+ <p class="fs26">4. 本活动最终解释权归双子星云手机所有。</p>
|
|
|
+ </div>
|
|
|
+ </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 = '3000';
|
|
|
+ </script>
|
|
|
+ <script type="text/javascript">
|
|
|
+ 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 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 (isiOS) {
|
|
|
+ var btnMsg = '立即邀请'
|
|
|
+ } else if (isAndroid) {
|
|
|
+ btnMsg = '立即邀请'
|
|
|
+ } else {
|
|
|
+ btnMsg = '复制邀请链接'
|
|
|
+ }
|
|
|
+ $('#recv_btn').append(btnMsg)
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/user/v3/invitation/client/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 () {
|
|
|
+ var input = document.getElementById("passwordCopy");
|
|
|
+ // 选中文本
|
|
|
+ input.select();
|
|
|
+ // 执行浏览器复制命令
|
|
|
+ document.execCommand("copy");
|
|
|
+ toastr.error('复制成功', 0)
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res.data.friendList.length > 0) {
|
|
|
+ var str = '<ul class="goodFriend-title-list"><li class="tal">被邀请好友帐号</li><li class="tac">获时长数(小时)</li><li class="tar">邀请时间</li></ul>'
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ $("#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);
|
|
|
+ toastr.error('请输入正确的手机号')
|
|
|
+ }
|
|
|
+ if (ipt_phones.length >= 12) {
|
|
|
+ toastr.error('请输入正确的手机号')
|
|
|
+ var recvstr = ipt_phones.substring(0, 11)
|
|
|
+ $("#recv_ipt").val(recvstr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ 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 (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) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (isAndroid) {
|
|
|
+ window.native.onClikWebView()
|
|
|
+ } else {
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/user/v1/promote',
|
|
|
+ type: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ //加载数据
|
|
|
+ var copyBefore = JSON.stringify(res.data.url);
|
|
|
+ var copyUrl = copyBefore.split('"');
|
|
|
+ $('#inviteCopy').val(copyUrl[1]);
|
|
|
+ var input = document.getElementById("inviteCopy");
|
|
|
+ // 选中文本
|
|
|
+ input.select();
|
|
|
+ // 执行浏览器复制命令
|
|
|
+ document.execCommand("copy");
|
|
|
+ toastr.error('复制成功')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+
|
|
|
+</html>
|