You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
79
hyhproject/mobile2/view/default/js/index-lxy.js
Executable file
79
hyhproject/mobile2/view/default/js/index-lxy.js
Executable file
@ -0,0 +1,79 @@
|
||||
//秒杀
|
||||
var swiper = new Swiper('.swiper-container', {
|
||||
pagination: '.swiper-pagination',
|
||||
slidesPerView: 4,
|
||||
paginationClickable: true,
|
||||
spaceBetween: 6,
|
||||
freeMode: true
|
||||
});
|
||||
|
||||
//banner1
|
||||
var swiper = new Swiper('.banner .swiper-container', {
|
||||
pagination: '.banner .swiper-container .swiper-pagination',
|
||||
slidesPerView: 1,
|
||||
centeredSlides: true,
|
||||
paginationClickable: true,
|
||||
spaceBetween: 6,
|
||||
grabCursor: true
|
||||
});
|
||||
//banner2
|
||||
var swiper = new Swiper('.banner1 .swiper-container', {
|
||||
pagination: '.banner1 .swiper-container .swiper-pagination',
|
||||
slidesPerView: 1,
|
||||
centeredSlides: true,
|
||||
paginationClickable: true,
|
||||
spaceBetween: 6,
|
||||
grabCursor: true
|
||||
});
|
||||
|
||||
//$('.ac_r-lxy .ac_right_img1').on('click',function(){
|
||||
// window.location.href = "heyuanhui.cn/mgoods-23.html"
|
||||
//})
|
||||
|
||||
$('.ac_r-lxy .ac_right_img2').on('click', function() {
|
||||
window.location.href = "heyuanhui.cn/mgoods-20.html"
|
||||
})
|
||||
|
||||
/**
|
||||
* 秒杀模块倒计时
|
||||
* */
|
||||
function GetRTime(end_time) {
|
||||
var NowTime = new Date();
|
||||
var t = (end_time * 1000) - NowTime.getTime();
|
||||
var d = Math.floor(t / 1000 / 60 / 60 / 24);
|
||||
var h = Math.floor(t / 1000 / 60 / 60 % 24);
|
||||
var m = Math.floor(t / 1000 / 60 % 60);
|
||||
var s = Math.floor(t / 1000 % 60);
|
||||
if(s >= 0)
|
||||
return(d * 24 + h) + '时' + m + '分' + s + '秒';
|
||||
}
|
||||
|
||||
function GetRTime2() {
|
||||
var myDate = new Date();
|
||||
var timestamp = Date.parse(myDate);
|
||||
var hour = myDate.getHours(); //获取当前小时数(0-23)
|
||||
//alert(hour);
|
||||
if(timestamp >= (1509105600 * 1000) || hour < 8) {
|
||||
//alert(timestamp);
|
||||
//alert(1509105600);
|
||||
if(hour < 8) {
|
||||
start_time = 1509062400;
|
||||
} else {
|
||||
start_time = 1509148800;
|
||||
}
|
||||
var text = GetRTime(start_time); // alert(1509105600);
|
||||
if(text == 0) {
|
||||
$(".h").text('活动已结束');
|
||||
} else {
|
||||
$(".h").text('距开始' + text);
|
||||
}
|
||||
} else {
|
||||
var text = GetRTime('1509105600'); // alert(1509105600);
|
||||
if(text == 0) {
|
||||
$(".h").text('活动已结束');
|
||||
} else {
|
||||
$(".h").text('距结束' + text);
|
||||
}
|
||||
}
|
||||
}
|
||||
setInterval(GetRTime2, 1000);
|
Reference in New Issue
Block a user