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.3 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
测试
21d4ecf8
 
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 30 31 32 33 34 35
 var data = url_get_params(bbb)
 if (sessionStorage.kkk == undefined) {
     sessionStorage.kkk = data.token; //t
     sessionStorage.bbb = data.uid; //u
     sessionStorage.version = data.appversion;
     sessionStorage.pkg=data.pkg
 }
libai's avatar
测试
3749fa07
 
libai committed 2 years ago
36 37 38 39 40 41 42 43
 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
44
sessionStorage.topicId=data.topicId
libai's avatar
测试
bf0a0a8b
 
libai committed 2 years ago
45
sessionStorage.go=data.go
libai's avatar
测试
817ae82a
 
libai committed 2 years ago
46
if(data.tag==undefined||data.tag=='undefined')data.tag=''
libai's avatar
测试
9883f692
 
libai committed 2 years ago
47 48 49
if(sessionStorage.pmt==undefined||sessionStorage.pmt=="undefined"){
    sessionStorage.pmt=data.pmt
}
libai's avatar
测试
9b897879
 
libai committed 2 years ago
50

libai's avatar
测试
9883f692
 
libai committed 2 years ago
51 52
if(sessionStorage.pmt!=undefined&&sessionStorage.pmt!="undefined"){
    var pmtNumber=sessionStorage.pmt.split('/d/')[1]
libai's avatar
测试
4b94318d
 
libai committed 2 years ago
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
    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
71
               sessionStorage.apkDown=data.downloadLink
libai's avatar
测试
4b94318d
 
libai committed 2 years ago
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 97 98
            }
        }
    })
     //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
99 100
    })  
} 
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
101 102
sessionStorage.tag=data.tag
sessionStorage.qd=data.qd
libai's avatar
测试
592f551e
 
libai committed 2 years ago
103
sessionStorage.like=data.like;
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
104
 if(sessionStorage.open==undefined)sessionStorage.open=1
libai's avatar
测试
949a863e
 
libai committed 2 years ago
105
//跳轉移動端
libai's avatar
测试
b16913fe
 
libai committed 2 years ago
106 107
var ua = window.navigator.userAgent.toLowerCase();
try {
libai's avatar
测试
949a863e
 
libai committed 2 years ago
108

libai's avatar
测试
3aced290
 
libai committed 2 years ago
109 110 111 112 113 114 115 116 117
    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
测试
8c60913e
 
libai committed 2 years ago
118
            else window.location.href="https://www.footseen.xyz/mobile/index.html"
libai's avatar
测试
3aced290
 
libai committed 2 years ago
119 120 121 122 123 124 125
    
        } 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
测试
8c60913e
 
libai committed 2 years ago
126
            else window.location.href="https://www.footseen.xyz/mobile/index.html"
libai's avatar
测试
b16913fe
 
libai committed 2 years ago
127 128
        }
    }
libai's avatar
测试
3aced290
 
libai committed 2 years ago
129

libai's avatar
测试
b16913fe
 
libai committed 2 years ago
130 131
} catch (e) {
}
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
 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
151
                    window.location.href = 'https://www.footseen.xyz/content.html?ip=' + result.ip;
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
152 153 154 155 156
                }
            }
        }
    })
}
libai's avatar
测试
592f551e
 
libai committed 2 years ago
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
 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
173 174


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

 //点击刷新
 $(".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
196

libai's avatar
测试
ed59f820
 
libai committed 2 years ago
197 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
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
231
    if(localStorage.canvasCode=="oneEnter"||localStorage.canvasCode==undefined)return;
libai's avatar
测试
ed59f820
 
libai committed 2 years ago
232 233 234 235 236 237 238 239 240 241
    $.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
242 243 244 245 246 247 248 249 250 251 252 253
    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
254
}
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
255 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
 //与客户端交互
 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
396

libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
397 398 399 400 401 402 403 404
 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
405
             $("html,body").animate({scrollTop:$(element).offset().top-70},speed);
libai's avatar
测试
5e6a6fb8
 
libai committed 3 years ago
406 407 408 409
         }
     }
 }
 
libai's avatar
测试
61df30d3
 
libai committed 2 years ago
410
 //var betEnd = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours(), 59, 59).getTime();