Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

libai / fsActive

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • fsActive
  • activeFt
  • liveData
  • lib
  • default.js
Find file
Normal viewHistoryPermalink
default.js 5.89 KB
Newer Older
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
1 2 3 4
/**
 * Created by webshow on 2019/11/22.
 */
var bbb = location.href;
libai's avatar
ft活动上线
31f3dcee
 
libai committed 11 months ago
5
if (bbb.indexOf("https://fsactive.fusi.club/") > -1) {
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
6 7 8 9 10 11 12
    $ip = "https://webserver.yabolive.net";
}
else{
    $ip = 'http://ceshi.yabolive.tv/web';
}
var bbb = location.href;
var data = url_get_params(bbb)
libai's avatar
ft活动上线
22d27a74
 
libai committed 10 months ago
13 14 15
if (sessionStorage.token == undefined) {
    sessionStorage.token = data.token; //t
    sessionStorage.uid = data.uid; //u
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    sessionStorage.version = data.appversion;
    sessionStorage.pkg=data.pkg;
    sessionStorage.lang=data.lang;
    sessionStorage.roomId = data.roomid;
    if(sessionStorage.roomId=='undefined')sessionStorage.roomId=0
}
sessionStorage.jump=data.jump
sessionStorage.isShowHalf=data.isShowHalf
function url_get_params(url_path) {
    var url = url_path;
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(url.indexOf("?") + 1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}
if (bbb.indexOf("http://localhost:63342") > -1) {
libai's avatar
ft活动上线
22d27a74
 
libai committed 10 months ago
37 38
    sessionStorage.uid = 23871190;
    sessionStorage.token = 'debug'
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
39 40 41
    sessionStorage.roomId=23864554
}
if (bbb.indexOf("file:///") > -1) {
libai's avatar
ft活动上线
22d27a74
 
libai committed 10 months ago
42 43
    sessionStorage.uid = 155100;
    sessionStorage.token = 'debug'
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
44 45 46 47 48 49 50 51
    sessionStorage.roomId=155100
    sessionStorage.lang=1
}
//ajax设置默认参数
$.ajaxSetup({
    global: false,
    type: 'get',
    data: {
libai's avatar
ft活动上线
22d27a74
 
libai committed 10 months ago
52 53
        uid: sessionStorage.uid,
        token: sessionStorage.token,
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
        lang:sessionStorage.lang,
        vest:0,
        cid:'web_gw',
        os:'WEB'
    },
    dataType: "JSON"
})
//点击刷新
$(".ref").on("click", function () {
    window.location.reload()
})
//与客户端交互
function appCollaboration(msg) {
    var ua = window.navigator.userAgent.toLowerCase();
    try {
        if (/iphone|ipad|ipod/.test(ua)) {
            window.webkit.messageHandlers.appCollaboration.postMessage(msg);
        } else if (/android/.test(ua)) {
            window.yazhai.appCollaboration(msg);
        }
    } catch (e) {
    }
}
//处理时间倒计时的函数
function timeDeal(e){
    var endTime=e;
    var newTime=new Date().getTime();
    var Remain=Math.floor((endTime-newTime)/1000);
    if(Remain<=0)window.location.reload();
    var day=Math.floor(Remain/86400);
    var hour=add0(Math.floor(Remain%86400/3600));
    if(hour>99)hour=99;
    var min=add0(Math.floor(Remain%3600/60));
    var sceond=add0(Math.floor(Remain%60));
    var timeArr=[day,hour,min,sceond];
    return timeArr;
}
function timeDeal2(e,time){
    var endTime=e;
    var newTime=time;
    var Remain=Math.floor((endTime-newTime)/1000);
    if(Remain<=0)Remain=0
    var bbb = location.href;
libai's avatar
ft活动上线
31f3dcee
 
libai committed 11 months ago
97
    if (bbb.indexOf("https://fsactive.fusi.club/") > -1) {
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
       if(Remain<=0)window.location.reload();
    }
    var day=add0(Math.floor(Remain/86400));
    var hour=add0(Math.floor(Remain/3600));
    if(hour>99)hour=99;
    var min=add0(Math.floor(Remain%3600/60));
    var sceond=add0(Math.floor(Remain%60));
    var timeArr=[day,hour,min,sceond];
    return timeArr;
}
//时间戳转具体 年月日时分秒
function timeGet(e){
    var time = new Date(Number(e));
    var y = time.getFullYear();
    var m = time.getMonth()+1;
    var d = time.getDate();
    var h = time.getHours();
    var mm = time.getMinutes();
    var s = time.getSeconds();
    var timeArr=[y,m,d,add0(h),add0(mm),s]
    return timeArr
}


//一位数前面加0
function add0(m) {
    return m < 10 ? '0' + m : m
}
function add00(m){
    if(m<10){
        return '00'+m
    }else if(m>10&&m<100){
        return '0'+m
    }else{
        return m
    }
}
function imgAdd(m){
    if(String(m).length > 5) return m;
    return (Array(5).join(0) + m).slice(-5);
}
//一万以上省略
function addw(e){
    if(e>=100000000){
        return Math.floor((e/100000000).toFixed(2)*10)/10+'亿';
    }
    else if(e>=10000){
        return Math.floor((e/10000).toFixed(2)*10)/10+'万';
    }else{
        return Math.ceil(e);
    }
}
function addDoc(e){
    if(e%1==0){
        return e+'.0';
    }else return e
}
function loadImageGo(name,sNum,eNum,num) {
    var imgList = [];
    var num = sNum;
    loadImage()
    function loadImage() {
        var img = new Image();
        img.addEventListener("load", loadHandler);
        img.src = "images/" + name + "/"+num+"_" + imgAdd(num) + ".png";
    }
    function loadHandler() {
        imgList.push(this.cloneNode());
        num++;
        if (num > eNum) { return; }
        this.src = "images/" + name + "/"+num+"_" + imgAdd(num)  + ".png";
    }
}  
//跳转充值页面
function goReg(){
    if(sessionStorage.pkg=='qingliang'){
        var ua = window.navigator.userAgent.toLowerCase();
        if (/iphone|ipad|ipod/.test(ua)) {
            window.location.href='yazhai://_recharge';
        }else{
libai's avatar
ft活动上线
22d27a74
 
libai committed 10 months ago
178
            window.location.href='http://web.yazhai.co/milkRecharge/index.html?uid='+sessionStorage.uid+'&token='+sessionStorage.token+'&pkg=qingliang';
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
179 180 181 182 183 184
        }
    } else if(sessionStorage.pkg=='qiezi'){
		var ua = window.navigator.userAgent.toLowerCase();
        if (/iphone|ipad|ipod/.test(ua)) {
            window.location.href='yazhai://_recharge';
        }else{
libai's avatar
ft活动上线
22d27a74
 
libai committed 10 months ago
185
            window.location.href='http://web.yazhai.co/guodongRecharge/index.html?uid='+sessionStorage.uid+'&token='+sessionStorage.token+'&pkg=qingliang';
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
186 187 188
        }
    }
    else{
libai's avatar
ft活动上线
22d27a74
 
libai committed 10 months ago
189
        window.location.href='http://web.yazhai.co/recharge/index.html?uid='+sessionStorage.uid+'&token='+sessionStorage.token+'&pkg=yabo';
libai's avatar
ft活动上线
0c9f6783
 
libai committed 11 months ago
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
    }
}
function scrollTo(element,speed) {
    if(!speed){
        speed = 300;
    }
    if(!element){
        $("html,body").animate({scrollTop:0},speed);
    }else{
        if(element.length>0){
            $("html,body").animate({scrollTop:$(element).offset().top-200},speed);
        }
    }
}

//var betEnd = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours(), 59, 59).getTime();