|
|
@ -1,10 +1,10 @@
|
|
|
|
window.onbeforeunload = function(e) {
|
|
|
|
window.onbeforeunload = function (e) {
|
|
|
|
return '页面已过期|Page Expired';
|
|
|
|
return '页面已过期|Page Expired';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$(function () {
|
|
|
|
$(function () {
|
|
|
|
var ctrl = {doubled: false, accessed: false};
|
|
|
|
var ctrl = {doubled: false, accessed: false};
|
|
|
|
$('.coin').click(function () {
|
|
|
|
$('.coin').click(function () {
|
|
|
|
if(ctrl.accessed && !ctrl.doubled){
|
|
|
|
if (ctrl.accessed && !ctrl.doubled) {
|
|
|
|
var coin = $(this);
|
|
|
|
var coin = $(this);
|
|
|
|
coin.addClass('throwing');
|
|
|
|
coin.addClass('throwing');
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
@ -15,20 +15,21 @@ $(function () {
|
|
|
|
$('.encourage-dialog .money-amount').html(encourage.actural_amount);
|
|
|
|
$('.encourage-dialog .money-amount').html(encourage.actural_amount);
|
|
|
|
$('.encourage-dialog .double-rate').html('X ' + encourage.factor);
|
|
|
|
$('.encourage-dialog .double-rate').html('X ' + encourage.factor);
|
|
|
|
$('.encourage-dialog .double-text').hide();
|
|
|
|
$('.encourage-dialog .double-text').hide();
|
|
|
|
setTimeout(function(){
|
|
|
|
setTimeout(function () {
|
|
|
|
coin.removeClass('throwing');
|
|
|
|
coin.removeClass('throwing');
|
|
|
|
},1000);
|
|
|
|
}, 1000);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
error: function () {
|
|
|
|
error: function () {
|
|
|
|
setTimeout(function(){
|
|
|
|
setTimeout(function () {
|
|
|
|
coin.removeClass('throwing');
|
|
|
|
coin.removeClass('throwing');
|
|
|
|
},1000);
|
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
ctrl.doubled = true;
|
|
|
|
ctrl.doubled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function loadEncourage() {
|
|
|
|
function loadEncourage() {
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
url: '/act/encourage_money/orders/' + window.order_id,
|
|
|
|
url: '/act/encourage_money/orders/' + window.order_id,
|
|
|
@ -39,28 +40,32 @@ $(function () {
|
|
|
|
$('.encourage-dialog .money-amount').html(encourage.actural_amount);
|
|
|
|
$('.encourage-dialog .money-amount').html(encourage.actural_amount);
|
|
|
|
$('.encourage-dialog .double-rate').html('X ' + encourage.factor);
|
|
|
|
$('.encourage-dialog .double-rate').html('X ' + encourage.factor);
|
|
|
|
$('.encourage-dialog').removeClass('hide');
|
|
|
|
$('.encourage-dialog').removeClass('hide');
|
|
|
|
ctrl.accessed=true;
|
|
|
|
ctrl.accessed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
loadEncourage();
|
|
|
|
loadEncourage();
|
|
|
|
|
|
|
|
|
|
|
|
function loadPoints() {
|
|
|
|
function loadPoints() {
|
|
|
|
$.ajax({
|
|
|
|
if ([0, 1, 2, 11].indexOf(window.order_gateway) >= 0) {
|
|
|
|
url: '/customers/points/' + window.order_id +'/check',
|
|
|
|
$.ajax({
|
|
|
|
method: 'GET',
|
|
|
|
url: '/customers/points/' + window.order_id + '/check',
|
|
|
|
dataType: 'text',
|
|
|
|
method: 'GET',
|
|
|
|
success: function (data) {
|
|
|
|
dataType: 'text',
|
|
|
|
if (data>0){
|
|
|
|
success: function (data) {
|
|
|
|
$('.points-dialog .points-value').html('+ ' + data);
|
|
|
|
if (data > 0) {
|
|
|
|
$('.points-dialog').removeClass('hide');
|
|
|
|
$('.points-dialog .points-value').html('+ ' + data);
|
|
|
|
}
|
|
|
|
$('.points-dialog').removeClass('hide');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},error:function () {
|
|
|
|
}, error: function () {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
loadPoints();
|
|
|
|
loadPoints();
|
|
|
|
|
|
|
|
|
|
|
|
$('.encourage-dialog .close-circle').click(function () {
|
|
|
|
$('.encourage-dialog .close-circle').click(function () {
|
|
|
|