修复bug
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
let urlPrefix = getUrlPrefix()
|
||||
let browser = checkVersion()
|
||||
// 封装layer消息提醒框
|
||||
let env = EnvCheck();
|
||||
if (env == 'test') {
|
||||
new VConsole();
|
||||
}
|
||||
// 封裝layer消息提醒框
|
||||
let layerIndex
|
||||
const showLoading = (content = '加载中...') => {
|
||||
const showLoading = (content = '加載中...') => {
|
||||
layer.open({
|
||||
type: 2,
|
||||
shadeClose: false,
|
||||
@@ -27,23 +31,23 @@ var and;
|
||||
var url;
|
||||
var androidSkipType;
|
||||
var iosSkipType;
|
||||
// 初始化函数
|
||||
// 初始化函數
|
||||
$(function () {
|
||||
getInfoFromClient();
|
||||
getConfig();
|
||||
})
|
||||
// 获取配置接口
|
||||
// 獲取配置接口
|
||||
function getConfig () {
|
||||
showLoading();
|
||||
networkRequest({
|
||||
type: 'GET',
|
||||
url: urlPrefix + '/official/config',
|
||||
success (res) {
|
||||
// 处理联系方式
|
||||
// 處理聯繫方式
|
||||
$(`.contactUs_pub .contactUs_pub_in ul .li1 span`).html(`<b>Wehchat:</b> ${res.data.contact0}`);
|
||||
$(`.contactUs_pub .contactUs_pub_in ul .li2 span`).html(`<b>Line:</b> ${res.data.contact1}`);
|
||||
$(`.contactUs_pub .contactUs_pub_in ul .li3 span`).html(`<b>Email:</b> ${res.data.contact2}`);
|
||||
// 赋值下载
|
||||
// 賦值下載
|
||||
and = res.data.androidUrl;
|
||||
ios = res.data.iosUrl;
|
||||
androidSkipType = res.data.androidSkipType;
|
||||
@@ -51,13 +55,12 @@ function getConfig () {
|
||||
console.log(browser);
|
||||
if (browser.ios) {
|
||||
url = ios;
|
||||
$('body .h5 .pagesBox .pages .downioad').attr('src', './images/h5Ios.png');
|
||||
} else if (browser.android) {
|
||||
url = and;
|
||||
$('body .h5 .pagesBox .pages .downioad').attr('src', './images/h5And.png');
|
||||
}
|
||||
console.log(and, ios);
|
||||
// if (androidSkipType == 0) {
|
||||
// }
|
||||
|
||||
|
||||
hideLoading(layerIndex)
|
||||
animatedImplementFun(0);
|
||||
},
|
||||
@@ -66,7 +69,21 @@ function getConfig () {
|
||||
}
|
||||
})
|
||||
}
|
||||
// 监听滑动事件
|
||||
// 点击记录接口
|
||||
function officialClick (downloadType) {
|
||||
showLoading();
|
||||
networkRequest({
|
||||
type: 'GET',
|
||||
url: urlPrefix + '/official/click',
|
||||
data: { downloadType, },
|
||||
success (res) {
|
||||
},
|
||||
error (err) {
|
||||
hideLoading(layerIndex)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 監聽滑動事件
|
||||
let startY
|
||||
var length = $('.h5 .pages').length - 1;//
|
||||
var index = 0;
|
||||
@@ -83,7 +100,6 @@ $('body .h5').on('touchend', function (e) {
|
||||
} else {
|
||||
index = index + 1;
|
||||
$('.pagesBox').css("transform", `translateY(-${index * touchLength}%)`);
|
||||
console.log('上滑');
|
||||
animatedImplementFun(index);
|
||||
}
|
||||
}
|
||||
@@ -92,17 +108,15 @@ $('body .h5').on('touchend', function (e) {
|
||||
if (index > 0) {
|
||||
index = index - 1;
|
||||
$('.pagesBox').css("transform", `translateY(-${index * touchLength}%)`);
|
||||
console.log('下滑');
|
||||
animatedImplementFun(index);
|
||||
}
|
||||
}
|
||||
})
|
||||
// 动画调用
|
||||
// 動畫調用
|
||||
function animatedImplementFun (index) {
|
||||
if (index == 0) {
|
||||
animatedFun($(`body .h5 .pagesBox .page1 .pageTxte1`), ['animate__zoomInUp',]);
|
||||
animatedFun($(`body .h5 .pagesBox .page1 .h5Ios`), ['animate__fadeInLeft',]);
|
||||
animatedFun($(`body .h5 .pagesBox .page1 .h5And`), ['animate__fadeInRight',]);
|
||||
animatedFun($(`body .h5 .pagesBox .page1 .downioad`), ['animate__wobble',]);
|
||||
} else if (index == 1) {
|
||||
animatedFun($(`body .h5 .pagesBox .page2 .pageText2`), ['animate__bounce',]);
|
||||
animatedFun($(`body .h5 .pagesBox .page2 .pagetx1`), ['animate__heartBeat',]);
|
||||
@@ -127,47 +141,58 @@ function animatedImplementFun (index) {
|
||||
animatedFun($(`body .h5 .pagesBox .page5 .downioad `), ['animate__slideInUp',]);
|
||||
}
|
||||
}
|
||||
// 处理动画
|
||||
// 處理動畫
|
||||
function animatedFun (dom, arrClass) {
|
||||
// 获取元素
|
||||
// 獲取元素
|
||||
const element = dom;
|
||||
// 添加动画
|
||||
// 添加動畫
|
||||
element.addClass(...arrClass);
|
||||
// 监听动画结束
|
||||
// 監聽動畫結束
|
||||
element[0].addEventListener('animationend', () => {
|
||||
element.removeClass(...arrClass);
|
||||
});
|
||||
}
|
||||
// pc跳转充值
|
||||
// pc跳轉充值
|
||||
$('body .pc .header .diamound, html .pc .header .diamound').click(function () {
|
||||
window.location.href = 'https://api.pekolive.com/peko/modules/pay/index.html?channelType=4'
|
||||
})
|
||||
// PC苹果下载按钮
|
||||
$('body .pc .pcIos, html .pc .pcIos').click(function () {
|
||||
window.location.href = ios;
|
||||
// PC蘋果下載按鈕
|
||||
$('html .pc .pcIos').click(function () {
|
||||
if (ios) {
|
||||
officialClick(iosSkipType);
|
||||
window.location.href = ios;
|
||||
} else {
|
||||
toastMsg('暫未開放下載,詳情請聯繫客服')
|
||||
}
|
||||
})
|
||||
// PC安卓下载按钮
|
||||
$('body .pc .pcIos, html .pc .pcAnd').click(function () {
|
||||
window.location.href = and;
|
||||
// PC安卓下載按鈕
|
||||
$('html .pc .pcAnd').click(function () {
|
||||
if (and) {
|
||||
officialClick(androidSkipType);
|
||||
window.location.href = and;
|
||||
} else {
|
||||
toastMsg('暫未開放下載,詳情請聯繫客服')
|
||||
}
|
||||
})
|
||||
// h5跳转充值
|
||||
// h5跳轉充值
|
||||
$('body .header .diamound, html .header .diamound').click(function () {
|
||||
window.location.href = 'https://api.pekolive.com/peko/modules/pay/index.html?channelType=4'
|
||||
})
|
||||
// h5展开菜单
|
||||
// h5展開菜單
|
||||
$('body .header .more, html .header .more').click(function () {
|
||||
$('.menu').css("height", "100%");
|
||||
})
|
||||
// h5收起菜单
|
||||
// h5收起菜單
|
||||
$('body .h5 .menu .top .close, html .h5 .menu .top .close').click(function () {
|
||||
$('.menu').css("height", "0%");
|
||||
})
|
||||
// 菜单选项按钮
|
||||
// 菜單選項按鈕
|
||||
$('body .h5 .menu ul li, html .h5 .menu ul li').click(function () {
|
||||
var i = $(this).index() + 1;
|
||||
if (i == 1) {
|
||||
$('.menu').css("height", "0%");
|
||||
$('.pagesBox').css("transform", `translateY(-${0}%)`);
|
||||
index = 0;
|
||||
} else if (i == 2) {
|
||||
window.location.href = 'https://api.pekolive.com/peko/modules/h5Income/login.html'
|
||||
} else {
|
||||
@@ -175,27 +200,47 @@ $('body .h5 .menu ul li, html .h5 .menu ul li').click(function () {
|
||||
$('.contactUs_pub').show();
|
||||
}
|
||||
})
|
||||
// 关闭联系我们弹窗
|
||||
// 關閉聯繫我們彈窗
|
||||
$('body .contactUs_pub .contactUs_pub_in .sClose').click(function () {
|
||||
$('.contactUs_pub').hide();
|
||||
})
|
||||
// 打开联系我们弹窗
|
||||
// 打開聯繫我們彈窗
|
||||
$('.page5 .contactUs').click(function () {
|
||||
$('.contactUs_pub').show();
|
||||
})
|
||||
// h5首页安卓下载
|
||||
// h5首頁安卓下載
|
||||
$('body .h5 .pagesBox .page1 .h5And').click(function () {
|
||||
window.location.href = and;
|
||||
})
|
||||
// h5首页苹果下载
|
||||
$('body .h5 .pagesBox .page1 .h5Ios').click(function () {
|
||||
window.location.href = ios;
|
||||
})
|
||||
// h5自动识别普通下载
|
||||
$('body .h5 .pagesBox .pages .downioad').click(function () {
|
||||
if (browser.ios) {
|
||||
window.location.href = ios;
|
||||
} else if (browser.android) {
|
||||
if (and) {
|
||||
officialClick(androidSkipType);
|
||||
window.location.href = and;
|
||||
} else {
|
||||
toastMsg('暫未開放下載,詳情請聯繫客服')
|
||||
}
|
||||
})
|
||||
// h5首頁蘋果下載
|
||||
$('body .h5 .pagesBox .page1 .h5Ios').click(function () {
|
||||
if (ios) {
|
||||
officialClick(iosSkipType);
|
||||
window.location.href = ios;
|
||||
} else {
|
||||
toastMsg('暫未開放下載,詳情請聯繫客服')
|
||||
}
|
||||
})
|
||||
// h5自動識別普通下載
|
||||
$('body .h5 .pagesBox .pages .downioad').click(function () {
|
||||
if (url) {
|
||||
if (browser.ios) {
|
||||
officialClick(iosSkipType);
|
||||
} else if (browser.android) {
|
||||
officialClick(androidSkipType);
|
||||
}
|
||||
window.location.href = url;
|
||||
} else {
|
||||
toastMsg('暫未開放下載,詳情請聯繫客服')
|
||||
}
|
||||
})
|
||||
// 禁止瀏覽器下拉刷新
|
||||
|
||||
document.addEventListener('touchmove', event => {
|
||||
event.preventDefault()
|
||||
}, { passive: false })
|
Reference in New Issue
Block a user