Commit 4c5ce7f6 authored by 华国豪's avatar 华国豪 🙄
parents 6c1d7b7c 328d0756
......@@ -8,10 +8,10 @@ $.fn.dataStatistics = function(options) {
couponId: 0, //订单id
platform: 'app',
count: 0,
login:true,
activityStartDate:0,
activityEndDate:0,
nowDate:0
login: true,
activityStartDate: 0,
activityEndDate: 0,
nowDate: 0
}, options || {});
var ths = this; //解决this指向问题
......@@ -63,7 +63,8 @@ $.fn.dataStatistics = function(options) {
var difference = 0; //执行次数
var nownumber = options.min; //优惠券数量
var Activityendtime = ''; //活动结束时间
let nodisplay = false;
let nodisplay = false;
function run(diff) {
if (diff) {
difference = diff
......@@ -83,7 +84,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 (nodisplay == true) { //显示活动预告
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
......@@ -147,7 +148,7 @@ $.fn.dataStatistics = function(options) {
type: "POST",
url: `${getApiUrl().urlJava}api/appActivity/getCurrentActivity`,
contentType: "application/json",
data: getJavaData({couponId:options.couponId}),
data: getJavaData({ couponId: options.couponId }),
async: false,
success: function(res) {
if (res.resultCode === 1) {
......@@ -157,7 +158,7 @@ $.fn.dataStatistics = function(options) {
nownumber = res.data.repertory; // 算出现在的数字
if (num > 0) {
if(num> 5){
if (num > 5) {
$('.digit_set').empty()
clearInterval(timer2);
$('.dataStatistics').dataStatistics({
......@@ -168,16 +169,16 @@ $.fn.dataStatistics = function(options) {
price: options.price,
couponId: options.couponId,
platform: options.platform,
login:options.login,
login: options.login,
count: options.count, //判断是否可以抢购 0为不可以
activityStartDate:options.activityStartDate,
activityEndDate:options.activityEndDate,
activityStartDate: options.activityStartDate,
activityEndDate: options.activityEndDate,
}); //刚进入页面不执行动画
}else {
} else {
run(num)
}
}else if(num< 0){
} else if (num < 0) {
$('.digit_set').empty()
clearInterval(timer2);
$('.dataStatistics').dataStatistics({
......@@ -188,10 +189,10 @@ $.fn.dataStatistics = function(options) {
price: options.price,
couponId: options.couponId,
platform: options.platform,
login:options.login,
login: options.login,
count: options.count, //判断是否可以抢购 0为不可以
activityStartDate:options.activityStartDate,
activityEndDate:options.activityEndDate,
activityStartDate: options.activityStartDate,
activityEndDate: options.activityEndDate,
}); //刚进入页面不执行动画
}
......@@ -269,19 +270,17 @@ $.fn.dataStatistics = function(options) {
$('.img_btn').click(function() {
if ($('.img_btn p').css('color') == 'rgb(224, 50, 52)') { //判断按钮是否可以点击
if(options.login == true){
if ($('.img_btn p').css('color') == 'rgb(224, 50, 52)') { //判断按钮是否可以点击
if (options.login == true) {
if (options.count != 0) { //判断是可以抢购
let buyInfo = {
redemptionPrice: options.price,
couponId: options.couponId,
platform:options.platform,
}
localStorage.buyInfo = JSON.stringify(buyInfo)
window.location.href = 'https://activity.oytour.com/html/Rushbuy.html';
// window.location.href = './Rushbuy.html' ;
// let buyInfo = {
// redemptionPrice: options.price,
// couponId: options.couponId,
// platform: options.platform,
// }
// localStorage.buyInfo = JSON.stringify(buyInfo)
window.location.href = `https://activity.oytour.com/html/Rushbuy.html?redemptionPrice=${options.price}&couponId=${options.couponId}&platform=${options.platform}`;
} else {
let data = {
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
......@@ -292,12 +291,12 @@ $.fn.dataStatistics = function(options) {
}
if (options.platform == 'app') {
window.postMessage(JSON.stringify(data));
}else if(options.platform == 'H5'){
} else if (options.platform == 'H5') {
window.location.href = 'https://activity.oytour.com/html/downloadApp.html'
}
}
}else {
} else {
window.location.href = 'https://activity.oytour.com/html/login.html'
}
} else {
......@@ -318,4 +317,4 @@ $.fn.dataStatistics = function(options) {
}
})
};
};
\ No newline at end of file
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