Commit 33e49d17 authored by Mac's avatar Mac

1

parent 87d68864
...@@ -397,7 +397,10 @@ ...@@ -397,7 +397,10 @@
//优惠券的有限时间 //优惠券的有限时间
let expirationDate = (res.data.expirationDate).split('T')[0].replace(/-/g, '.'); let expirationDate = (res.data.expirationDate).split('T')[0].replace(/-/g, '.');
RushbuyTime = expirationDate; let RushbuyTime = {
RushbuyTime: expirationDate,
}
localStorage.RushbuyTime = JSON.stringify(RushbuyTime)
$('.img_bg_p2').html('有效期截止:' + expirationDate) $('.img_bg_p2').html('有效期截止:' + expirationDate)
} else { } else {
......
...@@ -63,21 +63,122 @@ ...@@ -63,21 +63,122 @@
<script type="text/javascript" src="../js/layer/layer.js"></script> <script type="text/javascript" src="../js/layer/layer.js"></script>
<script type="text/javascript" src="../js/mian.js"></script> <script type="text/javascript" src="../js/mian.js"></script>
<script> <script>
let RushbuyTime = JSON.parse(localStorage.RushbuyTime)
$( $(
function(){ function(){
$('#RushbuyTime').html(`有效期截止:` + RushbuyTime) $('#RushbuyTime').html(`有效期截止:` + RushbuyTime.RushbuyTime)
setTimeout(function(){ setTimeout(function(){
$('.box').addClass('move') $('.box').addClass('move')
}, 500) }, 500)
} }
) )
let buyIf = {} let buyIf = {}
// if (localStorage.buyInfo) { if (localStorage.buyInfo) {
// buyIf = localStorage.buyInfo buyIf = JSON.parse(localStorage.buyInfo)
// }else { }else {
// window.location.href = 'https://activity.oytour.com/html/GT_activities.html'; window.location.href = 'https://activity.oytour.com/html/GT_activities.html';
// } }
var loadingFlag;
if (options.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'showHud', 'message': '抢购中...'}));
}
if (options.platform == 'H5') {
loadingFlag = layer.msg('抢购中...', {icon: 16, shade: 0.01, shadeClose: false, time: 60000});
}
$.ajax({
type: "POST",
url: `${getApiUrl().urlJava}api/appActivity/PanicBuyingCoupon`,
contentType: "application/json",
data: getJavaData({
redemptionPrice: buyIf.redemptionPrice,
couponId: buyIf.couponId,
productName: '印象之旅-200元线路产品优惠券'
}),
async: false,
success: function (res) {
if (options.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'dismissHud'}));
}
if (options.platform == 'H5') {
layer.close(loadingFlag);
}
if (res.resultCode === 1) {
// var timer3 = setInterval(()=>{ //1,需要timer2的定时器走完了 才走timer3的定时器
//
// nownumber = nownumber -1;
// run(1)
// clearInterval(timer3) //2,执行动画之后清除timer3
// },difference*1000)
let title = '印象之旅-200元线路产品优惠券';
let data = {
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'page': 'payment',
'pageData': {
'couponId': res.data.couponId,
'title': title,
'price': res.data.preferPrice,
'backType': 'reload',
'data': res.data
}
}
if (options.platform == 'app') {
window.postMessage(JSON.stringify(data));
}
// 跳转到支付
else if (options.platform == 'xcx') {
// window.postMessage(JSON.stringify(data));
let data = {};
data.sOrderNo = res.data.id;
data.sProductName = title;
data.productId = res.data.couponId;
data.dTotalPrice = res.data.preferPrice;
wx.miniProgram.getEnv(function (res) {
window.wx.miniProgram.navigateTo({
url: `/pages/Home/pay/pay?data=` + JSON.stringify(data),
});
});
} else if (options.platform == 'H5') {
let userInfo = getLocalStorage()
let data = {};
data.sOrderNo = res.data.id;
data.sProductName = title;
data.productId = res.data.couponId;
data.dTotalPrice = res.data.preferPrice;
data.customerId = userInfo.customerId;
sessionStorage.setItem("payInfo", JSON.stringify(data));
//window.location.href = 'https://127.0.0.1:5500/html/pay.html';
//window.location.href = 'http://192.168.0.117:5500/html/pay.html';
window.location.href = 'https://activity.oytour.com/html/pay.html';
}
} else {
if (options.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'showToast', 'message': res.message}));
} else {
layer.msg(res.message)
}
layer.msg(res.message)
// window.location.reload()
}
},
error: function (res) {
console.log(options.platform)
if (options.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'dismissHud'}));
} else if (options.platform == 'H5') {
layer.close(loadingFlag);
}
}
});
</script> </script>
</body> </body>
......
...@@ -264,105 +264,114 @@ $.fn.dataStatistics = function(options) { ...@@ -264,105 +264,114 @@ $.fn.dataStatistics = function(options) {
if (options.count != 0) { //判断是可以抢购 if (options.count != 0) { //判断是可以抢购
var loadingFlag; let buyInfo = {
if (options.platform == 'app') { redemptionPrice: options.price,
window.postMessage(JSON.stringify({'action': 'showHud', 'message': '抢购中...'})); couponId: options.couponId,
}
if (options.platform == 'H5') {
loadingFlag = layer.msg('抢购中...', {icon: 16, shade: 0.01, shadeClose: false, time: 60000});
}
$.ajax({
type: "POST",
url: `${getApiUrl().urlJava}api/appActivity/PanicBuyingCoupon`,
contentType: "application/json",
data: getJavaData({
redemptionPrice: options.price,
couponId: options.couponId,
productName: '印象之旅-200元线路产品优惠券'
}),
async: false,
success: function (res) {
if (options.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'dismissHud'}));
}
if (options.platform == 'H5') {
layer.close(loadingFlag);
}
if (res.resultCode === 1) {
// var timer3 = setInterval(()=>{ //1,需要timer2的定时器走完了 才走timer3的定时器 }
localStorage.buyInfo = JSON.stringify(buyInfo)
// window.location.href = 'https://activity.oytour.com/html/GT_activities.html';
window.location.href = './Rushbuy.html' ;
// var loadingFlag;
// if (options.platform == 'app') {
// window.postMessage(JSON.stringify({'action': 'showHud', 'message': '抢购中...'}));
// }
// if (options.platform == 'H5') {
// loadingFlag = layer.msg('抢购中...', {icon: 16, shade: 0.01, shadeClose: false, time: 60000});
// }
// $.ajax({
// type: "POST",
// url: `${getApiUrl().urlJava}api/appActivity/PanicBuyingCoupon`,
// contentType: "application/json",
// data: getJavaData({
// redemptionPrice: options.price,
// couponId: options.couponId,
// productName: '印象之旅-200元线路产品优惠券'
// }),
// async: false,
// success: function (res) {
// if (options.platform == 'app') {
// window.postMessage(JSON.stringify({'action': 'dismissHud'}));
// }
// if (options.platform == 'H5') {
// layer.close(loadingFlag);
// }
// if (res.resultCode === 1) {
// //
// nownumber = nownumber -1; // // var timer3 = setInterval(()=>{ //1,需要timer2的定时器走完了 才走timer3的定时器
// run(1) // //
// clearInterval(timer3) //2,执行动画之后清除timer3 // // nownumber = nownumber -1;
// },difference*1000) // // run(1)
// // clearInterval(timer3) //2,执行动画之后清除timer3
let title = '印象之旅-200元线路产品优惠券'; // // },difference*1000)
let data = { //
// let title = '印象之旅-200元线路产品优惠券';
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading // let data = {
'page': 'payment', //
'pageData': { // 'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'couponId': res.data.couponId, // 'page': 'payment',
'title': title, // 'pageData': {
'price': res.data.preferPrice, // 'couponId': res.data.couponId,
'backType': 'reload', // 'title': title,
'data': res.data // 'price': res.data.preferPrice,
} // 'backType': 'reload',
} // 'data': res.data
if (options.platform == 'app') { // }
window.postMessage(JSON.stringify(data)); // }
} // if (options.platform == 'app') {
// 跳转到支付 // window.postMessage(JSON.stringify(data));
else if (options.platform == 'xcx') { // }
// window.postMessage(JSON.stringify(data)); // // 跳转到支付
let data = {}; // else if (options.platform == 'xcx') {
data.sOrderNo = res.data.id; // // window.postMessage(JSON.stringify(data));
data.sProductName = title; // let data = {};
data.productId = res.data.couponId; // data.sOrderNo = res.data.id;
data.dTotalPrice = res.data.preferPrice; // data.sProductName = title;
wx.miniProgram.getEnv(function (res) { // data.productId = res.data.couponId;
window.wx.miniProgram.navigateTo({ // data.dTotalPrice = res.data.preferPrice;
url: `/pages/Home/pay/pay?data=` + JSON.stringify(data), // wx.miniProgram.getEnv(function (res) {
}); // window.wx.miniProgram.navigateTo({
}); // url: `/pages/Home/pay/pay?data=` + JSON.stringify(data),
} else if (options.platform == 'H5') { // });
let userInfo = getLocalStorage() // });
let data = {}; // } else if (options.platform == 'H5') {
data.sOrderNo = res.data.id; // let userInfo = getLocalStorage()
data.sProductName = title; // let data = {};
data.productId = res.data.couponId; // data.sOrderNo = res.data.id;
data.dTotalPrice = res.data.preferPrice; // data.sProductName = title;
data.customerId = userInfo.customerId; // data.productId = res.data.couponId;
// data.dTotalPrice = res.data.preferPrice;
sessionStorage.setItem("payInfo", JSON.stringify(data)); // data.customerId = userInfo.customerId;
//window.location.href = 'https://127.0.0.1:5500/html/pay.html'; //
//window.location.href = 'http://192.168.0.117:5500/html/pay.html'; // sessionStorage.setItem("payInfo", JSON.stringify(data));
window.location.href = 'https://activity.oytour.com/html/pay.html'; // //window.location.href = 'https://127.0.0.1:5500/html/pay.html';
} // //window.location.href = 'http://192.168.0.117:5500/html/pay.html';
// window.location.href = 'https://activity.oytour.com/html/pay.html';
// }
} else { //
if (options.platform == 'app') { //
window.postMessage(JSON.stringify({'action': 'showToast', 'message': res.message})); // } else {
} else { // if (options.platform == 'app') {
layer.msg(res.message) // window.postMessage(JSON.stringify({'action': 'showToast', 'message': res.message}));
} // } else {
layer.msg(res.message) // layer.msg(res.message)
// }
// window.location.reload() // layer.msg(res.message)
//
} // // window.location.reload()
}, //
error: function (res) { // }
console.log(options.platform) // },
if (options.platform == 'app') { // error: function (res) {
window.postMessage(JSON.stringify({'action': 'dismissHud'})); // console.log(options.platform)
} else if (options.platform == 'H5') { // if (options.platform == 'app') {
layer.close(loadingFlag); // window.postMessage(JSON.stringify({'action': 'dismissHud'}));
} // } else if (options.platform == 'H5') {
} // layer.close(loadingFlag);
}); // }
// }
// });
} else { } else {
let data = { let data = {
......
let locationName = window.location.hostname; let locationName = window.location.hostname;
let RushbuyTime = '2019-11-14';
function getApiUrl() { function getApiUrl() {
let url = { let url = {
urlPost: "https://reborn.oytour.com/api/common/post", urlPost: "https://reborn.oytour.com/api/common/post",
......
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