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

libai / footseen-large-website

  • 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
  • footseen-large-website
  • lib
  • default.js
Find file
Normal viewHistoryPermalink
default.js 11.5 KB
Newer Older
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
1 2 3
/**
 * Created by webshow on 2019/11/22.
 */
libai's avatar
测试
21d4ecf8
 
libai committed 2 years ago
4
 var bbb = location.href;
libai's avatar
测试
bc1c4e0f
 
libai committed 2 years ago
5
 if (bbb.indexOf("footseen.xyz") > -1) {
libai's avatar
测试
592f551e
 
libai committed 2 years ago
6 7
    $ip = "https://cpapi.footseen.xyz/";
    $ws = "wss://websocket.footseen.xyz:12308/"
libai's avatar
测试
88d3ab4a
 
libai committed 2 years ago
8 9 10
    if(bbb.indexOf("libaiCensor")==-1){
        checkIp()
    }
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
11 12
}
else{
libai's avatar
测试
592f551e
 
libai committed 2 years ago
13 14
    $ip='http://cpapitest.yabolive.net:81/'
    $ws = "ws://47.242.178.187:12308/"
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
15
}
libai's avatar
测试
30eeea5a
 
libai committed 2 years ago
16 17

//移動端
libai's avatar
测试
bc1c4e0f
 
libai committed 2 years ago
18
if (bbb.indexOf("footseen.xyz/video.html") > -1) {
libai's avatar
测试
30eeea5a
 
libai committed 2 years ago
19 20 21 22 23 24 25
    $ip = 'https://webserver.yabolive.net';
    $ws='wss://zhiboweb.ishuaji.cn/yzsocket/ws?type=2'
    $url ='https://activity.ishuaji.cn/'
    $pay='https://pay.ishuaji.cn/'
    $api='https://zhibo.lvdou66.com/'
    checkIp()
}
libai's avatar
测试
f76e381c
 
libai committed 2 years ago
26

libai's avatar
测试
b127b824
 
libai committed 2 years ago
27 28
// $ip = "https://cpapi.footseen.xyz/";
// $ws = "wss://websocket.footseen.xyz:12308/"
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
29
 var data = url_get_params(bbb)
libai's avatar
测试
3749fa07
 
libai committed 2 years ago
30 31 32 33 34 35 36 37
 if(sessionStorage.roomId==data.roomId){
    sessionStorage.ref=1
    sessionStorage.roomId = data.roomId;
 }else{
    sessionStorage.roomId = data.roomId;
    sessionStorage.ref=0
 }

libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
38
sessionStorage.topicId=data.topicId
libai's avatar
测试
bf0a0a8b
 
libai committed 2 years ago
39
sessionStorage.go=data.go
libai's avatar
测试
817ae82a
 
libai committed 2 years ago
40
if(data.tag==undefined||data.tag=='undefined')data.tag=''
libai's avatar
测试
9883f692
 
libai committed 2 years ago
41 42 43
if(sessionStorage.pmt==undefined||sessionStorage.pmt=="undefined"){
    sessionStorage.pmt=data.pmt
}
libai's avatar
测试
9b897879
 
libai committed 2 years ago
44

libai's avatar
测试
9883f692
 
libai committed 2 years ago
45
if(sessionStorage.pmt!=undefined&&sessionStorage.pmt!="undefined"){
libai's avatar
测试
46e1d249
 
libai committed 2 years ago
46 47
    if(isNaN(sessionStorage.pmt)==true)var pmtNumber=sessionStorage.pmt.split('/d/')[1]
    else var pmtNumber=sessionStorage.pmt
libai's avatar
测试
4b94318d
 
libai committed 2 years ago
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
    myCid='ftsweb'
    $.ajax({
        url:$ip+'frontPage/queryLinkNumberCid',
        type: 'get',
        data:{
            lang:2,
            os:'pc_web',
            cid:'ftsweb',
            webVersion:'1000',
            linkNumber:pmtNumber,
            // pageID:localStorage.canvasCode,
        },
        dataType: "JSON",
        async:false,
        success:function(data){
            console.log(data)
            if(data.code==1){
               myCid=data.pcCid
libai's avatar
测试
9883f692
 
libai committed 2 years ago
66
               sessionStorage.apkDown=data.downloadLink
libai's avatar
测试
4b94318d
 
libai committed 2 years ago
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
            }
        }
    })
     //ajax设置默认参数
    $.ajaxSetup({
        global: false,
        type: 'get',
        data: {
            lang:2,
            os:'pc_web',
            cid:myCid,
            webVersion:'1000'
        },
        dataType: "JSON"
    })
}else{
 //ajax设置默认参数
    $.ajaxSetup({
        global: false,
        type: 'get',
        data: {
            lang:2,
            os:'pc_web',
            cid:'ftsweb',
            webVersion:'1000'
        },
        dataType: "JSON"
libai's avatar
测试
fe0adc63
 
libai committed 2 years ago
94 95
    })  
} 
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
96 97
sessionStorage.tag=data.tag
sessionStorage.qd=data.qd
libai's avatar
测试
592f551e
 
libai committed 2 years ago
98
sessionStorage.like=data.like;
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
99
 if(sessionStorage.open==undefined)sessionStorage.open=1
libai's avatar
测试
949a863e
 
libai committed 2 years ago
100
//跳轉移動端
libai's avatar
测试
b16913fe
 
libai committed 2 years ago
101 102
var ua = window.navigator.userAgent.toLowerCase();
try {
libai's avatar
测试
949a863e
 
libai committed 2 years ago
103

libai's avatar
测试
3aced290
 
libai committed 2 years ago
104 105 106 107 108 109 110 111 112
    if(ua.indexOf('Googlebot')>-1){
    
    }else{
        if (/iphone|ipad|ipod/.test(ua)) {
            if (bbb.indexOf("/videoRoom") > -1){
                window.location.href='https://www.footseen.xyz/mobile/video.html?topicId='+sessionStorage.topicId+'&tag='+sessionStorage.tag+''
            }else if(bbb.indexOf("/imagesRoom") > -1){
                window.location.href='https://www.footseen.xyz/mobile/Graphics.html?topicId='+sessionStorage.topicId+'&tag=';
            }
libai's avatar
测试
4dc44f18
 
libai committed 2 years ago
113
            else{
libai's avatar
测试
e9bc8e10
 
libai committed 2 years ago
114 115
                if(sessionStorage.pmt!=undefined&&sessionStorage.pmt!='undefined') window.location.href="/mobile/index.html?pmt="+sessionStorage.pmt
                else window.location.href="/mobile/index.html"
libai's avatar
测试
4dc44f18
 
libai committed 2 years ago
116
            } 
libai's avatar
测试
3aced290
 
libai committed 2 years ago
117 118 119 120 121 122 123
    
        } else if (/android/.test(ua)) {
            if (bbb.indexOf("/videoRoom") > -1){
                window.location.href='https://www.footseen.xyz/mobile/video.html?topicId='+sessionStorage.topicId+'&tag='+sessionStorage.tag+''
            }else if(bbb.indexOf("/imagesRoom") > -1){
                window.location.href='https://www.footseen.xyz/mobile/Graphics.html?topicId='+sessionStorage.topicId+'&tag=';
            }
libai's avatar
测试
4dc44f18
 
libai committed 2 years ago
124
            else{
libai's avatar
测试
e9bc8e10
 
libai committed 2 years ago
125 126
                if(sessionStorage.pmt!=undefined&&sessionStorage.pmt!='undefined') window.location.href="/mobile/index.html?pmt="+sessionStorage.pmt
                else window.location.href="/mobile/index.html"
libai's avatar
测试
4dc44f18
 
libai committed 2 years ago
127
            } 
libai's avatar
测试
b16913fe
 
libai committed 2 years ago
128 129
        }
    }
libai's avatar
测试
3aced290
 
libai committed 2 years ago
130

libai's avatar
测试
b16913fe
 
libai committed 2 years ago
131 132
} catch (e) {
}
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
 try {
     if (/iphone|ipad|ipod/.test(ua)) {
         sessionStorage.os='ios'
     } else if (/android/.test(ua)) {
         sessionStorage.os='android'
     }
 } catch (e) {
 }
 function checkIp() {
    $.ajax({
        url:"https://webserver.yabolive.net/user/checkIpIsChina.html",
        async: false,
        success: function (res) {
            var result = JSON.parse(res);
            if (result.code === 1) {
                if (result.checkResult) {
                    window.location.hash = "no-back";
                    window.location.hash = "Again-No-back-button";
                    window.onhashchange = function () { window.location.hash = "no-back"; }
libai's avatar
测试
7e3347c7
 
libai committed 2 years ago
152
                    window.location.href = 'https://www.footseen.xyz/content.html?ip=' + result.ip;
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
153 154 155 156 157
                }
            }
        }
    })
}
libai's avatar
测试
592f551e
 
libai committed 2 years ago
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
 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("file:///") > -1) {

 }
libai's avatar
测试
4b94318d
 
libai committed 2 years ago
174 175


libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196

 //点击刷新
 $(".ref").on("click", function () {
     sessionStorage.jump=undefined;
     window.location.reload()
 })
 $(".callKf").on("click",function(){
    callFK()
})
 function btnHref(e){
     var myJson = {
         "cid": 12,
         "reqCode": new Date().getTime(),
         "data": {
             "msg":'跳转页面',
             "jump": e,
         }
     }
     var obj=JSON.stringify(myJson);
     appCollaboration(obj)
 }
libai's avatar
测试
9766df6b
 
libai committed 2 years ago
197

libai's avatar
测试
ed59f820
 
libai committed 2 years ago
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
stat()
webActive()
function stat(){
    if(sessionStorage.stat==1)return;
    if(localStorage.canvasCode=="oneEnter"||localStorage.canvasCode==undefined)return
    if(localStorage.token!==undefined){
        $.ajax({
            url:$ip+'stat/log',
            data:{
                resolution:screen.width+'*'+screen.height,
                pageID:localStorage.canvasCode,
                uid:localStorage.uid
            },
            success:function(data){
                // console.log('上報',data)
                sessionStorage.stat=1
            }
        })
        return;
    }
    $.ajax({
        url:$ip+'stat/log',
        data:{
            resolution:screen.width+'*'+screen.height,
            pageID:localStorage.canvasCode
        },
        success:function(data){
            // console.log('上報',data)
            sessionStorage.stat=1
        }
    })
}
function webActive(){
    if(sessionStorage.stat2==1)return;
libai's avatar
测试
97121a9c
 
libai committed 2 years ago
232
    if(localStorage.canvasCode=="oneEnter"||localStorage.canvasCode==undefined)return;
libai's avatar
测试
ed59f820
 
libai committed 2 years ago
233 234 235 236 237 238 239 240 241 242
    $.ajax({
        url:$ip+'activeLog/webActive',
        data:{
            activeType:0,
            pageID:localStorage.canvasCode,
        },
        success:function(data){
            sessionStorage.stat2=1
        }
    })
libai's avatar
测试
97121a9c
 
libai committed 2 years ago
243 244 245 246 247 248 249 250 251 252 253 254
    if(localStorage.uid==undefined||localStorage.uid=='undefined')return;
    $.ajax({
        url:$ip+'activeLog/webActive',
        data:{
            activeType:7,
            pageID:localStorage.canvasCode,
            uid:localStorage.uid
        },
        success:function(data){
            sessionStorage.stat2=1
        }
    })
libai's avatar
测试
ed59f820
 
libai committed 2 years ago
255
}
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
 //与客户端交互
 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,time){
     var endTime=e;
     var newTime=time;
     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;
     if (bbb.indexOf("https://activity.ishuaji.cn/") > -1) {
        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%100));
     var timeArr=[day,hour,min,sceond];
     return timeArr;
 }
 function getMyTime(){
     $.ajax({
         url:$ip+'activesys/getSysTimeStamp',
         async:false,
         success:function(data){
             myTime=data.timestamp
             return myTime
         }
     })
 }
 //时间戳转具体 年月日时分秒
 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
 }
 function callFK(){
    var obj2 = {
        "cid": 4,
        "reqCode": new Date().getTime(),
        "data": {
            "msg": "请求客服",
        }
    }
    var obj = JSON.stringify(obj2);
    appCollaboration(obj)
}
 //一位数前面加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 loadImageGo(name,sNum,eNum) {
    var imgList = [];
    var num = sNum;
    loadImage()
    function loadImage() {
        var img = new Image();
        img.addEventListener("load", loadHandler);
        img.src = "images/" + name + "/1_" + imgAdd(num) + ".png";
    }
    function loadHandler() {
        imgList.push(this.cloneNode());
        num++;
        if (num > eNum) { return; }
        this.src = "images/" + name + "/1_" + imgAdd(num)  + ".png";
    }
}  
function loadImageGo3(name,sNum,eNum) {
    var imgList = [];
    var num = sNum;
    loadImage()
    function loadImage() {
        var img = new Image();
        img.addEventListener("load", loadHandler);
        img.src = "images/" + name + "/(" + num + ").png";
    }
    function loadHandler() {
        imgList.push(this.cloneNode());
        num++;
        if (num > eNum) { return; }
        this.src = "images/" + name + "/(" + num + ").png";
    }
}   
 function addDoc(e){
     if(e%1==0){
         return e+'.0';
     }else return e
 }
libai's avatar
测试
7e3347c7
 
libai committed 2 years ago
397

libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
398 399 400 401 402 403 404 405
 function scrollTo(element,speed) {
     if(!speed){
         speed = 300;
     }
     if(!element){
         $("html,body").animate({scrollTop:0},speed);
     }else{
         if(element.length>0){
libai's avatar
测试
592f551e
 
libai committed 2 years ago
406
             $("html,body").animate({scrollTop:$(element).offset().top-70},speed);
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
407 408 409 410
         }
     }
 }
 
libai's avatar
测试
61df30d3
 
libai committed 2 years ago
411
 //var betEnd = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours(), 59, 59).getTime();