Commit d0eed48a authored by 黄媛媛's avatar 黄媛媛
parents 51aa1170 5a649ba2
html,body{
height:100%;
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
p{
display:block;
-webkit-margin-before:0;
-webkit-margin-after:0;
p {
display: block;
-webkit-margin-before: 0;
-webkit-margin-after: 0;
}
#box{
#box {
width: 100%;
height: 100%;
background-image: url(../images/bg2@3x.png);
......@@ -21,21 +20,24 @@ p{
padding-top: 0.7rem;
position: relative;
}
.wx_bg{
width:100%;
height:100%;
background: rgba(00,00,00,0.6);
.wx_bg {
width: 100%;
height: 100%;
background: rgba(00, 00, 00, 0.6);
position: fixed;
top:0;
z-index:999;
top: 0;
z-index: 999;
text-align: center;
display: none;
}
.wx_bg img{
width:2.5rem;
margin-top:50%;
.wx_bg img {
width: 2.5rem;
margin-top: 50%;
}
.box_title{
.box_title {
width: 80%;
margin-left: 10%;
height: 2.38rem;
......@@ -43,15 +45,17 @@ p{
border-radius: 0.08rem;
position: relative;
}
.box_title .G_img{
.box_title .G_img {
width: 0.56rem;
height: 0.57rem;
position: absolute;
left: 1.23rem;
top: -0.235rem;
}
.box_title h5{
font-size: 0.28rem;
.box_title h5 {
font-size: 0.26rem;
color: #C72220;
margin-block-start: 0;
margin-block-end: 0;
......@@ -59,35 +63,38 @@ p{
padding-top: 0.35rem;
/*font-weight: bold;*/
}
.box_title .box_limit{
.box_title .box_limit {
width: 2.6rem;
margin: 0.2rem auto;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.box_text{
.box_text {
font-size: 0.2rem;
color: #111111;
float: left;
}
.box_d{
.box_d {
width: 0.45rem;
height: 0.7rem;
background: #C72220;
float: left;
margin: 0 0.05rem;
border-radius: 0.05rem;
}
.box_d p{
.box_d p {
font-size: 0.54rem;
color: white;
text-align: center;
line-height: 0.7rem;
}
.box_content{
.box_content {
width: 100%;
height: 5.2rem;
background-image: url(../images/bg1@3x.png);
......@@ -97,32 +104,35 @@ p{
left: 0;
top: 1.48rem;
}
.box_content .box_content_t{
.box_content .box_content_t {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-top: 0.1rem;
}
.t_name{
.t_name {
font-size: 0.16rem;
color: white;
}
.time_view{
.time_view {
width: 0.37rem;
height: 0.31rem;
border-radius: 0.07rem;
background: #FAB001;
}
.time_view p{
.time_view p {
font-size: 0.25rem;
color: #E03234;
text-align: center;
line-height: 0.31rem;
}
.img_bg_M{
.img_bg_M {
width: 100%;
height: 2.14rem;
background-image: url(../images/M_200.png);
......@@ -131,17 +141,37 @@ p{
position: relative;
}
/*.img_bg_p1{*/
/* font-size: 0.3rem;*/
/* color: #E03234;*/
/* padding-top: 0.2rem;*/
/*}*/
/*.img_bg_p2{*/
/* font-size: 0.14rem;*/
/* color: #E03234;*/
/* height: 0.2rem;*/
/*}*/
.img_btn{
.img_btn {
width: 1.4rem;
height: 0.38rem;
/*background: #FAB001;*/
......@@ -155,27 +185,30 @@ p{
background-repeat: no-repeat;
}
.img_btn p{
.img_btn p {
font-size: 0.16rem;
color: #E03234;
}
.explain_box{
.explain_box {
background: #C72220;
padding: 0.15rem;
}
.explain{
.explain {
width: 100%;
background: #E03234;
overflow: auto;
}
.explain p{
.explain p {
font-size: 0.12rem;
color: #FFFFFF;
margin: 0.15rem;
line-height: 0.2rem;
}
.img_bg_M .received_img{
.img_bg_M .received_img {
position: absolute;
right: 0.14rem;
top: 0.67rem;
......@@ -183,7 +216,8 @@ p{
height: 0.65rem;
display: none;
}
.box_title_2{
.box_title_2 {
width: 90%;
display: flex;
flex-direction: row;
......@@ -191,12 +225,13 @@ p{
justify-content: center;
margin-left: 5%;
}
.box_title_2 p{
.box_title_2 p {
font-size: 0.26rem;
color: #FFFFFF;
}
#notice{
#notice {
width: 100%;
height: 100%;
position: absolute;
......@@ -207,7 +242,8 @@ p{
z-index: 100;
display: none;
}
.notice_img{
.notice_img {
width: 2.66rem;
height: 3.18rem;
position: absolute;
......@@ -222,20 +258,22 @@ p{
opacity: 1;
display: none;
}
.notice_img img{
.notice_img img {
width: 1.99rem;
height: 0.63rem;
margin-left: 0.3rem;
}
.notice_name{
.notice_name {
font-size: 0.16rem;
color: #FFFFFF;
text-align: center;
margin-top: 0;
}
.notice_content,.notice_content2{
.notice_content,
.notice_content2 {
font-size: 0.10rem;
color: #FFFFFF;
text-align: center;
......@@ -243,7 +281,8 @@ p{
margin-left: 3%;
line-height: 0.2rem;
}
.c_close{
.c_close {
width: 1.2rem;
height: 0.35rem;
border-radius: 0.06rem;
......@@ -253,12 +292,13 @@ p{
justify-content: center;
margin: 0.4rem auto;
}
.c_close p{
.c_close p {
font-size: 0.16rem;
color: #9B0612;
}
.use_oupon{
.use_oupon {
width: 3.14rem;
height: 0.4rem;
margin-top: 0.16rem;
......@@ -268,84 +308,93 @@ p{
align-items: center;
justify-content: space-between;
}
.use_news{
.use_news {
display: flex;
flex-direction: row;
align-items: center;
}
.use_news img{
.use_news img {
width: 0.4rem;
height: 0.4rem;
/*border-radius: 0.2rem;*/
overflow: hidden;
}
.use_news div{
.use_news div {
height: 0.4rem;
margin-left: 0.1rem;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.use_news div p:nth-child(1){
.use_news div p:nth-child(1) {
font-size: 0.12rem;
color: #111111;
}
.use_news div p:nth-child(2){
.use_news div p:nth-child(2) {
font-size: 0.1rem;
color: #888888;
width: 1.8rem;
overflow: hidden;
}
.click_use{
.click_use {
width: 0.8rem;
height: 0.25rem;
border:solid 1px #E03234
border: solid 1px #E03234
}
.click_use p{
.click_use p {
font-size: 0.11rem;
color: #E03234;
text-align: center;
line-height: 0.25rem;
}
.deta_replace{
.deta_replace {
width: 2rem;
height: 0.7rem;
display: none;
flex-direction: row;
justify-content: space-between;
}
.replace_box{
.replace_box {
width: 0.46rem;
height: 100%;
display: inline-block;
position: relative;
}
.replace_top{
.replace_top {
width: 0.46rem;
height:50% ;
height: 50%;
background: #C72220;
border-bottom: 1px solid #FFFFFF;
box-sizing: border-box;
border-radius: 10px 10px 0 0;
}
.replace_bottom{
height:50% ;
.replace_bottom {
height: 50%;
background: #C72220;
box-sizing: border-box;
border-radius: 0 0 10px 10px;
}
.replace_text{
.replace_text {
width: 0.46rem;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.replace_text p{
.replace_text p {
color: #FFFFFF;
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 0.54rem;
......@@ -354,13 +403,13 @@ p{
text-align: center;
}
.app_share{
.app_share {
width: 100%;
height: 0.35rem;
display: none;
}
.app_sharebox{
.app_sharebox {
width: 90%;
margin-left: 5%;
height: 0.35rem;
......@@ -368,51 +417,58 @@ p{
flex-direction: row;
align-items: center;
}
.app_sharebox p{
.app_sharebox p {
font-size: 0.14rem;
color: white;
margin-right: 0.1rem;
}
.app_sharebox img{
.app_sharebox img {
width: 0.2rem;
height: 0.2rem;
margin-left: 0.15rem;
}
.Noticewarp{
.Noticewarp {
overflow: hidden;
height: 0.3rem;
line-height: 0.3rem;
width: 100%;
position: absolute;
top:2.7rem;
z-index:999;
top: 2.7rem;
z-index: 999;
}
.Noticewarp .scroll {
width: 200%;
float: left;
position: relative;
}
.Noticewarp a {
color: #fff;
width: auto;
float: left;
padding:0 0.2rem 0 0.05rem;
height:0.3rem;
padding: 0 0.2rem 0 0.05rem;
height: 0.3rem;
text-decoration: none;
margin-right:0.1rem;
border-radius:1rem;
background: rgba(0,0,0,0.5);
font-size:0.1rem;
margin-right: 0.1rem;
border-radius: 1rem;
background: rgba(0, 0, 0, 0.5);
font-size: 0.1rem;
display: inline-block;
}
.scroll a img{
width:0.25rem;
height:0.25rem;
.scroll a img {
width: 0.25rem;
height: 0.25rem;
vertical-align: middle;
position: relative;
top:-0.02rem;
border-radius:50%;
top: -0.02rem;
border-radius: 50%;
}
.Noticewarp a:last-child{
margin-right:0;
.Noticewarp a:last-child {
margin-right: 0;
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
<meta name="x5-orientation" content="portrait">
</meta>
<!-- <link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon" />-->
<link rel="stylesheet" href="../css/GT_activities.css">
<link rel="stylesheet" href="../css/GT_activities.css?r=2341654165">
<link rel="stylesheet" href="../css/GT_activities2.css" media="screen" type="text/css" />
<div id='wx_pic' style='margin:0 auto;display:none;'>
<img src='../images/18logo.png' />
......@@ -157,7 +157,7 @@
</div>
<div class="notice_img">
<img src="../images/notice_2.png" alt="">
<p class="notice_name"></p>
<p class="notice_name">尊敬的客户</p>
<p class="notice_content"></p>
<p class="notice_content2"></p>
<div class="c_close">
......@@ -223,7 +223,10 @@
}
var str = ''
for (var i = 0; i < dataList.length; i++) {
str += `<a href="#">
if (!dataList[i].customerPhoto) {
dataList[i].customerPhoto = '../images/tx_bg.png'
}
str += `<a href="javascript:void(0);">
<img src="${dataList[i].customerPhoto}"/>
${dataList[i].customerName}抢到了优惠券
</a>`
......@@ -254,7 +257,7 @@
let login = true; //判断是否登录
let userInfo = {};
let platform = "H5";
if (localStorage.u) {
if (localStorage.u && href.indexOf("platform") == -1) {
try {
userInfo = JSON.parse(localStorage.u);
if (!userInfo.customerId) {
......@@ -274,8 +277,6 @@
login = false
}
} else {
// 如果进入页面没有登录的参数 处理跳到h5页面登录
if (href.split('?')[1]) {
......@@ -297,7 +298,6 @@
secretKey: param[3].split('=')[1]
}
platform = param[4].split('=')[1] //获取从哪里跳过来的
}
} else {
// window.location.href = 'https://activity.oytour.com/html/login.html';
......@@ -309,6 +309,10 @@
}
}
if (login == true) {
}
var ua = navigator.userAgent.toLowerCase();
......@@ -332,7 +336,6 @@
$('.click_use p').html('立即登录');
}
$.ajax({
type: "POST",
url: `${getApiUrl().urlJava}api/appActivity/getUserPurchaseTime`,
......@@ -349,14 +352,24 @@
$('.box_title_2 p').html(res.data.redemptionPrice + '元抢购');
$('.box_title h5').html(res.data.remark);
$('.explain p').html('使用说明' + '<br/>' + res.data.instructions);
$('.explain p').html('活动规则' + '<br/>' + res.data.instructions);
if (login == false) {
$('.use_o').html('暂无登录');
} else {
$('.use_o').html(res.data.contact);
$('.use_t').html(res.data.customerName);
}
$('.use_t').html(res.data.customerName);
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,
......@@ -368,16 +381,16 @@
platform: platform,
login: login,
count: res.data.count, //判断是否可以抢购 0为不可以
activityStartDate: activityStartDate,
activityEndDate: activityEndDate,
nextAc:nextAc
}); //刚进入页面不执行动画
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 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;
......@@ -385,7 +398,6 @@
let month = nexttime.split('T')[0].split('-')[1];
let day = nexttime.split('T')[0].split('-')[2];
let hour = nexttime.split('T')[1].split(':')[0];
$('.notice_name').html('亲爱的' + nextActivity.userName);
$('.notice_content').html('下期活动将于' + year + '年' + month + '月' + day + '日' + hour + '点开始。');
$('.notice_content2').html('届时会有' + nextActivity.couponCount + '张价值' + nextActivity.denomination + '的折扣券等待您的抢 购(抢购价' + nextActivity.redemptionPrice + '元),请准时参加。');
// var time2 = setInterval(setTimer3, 1000); //计时器
......@@ -478,6 +490,8 @@
let RushbuyTime = {
RushbuyTime: expirationDate,
title: title,
userName: res.data.contact,
shopName: res.data.customerName,
}
localStorage.RushbuyTime = JSON.stringify(RushbuyTime)
$('.img_bg_p2').html('有效期截止:' + expirationDate)
......@@ -491,6 +505,7 @@
}); //刚进入页面不执行动画
}
// clearInterval(xhtime)
},
error: function(res) {
layer.msg(res.message)
......@@ -506,6 +521,7 @@
//时间为一位数时显示格式为:"0X"
function checkTime(i) {
if (i < 10) {
......@@ -686,7 +702,193 @@
window.postMessage(JSON.stringify(data));
})
setInterval(() => {
$('.digit_set').empty()
$.ajax({
type: "POST",
url: `${getApiUrl().urlJava}api/appActivity/getUserPurchaseTime`,
contentType: "application/json",
data: getJavaData({}),
async: false,
success: function(res) {
if (res.resultCode === 1) {
getTicketList(res.data.couponId);
let num = res.data.repertory; //优惠券总共数量
// let num = 5000; //优惠券总共数量
$('.box_title_2 p').html(res.data.redemptionPrice + '元抢购');
$('.box_title h5').html(res.data.remark);
$('.explain p').html('活动规则' + '<br/>' + res.data.instructions);
if (login == false) {
$('.use_o').html('暂无登录');
} else {
$('.use_o').html(res.data.contact);
$('.use_t').html(res.data.customerName);
}
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,
min: num,
len: 4,
add: true,
price: res.data.redemptionPrice,
couponId: res.data.couponId,
platform: platform,
login: login,
count: res.data.count, //判断是否可以抢购 0为不可以
activityStartDate: activityStartDate,
activityEndDate: activityEndDate,
nextAc:nextAc
}); //刚进入页面不执行动画
// let activityStartDate = new Date('2019/11/08 17:43:50').getTime();
// let activityEndDate = new Date('2019/11/14 11:23:00').getTime(); //活动结束时间
if (nextActivity != null) {
let nexttime = nextActivity.activityStartDate;
let year = nexttime.split('T')[0].split('-')[0];
let month = nexttime.split('T')[0].split('-')[1];
let day = nexttime.split('T')[0].split('-')[2];
let hour = nexttime.split('T')[1].split(':')[0];
$('.notice_content').html('下期活动将于' + year + '年' + month + '月' + day + '日' + hour + '点开始。');
$('.notice_content2').html('届时会有' + nextActivity.couponCount + '张价值' + nextActivity.denomination + '的折扣券等待您的抢 购(抢购价' + nextActivity.redemptionPrice + '元),请准时参加。');
// var time2 = setInterval(setTimer3, 1000); //计时器
let beforeDawn = new Date(year + '/' + month + '/' + day + ' 00:00:00').getTime()
let time = ((beforeDawn - nowDate) / 1000).toFixed(0);
runtime(time)
}
//判断当前时间是否到了抢购时间
if (activityStartDate >= nowDate) { //没到抢购时间 显示抢购的具体时间
$('#t1').html('抢购时间:');
$('#t2').html('');
let startDate = res.data.activityStartDate;
let month = startDate.split('T')[0].split('-')[1];
let day = startDate.split('T')[0].split('-')[2];
let hour = startDate.split('T')[1].split(':')[0];
$('#p1').html(month);
$('#p2').html(day);
$('#p3').html(hour);
$('#t3').html('月');
$('#t4').html('日');
$('#t5').html('点整');
$('.img_btn p').html('立即抢购');
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
$('.img_btn p').css("color", "#FFFFFF");
// $(".received_img").attr("src", "");
let time = ((activityStartDate - nowDate) / 1000).toFixed(0);
runtime(time)
} else if (nowDate > activityEndDate || res.data.activityIsEnding == 1) { // 活动时间已过
// $(".received_img").attr("src", "");
$('.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 p').html('活动结束')
$('.box_content_t').hide()
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
} else { // 到了抢购的时间显示距离结束时间的倒计时
currentTime = res.data.currentTime.replace('T', ' ').replace(/-/g, '/');
end = res.data.activityEndDate.replace('T', ' ').replace(/-/g, '/');
if (num > 0) {
$('#t1').html('结束倒计时:')
if (res.data.count != 0) {
// $(".received_img").attr("src", "");
$('.img_btn p').html('立即抢购');
} else {
$('.img_btn p').html('去使用');
$(".received_img").css('display', "block");
$('.img_btn').css("background-image", "url(../images/buy_btn.png)");
}
} else {
// $(".received_img").attr("src", "");
$('.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 p').html('活动结束')
$('.box_content_t').hide()
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
}
}
//优惠券的有限时间
let expirationDate = (res.data.expirationDate).split('T')[0].replace(/-/g, '.');
let title = $('.img_bg_p1').text()
let RushbuyTime = {
RushbuyTime: expirationDate,
title: title,
userName: res.data.contact,
shopName: res.data.customerName,
}
localStorage.RushbuyTime = JSON.stringify(RushbuyTime)
$('.img_bg_p2').html('有效期截止:' + expirationDate)
} else {
$('.dataStatistics').dataStatistics({
max: 0,
min: 0,
len: 4,
add: true
}); //刚进入页面不执行动画
}
// clearInterval(xhtime)
},
error: function(res) {
layer.msg(res.message)
$('.dataStatistics').dataStatistics({
max: 0,
min: 0,
len: 4,
add: true
}); //刚进入页面不执行动画
}
});
}, 300000) //5分钟请求一次接口
</script>
</body>
</html>
\ No newline at end of file
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<meta name="screen-orientation" content="portrait">
</meta>
<meta name="x5-orientation" content="portrait">
</meta>
<title>印象之旅11.18</title>
<style>
*{margin: 0; padding: 0;}
.main{
width: 100%;
height: 100%;
background: url(../images/gongxi4.png) no-repeat;
background-size:100%;
background-color: #8d54cc;
}
.main .box{
position: relative;
top: 30%;
width: 100%;
opacity: 0;
text-align: center;
}
.main .box.move{
top: 40%;
opacity: 1;
transition: all linear .5s;
}
.main .box .hongbao{
width: 80%;
}
.main .box .anniu{
width: 64%;
position: absolute;
left: 18%;
bottom: 15%;
}
#RushbuyTime{
font-size: 0.13rem;
color: #e03234;
height: 0.2rem;
position: absolute;
width: 100%;
right: -18.5%;
top: 26%;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<meta name="screen-orientation" content="portrait">
</meta>
<meta name="x5-orientation" content="portrait">
</meta>
<title>印象之旅11.18</title>
<style>
* {
margin: 0;
padding: 0;
}
.main {
width: 100%;
height: 100%;
background: url(../images/gongxi4.png) no-repeat;
background-size: 100%;
background-color: #8d54cc;
position: relative;
overflow: hidden;
}
.main .box {
position: relative;
top: 30%;
width: 100%;
opacity: 0;
text-align: center;
}
.main .box.nomove {
top: 40%;
opacity: 1;
}
.main .box.move {
top: 40%;
opacity: 1;
transition: all linear .5s;
-moz-transition: all linear .5s;
/* Firefox 4 */
-webkit-transition: all linear .5s;
/* Safari and Chrome */
-o-transition: all linear .5s;
/* Opera */
}
.main .box .hongbao {
width: 80%;
}
.main .box .anniu {
width: 64%;
position: absolute;
left: 18%;
bottom: 15%;
background: url(../images/gongxi22.png);
background-repeat: no-repeat;
background-size: 100% 100%;
background-position-x: center;
margin: 0 auto;
font-size: 1.4rem;
color: #c6780f;
height: 4rem;
line-height: 4rem;
}
.main .box .anniu::after {
content: "";
display: block;
padding-bottom: 36%;
}
#RushbuyTime {
font-size: 0.13rem;
color: #e03234;
height: 0.2rem;
position: absolute;
width: 100%;
right: -18.5%;
top: 26%;
}
.rushNocheck {
width: 0.9rem;
height: 0.9rem;
border: 1px solid #fff;
display: inline-block;
border-radius: 0.2rem;
position: relative;
top: 0.1rem;
margin-right: 0.2rem;
display: none;
}
.rushNocheckTwo {
width: 1rem;
height: 1rem;
display: inline-block;
border-radius: 0.2rem;
position: relative;
top: 0.1rem;
margin-right: 0.2rem;
}
.rushNocheckTwo img {
width: 100%;
height: 100%;
}
.readXieyi {
color: #fff;
font-size: 1rem;
width: 100%;
text-align: center;
position: absolute;
bottom: 3rem;
}
.benciXieyi {
color: #FFCE55;
text-decoration: underline;
}
.activeXieyi {
position: absolute;
width: 100%;
height: 100%;
display: none;
top: 0;
left: 0;
background: rgba(0, 0, 0, .6);
color: #333333;
}
.xieyiContent {
width: 80%;
height: 26rem;
padding: 1rem;
background-color: #fff;
margin: 0 auto;
margin-top: 6rem;
border-radius: 1rem;
}
.xieyiTitle {
font-size: 1rem;
width: 100%;
text-align: center;
}
.xieyiNei {
width: 100%;
height: 6rem;
width: 100%;
height: 20rem;
margin-top: 1rem;
overflow-y: auto;
font-size: 0.9rem;
color: #333333;
padding: 0 0.2rem;
}
.xieyiNei div {
margin-bottom: 1rem;
}
.xieyiNei::-webkit-scrollbar {
width: 4px;
height: 8px;
}
.xieyiNei::-webkit-scrollbar-thumb {
border-radius: 4px;
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
background: #c9c9c9;
}
.xieyiNei::-webkit-scrollbar-track {
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
border-radius: 4px;
background: #EDEDED;
}
.readBtn {
width: 6rem;
height: 2.5rem;
background-color: #FFC430;
color: #A76104;
border: none;
outline: none;
font-size: 1rem;
border-radius: 0.5rem;
margin-top: 1rem;
}
</style>
</head>
<body>
<div class="main">
<div class="box">
<img class="hongbao" src="../images/gongxi1.png">
<span id="RushbuyTime"></span>
<img class="anniu" src="../images/gongxi2.png">
<div class="main">
<div class="box">
<img class="hongbao" src="../images/gongxi1.png">
<span id="RushbuyTime"></span>
<div class="anniu">
</div>
<!-- <img class="anniu" src="../images/gongxi2.png"> -->
</div>
<div class="readXieyi">
<div class="rushNocheck"></div>
<div class="rushNocheckTwo">
<img src="../images/xyck.png" alt="" />
</div>
<span>我已阅读并同意</span><span class="benciXieyi">《本次活动说明》</span>
</div>
<div class="activeXieyi">
<div class="xieyiContent">
<div class="xieyiTitle">11.18活动说明</div>
<div class="xieyiNei">
<div>1、所有印象同业会员均可参加本次活动</div>
<div>2、活动期间内,每天更新1118张面额为200的散拼跟团游优惠券,用户需要进入活动页面进行抢购,抢到优惠券的用户需要在1分钟内完成支付,若未完成支付系统将自动取消订单;用户完成付款后,系统将自动发放优惠券,可前往APP“我的优惠券”页面进行查看。</div>
<div>3、本次活动的优惠券只能用于印象之旅的散拼跟团游产品,每团限定使用一张。</div>
<div>4、本次活动商品为APP专享优惠券,只能在印象同业APP中使用,优惠券有效期为:2019-11-18 至 2020-11-17。</div>
<div>5、本次优惠券不能与其他优惠券叠加使用,但可以与其他活动一起组合使用。例如:幸福存折等。</div>
<div>6、每个同行用户限定每天只能抢购一张优惠券。</div>
<div>7、活动时间:2019年11月18日-2019年11月25日为期8天,用户可在印象同业APP,行程助理小程序以及本次活动的H5页面中参与。</div>
<div>本次活动最终解释权归印象之旅所有。</div>
</div>
<div style="width:100%;text-align:center;">
<button class="readBtn">我已阅读</button>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="../js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../js/md5.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="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>
let RushbuyTime = JSON.parse(localStorage.RushbuyTime)
$(
function(){
<script type="text/javascript" src="../js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../js/md5.js"></script>
<script type="text/javascript" src="../js/layer/layer.js"></script>
<script type="text/javascript" src="../js/mian.js?r=12312312312"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>
let param = window.location.href.split('?')[1].split("&") ? window.location.href.split('?')[1].split("&") : null;
let price = param ? param[0].split('=')[1] : 0;
let couponId = param ? param[1].split('=')[1] : 0;
let platform = param ? param[2].split('=')[1] : 0;
$('.anniu').html('支付' + price + '元领取')
let buyIf = {}
// if (localStorage.buyInfo) {
// buyIf = JSON.parse(localStorage.buyInfo)
// }else {
// history.go(-1)
// }
if (platform == 'app') {
move(1)
} else {
move(2)
}
let RushbuyTime = localStorage.RushbuyTime ? JSON.parse(localStorage.RushbuyTime) : {
RushbuyTime: ''
}
$('#RushbuyTime').html(`有效期截止:` + RushbuyTime.RushbuyTime)
setTimeout(function(){
$('.box').addClass('move')
}, 500)
}
)
let buyIf = {}
if (localStorage.buyInfo) {
buyIf = JSON.parse(localStorage.buyInfo)
}else {
window.location.href = 'https://activity.oytour.com/html/GT_activities.html';
}
$('.anniu').click(function () {
var loadingFlag;
if (buyIf.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'showHud', 'message': '抢购中...'}));
}
if (buyIf.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 (buyIf.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'dismissHud'}));
}
if (buyIf.platform == 'H5') {
layer.close(loadingFlag);
}
if (res.resultCode === 1) {
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,
'goBack':'1',
'cardInfo' : {
title : RushbuyTime.title,
date : RushbuyTime.RushbuyTime,
}
}
}
if (buyIf.platform == 'app') {
window.postMessage(JSON.stringify(data));
}
// 跳转到支付
else if (buyIf.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 (buyIf.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 (buyIf.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(buyIf.platform)
if (buyIf.platform == 'app') {
window.postMessage(JSON.stringify({'action': 'dismissHud'}));
} else if (buyIf.platform == 'H5') {
layer.close(loadingFlag);
}
}
});
})
</script>
function move(t) {
if (t === 1) {
$('.box').addClass('nomove')
} else {
setTimeout(function() {
$('.box').addClass('move')
}, 500)
}
}
var isChecke = true;
$('.readXieyi').click(function() {
isChecke = !isChecke
if (!isChecke) {
$('.rushNocheckTwo').css({
'display': 'none'
})
$('.rushNocheck').css({
'display': 'inline-block'
})
} else {
$('.rushNocheckTwo').css({
'display': 'inline-block'
})
$('.rushNocheck').css({
'display': 'none'
})
}
})
//点击本次协议弹出窗
$(".benciXieyi").click(function(e) {
e.stopPropagation();
$('.activeXieyi').css({
'display': 'block'
});
});
//关闭弹窗
$('.readBtn').click(function() {
$('.activeXieyi').css({
'display': 'none'
});
})
$('.anniu').click(function() {
if (!isChecke) {
layer.msg('请同意活动说明');
return;
}
var loadingFlag;
if (platform == 'app') {
window.postMessage(JSON.stringify({
'action': 'showHud',
'message': '抢购中...'
}));
}
if (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: price,
couponId: couponId,
productName: '印象之旅-200元线路产品优惠券'
}),
async: false,
success: function(res) {
if (platform == 'app') {
window.postMessage(JSON.stringify({
'action': 'dismissHud'
}));
}
if (platform == 'H5') {
layer.close(loadingFlag);
}
if (res.resultCode === 1) {
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,
'goBack': '1',
'cardInfo': {
title: RushbuyTime.title,
date: RushbuyTime.RushbuyTime,
userName: RushbuyTime.userName,
shopName: RushbuyTime.shopName,
}
}
}
if (platform == 'app') {
window.postMessage(JSON.stringify(data));
}
// 跳转到支付
else if (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 (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 (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(platform)
if (platform == 'app') {
window.postMessage(JSON.stringify({
'action': 'dismissHud'
}));
} else if (platform == 'H5') {
layer.close(loadingFlag);
}
}
});
})
</script>
</body>
</html>
</html>
\ No newline at end of file
......@@ -380,9 +380,9 @@
</div>
<div class="goToDownLoad">
<div>
<img class="downloadImg" src="../images/login/godownload.png" alt=""/>
<img class="downloadImg" src="http://acitvityimage.oytour.com/activity/godownload.png" alt=""/>
<span onclick="goDownLoad()">
下载同业App使用<img src="../images/login/arrowR.png" alt=""/>
下载同业App使用<img src="http://acitvityimage.oytour.com/activity/arrowR.png" alt=""/>
</span>
</div>
</div>
......@@ -395,6 +395,18 @@
<script>
$(function(){
pushHistory();
    window.addEventListener("popstate", function(e) {
    //根据自己的需求实现自己的功能
window.location.href = 'https://activity.oytour.com/html/GT_activities.html';
  }, false);
  function pushHistory() {
    var state = {
    title: "title",
    url: "#"
  };
    window.history.pushState(state, "title", "#");
  }
$(document).click(function(e){
var target = $(e.target);
if(target.closest(".coupons_Navone").length != 0) return;
......
......@@ -19,7 +19,7 @@
position: relative;
height: 100%;
background-color: #FFFFFF;
background-image: url('../images/login/login_bg.png');
background-image: url('http://acitvityimage.oytour.com/activity/login_bg.jpg');
background-size:cover;
}
.login_page .page__bd{
......@@ -229,22 +229,22 @@
<div class="login_denglu">
<div class='page__bd'>
<div class="headBg">
<img class="headBgImg" src="../images/login/login_content.png"/>
<img class="headBgImg" src="http://acitvityimage.oytour.com/activity/login_content.png"/>
<div class='header'>
<img class='header_image' src='../images/login/login_elp.png'>
<img class='header_image' src='http://acitvityimage.oytour.com/activity/login_elp.png'>
<span class='header_span'>Welcome</span>
</div>
<div class='form'>
<div class='form_item1'>
<div class='form_item_inBox'>
<img class='form_item_ico' src='../images/login/ico_lock1.png'/>
<img class='form_item_ico' src='http://acitvityimage.oytour.com/activity/ico_lock1.png'/>
<span class="login_Zh">账号</span>
<input class='form_item_input' id="UserAccount" type='number' placeholder="请输入手机号"></input>
</div>
</div>
<div class='form_item2'>
<div class='form_item_inBox'>
<img class='form_item_ico' src='../images/login/ico_lock2.png'/>
<img class='form_item_ico' src='http://acitvityimage.oytour.com/activity/ico_lock2.png'/>
<span class="login_Zh">密码</span>
<input class='form_item_input' id="passWord" type="password" placeholder="请输入密码"></input>
</div>
......@@ -265,29 +265,29 @@
<div class="login_jihuo">
<div class='page__bd'>
<div class="headBg" style="height:60rem;">
<img class="headBgImg" src="../images/login/login_content.png"/>
<img class="headBgImg" src="http://acitvityimage.oytour.com/activity/login_content.png"/>
<div class='header'>
<img class='header_image' src='../images/login/login_elp.png'>
<img class='header_image' src='http://acitvityimage.oytour.com/activity/login_elp.png'>
<span class='header_span'>Welcome</span>
</div>
<div class='form'>
<div class='form_item1'>
<div class='form_item_inBox'>
<img class='form_item_ico' src='../images/login/ico_lock1.png'/>
<img class='form_item_ico' src='http://acitvityimage.oytour.com/activity/ico_lock1.png'/>
<span class="login_Zh">账号</span>
<input class='form_item_input' type='number' id="Activation_Account" placeholder="请输入手机号"></input>
</div>
</div>
<div class='form_item2'>
<div class='form_item_inBox'>
<img class='form_item_ico' src='../images/login/ico_lock2.png'/>
<img class='form_item_ico' src='http://acitvityimage.oytour.com/activity/ico_lock2.png'/>
<span class="login_Zh">密码</span>
<input class='form_item_input' type="password" id="Activation_password" placeholder="请输入密码"></input>
</div>
</div>
<div class='form_item2'>
<div class='form_item_inBox'>
<img class='form_item_ico' src='../images/login/ico_yzm.png' style="margin-top:1rem;"/>
<img class='form_item_ico' src='http://acitvityimage.oytour.com/activity/ico_yzm.png' style="margin-top:1rem;"/>
<span class="login_Zh">验证码</span>
<input class='form_validate_input' id="Activation_valicode" placeholder="请输入验证码"></input>
<span class="login_yzm" onclick="getCode()">发送验证码</span>
......@@ -304,7 +304,7 @@
</div>
<div class="login_Agreement">
<div class="login_AgreeTitle">
<img onclick="gobackLogin()" src="../images/login/login_arrowleft.png"/> 用户协议
<img onclick="gobackLogin()" src="http://acitvityimage.oytour.com/activity/login_arrowleft.jpg"/> 用户协议
</div>
<div class="boxcenter">
<h1>《用户协议和法律协议》 本协议为您与本APP管理者之间所订立的契约,具有合同的法律效力,请您仔细阅读。</h1>
......
......@@ -155,11 +155,11 @@
</div>
<div class="pay_zhifu">
<img class="pay_one" src="../images/login/wechat.png" alt="" />
<img class="pay_one" src="http://acitvityimage.oytour.com/activity/wechat.png" alt="" />
<span class="pay_two">微信支付</span>
<div class="pay_three">
<!-- <div class="pay_circle"></div> -->
<img src="../images/login/checkbox.png" aly="" />
<img src="http://acitvityimage.oytour.com/activity/checkbox.png" aly="" />
</div>
</div>
</div>
......@@ -230,7 +230,7 @@
return result;
};
function goActive(){
window.location.href = 'https://activity.oytour.com/html/paySuccess.html';
window.location.href = 'https://activity.oytour.com/html/GT_activities.html';
// window.location.href = 'http://127.0.0.1:5500/html/paySuccess.html';
}
......
......@@ -153,6 +153,20 @@
<script type="text/javascript" src="../js/mian.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>
$(function(){
  pushHistory();
    window.addEventListener("popstate", function(e) {
    //根据自己的需求实现自己的功能
window.location.href = 'https://activity.oytour.com/html/GT_activities.html';
  }, false);
  function pushHistory() {
    var state = {
    title: "title",
    url: "#"
  };
    window.history.pushState(state, "title", "#");
  }
});
let href = window.location.href;
// let href = 'https://127.0.0.1:5500/html/GT_activities.html';
// let href='https://127.0.0.1:5500/html/GT_activities.html?customerId=1549&accountId=1182&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NzM0NjY2NjMuMCwiZXhwIjoxNTczNTUzMDYzLjAsInVzZXJJbmZvIjp7InVpZCI6IjExODIiLCJyZXF1ZXN0RnJvbSI6NH19.hX2b2MqSWYmWS0k3YsthxW-T6UxarIm5rdbqCVQtxdQ&secretKey=5d5e16254bd741c486fe2b83b42171d2&platform=xcx';
......
......@@ -8,7 +8,11 @@ $.fn.dataStatistics = function(options) {
couponId: 0, //订单id
platform: 'app',
count: 0,
login:true,
login: true,
activityStartDate: 0,
activityEndDate: 0,
nowDate: 0,
nextAc:false,
}, options || {});
var ths = this; //解决this指向问题
......@@ -60,6 +64,8 @@ $.fn.dataStatistics = function(options) {
var difference = 0; //执行次数
var nownumber = options.min; //优惠券数量
var Activityendtime = ''; //活动结束时间
function run(diff) {
if (diff) {
difference = diff
......@@ -71,7 +77,6 @@ $.fn.dataStatistics = function(options) {
clearInterval(timer2); //优惠券用完 清楚定时器
// $(".received_img").attr("src", "");
$('.img_bg_M').css("background-image", "url(../images/MJ_200@3x.png)");
$('.img_bg_p1').css("color", "#CCCCCC");
......@@ -80,10 +85,13 @@ $.fn.dataStatistics = function(options) {
$('.img_btn p').html('活动结束')
$('.box_content_t').hide()
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
if (options.nextAc == true) { //显示活动预告
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
}
// layer.msg('优惠券被抢光了!')
}
......@@ -139,20 +147,19 @@ $.fn.dataStatistics = function(options) {
var timer2 = setInterval(() => {
$.ajax({
type: "POST",
url: `${getApiUrl().urlJava}api/appActivity/getUserPurchaseTime`,
url: `${getApiUrl().urlJava}api/appActivity/getCurrentActivity`,
contentType: "application/json",
data: getJavaData({}),
data: getJavaData({ couponId: options.couponId }),
async: false,
success: function(res) {
if (res.resultCode === 1) {
nodisplay = true
if (nownumber > 0) {
let num = nownumber - res.data.repertory; // 算出动画执行的次数
nownumber = res.data.repertory; // 算出现在的数字
// let num = 10 ; // 算出动画执行的次数
// // nownumber = 900; // 算出现在的数字
if (num > 0) {
if(num> 5){
if (num > 5) {
$('.digit_set').empty()
clearInterval(timer2);
$('.dataStatistics').dataStatistics({
......@@ -160,17 +167,20 @@ $.fn.dataStatistics = function(options) {
min: nownumber,
len: 4,
add: true,
price: res.data.redemptionPrice,
couponId: res.data.couponId,
price: options.price,
couponId: options.couponId,
platform: options.platform,
login:options.login,
count: res.data.count, //判断是否可以抢购 0为不可以
login: options.login,
count: options.count, //判断是否可以抢购 0为不可以
activityStartDate: options.activityStartDate,
activityEndDate: options.activityEndDate,
nextAc: options.nextAc,
}); //刚进入页面不执行动画
}else {
} else {
run(num)
}
}else if(num< 0){
} else if (num < 0) {
$('.digit_set').empty()
clearInterval(timer2);
$('.dataStatistics').dataStatistics({
......@@ -178,23 +188,24 @@ $.fn.dataStatistics = function(options) {
min: nownumber,
len: 4,
add: true,
price: res.data.redemptionPrice,
couponId: res.data.couponId,
price: options.price,
couponId: options.couponId,
platform: options.platform,
login:options.login,
count: res.data.count, //判断是否可以抢购 0为不可以
login: options.login,
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 = new Date(res.data.activityStartDate.replace('T', ' ').replace(/-/g, '/')).getTime();
let activityEndDate = new Date(res.data.activityEndDate.replace('T', ' ').replace(/-/g, '/')).getTime();
// options.count = res.data.count;
let activityStartDate = options.activityStartDate;
let activityEndDate = options.activityEndDate;
let nowDate = new Date(res.data.currentTime.replace('T', ' ').replace(/-/g, '/')).getTime(); //服务器时间
let nowDate = new Date(res.data.currentTime.replace(/-/g, '/')).getTime(); //服务器时间
// let nowDate = options.nowDate; //服务器时间
if (activityStartDate >= nowDate) { //活动还没开始
clearInterval(timer2);
......@@ -208,14 +219,16 @@ $.fn.dataStatistics = function(options) {
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
$('.img_btn p').html('活动结束')
$('.box_content_t').hide()
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
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) {
if (res.data.count != 0) {
if (options.count != 0) {
// $(".received_img").attr("src", "");
$('.img_btn p').html('立即抢购')
} else {
......@@ -233,13 +246,14 @@ $.fn.dataStatistics = function(options) {
$('.img_btn p').html('活动结束')
$('.box_content_t').hide()
$('.img_btn').css("background-image", "url(../images/nobuy_btn.png)");
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
if (options.nextAc == true) { //显示活动预告
$('.dataStatistics').css('display', "none");
$('.deta_replace').css('display', "flex");
$('#notice').css('display', "block");
$('.notice_img').css('display', "block");
}
}
}
} else {
......@@ -259,52 +273,75 @@ $.fn.dataStatistics = function(options) {
$('.img_btn').click(function() {
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' ;
} else {
let data = {
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'page': 'teamWalker_2',
'pageData': {
'backType': 'pop',
// let userInfo = JSON.parse(localStorage.userInfo)
// if(userInfo.accountId && userInfo.accountId == '1182'){ //如果为唐杰的号直接跳转
// if (options.count != 0) { //判断是可以抢购
// 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
// 'page': 'teamWalker_2',
// 'pageData': {
// 'backType': 'pop',
// }
// }
// if (options.platform == 'app') {
// window.postMessage(JSON.stringify(data));
// } else if (options.platform == 'H5') {
// window.location.href = 'https://activity.oytour.com/html/downloadApp.html'
// }
//
// }
//
// }else {
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?redemptionPrice=${options.price}&couponId=${options.couponId}&platform=${options.platform}`;
} else {
let data = {
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'page': 'teamWalker_2',
'pageData': {
'backType': 'pop',
}
}
if (options.platform == 'app') {
window.postMessage(JSON.stringify(data));
} else if (options.platform == 'H5') {
window.location.href = 'https://activity.oytour.com/html/downloadApp.html'
}
}
if (options.platform == 'app') {
window.postMessage(JSON.stringify(data));
}
}
}else {
window.location.href = 'https://activity.oytour.com/html/login.html'
}
} else {
if ($('.img_btn p').text() == '活动结束') {
if (options.platform == 'app') {
window.postMessage(JSON.stringify({ 'action': 'showToast', 'message': '活动已结束' }));
}
} else {
layer.msg('活动已结束')
window.location.href = 'https://activity.oytour.com/html/login.html'
}
} else {
if (options.platform == 'app') {
window.postMessage(JSON.stringify({ 'action': 'showToast', 'message': '活动还未开始' }));
if ($('.img_btn p').text() == '活动结束') {
if (options.platform == 'app') {
window.postMessage(JSON.stringify({ 'action': 'showToast', 'message': '活动已结束' }));
} else {
layer.msg('活动已结束')
}
} else {
if (options.platform == 'app') {
window.postMessage(JSON.stringify({ 'action': 'showToast', 'message': '活动还未开始' }));
} else {
layer.msg('活动还未开始')
layer.msg('活动还未开始')
}
}
}
}
// }
})
};
let locationName = window.location.hostname;
function getApiUrl() {
let url = {
urlPost: "https://reborn.oytour.com/api/common/post",
//urlPost: locationName.indexOf('oytour') !== -1 ? "http://reborn.oytour.com/api/common/post" : "http://192.168.2.214:8082/api/common/post",
//urlJava: locationName.indexOf('oytour') !== -1 ? "https://efficient.oytour.com/" : "http://192.168.2.215:9000/"
urlJava: "https://efficient.oytour.com/"
}
return url
let url = {
urlPost: "https://reborn.oytour.com/api/common/post",
//urlPost: locationName.indexOf('oytour') !== -1 ? "http://reborn.oytour.com/api/common/post" : "http://192.168.2.214:8082/api/common/post",
//urlJava: locationName.indexOf('oytour') !== -1 ? "https://efficient.oytour.com/" : "http://192.168.2.215:9000/"
urlJava: "https://efficient.oytour.com/"
}
return url
}
String.prototype.myReplace=function(f,e){ //时间格式化 苹果手机-替换为/
var reg=new RegExp(f,"g"); //创建正则RegExp对象
return this.replace(reg,e);
String.prototype.myReplace = function(f, e) { //时间格式化 苹果手机-替换为/
var reg = new RegExp(f, "g"); //创建正则RegExp对象
return this.replace(reg, e);
}
function getLocalStorage() {
var localStorageData = window.localStorage["userInfo"];
if (localStorageData != undefined) {
return JSON.parse(localStorageData);
} else {
return null;
}
var localStorageData = window.localStorage["userInfo"];
if (localStorageData != undefined) {
return JSON.parse(localStorageData);
} else {
return null;
}
}
function getLocalStorage2() {
var localStorageData = window.localStorage["userInfo2"];
if (localStorageData != undefined) {
return JSON.parse(localStorageData);
} else {
return null;
}
var localStorageData = window.localStorage["userInfo2"];
if (localStorageData != undefined) {
return JSON.parse(localStorageData);
} else {
return null;
}
}
function clearLocalStorage() {
window.localStorage.removeItem('userInfo')
window.localStorage.removeItem('userInfo')
}
function getAjaxData(cmd, msg, tk) {
if (msg == null || msg == "") {
msg = {}
}
let timestamp = (new Date()).valueOf();
let token = "";
let key = "";
if (getLocalStorage() != null) {
token = getLocalStorage().token;
key = getLocalStorage().secretKey;
}
let encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
let md5Str = hex_md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let postData = {
"msg": msg,
"cmd": cmd,
"timestamp": timestamp,
"token": tk ? tk : token,
"sign": md5Str
}
return JSON.stringify(postData)
if (msg == null || msg == "") {
msg = {}
}
let timestamp = (new Date()).valueOf();
let token = "";
let key = "";
if (getLocalStorage() != null) {
token = getLocalStorage().token;
key = getLocalStorage().secretKey;
}
let encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
let md5Str = hex_md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let postData = {
"msg": msg,
"cmd": cmd,
"timestamp": timestamp,
"token": tk ? tk : token,
"sign": md5Str
}
return JSON.stringify(postData)
}
function getJavaData(msg) {
if (msg == null || msg == "") {
msg = {}
}
let timestamp = (new Date()).valueOf();
let token = "";
let key = "";
if (getLocalStorage() != null) {
token = getLocalStorage().token;
key = getLocalStorage().SecretKey;
} else if (getLocalStorage2() != null) {
if (getLocalStorage2() != null) {
token = getLocalStorage2().token;
key = getLocalStorage2().secretKey;
}
}
let userInfo = localStorage.userInfo ? JSON.parse(localStorage.userInfo) : JSON.parse(localStorage.userInfo2) ? JSON.parse(localStorage.userInfo2) : ''
let uid = userInfo.accountId ? userInfo.accountId : 0
let encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
let md5Str = hex_md5(`msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let postData = {
"groupId": 2,
"msg": msg,
"uid": uid,
"timestamp": timestamp,
"token": token,
"sign": md5Str
}
return JSON.stringify(postData)
if (msg == null || msg == "") {
msg = {}
}
let timestamp = (new Date()).valueOf();
let token = "";
let key = "";
if (getLocalStorage() != null) {
token = getLocalStorage().token;
key = getLocalStorage().secretKey;
} else if (getLocalStorage2() != null) {
if (getLocalStorage2() != null) {
token = getLocalStorage2().token;
key = getLocalStorage2().secretKey;
}
}
let userInfo = localStorage.userInfo ? JSON.parse(localStorage.userInfo) : JSON.parse(localStorage.userInfo2) ? JSON.parse(localStorage.userInfo2) : ''
let uid = userInfo.accountId ? userInfo.accountId : 0
let encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
let md5Str = hex_md5(`msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let postData = {
"groupId": 2,
"msg": msg,
"uid": uid,
"timestamp": timestamp,
"token": token,
"sign": md5Str
}
return JSON.stringify(postData)
}
function getJavaA(msg, tk) {
......@@ -110,4 +114,4 @@ function getJavaA(msg, tk) {
"uid": uid,
}
return JSON.stringify(postData)
}
}
\ 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