1
This commit is contained in:
1
static/js/1283-5f006781ced80196.js
Normal file
1
static/js/1283-5f006781ced80196.js
Normal file
File diff suppressed because one or more lines are too long
1
static/js/2755-f4e7dd850c7f17a0.js
Normal file
1
static/js/2755-f4e7dd850c7f17a0.js
Normal file
File diff suppressed because one or more lines are too long
10
static/js/4111-8655188d621cfead.js
Normal file
10
static/js/4111-8655188d621cfead.js
Normal file
File diff suppressed because one or more lines are too long
1
static/js/4127-53f1b1a85165ca52.js
Normal file
1
static/js/4127-53f1b1a85165ca52.js
Normal file
File diff suppressed because one or more lines are too long
1
static/js/4856-81284dbb4abc4d90.js
Normal file
1
static/js/4856-81284dbb4abc4d90.js
Normal file
File diff suppressed because one or more lines are too long
1
static/js/7582-0da0a63f7ca1b2dd.js
Normal file
1
static/js/7582-0da0a63f7ca1b2dd.js
Normal file
File diff suppressed because one or more lines are too long
1
static/js/8315-82f676efa55604bf.js
Normal file
1
static/js/8315-82f676efa55604bf.js
Normal file
File diff suppressed because one or more lines are too long
5
static/js/867-24cb2174dbfc1c26.js
Normal file
5
static/js/867-24cb2174dbfc1c26.js
Normal file
File diff suppressed because one or more lines are too long
1
static/js/87c73c54-5f13a1736e7c1586.js
Normal file
1
static/js/87c73c54-5f13a1736e7c1586.js
Normal file
File diff suppressed because one or more lines are too long
1
static/js/907-5b0a12ad81ff99a0.js
Normal file
1
static/js/907-5b0a12ad81ff99a0.js
Normal file
File diff suppressed because one or more lines are too long
101
static/js/common.js
Normal file
101
static/js/common.js
Normal file
@ -0,0 +1,101 @@
|
||||
|
||||
let NAV_MENU_STATUS = false;
|
||||
const requestApi = 'http://proxy.apiapl.com/api/v1';
|
||||
let kwdValue = new URLSearchParams(window.location.search).get('kwd');
|
||||
let invitCode = new URLSearchParams(window.location.search).get('code');
|
||||
if (kwdValue) {
|
||||
localStorage.setItem("keyword", kwdValue);
|
||||
}
|
||||
if(invitCode){
|
||||
localStorage.setItem("invitCode", invitCode);
|
||||
}
|
||||
// const $POST_P = async (u, d) => $.post(_payApi + u, { ...d,session: localStorage.getItem("session") || "" });
|
||||
// const requestApi = 'http://proxy.apiapl.com/api/v1';
|
||||
const loading = async (v) =>{
|
||||
if (typeof v == "undefined" || v) {
|
||||
if ($(".lo_loading").length) {
|
||||
return;
|
||||
}
|
||||
var child = $('<div class="lo_loading"><div class="load"></div></div>');
|
||||
$(document.body).append(child);
|
||||
return;
|
||||
}
|
||||
$(".lo_loading").remove();
|
||||
}
|
||||
|
||||
|
||||
const nav_init = async () => {
|
||||
if ($(document).scrollTop() > 44) {
|
||||
$(".nav_header").addClass("active");
|
||||
}
|
||||
$(document).on("scroll", function () {
|
||||
if ($(document).scrollTop() > 44) {
|
||||
$(".nav_header").addClass("active");
|
||||
} else {
|
||||
$(".nav_header").removeClass("active");
|
||||
}
|
||||
});
|
||||
|
||||
$('.m-menu-list-main>.m-menu-list-item').on('click', function () {
|
||||
|
||||
});
|
||||
$(".m-menu-list-main>.m-menu-list-item").click((e) => {
|
||||
const DOM = $(e.currentTarget).parent()[0];
|
||||
if ($(DOM).hasClass("active")) return $(DOM).removeClass("active");
|
||||
$(DOM).addClass("active").siblings(".m-menu-list-main").removeClass("active");
|
||||
});
|
||||
|
||||
$('.mobile_menu').on('click',function(){
|
||||
$('.header_container>.m-menu-list').show();
|
||||
})
|
||||
|
||||
$('.m-menu-list-hesder>img').on('click',function(){
|
||||
$('.header_container>.m-menu-list').hide();
|
||||
})
|
||||
|
||||
|
||||
$('.m-menu-list-hesder img, .nav-small-screen .bg').on('click',function(){
|
||||
$('.nav-small-screen').removeClass('active');
|
||||
$('.nav-small-screen>.bg').fadeOut();
|
||||
|
||||
})
|
||||
|
||||
$('.faq-list>div:nth-of-type(1)').on('click',function(e){
|
||||
e.stopPropagation();
|
||||
$(this).siblings().slideToggle(200);
|
||||
$(this).parents(".faq-list").toggleClass("on");
|
||||
$(this).parents(".faq-list").siblings().find("div:nth-of-type(2)").slideUp(200);
|
||||
$(this).parents(".faq-list").siblings().removeClass("on");
|
||||
})
|
||||
|
||||
|
||||
};
|
||||
$(function () {
|
||||
nav_init();
|
||||
|
||||
});
|
||||
|
||||
const messageData = {
|
||||
handle: null,
|
||||
delayTime: 3000,
|
||||
obj: []
|
||||
}
|
||||
const messageFn= async (v) => {
|
||||
clearTimeout(messageData.handle);
|
||||
// Clean box
|
||||
var removeObj = setTimeout(function () {
|
||||
$(".lo_message").removeClass("on");
|
||||
}, 0);
|
||||
|
||||
var newTime = "lo_" + new Date().getTime();
|
||||
var message = $('<div class="lo_message ' + newTime + '"><span>' + v + "</span></div>");
|
||||
$(document.body).append(message);
|
||||
|
||||
var addObj = setTimeout(function () {
|
||||
$("." + newTime).addClass("on");
|
||||
}, 2);
|
||||
|
||||
messageData.handle = setTimeout(function () {
|
||||
$(".lo_message").remove();
|
||||
}, messageData.delayTime);
|
||||
}
|
||||
2
static/js/cookie.js
Normal file
2
static/js/cookie.js
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
!function(e){var n;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var t=window.Cookies,o=window.Cookies=e();o.noConflict=function(){return window.Cookies=t,o}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var t=arguments[e];for(var o in t)n[o]=t[o]}return n}function n(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function t(o){function r(){}function i(n,t,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},r.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var c=JSON.stringify(t);/^[\{\[]/.test(c)&&(t=c)}catch(e){}t=o.write?o.write(t,n):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var f="";for(var u in i)i[u]&&(f+="; "+u,!0!==i[u]&&(f+="="+i[u].split(";")[0]));return document.cookie=n+"="+t+f}}function c(e,t){if("undefined"!=typeof document){for(var r={},i=document.cookie?document.cookie.split("; "):[],c=0;c<i.length;c++){var f=i[c].split("="),u=f.slice(1).join("=");t||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var a=n(f[0]);if(u=(o.read||o)(u,a)||n(u),t)try{u=JSON.parse(u)}catch(e){}if(r[a]=u,e===a)break}catch(e){}}return e?r[e]:r}}return r.set=i,r.get=function(e){return c(e,!1)},r.getJSON=function(e){return c(e,!0)},r.remove=function(n,t){i(n,"",e(t,{expires:-1}))},r.defaults={},r.withConverter=t,r}(function(){})});
|
||||
10
static/js/countdown.js
Normal file
10
static/js/countdown.js
Normal file
@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* vue-countdown v1.1.5
|
||||
* https://fengyuanchen.github.io/vue-countdown
|
||||
*
|
||||
* Copyright 2018-present Chen Fengyuan
|
||||
* Released under the MIT license
|
||||
*
|
||||
* Date: 2020-02-25T01:19:32.769Z
|
||||
*/
|
||||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t=t||self).VueCountdown=i()}(this,function(){"use strict";var t=1e3,i=6e4,s=36e5,e="visibilitychange";return{name:"countdown",data:function(){return{counting:!1,endTime:0,totalMilliseconds:0}},props:{autoStart:{type:Boolean,default:!0},emitEvents:{type:Boolean,default:!0},interval:{type:Number,default:1e3,validator:function(t){return 0<=t}},now:{type:Function,default:function(){return Date.now()}},tag:{type:String,default:"span"},time:{type:Number,default:0,validator:function(t){return 0<=t}},transform:{type:Function,default:function(t){return t}}},computed:{days:function(){return Math.floor(this.totalMilliseconds/864e5)},hours:function(){return Math.floor(this.totalMilliseconds%864e5/s)},minutes:function(){return Math.floor(this.totalMilliseconds%s/i)},seconds:function(){return Math.floor(this.totalMilliseconds%i/t)},milliseconds:function(){return Math.floor(this.totalMilliseconds%t)},totalDays:function(){return this.days},totalHours:function(){return Math.floor(this.totalMilliseconds/s)},totalMinutes:function(){return Math.floor(this.totalMilliseconds/i)},totalSeconds:function(){return Math.floor(this.totalMilliseconds/t)}},render:function(t){return t(this.tag,this.$scopedSlots.default?[this.$scopedSlots.default(this.transform({days:this.days,hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds,totalDays:this.totalDays,totalHours:this.totalHours,totalMinutes:this.totalMinutes,totalSeconds:this.totalSeconds,totalMilliseconds:this.totalMilliseconds}))]:this.$slots.default)},watch:{$props:{deep:!0,immediate:!0,handler:function(){this.totalMilliseconds=this.time,this.endTime=this.now()+this.time,this.autoStart&&this.start()}}},methods:{start:function(){this.counting||(this.counting=!0,this.emitEvents&&this.$emit("start"),"visible"===document.visibilityState&&this.continue())},continue:function(){var e=this;if(this.counting){var n=Math.min(this.totalMilliseconds,this.interval);if(0<n)if(window.requestAnimationFrame){var o,a;this.requestId=requestAnimationFrame(function t(i){a=a||i;var s=i-(o=o||i);n<=s||n<=s+(i-a)/2?e.progress():e.requestId=requestAnimationFrame(t),a=i})}else this.timeoutId=setTimeout(function(){e.progress()},n);else this.end()}},pause:function(){window.requestAnimationFrame?cancelAnimationFrame(this.requestId):clearTimeout(this.timeoutId)},progress:function(){this.counting&&(this.totalMilliseconds-=this.interval,this.emitEvents&&0<this.totalMilliseconds&&this.$emit("progress",{days:this.days,hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds,totalDays:this.totalDays,totalHours:this.totalHours,totalMinutes:this.totalMinutes,totalSeconds:this.totalSeconds,totalMilliseconds:this.totalMilliseconds}),this.continue())},abort:function(){this.counting&&(this.pause(),this.counting=!1,this.emitEvents&&this.$emit("abort"))},end:function(){this.counting&&(this.pause(),this.totalMilliseconds=0,this.counting=!1,this.emitEvents&&this.$emit("end"))},update:function(){this.counting&&(this.totalMilliseconds=Math.max(0,this.endTime-this.now()))},handleVisibilityChange:function(){switch(document.visibilityState){case"visible":this.update(),this.continue();break;case"hidden":this.pause()}}},mounted:function(){document.addEventListener(e,this.handleVisibilityChange)},beforeDestroy:function(){document.removeEventListener(e,this.handleVisibilityChange),this.pause()}}});
|
||||
79
static/js/country.js
Normal file
79
static/js/country.js
Normal file
@ -0,0 +1,79 @@
|
||||
$(function(){
|
||||
|
||||
let data = [];
|
||||
let randerCodeData = [];
|
||||
$.getJSON('https://f.cliproxy.com/json/country_code.json', function(jsonData) {
|
||||
data = jsonData;
|
||||
});
|
||||
|
||||
|
||||
function fuzzySearch(query, array) {
|
||||
const result = [];
|
||||
query = query.toLowerCase();
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
const item = array[i];
|
||||
const nameMatch = item.name && item.name.toLowerCase().includes(query);
|
||||
const codeMatch = item.code && item.code.toString().includes(query);
|
||||
if (nameMatch || codeMatch) {
|
||||
result.push(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
$('.search_input').on('click',function(){
|
||||
var search_contant = $('.serach_code').val();
|
||||
randerCodeData = fuzzySearch(search_contant, data);
|
||||
$('ul>li' ).removeClass('active');
|
||||
randerCode();
|
||||
})
|
||||
|
||||
$('.load_more').on('click',function(){
|
||||
$('.country_cont .more_code:hidden').first().show();
|
||||
if ($('.country_cont .more_code:hidden').length === 0) {
|
||||
$('.load_more').hide();
|
||||
} else {
|
||||
$('.load_more').show();
|
||||
}
|
||||
})
|
||||
|
||||
$('ul>li').on('click',function(){
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
searchChar($(this).text())
|
||||
})
|
||||
|
||||
|
||||
|
||||
$('.serach_code').on('keydown', function (event) {
|
||||
if (event.key === "Enter") {
|
||||
var search_contant = $('.serach_code').val();
|
||||
randerCodeData = fuzzySearch(search_contant, data);
|
||||
$('ul>li' ).removeClass('active');
|
||||
randerCode();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function randerCode(){
|
||||
|
||||
let countryHtml = '';
|
||||
randerCodeData.forEach(function(item) {
|
||||
countryHtml += `<p><img src="/static/images/country/icon/${item.code.toLowerCase()}.png" alt="" /><span>${item.code}</span><span>${item.name}</span></p>`;
|
||||
});
|
||||
$('.render_code,.more_code').hide();
|
||||
$('.load_more').hide();
|
||||
$('.search_counry_conntent').html(countryHtml);
|
||||
|
||||
}
|
||||
|
||||
function searchChar(chat){
|
||||
$('.serach_code').val('');
|
||||
randerCodeData = data.filter(function(item) {
|
||||
return item.char == chat;
|
||||
});
|
||||
|
||||
randerCode();
|
||||
|
||||
}
|
||||
})
|
||||
1
static/js/email-decode.min.js
vendored
Normal file
1
static/js/email-decode.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(){"use strict";function e(e){try{if("undefined"==typeof console)return;"error"in console?console.error(e):console.log(e)}catch(e){}}function t(e){return d.innerHTML='<a href="'+e.replace(/"/g,""")+'"></a>',d.childNodes[0].getAttribute("href")||""}function r(e,t){var r=e.substr(t,2);return parseInt(r,16)}function n(n,c){for(var o="",a=r(n,c),i=c+2;i<n.length;i+=2){var l=r(n,i)^a;o+=String.fromCharCode(l)}try{o=decodeURIComponent(escape(o))}catch(u){e(u)}return t(o)}function c(t){for(var r=t.querySelectorAll("a"),c=0;c<r.length;c++)try{var o=r[c],a=o.href.indexOf(l);a>-1&&(o.href="mailto:"+n(o.href,a+l.length))}catch(i){e(i)}}function o(t){for(var r=t.querySelectorAll(u),c=0;c<r.length;c++)try{var o=r[c],a=o.parentNode,i=o.getAttribute(f);if(i){var l=n(i,0),d=document.createTextNode(l);a.replaceChild(d,o)}}catch(h){e(h)}}function a(t){for(var r=t.querySelectorAll("template"),n=0;n<r.length;n++)try{i(r[n].content)}catch(c){e(c)}}function i(t){try{c(t),o(t),a(t)}catch(r){e(r)}}var l="/cdn-cgi/l/email-protection#",u=".__cf_email__",f="data-cfemail",d=document.createElement("div");i(document),function(){var e=document.currentScript||document.scripts[document.scripts.length-1];e.parentNode.removeChild(e)}()}();
|
||||
113
static/js/forgot.js
Normal file
113
static/js/forgot.js
Normal file
@ -0,0 +1,113 @@
|
||||
|
||||
|
||||
$(function(){
|
||||
|
||||
let sendFlag = false;
|
||||
|
||||
$('.code_box>button').on('click',function(){
|
||||
let _lang = $('#language').val();
|
||||
var $this = $(this);
|
||||
var email = $("#forgot_email input").val();
|
||||
if (email == "" || email == undefined){
|
||||
$("#forgot_email").addClass("error");
|
||||
$("#forgot_email .error_tip").show();
|
||||
return;
|
||||
}
|
||||
if(sendFlag) return;
|
||||
sendFlag = true;
|
||||
$.ajax({
|
||||
url: requestApi+"/v1/mailCode",
|
||||
dataType:"json",
|
||||
type:"POST",
|
||||
aysc:false,
|
||||
data:{
|
||||
"lang":_lang,
|
||||
"email": email,
|
||||
|
||||
},
|
||||
success:function(res){
|
||||
sendFlag = false;
|
||||
if(res.code == 0){
|
||||
sendFlag = false;
|
||||
|
||||
settime($this)
|
||||
}else if(res.code == 5){ // timeout
|
||||
sendFlag = false;
|
||||
|
||||
}
|
||||
messageFn(res.msg);
|
||||
return;
|
||||
},error:function () {
|
||||
sendFlag = false;
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
$('.login_btn').click(forgotSubmit)
|
||||
const $passwordInput = $('#forgot_pwd input');
|
||||
const $eyeIcon = $('#eyeIcon');
|
||||
|
||||
$eyeIcon.on('click', function () {
|
||||
if ($passwordInput.attr('type') === 'password') {
|
||||
$passwordInput.attr('type', 'text');
|
||||
$eyeIcon.attr('src', '/static/common/login/img/pwd-2.png');
|
||||
} else {
|
||||
$passwordInput.attr('type', 'password');
|
||||
$eyeIcon.attr('src', '/static/common/login/img/pwd-1.png');
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
let countdown = 90
|
||||
const settime =async(obj)=>{
|
||||
if (countdown == 0) {
|
||||
obj.text("Send");
|
||||
countdown = 90;
|
||||
return;
|
||||
} else {
|
||||
obj.text("" + countdown + "s");
|
||||
countdown--;
|
||||
}
|
||||
setTimeout(function () {
|
||||
settime(obj);
|
||||
}, 1000);
|
||||
}
|
||||
let clickFlag = false;
|
||||
const forgotSubmit = () => {
|
||||
const email = $('#forgot_email input').val()
|
||||
const code = $('#forgot_code input').val()
|
||||
const password = $('#forgot_pwd input').val();
|
||||
let _lang = $('#language').val();
|
||||
if (clickFlag) return;
|
||||
clickFlag = true;
|
||||
$.ajax({
|
||||
url: requestApi+"/v1/repwd",
|
||||
dataType:"json",
|
||||
type:"POST",
|
||||
aysc:false,
|
||||
data:{
|
||||
"lang":_lang,
|
||||
"email": email,
|
||||
"pwd": password,
|
||||
"code": code
|
||||
|
||||
},
|
||||
success:function(res){
|
||||
clickFlag = false;
|
||||
|
||||
if(res.code == 0){
|
||||
setTimeout(() => {
|
||||
window.location.href = webDomain+'/sign-in/';
|
||||
}, 1000);
|
||||
clickFlag = false;
|
||||
}else{
|
||||
messageFn(res.msg);
|
||||
}
|
||||
return;
|
||||
},error:function () {
|
||||
clickFlag = false;
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
1
static/js/global-error-6ba4cc308476e045.js
Normal file
1
static/js/global-error-6ba4cc308476e045.js
Normal file
File diff suppressed because one or more lines are too long
105
static/js/googlelogin.js
Normal file
105
static/js/googlelogin.js
Normal file
@ -0,0 +1,105 @@
|
||||
$(function(){
|
||||
var _client_id = '89662634431-3fmfddg8hb9s8a992odnlf9a07ng23be.apps.googleusercontent.com';
|
||||
const url = window.location.href;
|
||||
const searchParams = new URLSearchParams(new URL(url).search);
|
||||
const rParam = searchParams.get('r');
|
||||
|
||||
initGoogleScript()
|
||||
function init(fn) {
|
||||
gload(fn)
|
||||
}
|
||||
function initGoogleScript(){
|
||||
var t = document.createElement("script");
|
||||
t.setAttribute("async", ""),
|
||||
t.src = "https://accounts.google.com/gsi/client",
|
||||
document.body.appendChild(t);
|
||||
t.onload = function() {
|
||||
console.log(2);
|
||||
init(handleCredentialResponse)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function gload(fn) {
|
||||
window.google.accounts.id.initialize({
|
||||
client_id: _client_id,
|
||||
callback: fn,
|
||||
locale: 'en-US'
|
||||
});
|
||||
window.google.accounts.id.renderButton(
|
||||
document.getElementById("g_id_signin2"), {
|
||||
theme: "filled_blue",
|
||||
size: 'large',
|
||||
width: '100%',
|
||||
height: '50',
|
||||
type: 'standard',
|
||||
text: 'signin_with'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// $('#g_id_signin2').on('click', function() {
|
||||
// console.log(444);
|
||||
|
||||
// })
|
||||
|
||||
function handleCredentialResponse(response){
|
||||
if (response) {
|
||||
SubmitLogin(response.credential)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function SubmitLogin(tokens){
|
||||
|
||||
$.ajax({
|
||||
url: requestApi+"/v1/gLogin",
|
||||
dataType:"json",
|
||||
type:"POST",
|
||||
aysc:false,
|
||||
data:{
|
||||
oauth_token: tokens
|
||||
|
||||
},
|
||||
success:function(res){
|
||||
|
||||
if(res.code == 0){
|
||||
localStorage.setItem('session',res.data.token);
|
||||
localStorage.setItem("user", JSON.stringify(res.data));
|
||||
const expiresDate = new Date();
|
||||
const expires = res.data.token_cache == 0 ? 9999999999999 : res.data.token_cache;
|
||||
expiresDate.setDate(expiresDate.getDate() + expires);
|
||||
const domain = window.location.host.split(".").slice(-2).join(".");
|
||||
Cookies.set("common_session", res.data.token, { expires: expiresDate, domain});
|
||||
if(!rParam){
|
||||
gtag_report_conversion('https://dash.cliproxy.com/cli/home');
|
||||
}else{
|
||||
gtag_report_conversion('https://cliproxy.com'+rParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function gtag_report_conversion(url) {
|
||||
var callback = function () {
|
||||
if (typeof(url) != 'undefined') {
|
||||
window.location = url;
|
||||
}else{
|
||||
window.location.href = '/';
|
||||
}
|
||||
};
|
||||
gtag('event', 'conversion', {
|
||||
'send_to': 'AW-11505915218/tAJJCNmDx_kZENKque4q',
|
||||
'value': 1.0,
|
||||
'currency': 'USD',
|
||||
'event_callback': callback
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
2
static/js/index-CmAXt1vL.js
Normal file
2
static/js/index-CmAXt1vL.js
Normal file
File diff suppressed because one or more lines are too long
41
static/js/index.js
Normal file
41
static/js/index.js
Normal file
@ -0,0 +1,41 @@
|
||||
$(function () {
|
||||
new Swiper(".nav-banner", {
|
||||
autoplay: {
|
||||
delay: 3000,
|
||||
|
||||
disableOnInteraction: false,
|
||||
pauseOnMouseEnter: true
|
||||
},
|
||||
loop: true,
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
slidesPerView: 1,
|
||||
|
||||
});
|
||||
|
||||
if(getStorage("newYearPop_flag") == '233'){
|
||||
$('.mayPop').hide();
|
||||
}else{
|
||||
$('.mayPop').show();
|
||||
}
|
||||
// if(lang2 == "zh"){
|
||||
// $('.mayPopZh').show();
|
||||
// }else {
|
||||
// $('.mayPop').show();
|
||||
// }
|
||||
|
||||
$(document).on("scroll", function () {
|
||||
$(".nav_header").addClass("active");
|
||||
});
|
||||
|
||||
$('.mayPop>div>i,.mayPopZh>div>i').on('click', function () {
|
||||
var _data = new Date().getTime();
|
||||
setStorage("newYearPop_flag", '233', _data + 6000000 * 60 * 1000);
|
||||
$('.mayPop').hide();
|
||||
})
|
||||
|
||||
|
||||
|
||||
});
|
||||
2
static/js/jquery-migrate.min.js
vendored
Normal file
2
static/js/jquery-migrate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
static/js/jquery.min-3.7.1.js
Normal file
3
static/js/jquery.min-3.7.1.js
Normal file
File diff suppressed because one or more lines are too long
2
static/js/jquery.min.js
vendored
Normal file
2
static/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/js/layout-afb6dea0caee6c4f.js
Normal file
1
static/js/layout-afb6dea0caee6c4f.js
Normal file
@ -0,0 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2508],{},_=>{var e=e=>_(_.s=e);_.O(0,[5615,3610,7219,7003,8586,1825,1018,867,2755,4111,907,1283,587,8315,7358],()=>e(71283)),_N_E=_.O()}]);
|
||||
123
static/js/login.js
Normal file
123
static/js/login.js
Normal file
@ -0,0 +1,123 @@
|
||||
$(function () {
|
||||
const url = window.location.href;
|
||||
const searchParams = new URLSearchParams(new URL(url).search);
|
||||
const rParam = searchParams.get("r");
|
||||
|
||||
let submitFlag = false;
|
||||
$(".login_btn").on("click", function () {
|
||||
let _lang = $("#language").val();
|
||||
var email = $("#login_email input").val();
|
||||
var password = $("#login_pwd input").val();
|
||||
var code = $("#login-code input").val();
|
||||
var uuid = localStorage.getItem("uuid");
|
||||
|
||||
if (email == "" || email == undefined) {
|
||||
$("#login_email").addClass("error");
|
||||
$("#login_email .error_tip").show();
|
||||
return;
|
||||
} else {
|
||||
$("#login_email").removeClass("error");
|
||||
$("#login_email .error_tip").hide();
|
||||
}
|
||||
|
||||
if (password == "" || password == undefined) {
|
||||
$("#login_pwd").addClass("error");
|
||||
$("#login_pwd .error_tip").show();
|
||||
return;
|
||||
} else {
|
||||
$("#login_pwd").removeClass("error");
|
||||
$("#login_pwd .error_tip").hide();
|
||||
}
|
||||
if (submitFlag) return;
|
||||
submitFlag = true;
|
||||
$(".loading-mask").show();
|
||||
$.ajax({
|
||||
url: requestApi + "/login",
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
contentType: "application/json",
|
||||
aysc: false,
|
||||
data: JSON.stringify({
|
||||
lang: _lang,
|
||||
username: email,
|
||||
password: password,
|
||||
code: code,
|
||||
rememberMe: false,
|
||||
uuid: uuid,
|
||||
}),
|
||||
success: function (res) {
|
||||
console.log("login", res);
|
||||
submitFlag = false;
|
||||
$(".loading-mask").hide();
|
||||
|
||||
if (res.code === 200) {
|
||||
localStorage.setItem("session", res.token);
|
||||
// localStorage.setItem("user", JSON.stringify(res.data));
|
||||
const expiresDate = new Date();
|
||||
// const expires =
|
||||
// res.data.token_cache == 0 ? 9999999999999 : res.data.token_cache;
|
||||
expiresDate.setDate(res.expire);
|
||||
const domain = window.location.host.split(".").slice(-2).join(".");
|
||||
|
||||
Cookies.set("common_session", res.token, {
|
||||
expires: expiresDate,
|
||||
domain,
|
||||
});
|
||||
// if(!rParam) {
|
||||
window.location.href = "cli-traffic.html";
|
||||
// } else {
|
||||
// window.location.href = "https://cliproxy.com" + rParam;
|
||||
// }
|
||||
} else {
|
||||
messageFn(res.msg);
|
||||
reloadCaptcha();
|
||||
}
|
||||
return;
|
||||
},
|
||||
error: function () {
|
||||
submitFlag = false;
|
||||
$(".loading-mask").hide();
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const $passwordInput = $("#login_pwd input");
|
||||
const $eyeIcon = $("#eyeIcon");
|
||||
const $codeImg = $("#codeImg");
|
||||
|
||||
$codeImg.on("click", function () {
|
||||
reloadCaptcha();
|
||||
});
|
||||
|
||||
$eyeIcon.on("click", function () {
|
||||
if ($passwordInput.attr("type") === "password") {
|
||||
$passwordInput.attr("type", "text");
|
||||
$eyeIcon.attr("src", "static/picture/pwd-2.png");
|
||||
} else {
|
||||
$passwordInput.attr("type", "password");
|
||||
$eyeIcon.attr("src", "static/picture/pwd-1.png");
|
||||
}
|
||||
});
|
||||
|
||||
function reloadCaptcha() {
|
||||
$.ajax({
|
||||
url: requestApi + "/captcha",
|
||||
dataType: "json",
|
||||
type: "GET",
|
||||
async: false,
|
||||
success: function (res) {
|
||||
if (res.code === 200) {
|
||||
$("#codeImg").attr("src", res.data);
|
||||
localStorage.setItem("uuid", res.id);
|
||||
} else {
|
||||
messageFn(res.msg);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
messageFn(err);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
reloadCaptcha();
|
||||
});
|
||||
1
static/js/main-app-06f8d75bd904c82a.js
Normal file
1
static/js/main-app-06f8d75bd904c82a.js
Normal file
@ -0,0 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7358],{7733:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,39065,23)),Promise.resolve().then(n.t.bind(n,33283,23)),Promise.resolve().then(n.t.bind(n,69699,23)),Promise.resolve().then(n.t.bind(n,34712,23)),Promise.resolve().then(n.t.bind(n,47132,23)),Promise.resolve().then(n.t.bind(n,87748,23)),Promise.resolve().then(n.t.bind(n,50700,23)),Promise.resolve().then(n.t.bind(n,75082,23))},43398:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[587,8315],()=>(s(45504),s(7733))),_N_E=e.O()}]);
|
||||
322
static/js/nav.js
Normal file
322
static/js/nav.js
Normal file
@ -0,0 +1,322 @@
|
||||
|
||||
// let NAV_MENU_STATUS = false;
|
||||
const requestApi = 'http://proxy.apiapl.com/api/v1';
|
||||
let kwdValue = new URLSearchParams(window.location.search).get('kwd');
|
||||
let invitCode = new URLSearchParams(window.location.search).get('code');
|
||||
|
||||
|
||||
if (kwdValue) {
|
||||
localStorage.setItem("keyword", kwdValue);
|
||||
kwd(kwdValue)
|
||||
}
|
||||
if(invitCode){
|
||||
localStorage.setItem("invitCode", invitCode);
|
||||
}
|
||||
const $POST = async (u, d) => $.post(requestApi + u, { ...d,lang:$('#language').val(),token: localStorage.getItem("session") || "" });
|
||||
|
||||
const nav_en_init = async () => {
|
||||
|
||||
if ($(document).scrollTop() > 44) {
|
||||
$(".nav_header").addClass("active");
|
||||
}
|
||||
$(document).on("scroll", function () {
|
||||
if ($(document).scrollTop() > 44) {
|
||||
$(".nav_header").addClass("active");
|
||||
} else {
|
||||
$(".nav_header").removeClass("active");
|
||||
}
|
||||
});
|
||||
|
||||
$('.m-menu-list-main>.m-menu-list-item').on('click', function () {
|
||||
|
||||
});
|
||||
$(".m-menu-list-main>.m-menu-list-item").click((e) => {
|
||||
const DOM = $(e.currentTarget).parent()[0];
|
||||
if ($(DOM).hasClass("active")) return $(DOM).removeClass("active");
|
||||
$(DOM).addClass("active").siblings(".m-menu-list-main").removeClass("active");
|
||||
});
|
||||
|
||||
$('.mobile_menu').on('click',function(){
|
||||
$('.header_container>.m-menu-list').show();
|
||||
})
|
||||
|
||||
$('.m-menu-list-hesder>img').on('click',function(){
|
||||
$('.header_container>.m-menu-list').hide();
|
||||
})
|
||||
|
||||
|
||||
$('.m-menu-list-hesder img, .nav-small-screen .bg').on('click',function(){
|
||||
$('.nav-small-screen').removeClass('active');
|
||||
$('.nav-small-screen>.bg').fadeOut();
|
||||
|
||||
})
|
||||
|
||||
$('.faq-list>div:nth-of-type(1)').on('click',function(e){
|
||||
e.stopPropagation();
|
||||
$(this).siblings().slideToggle(200);
|
||||
$(this).parents(".faq-list").toggleClass("on");
|
||||
$(this).parents(".faq-list").siblings().find("div:nth-of-type(2)").slideUp(200);
|
||||
$(this).parents(".faq-list").siblings().removeClass("on");
|
||||
})
|
||||
|
||||
await checkLoginFn();
|
||||
// logout login
|
||||
$(".infobtn.user>.user-panel>em").click(sinOutFn);
|
||||
$(".vh-middle-logout").click(sinOutFn);
|
||||
$(".m-logout").click(sinOutFn);
|
||||
|
||||
$('.change_price_case>li').click(changeProxyFn)
|
||||
|
||||
|
||||
|
||||
// vh.getUrlParams("invite") && sessionStorage.setItem("invite", vh.getUrlParams("invite"));
|
||||
|
||||
$(".proxy_nav_banner>img").on("click", function () {
|
||||
$(".proxy_nav_banner").hide();
|
||||
})
|
||||
};
|
||||
|
||||
function getLanguageFromUrl(url = window.location.href, defaultLang = 'en') {
|
||||
const match = url.match(/\/([a-z]{2}|zh-tw)\/(?!\d)/);
|
||||
return match? match[1] : defaultLang;
|
||||
}
|
||||
let shareLang = 'en'
|
||||
window.addEventListener('load', function() {
|
||||
shareLang = getLanguageFromUrl();
|
||||
if(shareLang == 'zh'){
|
||||
shareLang = 'zh-tw';
|
||||
}
|
||||
|
||||
const expiresDate = new Date();
|
||||
expiresDate.setDate(expiresDate.getDate() + 3000);
|
||||
const domain = window.location.host.split(".").slice(-2).join(".");
|
||||
Cookies.set("cli_lang", shareLang, { expires: expiresDate, domain });
|
||||
});
|
||||
|
||||
|
||||
|
||||
const checkLoginFn = async () => {
|
||||
const session = localStorage.getItem("session");
|
||||
const user = localStorage.getItem("user");
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
|
||||
$(".infobtn.haveinfo").hide().siblings(".infobtn").css('display', 'flex');
|
||||
$('.m-l-item-btn>.m-no-login').show().siblings('.m-have-login').hide();
|
||||
localStorage.removeItem("session");
|
||||
localStorage.removeItem("user");
|
||||
} else {
|
||||
let center_url = $("#centerUrl").val()+'/cli/isp-user';
|
||||
$('.banner_free_link').attr('href', center_url);
|
||||
const userDOM = $(".infobtn.haveinfo");
|
||||
userDOM.find(">a").html(JSON.parse(user).email);
|
||||
userDOM.find(".user-panel>span>i").text(JSON.parse(user).email);
|
||||
$('.m-have-login>a').html(JSON.parse(user).email);
|
||||
userDOM.css({ display: "flex" }).siblings(".infobtn").hide();
|
||||
$('.m-l-item-btn>.m-no-login').hide().siblings('.m-have-login').show();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// logout login
|
||||
const sinOutFn = async (e) => {
|
||||
|
||||
const res = await $POST("/v1/signout");
|
||||
|
||||
messageFn(res.msg);
|
||||
$(e.currentTarget).parent().css("pointer-events", "none").parent().css("pointer-events", "none");
|
||||
localStorage.removeItem("session");
|
||||
localStorage.removeItem("user");
|
||||
const domain = window.location.host.split(".").slice(-2).join(".");
|
||||
Cookies.set("common_session", "null", { domain });
|
||||
location.reload();
|
||||
};
|
||||
const updateLink = () => {
|
||||
|
||||
const link = $('.tlinks');
|
||||
if (!link) return;
|
||||
const utcHour = new Date().getUTCHours();
|
||||
const { href } = utcHour >= 14 && utcHour <= 23 ? LINKS.evening : LINKS.daytime;
|
||||
link.attr('href', href);
|
||||
$('.tlinks-email').html(href);
|
||||
};
|
||||
|
||||
$(function () {
|
||||
// updateLink();
|
||||
nav_en_init();
|
||||
currntPageShow();
|
||||
$('.copy_tmemail').click(function () {
|
||||
const email = $('.tlinks-email').text();
|
||||
copyText(email);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
const currntPageShow = async () => {
|
||||
const domain = window.location.host.split(".").slice(-2).join(".");
|
||||
const c_token = Cookies.get("common_session");
|
||||
const local_session = localStorage.getItem("session");
|
||||
if (c_token == "null" || c_token == undefined || c_token == '') {
|
||||
if (!local_session) return;
|
||||
window.stop();
|
||||
|
||||
Cookies.set("common_session", "", { domain });
|
||||
localStorage.removeItem("session");
|
||||
localStorage.removeItem("user");
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 100);
|
||||
} else if (c_token && c_token.length > 6) {
|
||||
if (local_session) return;
|
||||
localStorage.setItem("session", c_token);
|
||||
const res = await $POST("/v1/webauto", { session: c_token });
|
||||
if (res.code != 0) {
|
||||
localStorage.removeItem("session");
|
||||
localStorage.removeItem("user");
|
||||
const domain = window.location.host.split(".").slice(-2).join(".");
|
||||
Cookies.set("common_session", "null", { domain });
|
||||
return;
|
||||
}
|
||||
localStorage.setItem('session',res.data.token);
|
||||
localStorage.setItem("user", JSON.stringify(res.data));
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 666);
|
||||
}
|
||||
};
|
||||
|
||||
const LINKS = {
|
||||
evening: { href: 'https://t.me/cliproxybd'},
|
||||
daytime: { href: 'https://t.me/cliproxyOfficial'}
|
||||
};
|
||||
|
||||
|
||||
window.addEventListener("visibilitychange", () => document.visibilityState === "visible" && currntPageShow());
|
||||
|
||||
|
||||
|
||||
const messageData = {
|
||||
handle: null,
|
||||
delayTime: 3000,
|
||||
obj: []
|
||||
}
|
||||
const messageFn= async (v) => {
|
||||
clearTimeout(messageData.handle);
|
||||
// Clean box
|
||||
var removeObj = setTimeout(function () {
|
||||
$(".lo_message").removeClass("on");
|
||||
}, 0);
|
||||
|
||||
var newTime = "lo_" + new Date().getTime();
|
||||
var message = $('<div class="lo_message ' + newTime + '"><span>' + v + "</span></div>");
|
||||
$(document.body).append(message);
|
||||
|
||||
var addObj = setTimeout(function () {
|
||||
$("." + newTime).addClass("on");
|
||||
}, 2);
|
||||
|
||||
messageData.handle = setTimeout(function () {
|
||||
$(".lo_message").remove();
|
||||
}, messageData.delayTime);
|
||||
}
|
||||
|
||||
const changeProxyFn = async (e) => {
|
||||
const DOM = $(e.currentTarget);
|
||||
DOM.addClass("active").siblings().removeClass("active");
|
||||
const index = DOM.index();
|
||||
$('.price_case_content').eq(index).css('display','flex').siblings('.price_case_content').hide();
|
||||
}
|
||||
|
||||
|
||||
const setStorage = (key, value, ttl_ms) => {
|
||||
var data = { value: value, exprice: new Date(ttl_ms).getTime() };
|
||||
sessionStorage.setItem(key, JSON.stringify(data));
|
||||
}
|
||||
|
||||
const getStorage = (key) => {
|
||||
var data = JSON.parse(sessionStorage.getItem(key));
|
||||
if (data !== null) {
|
||||
if (data.exprice != null && data.exprice - new Date().getTime() < 0) {
|
||||
sessionStorage.removeItem(key);
|
||||
return [];
|
||||
} else {
|
||||
return data.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const countDownTime =() =>{
|
||||
const now = Date.now();
|
||||
const endOfDay = new Date().setHours(23, 59, 59, 999);
|
||||
const diff = endOfDay - now;
|
||||
const [hour, min, sec] = [
|
||||
Math.floor(diff / 1000 / 3600).toString().padStart(2, '0'),
|
||||
Math.floor((diff % (1000 * 3600)) / 1000 / 60).toString().padStart(2, '0'),
|
||||
Math.floor((diff % (1000 * 60)) / 1000).toString().padStart(2, '0')
|
||||
];
|
||||
$(".countdown").html(`${hour}:${min}:${sec}`);
|
||||
|
||||
setTimeout(countDownTime, 1000);
|
||||
}
|
||||
|
||||
function countdown(endTimes) {
|
||||
const update = () => {
|
||||
const now = Date.now();
|
||||
endTimes.forEach((endTime, index) => {
|
||||
const diff = endTime - now;
|
||||
if (diff <= 0) {
|
||||
return;
|
||||
}
|
||||
const days = Math.floor(diff / (1000 * 3600 * 24));
|
||||
const hours = Math.floor((diff % (1000 * 3600 * 24)) / (1000 * 3600)).toString().padStart(2, '0');
|
||||
const minutes = Math.floor((diff % (1000 * 3600)) / (1000 * 60)).toString().padStart(2, '0');
|
||||
const seconds = Math.floor((diff % (1000 * 60)) / 1000).toString().padStart(2, '0');
|
||||
|
||||
$(`.coming_soon_days_${index}`).html(days);
|
||||
$(`.itime`).html(hours);
|
||||
$(`.imin`).html(minutes);
|
||||
$(`.isec`).html(seconds);
|
||||
$(`.iday`).html(days);
|
||||
});
|
||||
};
|
||||
const timer = setInterval(update, 1000);
|
||||
update();
|
||||
}
|
||||
|
||||
// crontab
|
||||
const endTimes = [
|
||||
new Date('2025-07-15T00:00:00').getTime(),
|
||||
new Date('2025-07-15T00:00:00').getTime(),
|
||||
new Date('2025-07-15T00:00:00').getTime()
|
||||
];
|
||||
countdown(endTimes);
|
||||
// countdown(endTine);
|
||||
// countdown(endActiveTime);
|
||||
const copyText = (str) =>{
|
||||
var save = function (e) {
|
||||
e.clipboardData.setData("text/plain", str);
|
||||
e.preventDefault();
|
||||
};
|
||||
document.addEventListener("copy", save);
|
||||
document.execCommand("copy");
|
||||
document.removeEventListener("copy", save);
|
||||
messageFn("Copied to clipboard");
|
||||
}
|
||||
|
||||
|
||||
function kwd(kword){
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open('POST', requestApi + '/v1/kwd', true);
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||
if (xhr.status === 200) {
|
||||
console.log(xhr.responseText);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.send('kwd='+kword);
|
||||
}
|
||||
1
static/js/page-d6587ed19a473453.js
Normal file
1
static/js/page-d6587ed19a473453.js
Normal file
@ -0,0 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3487,3635,4060,7808,9595],{79698:(e,s,n)=>{Promise.resolve().then(n.bind(n,27801)),Promise.resolve().then(n.bind(n,39496)),Promise.resolve().then(n.t.bind(n,44760,23)),Promise.resolve().then(n.bind(n,21860)),Promise.resolve().then(n.bind(n,76169)),Promise.resolve().then(n.bind(n,33591)),Promise.resolve().then(n.bind(n,98953)),Promise.resolve().then(n.bind(n,56462)),Promise.resolve().then(n.bind(n,52044)),Promise.resolve().then(n.bind(n,15582)),Promise.resolve().then(n.bind(n,42651)),Promise.resolve().then(n.t.bind(n,29751,23)),Promise.resolve().then(n.t.bind(n,4436,23)),Promise.resolve().then(n.t.bind(n,36143,23)),Promise.resolve().then(n.t.bind(n,17694,23)),Promise.resolve().then(n.bind(n,19719)),Promise.resolve().then(n.bind(n,63644)),Promise.resolve().then(n.bind(n,42613)),Promise.resolve().then(n.bind(n,14417)),Promise.resolve().then(n.bind(n,85053)),Promise.resolve().then(n.bind(n,5833)),Promise.resolve().then(n.bind(n,36329)),Promise.resolve().then(n.bind(n,90654)),Promise.resolve().then(n.bind(n,99447)),Promise.resolve().then(n.bind(n,41341)),Promise.resolve().then(n.bind(n,75555)),Promise.resolve().then(n.bind(n,10083)),Promise.resolve().then(n.bind(n,91365)),Promise.resolve().then(n.t.bind(n,3017,23)),Promise.resolve().then(n.bind(n,13424)),Promise.resolve().then(n.bind(n,90983)),Promise.resolve().then(n.bind(n,42296)),Promise.resolve().then(n.bind(n,47091)),Promise.resolve().then(n.bind(n,9443)),Promise.resolve().then(n.bind(n,15943)),Promise.resolve().then(n.bind(n,90862)),Promise.resolve().then(n.bind(n,20310)),Promise.resolve().then(n.bind(n,27851)),Promise.resolve().then(n.bind(n,32292)),Promise.resolve().then(n.bind(n,30711)),Promise.resolve().then(n.bind(n,56240)),Promise.resolve().then(n.bind(n,58132)),Promise.resolve().then(n.bind(n,18003)),Promise.resolve().then(n.bind(n,54286)),Promise.resolve().then(n.bind(n,56659)),Promise.resolve().then(n.bind(n,1477)),Promise.resolve().then(n.bind(n,78841)),Promise.resolve().then(n.bind(n,43248)),Promise.resolve().then(n.bind(n,29484)),Promise.resolve().then(n.bind(n,61404)),Promise.resolve().then(n.t.bind(n,64902,23)),Promise.resolve().then(n.bind(n,7970)),Promise.resolve().then(n.bind(n,42149)),Promise.resolve().then(n.bind(n,24665)),Promise.resolve().then(n.bind(n,38911)),Promise.resolve().then(n.bind(n,3259)),Promise.resolve().then(n.bind(n,42775)),Promise.resolve().then(n.bind(n,35886)),Promise.resolve().then(n.bind(n,69804)),Promise.resolve().then(n.bind(n,81784)),Promise.resolve().then(n.bind(n,20604)),Promise.resolve().then(n.bind(n,90015)),Promise.resolve().then(n.bind(n,99102)),Promise.resolve().then(n.bind(n,32868)),Promise.resolve().then(n.bind(n,72105))}},e=>{var s=s=>e(e.s=s);e.O(0,[6602,4995,633,6666,915,1825,2811,867,7582,2755,907,4856,4127,587,8315,7358],()=>s(79698)),_N_E=e.O()}]);
|
||||
1
static/js/polyfills-42372ed130431b0a.js
Normal file
1
static/js/polyfills-42372ed130431b0a.js
Normal file
File diff suppressed because one or more lines are too long
237
static/js/price.js
Normal file
237
static/js/price.js
Normal file
@ -0,0 +1,237 @@
|
||||
$(function(){
|
||||
|
||||
$('.order_btn_link').click(orderLinkFn);
|
||||
$('.package_list>p').click(packageSelectFn);
|
||||
$('.static_buy').click(orderNowFn);
|
||||
|
||||
$('#package_num').on('input', inputNumChangeFn );
|
||||
$('#package_num').on('blur', inputNumBlurFn );
|
||||
$('.c_close').on('click', function(){
|
||||
$('.coupon-model').hide();
|
||||
})
|
||||
couponCuttime();
|
||||
$('#package_num').focus();
|
||||
checkUserTypeFn();
|
||||
if(localStorage.getItem("userType") && localStorage.getItem("userType") == 0){
|
||||
document.addEventListener('visibilitychange', function () {
|
||||
if (document.visibilityState === 'visible' && localStorage.getItem('session')) {
|
||||
checkUserTypeFn();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.already-pay,.checkpay-close').on('click', function(){
|
||||
$('.checkpay').hide();
|
||||
})
|
||||
|
||||
$('.proxy_tab_btn>p').on('click', function(){
|
||||
const index = $(this).index();
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
$('.proxy_container>div').eq(index).show().siblings().hide();
|
||||
$('.ublimit_proxy_container>div').eq(index).show().siblings().hide();
|
||||
$('.unlimit-proxy-list').eq(index).show().siblings('.unlimit-proxy-list').hide();
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
let submitFlag1 = false;
|
||||
let countdown_check = 300;
|
||||
let check_time = null;
|
||||
const checkUserTypeFn = async () => {
|
||||
const res = await $POST("/v1/memberSimple");
|
||||
if(res.code!=0)return;
|
||||
localStorage.setItem("userType", res.data.repay);
|
||||
if(res.data.repay != 0){
|
||||
$('.neworder').fadeOut();
|
||||
}
|
||||
}
|
||||
const session = localStorage.getItem("session");
|
||||
const user = localStorage.getItem("user");
|
||||
let lang = $('#language').val();
|
||||
const orderLinkFn = async (e) => {
|
||||
const DOM = $(e.currentTarget);
|
||||
const sn = DOM.data("sn");
|
||||
countdown_check = 30;
|
||||
var currentUrl = window.location.href;
|
||||
var match = currentUrl.match(/\.com(.*)/);
|
||||
|
||||
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
let url = "/sign-up/" ;
|
||||
if (lang == "zh"){
|
||||
url = `/${lang}/sign-up/`
|
||||
}
|
||||
let r = "";
|
||||
if (match && match.length > 1) {
|
||||
var contentAfterCom = match[1];
|
||||
r = contentAfterCom;
|
||||
}
|
||||
window.location.href = url +"?r=" + r
|
||||
} else {
|
||||
settime();
|
||||
check_time = setInterval(function () {
|
||||
checkpay()
|
||||
}, 3000);
|
||||
if(submitFlag1) return;
|
||||
submitFlag1 = true;
|
||||
const res = await $POST("/v1/orderPackage", { sn, lang });
|
||||
submitFlag1 = false;
|
||||
if(res.code!=0)return messageFn(res.msg);
|
||||
window.open(res.data.url);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const checkpay = async () => {
|
||||
const res = await $POST("/v1/paymentCheck", { session, lang });
|
||||
if(res.code!=0)return;
|
||||
if(res.data.show == 1){
|
||||
$(".checkpay").show();
|
||||
clearInterval(check_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function settime() {
|
||||
clearInterval(check_time);
|
||||
check_time = setInterval(function () {
|
||||
if (countdown_check == 0) {
|
||||
clearInterval(check_time);
|
||||
} else {
|
||||
countdown_check--;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
let price = $('.package_list>p.active').data("price");
|
||||
let costprice = $('.package_list>p.active').data("costprice");
|
||||
let number = 1;
|
||||
let total = Math.floor(price * number * 100) / 100;;
|
||||
const packageSelectFn = (e) => {
|
||||
$('#package_num').focus();
|
||||
|
||||
const DOM = $(e.currentTarget);
|
||||
$(DOM).addClass('active').siblings().removeClass('active');
|
||||
price = DOM.data("price");
|
||||
costprice = DOM.data("costprice");
|
||||
number = $("#package_num").val();
|
||||
randerFn();
|
||||
}
|
||||
const inputNumChangeFn = (e) => {
|
||||
const dom = $(e.currentTarget);
|
||||
number = $(e.currentTarget).val();
|
||||
if (isNaN(number) || number < 1) {
|
||||
dom.addClass('error');
|
||||
} else {
|
||||
dom.removeClass('error');
|
||||
|
||||
}
|
||||
randerFn();
|
||||
|
||||
}
|
||||
const inputNumBlurFn = (e) => {
|
||||
number = $(e.currentTarget).val();
|
||||
if(number < 1){
|
||||
number = 1;
|
||||
$(e.currentTarget).removeClass('error');
|
||||
$(e.currentTarget).val(1);
|
||||
}
|
||||
randerFn();
|
||||
}
|
||||
const randerFn = () => {
|
||||
total = Math.floor(price * number * 100) / 100;
|
||||
$('.total_price_num').html('$'+total);
|
||||
$('.unit_price').html(price);
|
||||
$('.cost_price_hx').html(`$${costprice}/IP`);
|
||||
}
|
||||
|
||||
const orderNowFn = async (e) => {
|
||||
var currentUrl = window.location.href;
|
||||
var match = currentUrl.match(/\.com(.*)/);
|
||||
|
||||
if(total<1) return messageFn('Quantity must be greater than 0');;
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
let url = "/sign-up/" ;
|
||||
if (lang == "zh"){
|
||||
url = `/${lang}/sign-up/`
|
||||
}
|
||||
let r = "";
|
||||
if (match && match.length > 1) {
|
||||
var contentAfterCom = match[1];
|
||||
r = contentAfterCom;
|
||||
}
|
||||
|
||||
window.location.href = url +"?r=" + r
|
||||
} else {
|
||||
window.open(requestApi+`/recharge/${lang}/${session}/${total}`) ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const couponCuttime = async () => {
|
||||
|
||||
const res = await $POST("/v1/coupons");
|
||||
if(res.code!=0)return;
|
||||
const coupons = res.data.coupons;
|
||||
let HTML = ''
|
||||
if(coupons.length > 0){
|
||||
coupons.forEach(coupon => {
|
||||
HTML += `
|
||||
<div>
|
||||
<p>
|
||||
<span>${coupon.value}</span>
|
||||
<span>${coupon.value_tip}</span>
|
||||
</p>
|
||||
<div>
|
||||
<p>${coupon.title}</p>
|
||||
<p>${expiredTxt}: <span>${coupon.expired}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
|
||||
$('.counpin-list').html(HTML)
|
||||
|
||||
|
||||
$('.coupon-pop').show();
|
||||
const countdown = createCountdown(res.data.surplus_time, '.coupon_countdown');
|
||||
countdown.start();
|
||||
|
||||
$('.coupon-pop').on('click', function(e){
|
||||
$(".coupon-model").show();
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
function createCountdown(totalSeconds, targetSelector) {
|
||||
const $target = $(targetSelector);
|
||||
let timer;
|
||||
|
||||
const formatTime = (time) => String(time).padStart(2, '0');
|
||||
const update = () => {
|
||||
const h = formatTime(Math.floor(totalSeconds / 3600));
|
||||
const m = formatTime(Math.floor((totalSeconds % 3600) / 60));
|
||||
const s = formatTime(totalSeconds % 60);
|
||||
$target.text(`${h}:${m}:${s}`);
|
||||
};
|
||||
|
||||
const start = () => {
|
||||
update();
|
||||
timer = setInterval(() => {
|
||||
totalSeconds > 0 ? (totalSeconds--, update()) : (clearInterval(timer), $target.hide());
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const stop = () => clearInterval(timer);
|
||||
|
||||
return { start, stop };
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// couponCuttime();
|
||||
2
static/js/request.js
Normal file
2
static/js/request.js
Normal file
@ -0,0 +1,2 @@
|
||||
const requestUrl="http://proxy.apiapl.com/api/v1";
|
||||
const baseUrl="http://proxy.apiapl.com";
|
||||
56
static/js/scroll.js
Normal file
56
static/js/scroll.js
Normal file
@ -0,0 +1,56 @@
|
||||
// 无限循环左右滚动插件
|
||||
const vhInfiniteLoop = {
|
||||
init: function (dom, k = true, time = 1) {
|
||||
const _this = this;
|
||||
// 设置唯一标识符并初始化
|
||||
const numStr = `${dom.classList.value}-num`;
|
||||
const widthStr = `${dom.classList.value}-width`;
|
||||
const funStr = `${dom.classList.value}-fun`;
|
||||
_this[numStr] = 0;
|
||||
_this[funStr] = null;
|
||||
// Copy一遍子元素DOM并添加到父元素DOM尾部
|
||||
Array.from(dom.children)
|
||||
.map(i => i.cloneNode(true))
|
||||
.forEach(i => dom.appendChild(i));
|
||||
// 取宽度,设置初始位置,绑定事件
|
||||
// 每个子元素给悬浮事件
|
||||
Array.from(dom.children).forEach(i => {
|
||||
// 悬浮事件
|
||||
i.addEventListener("mouseenter", function () {
|
||||
_this[funStr] = function () {
|
||||
requestAnimationFrame(() => {
|
||||
_this[funStr](dom, numStr, widthStr, k);
|
||||
});
|
||||
};
|
||||
});
|
||||
// 取消悬浮事件
|
||||
i.addEventListener("mouseleave", function () {
|
||||
_this[funStr] = function (dom, numStr, widthStr, k) {
|
||||
_this[widthStr] = dom.offsetWidth;
|
||||
!k && (dom.style.transform = `translateX(-${_this[widthStr] / 2}px)`);
|
||||
_this[numStr] += time;
|
||||
dom.style.marginLeft = `${k ? "-" : ""}${_this[numStr]}px`;
|
||||
_this[numStr] >= _this[widthStr] / 2 && (_this[numStr] = 0);
|
||||
requestAnimationFrame(() => {
|
||||
_this[funStr](dom, numStr, widthStr, k);
|
||||
});
|
||||
};
|
||||
});
|
||||
});
|
||||
// 设置循环函数
|
||||
_this[funStr] = function (dom, numStr, widthStr, k) {
|
||||
_this[widthStr] = dom.offsetWidth;
|
||||
!k && (dom.style.transform = `translateX(-${_this[widthStr] / 2}px)`);
|
||||
_this[numStr] += time;
|
||||
dom.style.marginLeft = `${k ? "-" : ""}${_this[numStr]}px`;
|
||||
_this[numStr] >= _this[widthStr] / 2 && (_this[numStr] = 0);
|
||||
requestAnimationFrame(() => {
|
||||
_this[funStr](dom, numStr, widthStr, k);
|
||||
});
|
||||
};
|
||||
// 启动
|
||||
requestAnimationFrame(() => {
|
||||
_this[funStr](dom, numStr, widthStr, k);
|
||||
});
|
||||
}
|
||||
};
|
||||
175
static/js/shortact_proxy.js
Normal file
175
static/js/shortact_proxy.js
Normal file
@ -0,0 +1,175 @@
|
||||
$(function(){
|
||||
|
||||
$('.order_btn_link').click(orderLinkFn);
|
||||
$('.package_list>p').click(packageSelectFn);
|
||||
$('.static_buy').click(orderNowFn);
|
||||
|
||||
$('.c_close').on('click', function(){
|
||||
$('.coupon-model').hide();
|
||||
})
|
||||
|
||||
|
||||
// 点击减少按钮
|
||||
$('.reduce_short').click(function() {
|
||||
const countElement = $(this).siblings('.countInfo');
|
||||
let currentCount = parseInt(countElement.text(), 10);
|
||||
|
||||
if (currentCount > 10) {
|
||||
currentCount -= 10;
|
||||
countElement.text(currentCount);
|
||||
updateTotalPrice($(this).closest('.unlimt-detail'));
|
||||
}
|
||||
});
|
||||
|
||||
// 点击增加按钮
|
||||
$('.add_short').click(function() {
|
||||
const countElement = $(this).siblings('.countInfo');
|
||||
let currentCount = parseInt(countElement.text(), 10);
|
||||
|
||||
currentCount += 10;
|
||||
countElement.text(currentCount);
|
||||
updateTotalPrice($(this).closest('.unlimt-detail'));
|
||||
});
|
||||
|
||||
// 更新总价
|
||||
function updateTotalPrice(container) {
|
||||
const count = parseInt(container.find('.countInfo').text(), 10);
|
||||
const price = parseFloat(container.find('.price span').text());
|
||||
const total = (count * price).toFixed(2);
|
||||
|
||||
container.find('.total_money_show p:last-child').text(`$${total}`);
|
||||
}
|
||||
|
||||
$('#package_num').focus();
|
||||
checkUserTypeFn();
|
||||
if(localStorage.getItem("userType") && localStorage.getItem("userType") == 0){
|
||||
document.addEventListener('visibilitychange', function () {
|
||||
if (document.visibilityState === 'visible' && localStorage.getItem('session')) {
|
||||
checkUserTypeFn();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.already-pay,.checkpay-close').on('click', function(){
|
||||
$('.checkpay').hide();
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
let submitFlag1 = false;
|
||||
let countdown_check = 300;
|
||||
let check_time = null;
|
||||
const checkUserTypeFn = async () => {
|
||||
const res = await $POST("/v1/memberSimple");
|
||||
if(res.code!=0)return;
|
||||
localStorage.setItem("userType", res.data.repay);
|
||||
if(res.data.repay != 0){
|
||||
$('.neworder').fadeOut();
|
||||
}
|
||||
}
|
||||
const session = localStorage.getItem("session");
|
||||
const user = localStorage.getItem("user");
|
||||
let lang = $('#language').val();
|
||||
const orderLinkFn = async (e) => {
|
||||
const DOM = $(e.currentTarget);
|
||||
const sn = DOM.data("sn");
|
||||
const num = DOM.parent().find('.countInfo').text();
|
||||
console.log(sn);
|
||||
|
||||
countdown_check = 30;
|
||||
var currentUrl = window.location.href;
|
||||
var match = currentUrl.match(/\.com(.*)/);
|
||||
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
let url = "/sign-up/" ;
|
||||
if (lang == "zh"){
|
||||
url = `/${lang}/sign-up/`
|
||||
}
|
||||
let r = "";
|
||||
if (match && match.length > 1) {
|
||||
var contentAfterCom = match[1];
|
||||
r = contentAfterCom;
|
||||
}
|
||||
window.location.href = url +"?r=" + r
|
||||
} else {
|
||||
settime();
|
||||
check_time = setInterval(function () {
|
||||
checkpay()
|
||||
}, 3000);
|
||||
if(submitFlag1) return;
|
||||
submitFlag1 = true;
|
||||
const res = await $POST("/v1/orderStaticShort", { sn, lang, num });
|
||||
submitFlag1 = false;
|
||||
if(res.code!=0)return messageFn(res.msg);
|
||||
window.open(res.data.url);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const checkpay = async () => {
|
||||
const res = await $POST("/v1/paymentCheck", { session, lang });
|
||||
if(res.code!=0)return;
|
||||
if(res.data.show == 1){
|
||||
$(".checkpay").show();
|
||||
clearInterval(check_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function settime() {
|
||||
clearInterval(check_time);
|
||||
check_time = setInterval(function () {
|
||||
if (countdown_check == 0) {
|
||||
clearInterval(check_time);
|
||||
} else {
|
||||
countdown_check--;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
let price = $('.package_list>p.active').data("price");
|
||||
let costprice = $('.package_list>p.active').data("costprice");
|
||||
let number = 1;
|
||||
let total = Math.floor(price * number * 100) / 100;;
|
||||
const packageSelectFn = (e) => {
|
||||
$('#package_num').focus();
|
||||
|
||||
const DOM = $(e.currentTarget);
|
||||
$(DOM).addClass('active').siblings().removeClass('active');
|
||||
price = DOM.data("price");
|
||||
costprice = DOM.data("costprice");
|
||||
number = $("#package_num").val();
|
||||
randerFn();
|
||||
}
|
||||
|
||||
|
||||
const orderNowFn = async (e) => {
|
||||
var currentUrl = window.location.href;
|
||||
var match = currentUrl.match(/\.com(.*)/);
|
||||
|
||||
if(total<1) return messageFn('Quantity must be greater than 0');;
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
let url = "/sign-up/" ;
|
||||
if (lang == "zh"){
|
||||
url = `/${lang}/sign-up/`
|
||||
}
|
||||
let r = "";
|
||||
if (match && match.length > 1) {
|
||||
var contentAfterCom = match[1];
|
||||
r = contentAfterCom;
|
||||
}
|
||||
|
||||
window.location.href = url +"?r=" + r
|
||||
} else {
|
||||
window.open(requestApi+`/recharge/${lang}/${session}/${total}`) ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// couponCuttime();
|
||||
94
static/js/signup.js
Normal file
94
static/js/signup.js
Normal file
@ -0,0 +1,94 @@
|
||||
|
||||
|
||||
|
||||
|
||||
$(function(){
|
||||
const url = window.location.href;
|
||||
const searchParams = new URLSearchParams(new URL(url).search);
|
||||
const rParam = searchParams.get('r');
|
||||
let submitFlag = false;
|
||||
if(localStorage.getItem("invitCode")){
|
||||
$("#keyword input").val(localStorage.getItem("invitCode"))
|
||||
}
|
||||
$(".login_btn").on("click",function (){
|
||||
let _lang = $('#language').val();
|
||||
|
||||
var email = $("#login_email input").val();
|
||||
var password = $("#login_pwd input").val();
|
||||
var code = $("#keyword input").val();
|
||||
if (email == "" || email == undefined){
|
||||
$("#login_email").addClass("error");
|
||||
$("#login_email .error_tip").show();
|
||||
return;
|
||||
}else {
|
||||
$("#login_email").removeClass("error");
|
||||
$("#login_email .error_tip").hide();
|
||||
}
|
||||
|
||||
if (password == "" || password == undefined){
|
||||
$("#login_pwd").addClass("error");
|
||||
$("#login_pwd .error_tip").show();
|
||||
return;
|
||||
}else {
|
||||
$("#login_pwd").removeClass("error");
|
||||
$("#login_pwd .error_tip").hide();
|
||||
}
|
||||
if(submitFlag) return;
|
||||
submitFlag = true;
|
||||
$('.loading-mask').show();
|
||||
$.ajax({
|
||||
url: requestApi+"/v1/signup",
|
||||
dataType:"json",
|
||||
type:"POST",
|
||||
aysc:false,
|
||||
data:{
|
||||
"lang": _lang,
|
||||
"email": email,
|
||||
"pwd": password,
|
||||
"kwd":localStorage.getItem("keyword"),
|
||||
"pcode": code
|
||||
|
||||
},
|
||||
success:function(res){
|
||||
submitFlag = false;
|
||||
$('.loading-mask').hide();
|
||||
if(res.code == 0){
|
||||
localStorage.setItem('session',res.data.token);
|
||||
localStorage.setItem("user", JSON.stringify(res.data));
|
||||
const expiresDate = new Date();
|
||||
const expires = res.data.token_cache == 0 ? 9999999999999 : res.data.token_cache;
|
||||
expiresDate.setDate(expiresDate.getDate() + expires);
|
||||
const domain = window.location.host.split(".").slice(-2).join(".");
|
||||
Cookies.set("common_session", res.data.token, { expires: expiresDate, domain});
|
||||
if(res.data.country != 'CN'){
|
||||
console.log(res.data.country)
|
||||
fbq('track', 'Lead');
|
||||
}
|
||||
if(!rParam){
|
||||
window.location.href = '/';
|
||||
}else{
|
||||
window.location.href = 'https://cliproxy.com'+rParam;
|
||||
}
|
||||
}else{
|
||||
messageFn(res.msg);
|
||||
}
|
||||
},error:function () {
|
||||
submitFlag = false;
|
||||
$('.loading-mask').hide();
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
const $passwordInput = $('#login_pwd input');
|
||||
const $eyeIcon = $('#eyeIcon');
|
||||
|
||||
$eyeIcon.on('click', function () {
|
||||
if ($passwordInput.attr('type') === 'password') {
|
||||
$passwordInput.attr('type', 'text');
|
||||
$eyeIcon.attr('src', '/static/common/login/img/pwd-2.png');
|
||||
} else {
|
||||
$passwordInput.attr('type', 'password');
|
||||
$eyeIcon.attr('src', '/static/common/login/img/pwd-1.png');
|
||||
}
|
||||
});
|
||||
})
|
||||
305
static/js/static.js
Normal file
305
static/js/static.js
Normal file
@ -0,0 +1,305 @@
|
||||
$(function () {
|
||||
const $days = $('.package_list p');
|
||||
const $priceTables = $('.country_lists');
|
||||
const $showPriceDiv = $('.show_price');
|
||||
const $totalPriceSpan = $('.totalPrices');
|
||||
let result = [];
|
||||
let submitFlag = false;
|
||||
|
||||
|
||||
// tab click
|
||||
$days.on('click', function () {
|
||||
const targetDay = $(this).data('day');
|
||||
$days.removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$priceTables.hide().filter(`[data-day="${targetDay}"]`).show();
|
||||
});
|
||||
|
||||
// country_lists_detail click
|
||||
$priceTables.on('click', '.country_lists_detail', function () {
|
||||
const number = $(this).data('num');
|
||||
// if(number <1) return messageFn(tipsQuantity);
|
||||
$(this).toggleClass('active');
|
||||
updateUI();
|
||||
});
|
||||
|
||||
// buy click
|
||||
$('.buyNow').on('click', function () {
|
||||
const session = localStorage.getItem("session");
|
||||
const user = localStorage.getItem("user");
|
||||
const selectedItems = getSelectedItems();
|
||||
|
||||
let lang = $('#language').val();
|
||||
var currentUrl = window.location.href;
|
||||
var match = currentUrl.match(/\.com(.*)/);
|
||||
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
let url = "/sign-up/" ;
|
||||
if (lang == "zh"){
|
||||
url = `/${lang}/sign-up/`
|
||||
}
|
||||
let r = "";
|
||||
if (match && match.length > 1) {
|
||||
var contentAfterCom = match[1];
|
||||
r = contentAfterCom;
|
||||
}
|
||||
window.location.href = url +"?r=" + r
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (selectedItems.length === 0) {
|
||||
messageFn('Please select the purchase quantity');
|
||||
return;
|
||||
}
|
||||
|
||||
const transformedData = [];
|
||||
selectedItems.forEach(dayObj => {
|
||||
const day = dayObj.day;
|
||||
dayObj.items.forEach(item => {
|
||||
const code = item.code;
|
||||
const num = item.count;
|
||||
transformedData.push({ day, code, num,lang });
|
||||
});
|
||||
});
|
||||
borderFn(transformedData)
|
||||
|
||||
});
|
||||
|
||||
const borderFn = async(orderList) => {
|
||||
if(submitFlag) return;
|
||||
submitFlag = true;
|
||||
$('.loading-mask').show();
|
||||
const res = await $POST("/v1/orderStatic", { data: JSON.stringify(orderList) });
|
||||
submitFlag = false;
|
||||
$('.loading-mask').hide();
|
||||
|
||||
if(res.code!=0)return messageFn(res.msg);
|
||||
window.open(res.data.url);
|
||||
}
|
||||
|
||||
// update info
|
||||
const updateUI = () => {
|
||||
result = getSelectedItems();
|
||||
renderShowPrice(result);
|
||||
updateTotalPrice();
|
||||
};
|
||||
|
||||
// 获取选中的项目
|
||||
const getSelectedItems = () => {
|
||||
return $priceTables.map((_, table) => {
|
||||
const day = $(table).data('day');
|
||||
const unit = $(table).data('unit');
|
||||
const items = $(table).find('div.active').map((_, p) => {
|
||||
const code = $(p).data('code');
|
||||
const price = $(p).data('price');
|
||||
const imgUrl = $(p).data('url');
|
||||
const unit = $(p).data('unit');
|
||||
const existingItem = findExistingItem(day, code);
|
||||
const count = existingItem ? existingItem.count : 1;
|
||||
return { code, price, count,imgUrl,unit };
|
||||
}).get();
|
||||
return items.length ? { day, unit, items } : null;
|
||||
}).get().filter(Boolean);
|
||||
};
|
||||
|
||||
// 查找之前存储的项目
|
||||
const findExistingItem = (day, code) => {
|
||||
return result.find(item => item.day === day)?.items.find(subItem => subItem.code === code);
|
||||
};
|
||||
|
||||
// 渲染选中的项目到页面
|
||||
const renderShowPrice = (result) => {
|
||||
let PRICE_HTML = "";
|
||||
if(result.length >0){
|
||||
result.forEach((i) => {
|
||||
PRICE_HTML += `
|
||||
<div>
|
||||
<div class="show_price_header">
|
||||
<p>${i.day}${i.unit}</p>
|
||||
<p class="clearDay" data-day="${i.day}">
|
||||
<i></i>
|
||||
</p>
|
||||
</div>
|
||||
<div class="countrys_cont">`;
|
||||
i.items.forEach((item) => {
|
||||
PRICE_HTML += `
|
||||
<div class="detaile_country" data-price="${item.price}" data-code="${item.code}" data-day="${i.day}" data-count="${item.count}">
|
||||
<img src="${item.imgUrl}" alt="" />
|
||||
<p class="code">${item.code}</p>
|
||||
<p class="unit">$${item.price}/IP</p>
|
||||
<div>
|
||||
<p class="reduce">-</p>
|
||||
<input type="text" value="${item.count}" class="inputCount" oninput="validateInput(this)">
|
||||
<p class="add">+</p>
|
||||
</div>
|
||||
</div>`;
|
||||
});
|
||||
|
||||
PRICE_HTML += `
|
||||
</div>
|
||||
</div>`;
|
||||
});
|
||||
}else{
|
||||
PRICE_HTML+=`
|
||||
<div class="no-message">
|
||||
<img src="/static/common/price/img/noData.png" alt="">
|
||||
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
$(".show_price").html(PRICE_HTML);
|
||||
};
|
||||
|
||||
// input
|
||||
window.validateInput = function(input) {
|
||||
const $input = $(input);
|
||||
let v = $input.val();
|
||||
if (v.startsWith('-')) {
|
||||
v = v.replace(/-/g, '');
|
||||
$input.val(v);
|
||||
}
|
||||
v = v === '' ? 0 : parseInt(v);
|
||||
$input.val(v > 9999 ? 9999 : v);
|
||||
|
||||
const quantity = parseInt($input.val());
|
||||
const $parentDiv = $input.parents('.detaile_country');
|
||||
const { day, code } = $parentDiv.data();
|
||||
const dayEntry = result.find(entry => entry.day === day);
|
||||
|
||||
if (dayEntry) {
|
||||
const itemEntry = dayEntry.items.find(item => item.code === code);
|
||||
if (itemEntry) {
|
||||
itemEntry.count = quantity;
|
||||
}
|
||||
}
|
||||
|
||||
updateTotalPrice();
|
||||
};
|
||||
|
||||
|
||||
// updata total price
|
||||
const updateTotalPrice = () => {
|
||||
const total = $showPriceDiv.find('div[data-price]').get().reduce((sum, div) => {
|
||||
const quantity = parseInt($(div).find('input').val());
|
||||
const unitPrice = parseFloat($(div).data('price'));
|
||||
return sum + quantity * unitPrice;
|
||||
}, 0);
|
||||
$totalPriceSpan.text(`${total.toFixed(2)}`);
|
||||
};
|
||||
|
||||
// add reduce event listener to inputCount
|
||||
$showPriceDiv.on('click', '.reduce, .add', function () {
|
||||
const $input = $(this).siblings('input');
|
||||
let quantity = parseInt($input.val());
|
||||
const $parentDiv = $(this).parents('.detaile_country');
|
||||
const isAdd = $(this).hasClass('add');
|
||||
|
||||
if (isAdd) {
|
||||
quantity++;
|
||||
} else if (quantity > 1) {
|
||||
quantity--;
|
||||
} else {
|
||||
const { day, code } = $parentDiv.data();
|
||||
$(`.country_lists[data-day="${day}"]>div[data-code="${code}"]`).removeClass('active');
|
||||
return updateUI();
|
||||
}
|
||||
|
||||
$input.val(quantity);
|
||||
$parentDiv.data('count', quantity);
|
||||
|
||||
// 更新 result 数组里的 count 字段
|
||||
const { day, code } = $parentDiv.data();
|
||||
const dayEntry = result.find(entry => entry.day === day);
|
||||
if (dayEntry) {
|
||||
const itemEntry = dayEntry.items.find(item => item.code === code);
|
||||
if (itemEntry) {
|
||||
itemEntry.count = quantity;
|
||||
}
|
||||
}
|
||||
|
||||
updateTotalPrice();
|
||||
});
|
||||
|
||||
// clear day country
|
||||
$showPriceDiv.on('click', '.clearDay', function () {
|
||||
const day = $(this).data('day');
|
||||
$(`.country_lists[data-day="${day}"] .country_lists_detail`).removeClass('active');
|
||||
result = result.filter(item => item.day!== day);
|
||||
updateUI();
|
||||
});
|
||||
|
||||
updateUI();
|
||||
|
||||
|
||||
couponCuttime();
|
||||
$('.c_close').on('click', function(){
|
||||
$('.coupon-model').hide();
|
||||
})
|
||||
});
|
||||
|
||||
const couponCuttime = async () => {
|
||||
|
||||
const res = await $POST("/v1/coupons");
|
||||
if(res.code!=0)return;
|
||||
const coupons = res.data.coupons;
|
||||
let HTML = ''
|
||||
if(coupons.length > 0){
|
||||
coupons.forEach(coupon => {
|
||||
HTML += `
|
||||
<div>
|
||||
<p>
|
||||
<span>${coupon.value}</span>
|
||||
<span>${coupon.value_tip}</span>
|
||||
</p>
|
||||
<div>
|
||||
<p>${coupon.title}</p>
|
||||
<p>${expiredTxt}: <span>${coupon.expired}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
|
||||
$('.counpin-list').html(HTML)
|
||||
|
||||
|
||||
$('.coupon-pop').show();
|
||||
const countdown = createCountdown(res.data.surplus_time, '.coupon_countdown');
|
||||
countdown.start();
|
||||
|
||||
$('.coupon-pop').on('click', function(e){
|
||||
console.log(444);
|
||||
|
||||
$(".coupon-model").show();
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
function createCountdown(totalSeconds, targetSelector) {
|
||||
const $target = $(targetSelector);
|
||||
let timer;
|
||||
|
||||
const formatTime = (time) => String(time).padStart(2, '0');
|
||||
const update = () => {
|
||||
const h = formatTime(Math.floor(totalSeconds / 3600));
|
||||
const m = formatTime(Math.floor((totalSeconds % 3600) / 60));
|
||||
const s = formatTime(totalSeconds % 60);
|
||||
$target.text(`${h}:${m}:${s}`);
|
||||
};
|
||||
|
||||
const start = () => {
|
||||
update();
|
||||
timer = setInterval(() => {
|
||||
totalSeconds > 0 ? (totalSeconds--, update()) : (clearInterval(timer), $target.hide());
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const stop = () => clearInterval(timer);
|
||||
|
||||
return { start, stop };
|
||||
}
|
||||
|
||||
13
static/js/swiper-bundle.min.js
vendored
Normal file
13
static/js/swiper-bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
271
static/js/unlimit.js
Normal file
271
static/js/unlimit.js
Normal file
@ -0,0 +1,271 @@
|
||||
$(function(){
|
||||
|
||||
|
||||
if(location.href.includes('pricing/unlimit-proxies/')){
|
||||
const partnersDOM = document.querySelector(".partner_list_main");
|
||||
vhInfiniteLoop.init(partnersDOM, true, 0.4);
|
||||
}
|
||||
|
||||
$('.static_buy').click(orderNowFn);
|
||||
|
||||
$('.dropdown_ports>.dropdown-toggle,.dropdown_bandwidth>.dropdown-toggle,.dropdown_area>.dropdown-toggle').on('click', function(){
|
||||
$(this).next('.dropdown-menu').toggle();
|
||||
$(this).toggleClass("active");
|
||||
$(this).parents('.unlimt-detail').siblings().find('.dropdown-toggle').removeClass('active');
|
||||
$(this).parents('.unlimt-detail').siblings().find('.dropdown-menu').hide();
|
||||
|
||||
$(this).parents('.dropdown').siblings('.dropdown').find('.dropdown-toggle').removeClass('active');
|
||||
$(this).parents('.dropdown').siblings('.dropdown').find('.dropdown-menu').hide();
|
||||
})
|
||||
|
||||
$('.dropdown_ports>.dropdown-menu>li').click(portDropdownFn);
|
||||
$('.dropdown_bandwidth>.dropdown-menu>li').click(portBandDropdownFn);
|
||||
$('.dropdown_area>.dropdown-menu>li').click(areaDropdownFn);
|
||||
|
||||
$(document).on('click', '.order_btn_link', orderLinkFn);
|
||||
|
||||
$(document).on('click', function (e) {
|
||||
if (!$(e.target).closest('.dropdown').length) {
|
||||
$('.dropdown>.dropdown-menu').hide();
|
||||
$('.dropdown>.dropdown-toggle').removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
$('.c_close').on('click', function(){
|
||||
$('.coupon-model').hide();
|
||||
})
|
||||
couponCuttime();
|
||||
$('#package_num').focus();
|
||||
checkUserTypeFn();
|
||||
if(localStorage.getItem("userType") && localStorage.getItem("userType") == 0){
|
||||
document.addEventListener('visibilitychange', function () {
|
||||
if (document.visibilityState === 'visible' && localStorage.getItem('session')) {
|
||||
checkUserTypeFn();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.already-pay,.checkpay-close').on('click', function(){
|
||||
$('.checkpay').hide();
|
||||
})
|
||||
|
||||
$('.proxy_tab_btn>p').on('click', function(){
|
||||
const index = $(this).index();
|
||||
$(this).addClass('active').siblings().removeClass('active');
|
||||
$('.ublimit_proxy_container>div').eq(index).show().siblings().hide();
|
||||
$('.unlimit-proxy-list').eq(index).show().siblings('.unlimit-proxy-list').hide();
|
||||
})
|
||||
})
|
||||
const portDropdownFn = (e) => {
|
||||
const PORTDOM = $(e.currentTarget);
|
||||
const costMoney = PORTDOM.data('costmoney');
|
||||
const money = PORTDOM.data('money');
|
||||
const parentDiv = PORTDOM.closest('div[data-sn]');
|
||||
const portCostMoney = parentDiv.find('.port_cost_money');
|
||||
const portMoney = parentDiv.find('.port_money');
|
||||
portCostMoney.text(costMoney);
|
||||
portMoney.text(money);
|
||||
parentDiv.find('.unit_money').text(PORTDOM.data('price'))
|
||||
const dropdown = PORTDOM.closest('.dropdown');
|
||||
const toggleSpan = dropdown.find('.dropdown-toggle span');
|
||||
toggleSpan.text(PORTDOM.text());
|
||||
PORTDOM.parent('.dropdown-menu').hide();
|
||||
dropdown.find('.dropdown-toggle').removeClass('active');
|
||||
parentDiv.data('sn', PORTDOM.data('sn'));
|
||||
}
|
||||
|
||||
const portBandDropdownFn = (e) => {
|
||||
const PORTDOM = $(e.currentTarget);
|
||||
const parentDiv = PORTDOM.closest('div[data-sn]');
|
||||
const dropdown = PORTDOM.closest('.dropdown');
|
||||
const toggleSpan = dropdown.find('.dropdown-toggle span');
|
||||
toggleSpan.text(PORTDOM.text());
|
||||
PORTDOM.parent('.dropdown-menu').hide();
|
||||
dropdown.find('.dropdown-toggle').removeClass('active');
|
||||
parentDiv.data('day', PORTDOM.data('value'));
|
||||
queryBaindWidthInfo(parentDiv.data('regions'), PORTDOM.data('value'),parentDiv.data('name'),PORTDOM);
|
||||
}
|
||||
|
||||
const areaDropdownFn = (e) => {
|
||||
const PORTDOM = $(e.currentTarget);
|
||||
const parentDiv = PORTDOM.closest('div[data-sn]');
|
||||
const dropdown = PORTDOM.closest('.dropdown');
|
||||
const toggleSpan = dropdown.find('.dropdown-toggle span');
|
||||
toggleSpan.text(PORTDOM.text());
|
||||
PORTDOM.parent('.dropdown-menu').hide();
|
||||
dropdown.find('.dropdown-toggle').removeClass('active');
|
||||
parentDiv.data('regions', PORTDOM.data('value'));
|
||||
queryBaindWidthInfo(PORTDOM.data('value'), parentDiv.data('day'),parentDiv.data('name'),PORTDOM);
|
||||
}
|
||||
|
||||
const queryBaindWidthInfo = async(region,hours,value,PORTDOM) => {
|
||||
const res = await $POST("/v1/orderPriceSwitch",{region, value, hour: hours});
|
||||
if(res.code!=0) return messageFn(res.msg);
|
||||
const parentDiv = PORTDOM.closest('div[data-sn]');
|
||||
parentDiv.find('.unit_money').text(res.data.price);
|
||||
parentDiv.find('.port_cost_money').text(res.data.cost_money);
|
||||
parentDiv.find('.port_money').text(res.data.money);
|
||||
parentDiv.find('.ubind_hour').text(res.data.unit);
|
||||
|
||||
parentDiv.data('sn', res.data.sn);
|
||||
|
||||
}
|
||||
|
||||
|
||||
let submitFlag1 = false;
|
||||
let countdown_check = 300;
|
||||
let check_time = null;
|
||||
const checkUserTypeFn = async () => {
|
||||
const res = await $POST("/v1/memberSimple");
|
||||
if(res.code!=0)return;
|
||||
localStorage.setItem("userType", res.data.repay);
|
||||
if(res.data.repay != 0){
|
||||
$('.neworder').fadeOut();
|
||||
}
|
||||
}
|
||||
const session = localStorage.getItem("session");
|
||||
const user = localStorage.getItem("user");
|
||||
let lang = $('#language').val();
|
||||
const orderLinkFn = async (e) => {
|
||||
const DOM = $(e.currentTarget);
|
||||
const sn = DOM.closest('div[data-sn]').data('sn');
|
||||
countdown_check = 30;
|
||||
var currentUrl = window.location.href;
|
||||
var match = currentUrl.match(/\.com(.*)/);
|
||||
|
||||
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
let url = "/sign-up/" ;
|
||||
if (lang == "zh"){
|
||||
url = `/${lang}/sign-up/`
|
||||
}
|
||||
let r = "";
|
||||
if (match && match.length > 1) {
|
||||
var contentAfterCom = match[1];
|
||||
r = contentAfterCom;
|
||||
}
|
||||
window.location.href = url +"?r=" + r
|
||||
} else {
|
||||
|
||||
|
||||
if(submitFlag1) return;
|
||||
submitFlag1 = true;
|
||||
const res = await $POST("/v1/orderUnlimit ", { sn, lang });
|
||||
submitFlag1 = false;
|
||||
if(res.code!=0)return messageFn(res.msg);
|
||||
settime();
|
||||
check_time = setInterval(function () {
|
||||
checkpay()
|
||||
}, 3000);
|
||||
window.open(res.data.url);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const checkpay = async () => {
|
||||
const res = await $POST("/v1/paymentCheck", { session, lang });
|
||||
if(res.code!=0)return;
|
||||
if(res.data.show == 1){
|
||||
$(".checkpay").show();
|
||||
clearInterval(check_time);
|
||||
}
|
||||
}
|
||||
|
||||
function settime() {
|
||||
clearInterval(check_time);
|
||||
check_time = setInterval(function () {
|
||||
if (countdown_check == 0) {
|
||||
clearInterval(check_time);
|
||||
} else {
|
||||
countdown_check--;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
const orderNowFn = async (e) => {
|
||||
var currentUrl = window.location.href;
|
||||
var match = currentUrl.match(/\.com(.*)/);
|
||||
|
||||
if (!session || !user || user == undefined || user == "undefined") {
|
||||
let url = "/sign-up/" ;
|
||||
if (lang == "zh"){
|
||||
url = `/${lang}/sign-up/`
|
||||
}
|
||||
let r = "";
|
||||
if (match && match.length > 1) {
|
||||
var contentAfterCom = match[1];
|
||||
r = contentAfterCom;
|
||||
}
|
||||
|
||||
window.location.href = url +"?r=" + r
|
||||
} else {
|
||||
window.open(requestApi+`/recharge/${lang}/${session}/${total}`) ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const couponCuttime = async () => {
|
||||
const res = await $POST("/v1/coupons");
|
||||
if(res.code!=0)return;
|
||||
const coupons = res.data.coupons;
|
||||
let HTML = ''
|
||||
if(coupons.length > 0){
|
||||
coupons.forEach(coupon => {
|
||||
HTML += `
|
||||
<div>
|
||||
<p>
|
||||
<span>${coupon.value}</span>
|
||||
<span>${coupon.value_tip}</span>
|
||||
</p>
|
||||
<div>
|
||||
<p>${coupon.title}</p>
|
||||
<p>${expiredTxt}: <span>${coupon.expired}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
|
||||
$('.counpin-list').html(HTML)
|
||||
|
||||
|
||||
$('.coupon-pop').show();
|
||||
const countdown = createCountdown(res.data.surplus_time, '.coupon_countdown');
|
||||
countdown.start();
|
||||
|
||||
$('.coupon-pop').on('click', function(e){
|
||||
$(".coupon-model").show();
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
function createCountdown(totalSeconds, targetSelector) {
|
||||
const $target = $(targetSelector);
|
||||
let timer;
|
||||
|
||||
const formatTime = (time) => String(time).padStart(2, '0');
|
||||
const update = () => {
|
||||
const h = formatTime(Math.floor(totalSeconds / 3600));
|
||||
const m = formatTime(Math.floor((totalSeconds % 3600) / 60));
|
||||
const s = formatTime(totalSeconds % 60);
|
||||
$target.text(`${h}:${m}:${s}`);
|
||||
};
|
||||
|
||||
const start = () => {
|
||||
update();
|
||||
timer = setInterval(() => {
|
||||
totalSeconds > 0 ? (totalSeconds--, update()) : (clearInterval(timer), $target.hide());
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const stop = () => clearInterval(timer);
|
||||
|
||||
return { start, stop };
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// couponCuttime();
|
||||
13
static/js/vue@3.js
Normal file
13
static/js/vue@3.js
Normal file
File diff suppressed because one or more lines are too long
8
static/js/vuesax.js
Normal file
8
static/js/vuesax.js
Normal file
File diff suppressed because one or more lines are too long
2
static/js/webpack-55df4fabf4b22b05.js
Normal file
2
static/js/webpack-55df4fabf4b22b05.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user