Commit 578eeebe authored by 华国豪's avatar 华国豪 🙄
parents 162a87ab 824209d6
......@@ -365,6 +365,11 @@
let activityStartDate = new Date(res.data.activityStartDate.replace('T', ' ').replace(/-/g, '/')).getTime(); //活动开始时间
let activityEndDate = new Date(res.data.activityEndDate.replace('T', ' ').replace(/-/g, '/')).getTime(); //活动结束时间
let nowDate = new Date(res.data.currentTime.replace('T', ' ').replace(/-/g, '/')).getTime(); //服务器时间
let nextActivity = res.data.nextActivity;
let nextAc = false;
if(nextActivity != null){
nextAc = true
}
$('.dataStatistics').dataStatistics({
max: num,
......@@ -378,6 +383,7 @@
count: res.data.count, //判断是否可以抢购 0为不可以
activityStartDate: activityStartDate,
activityEndDate: activityEndDate,
nextAc:nextAc
}); //刚进入页面不执行动画
......@@ -385,7 +391,6 @@
// let activityStartDate = new Date('2019/11/08 17:43:50').getTime();
// let activityEndDate = new Date('2019/11/14 11:23:00').getTime(); //活动结束时间
let nextActivity = res.data.nextActivity;
if (nextActivity != null) {
let nexttime = nextActivity.activityStartDate;
......@@ -728,6 +733,11 @@
let activityStartDate = new Date(res.data.activityStartDate.replace('T', ' ').replace(/-/g, '/')).getTime(); //活动开始时间
let activityEndDate = new Date(res.data.activityEndDate.replace('T', ' ').replace(/-/g, '/')).getTime(); //活动结束时间
let nowDate = new Date(res.data.currentTime.replace('T', ' ').replace(/-/g, '/')).getTime(); //服务器时间
let nextActivity = res.data.nextActivity;
let nextAc = false;
if(nextActivity != null){
nextAc = true
}
$('.dataStatistics').dataStatistics({
max: num,
......@@ -741,6 +751,7 @@
count: res.data.count, //判断是否可以抢购 0为不可以
activityStartDate: activityStartDate,
activityEndDate: activityEndDate,
nextAc:nextAc
}); //刚进入页面不执行动画
......@@ -748,7 +759,6 @@
// let activityStartDate = new Date('2019/11/08 17:43:50').getTime();
// let activityEndDate = new Date('2019/11/14 11:23:00').getTime(); //活动结束时间
let nextActivity = res.data.nextActivity;
if (nextActivity != null) {
let nexttime = nextActivity.activityStartDate;
......
......@@ -11,7 +11,8 @@ $.fn.dataStatistics = function(options) {
login: true,
activityStartDate: 0,
activityEndDate: 0,
nowDate: 0
nowDate: 0,
nextAc:false,
}, options || {});
var ths = this; //解决this指向问题
......@@ -63,7 +64,7 @@ $.fn.dataStatistics = function(options) {
var difference = 0; //执行次数
var nownumber = options.min; //优惠券数量
var Activityendtime = ''; //活动结束时间
let nodisplay = false;
function run(diff) {
if (diff) {
......@@ -84,7 +85,7 @@ $.fn.dataStatistics = function(options) {
$('.img_btn p').html('活动结束')
$('.box_content_t').hide()
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
if (nodisplay == true) { //显示活动预告
if (options.nextAc == true) { //显示活动预告
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
......@@ -173,6 +174,7 @@ $.fn.dataStatistics = function(options) {
count: options.count, //判断是否可以抢购 0为不可以
activityStartDate: options.activityStartDate,
activityEndDate: options.activityEndDate,
nextAc: options.nextAc,
}); //刚进入页面不执行动画
} else {
......@@ -193,12 +195,10 @@ $.fn.dataStatistics = function(options) {
count: options.count, //判断是否可以抢购 0为不可以
activityStartDate: options.activityStartDate,
activityEndDate: options.activityEndDate,
nextAc: options.nextAc,
}); //刚进入页面不执行动画
}
if (nownumber == 0) {
Activityendtime = res.data.expirationDate.replace('T', ' ').replace(/-/g, '/');
}
// options.count = res.data.count;
let activityStartDate = options.activityStartDate;
let activityEndDate = options.activityEndDate;
......@@ -219,10 +219,12 @@ $.fn.dataStatistics = function(options) {
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
$('.img_btn p').html('活动结束')
$('.box_content_t').hide()
if (options.nextAc == true) { //显示活动预告
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
}
clearInterval(timer2); //活动结束 清楚定时器
} else {
if (nownumber > 0) {
......@@ -244,11 +246,13 @@ $.fn.dataStatistics = function(options) {
$('.img_btn p').html('活动结束')
$('.box_content_t').hide()
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
if (options.nextAc == true) { //显示活动预告
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment