Commit eceb4f05 authored by Mac's avatar Mac

修改丢失的代码

parent 7b532a90
......@@ -7,7 +7,7 @@ $.fn.dataStatistics = function(options){
len:4, //数字是几位数
price:0, //金额
couponId:0, //订单id
platform:'App',
platform:'app',
count:0,
},options || {});
......@@ -168,10 +168,8 @@ $.fn.dataStatistics = function(options){
$('.img_bg_M').css("background-image","url(../images/MJ_200@3x.png)");
$('.img_bg_p1').css("color","#CCCCCC");
$('.img_bg_p2').css("color","#CCCCCC");
$('.img_btn p').css("color","#FFFFFF");
$('.img_btn').css("background-color", "#CCCCCC");
$('.img_btn p').html('活动结束')
$('.box_content_t').hide()
clearInterval(timer2); //活动结束 清楚定时器
......@@ -220,7 +218,7 @@ $.fn.dataStatistics = function(options){
if($('.img_btn p').css('color')=='rgb(224, 50, 52)'){ //判断按钮是否可以点击
if( options.count !=0){ //判断是可以抢购
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showHud', 'message' : '抢购中...'}));
}
$.ajax({
......@@ -230,21 +228,17 @@ $.fn.dataStatistics = function(options){
data: getJavaData({redemptionPrice:options.price,couponId:options.couponId}),
async: false,
success: function (res) {
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'dismissHud'}));
}
if (res.resultCode === 1) {
if(options.platform == 'App'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : res.message}));
}else {
layer.msg(res.message)
}
var timer3 = setInterval(()=>{ //1,需要timer2的定时器走完了 才走timer3的定时器
nownumber = nownumber -1;
run(1)
clearInterval(timer3) //2,执行动画之后清除timer3
},difference*1000)
// var timer3 = setInterval(()=>{ //1,需要timer2的定时器走完了 才走timer3的定时器
//
// nownumber = nownumber -1;
// run(1)
// clearInterval(timer3) //2,执行动画之后清除timer3
// },difference*1000)
let title ='200元' + $('.img_bg_p1').html();
let data = {
......@@ -255,11 +249,11 @@ $.fn.dataStatistics = function(options){
'couponId' : res.data.couponId,
'title':title,
'price':res.data.preferPrice,
'backKey':'reload',
'backType':'reload',
'data':res.data
}
}
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify(data));
}
// 跳转到支付
......@@ -292,7 +286,7 @@ $.fn.dataStatistics = function(options){
}else {
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : res.message}));
}else {
layer.msg(res.message)
......@@ -303,7 +297,7 @@ $.fn.dataStatistics = function(options){
},
error: function (res) {
console.log(options.platform)
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'dismissHud'}));
}else {
......@@ -313,18 +307,27 @@ $.fn.dataStatistics = function(options){
}
});
}else {
layer.msg('去使用优惠券')
let data = {
'action' : 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'page' : 'teamWalker_2',
'pageData' : {
'backType':'pop',
}
}
if(options.platform == 'app'){
window.postMessage(JSON.stringify(data));
}
}
}else {
if($('.img_btn p').text() == '活动结束'){
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : '活动已结束'}));
}else {
layer.msg('活动已结束')
}
}else {
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : '活动还未开始'}));
}else {
......
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