123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
- <title>双11全球狂欢节红包</title>
- <link rel="stylesheet" type="text/css" href="public.css"/>
- <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
- <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1277653001'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s5.cnzz.com/z_stat.php%3Fid%3D1277653001' type='text/javascript'%3E%3C/script%3E"));</script>
- <script type="text/javascript">
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- window.onresize = function(){
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- }
- document.getElementById("cnzz_stat_icon_1277653001").style.display="none"; // 隐藏统计小图标
- //声明_czc对象:
- var _czc = _czc || [];
- //绑定siteid,请用您的siteid替换下方"XXXXXXXX"部分
- _czc.push(["_setAccount", "1277653001"]);
- </script>
- <style type="text/css">
- body{width: 100%;height: 100vh;background: #fff;}
- .container{width: 100%;min-height: 100vh;background: url(img-618/11_bg.png) no-repeat;background-size:100% ;}
- .button{
- display: block;width: 2.2rem;height: .8rem;background: url(img-618/buttonBack.png) no-repeat;background-size: 100%;position: absolute;left: 0;right: 0;top: 4.6rem;margin: auto;
- }
- .shadbox {
- width: 2.1rem;height: .48rem;position: absolute;top: 0;left: .05rem;border-radius: .3rem;z-index: 1;overflow: hidden;
- }
- .shadowImg {display: inline-block; width: .33rem;height: 100%;position: absolute;left: 0;top: 0;transform: translate(0,0);
- animation: move 2.4s infinite;}
- .text {
- width: 1.22rem;
- height: .34rem;
- position: relative;
- z-index: 2;
- margin-left: .25rem;
- margin-top: -.24rem;
- background-image: url(img-618/text.png);
- background-size: 100% 100%;
- }
- .go {
- width: .57rem;
- height: .58rem;
- background-image: url(img-618/goBtn.png);
- background-size: 100% 100%;
- position: absolute;
- top: -.17rem;
- right: .1rem;
- z-index: 2;
- animation: scale 1s infinite;
- }
- .con{
- width: 77%;
- position: absolute;
- top: 5.6rem;
- left: 0;
- right: 0;
- margin: auto;
- font-size: 0.13rem;
- line-height: 0.2rem;
- color: #333;
- min-height: 1.5rem;
- }
- .con .copyButton{
- width: 2rem;
- height: .42rem;
- background: url(img-618/copy.png) no-repeat;
- background-size:auto 100%;
- color: #fff;
- display: block;
- margin: 0.2rem auto 0;
- font-size: 0.14rem;
- border-radius: 0.3rem;
- }
- .hint{
- display: block;
- min-height: 0.6rem;
- }
- .hint02{
- text-align: center;
- padding: 0.2rem 0;
- color: #9604af;
- }
- #copy_1,#copy_2,#taokouling{
- position: absolute;
- left: -1000rem;
- }
- .alert-info {
- position: fixed;
- top: 4rem;
- right: 0;
- left: 0;
- bottom: 0;
- z-index: 4;
- text-align: center;
- }
-
- .alert-info p {
- display: inline-block;
- height: 0.38rem;
- color: #fff;
- font-size: 0.16rem;
- line-height: 0.38rem;
- padding: 0 0.10rem;
- background-color: rgba(0, 0, 0, 0.7);
- border-radius: 5px;
- }
- .toast {
- display: none;
- width: 3.2rem;
- height: 3.3rem;
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%,-50%);
- z-index: 4;
- }
- .toastImg {
- display: inline-block;
- width: 100%;
- }
- .tkl {
- width: 2.4rem;
- position: absolute;
- top: 1.2rem;
- left: 50%;
- transform: translate(-50%,0);
- color: #090909;
- font-family: "PingFang SC,Microsoft YaHei,SourceHanSansCN-Normal,HiraginoSansGB,HiraginoSans-W3,Helvetica Neue,Helvetica,STHeiTi,sans-serif";
- }
- .btn {
- width: 1.8rem;
- height: .5rem;
- position: absolute;
- top: 2.4rem;
- left: 50%;
- transform: translate(-50%,0);
- }
- .main {
- display: none;
- width: 100%;
- height: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 3;
- background: rgba(0,0,0,.4);
- }
- @keyframes scale {
- 0% {transform: scale(1.2);}
- 50% {transform: scale(1);}
- 100% {transform: scale(1.2);}
- }
- @keyframes move {
- 0% {transform: translate(0,0);}
- 100% {transform: translate(2.1rem,0);}
- }
- @keyframes move1 {
- 0% {transform: translate(-.22rem,0);}
- 100% {transform: translate(2.1rem,0);}
- }
- </style>
- </head>
- <body>
- <div class="container">
- <input id="copy_1" type="text" readOnly="true" value=""/>
- <div id="copy_2"></div>
- <text id="taokouling"></text>
- <button class="button" onclick="toTaobao()">
- <div class="text"></div>
- <div class="go"></div>
- <div class="shadbox">
- <img class="shadowImg" src="./img-618/shadow.png" alt="">
- </div>
- </button>
- <div class="con">
- <p class="hint">双11全球狂欢节--疯狂开趴购不停。超级红包来敲门,每天三次机会,考验手气的时刻抢就对了,还有超多惊喜等你来,复制淘口令</p>
- <button class="copyButton" onclick="showToast()"></button>
- </div>
- </div>
- <div class="alert-info" style="display: none;">
- <!-- tip提示,3s后消失 -->
- <p></p>
- </div>
- <div class="main"></div>
- <div class="toast">
- <img class="toastImg" src="./img-618/toast.png" alt="">
- <p class="tkl"></p>
- <div class="btn" onclick="copyPassword()"></div>
- </div>
- </body>
- </html>
- <script type="text/javascript">
- var token=''
- var tbUrl='',source = null
- var qs = parseQueryString(window.location.href);
- $().ready(function () {
- getToken()
- _czc.push(["_trackEvent",'2020-11-11','猎豆','页面加载']); //埋点
-
- })
-
- // 获取token
- function getToken() {
- var param = {
- "js_callback" : "callbackLogin"
- };
- param = JSON.stringify(param)
- try {
- if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
- window.webkit.messageHandlers.app_h5_login.postMessage(param);
- }
- if (navigator.userAgent.match(/android/i)) {
- obj4H5.app_h5_isLogin(param);
- }
- } catch (e) {
- // token='4f422467a11afa2cedaa593686f9b1d4257657'
- // todayTbkPassword()
- }
- }
- function callbackLogin(data) {//app token 回调
- var data = JSON.parse(data); //上线时添加
- if (navigator.userAgent.match(/android/i)&&!data.isLogin) {
- obj4H5.app_h5_login(JSON.stringify({
- "js_callback" : "callbackLogin"
- }));
- return false;
- }else {
- token=data.token; //上线时添加
- if(token) {
- todayTbkPassword()
- }
- }
- }
- //获取淘口令
- function todayTbkPassword(type) {
- if(token) {
- $.ajax({
- type: "get",
- url: "/api/v2/act_main_618",
- typeData: 'json',
- headers:{
- token:token
- },
- success: function (res) {
- if (res && res.errno == 0) {
- var tkl=res.rst.data.taoToken
- tbUrl=res.rst.data.m_url
- $(".tkl").text(tkl);
- $("#taokouling").text(tkl);
- }else {
- showMsg(res.err)
- }
- }
- });
- }else {
- getToken();
- }
-
- }
- function showToast() {
- $(".toast").show();
- $(".main").show();
- $("body").attr("style","overflow:hidden;")
- if(!$("#taokouling").text()) {
- todayTbkPassword();
- }
- }
- // 复制文字
- function copyPassword() {
- if(token) {
- var data = document.getElementById("taokouling").innerHTML;
- copy_2.innerHTML = data;
- copy_1.value = data;
- if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
- //区分iPhone设备
- window.getSelection().removeAllRanges();//这段代码必须放在前面否则无效
- var Url2 = document.getElementById("copy_2");//要复制文字的节点
- var range = document.createRange();
- // 选中需要复制的节点
- range.selectNode(Url2);
- // 执行选中元素
- window.getSelection().addRange(range);
- // 执行 copy 操作
- var successful = document.execCommand('copy');
- // 移除选中的元素
- window.getSelection().removeAllRanges();
- } else {
- var Url2 = document.getElementById("copy_1");//要复制文字的节点
- Url2.select(); // 选择对象
- document.execCommand("Copy"); // 执行浏览器复制命令
- }
- showMsg('复制成功')
-
- _czc.push(["_trackEvent",'2020-11-11','猎豆','复制淘口令']); //埋点
- }else {
- getToken();
- }
- }
- $(".btn").on("click",function(){
- $(".toast").hide();
- $(".main").hide();
- $("body").attr("style","")
- })
- // 打开淘宝
- function toTaobao() {
- _czc.push(["_trackEvent",'2020-11-11','猎豆','页面跳转']); //埋点
- if(token&&tbUrl) {
- var param = {
- "taobaoUrl" : tbUrl,//淘宝链接
- }
- param = JSON.stringify(param)
- try {
- if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
- window.webkit.messageHandlers.app_h5_open_taobao_url.postMessage(param);
- }
- if(navigator.userAgent.match(/android/i)){
- obj4H5.app_h5_open_taobao_url(param);
- }
- } catch (error) {
- }
- }else {
- getToken()
- }
- }
- function showMsg(msg) {
- //弹框
- var msgBox = document.getElementsByClassName('alert-info')[0];
- msgBox.children[0].innerText = msg;
- msgBox.style.display="block";
- setTimeout(function() {
- msgBox.style.display="none";
- }, 1500);
- }
- //获取地址栏参数
- function parseQueryString(url) {
- var urlObj = {};
- var reg = /([^?=&]+)=([^?=&]+)/g;
- url.replace(reg, function($0, $1, $2) {
- urlObj[$1] = decodeURIComponent($2);
- })
- return urlObj;
- }
- </script>
|