Commit 9e64c2ca authored by 黄媛媛's avatar 黄媛媛
parents 39aa226d 68195447
...@@ -21,6 +21,20 @@ p{ ...@@ -21,6 +21,20 @@ p{
padding-top: 0.7rem; padding-top: 0.7rem;
position: relative; position: relative;
} }
.wx_bg{
width:100%;
height:100%;
background: rgba(00,00,00,0.6);
position: fixed;
top:0;
z-index:999;
text-align: center;
display: none;
}
.wx_bg img{
width:2.5rem;
margin-top:50%;
}
.box_title{ .box_title{
width: 80%; width: 80%;
margin-left: 10%; margin-left: 10%;
...@@ -120,7 +134,7 @@ p{ ...@@ -120,7 +134,7 @@ p{
font-size: 0.3rem; font-size: 0.3rem;
color: #E03234; color: #E03234;
margin-left: 1.91rem; margin-left: 1.91rem;
padding-top: 0.27rem; padding-top: 0.2rem;
} }
.img_bg_p2{ .img_bg_p2{
font-size: 0.14rem; font-size: 0.14rem;
...@@ -135,23 +149,26 @@ p{ ...@@ -135,23 +149,26 @@ p{
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-left: 2.07rem; margin-left: 2.07rem;
margin-top: 0.08rem;
} }
.img_btn p{ .img_btn p{
font-size: 0.14rem; font-size: 0.14rem;
color: #E03234; color: #E03234;
} }
.explain_box{
background: #C72220;
padding: 0.15rem;
}
.explain{ .explain{
width: 90%; width: 100%;
height: 1.1rem;
background: #E03234; background: #E03234;
margin-left: 5%;
overflow: auto; overflow: auto;
} }
.explain p{ .explain p{
font-size: 0.14rem; font-size: 0.12rem;
color: #FFFFFF; color: #FFFFFF;
margin: 0.15rem; margin: 0.15rem;
line-height: 0.2rem;
} }
.img_bg_M .received_img{ .img_bg_M .received_img{
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
<script type="text/javascript" src="../js/autosize2.js"></script> <script type="text/javascript" src="../js/autosize2.js"></script>
<script type="text/javascript" src="../js/jquery-1.10.2.js"></script> <script type="text/javascript" src="../js/jquery-1.10.2.js"></script>
<title>活动</title> <title>11·18活动主会场</title>
</head> </head>
<body> <body>
<div id="box"> <div id="box">
<div class="wx_bg" onclick="hideTips()">
<img src="../images/qsywx.png" alt=""/>
</div>
<div class="box_title"> <div class="box_title">
<img src="../images/G@3x.png" alt="" class="G_img"> <img src="../images/G@3x.png" alt="" class="G_img">
<h5> <h5>
...@@ -120,8 +123,11 @@ ...@@ -120,8 +123,11 @@
</div> </div>
<div class="explain"> <div class="explain_box">
<p></p> <div class="explain">
<p></p>
</div>
</div> </div>
</div> </div>
...@@ -148,34 +154,50 @@ ...@@ -148,34 +154,50 @@
<script type="text/javascript" src="../js/layer/layer.js"></script> <script type="text/javascript" src="../js/layer/layer.js"></script>
<script> <script>
// let href = 'http://activity.oytour.com/html/Appmd/draw.html?customerId=1549&accountId=1182&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NzE5NzA5MDUuMCwiZXhwIjoxNTc0NTYyOTA1LjAsInVzZXJJbmZvIjp7InVpZCI6IjExODIiLCJyZXF1ZXN0RnJvbSI6M319.vlAcXCx4C_0KOmfLm4cLRxU28gTHmuMK6jgJtwjsSPM&secretKey=5d5e16254bd741c486fe2b83b42171d2&platform=App'; // let href = 'http://activity.oytour.com/html/Appmd/draw.html?customerId=1549&accountId=1182&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NzE5NzA5MDUuMCwiZXhwIjoxNTc0NTYyOTA1LjAsInVzZXJJbmZvIjp7InVpZCI6IjExODIiLCJyZXF1ZXN0RnJvbSI6M319.vlAcXCx4C_0KOmfLm4cLRxU28gTHmuMK6jgJtwjsSPM&secretKey=5d5e16254bd741c486fe2b83b42171d2&platform=app';
// let href = window.location.href; let href = window.location.href;
let href='http://127.0.0.1:5500/html/GT_activities.html?customerId=1549&accountId=1182&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NzM0NjY2NjMuMCwiZXhwIjoxNTczNTUzMDYzLjAsInVzZXJJbmZvIjp7InVpZCI6IjExODIiLCJyZXF1ZXN0RnJvbSI6NH19.hX2b2MqSWYmWS0k3YsthxW-T6UxarIm5rdbqCVQtxdQ&secretKey=5d5e16254bd741c486fe2b83b42171d2&platform=App'; // let href='http://127.0.0.1:5500/html/GT_activities.html?customerId=1549&accountId=1182&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NzM0NjY2NjMuMCwiZXhwIjoxNTczNTUzMDYzLjAsInVzZXJJbmZvIjp7InVpZCI6IjExODIiLCJyZXF1ZXN0RnJvbSI6NH19.hX2b2MqSWYmWS0k3YsthxW-T6UxarIm5rdbqCVQtxdQ&secretKey=5d5e16254bd741c486fe2b83b42171d2&platform=app';
let userInfo={};
// 如果进入页面没有登录的参数 处理跳到h5页面登录 let platform = "H5";
if(href.split('?')[1]){ if(localStorage.userInfo){
if(href.split('?')[1].indexOf('customerId') == -1 || href.split('?')[1].indexOf('accountId') == -1 || try{
href.split('?')[1].indexOf('token') == -1||href.split('?')[1].indexOf('secretKey') == -1|| userInfo=JSON.parse(localStorage.userInfo);
href.split('?')[1].indexOf('platform') == -1){ if(!userInfo.customerId){
window.location.href = 'http://activity.oytour.com/html/login.html';
}
}catch (e) {
window.location.href = 'http://activity.oytour.com/html/login.html'; window.location.href = 'http://activity.oytour.com/html/login.html';
} }
} }else{
else{ // 如果进入页面没有登录的参数 处理跳到h5页面登录
window.location.href = 'http://activity.oytour.com/html/login.html'; if(href.split('?')[1]){
if(href.split('?')[1].indexOf('customerId') == -1 || href.split('?')[1].indexOf('accountId') == -1 ||
href.split('?')[1].indexOf('token') == -1||href.split('?')[1].indexOf('secretKey') == -1||
href.split('?')[1].indexOf('platform') == -1){
window.location.href = 'http://activity.oytour.com/html/login.html';
}
}
else{
window.location.href = 'http://activity.oytour.com/html/login.html';
} }
let param = href.split('?')[1].split("&") ? href.split('?')[1].split("&") : null; let param = href.split('?')[1].split("&") ? href.split('?')[1].split("&") : null;
// console.log(href.split('?')[1].split("&").indexOf('customerId')) // console.log(href.split('?')[1].split("&").indexOf('customerId'))
let userInfo ={ userInfo ={
customerId: param[0].split('=')[1], customerId: param[0].split('=')[1],
accountId: param[1].split('=')[1], accountId: param[1].split('=')[1],
token: param[2].split('=')[1], token: param[2].split('=')[1],
secretKey: param[3].split('=')[1], secretKey: param[3].split('=')[1],
}
platform = param[4].split('=')[1] //获取从哪里跳过来的
} }
let platform = param[4].split('=')[1] //获取从哪里跳过来的 var ua = navigator.userAgent.toLowerCase();
if(platform == 'H5' && ua.match(/MicroMessenger/i)!="micromessenger"){
$('.wx_bg').css('display',"block");
}
var end = ''; var end = '';
var currentTime = ''; var currentTime = '';
localStorage.userInfo = JSON.stringify(userInfo) localStorage.userInfo = JSON.stringify(userInfo)
...@@ -414,7 +436,7 @@ ...@@ -414,7 +436,7 @@
// 跳转到我的是优惠券 // 跳转到我的是优惠券
$('.click_use').click(function () { $('.click_use').click(function () {
if(platform == 'App'){ if(platform == 'app'){
let data = { let data = {
'action' : 'jump', // showToast->一个提示信息 showHud->一个黑色的loading 'action' : 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
...@@ -438,6 +460,10 @@ ...@@ -438,6 +460,10 @@
window.location.href = 'http://activity.oytour.com/html/coupons.html'; window.location.href = 'http://activity.oytour.com/html/coupons.html';
} }
}) })
//点击隐藏提示
function hideTips(){
$('.wx_bg').css({'display':'none'})
}
</script> </script>
</body> </body>
......
...@@ -415,7 +415,7 @@ ...@@ -415,7 +415,7 @@
$('.coupons_NavTwo div').click(function(){ $('.coupons_NavTwo div').click(function(){
$(this).addClass('Coupons_active').siblings().removeClass('Coupons_active'); $(this).addClass('Coupons_active').siblings().removeClass('Coupons_active');
}) })
//getAllTicket(0,'',1); getAllTicket(0,'',1);
}) })
function showList(){ function showList(){
$('.coupons_tyList').slideToggle(300); $('.coupons_tyList').slideToggle(300);
......
...@@ -380,12 +380,17 @@ ...@@ -380,12 +380,17 @@
success: function (res) { success: function (res) {
if (res.resultCode === 1) { if (res.resultCode === 1) {
layer.msg(res.message); layer.msg(res.message);
let customerId=res.data.customerId; //存localstorage
let accountId=res.data.accountId; let userInfo ={
let token=res.data.token; customerId: res.data.customerId,
let secretKey=res.data.secretKey; accountId: res.data.accountId,
//window.location.href = 'http://activity.oytour.com/html/GT_activities.html?customerId='+customerId+'&accountId='+accountId+'&token='+token+'&secretKey='+secretKey+'&platform=H5'; token: res.data.token,
window.location.href = 'http://127.0.0.1:5500/html/GT_activities.html?customerId='+customerId+'&accountId='+accountId+'&token='+token+'&secretKey='+secretKey+'&platform=H5'; secretKey: res.data.secretKey,
}
localStorage.userInfo = JSON.stringify(userInfo)
window.location.href = 'http://activity.oytour.com/html/GT_activities.html';
//window.location.href = 'http://127.0.0.1:5500/html/GT_activities.html';
}else{ }else{
layer.msg(res.message); layer.msg(res.message);
} }
......
...@@ -7,7 +7,7 @@ $.fn.dataStatistics = function(options){ ...@@ -7,7 +7,7 @@ $.fn.dataStatistics = function(options){
len:4, //数字是几位数 len:4, //数字是几位数
price:0, //金额 price:0, //金额
couponId:0, //订单id couponId:0, //订单id
platform:'App', platform:'app',
count:0, count:0,
},options || {}); },options || {});
...@@ -216,7 +216,7 @@ $.fn.dataStatistics = function(options){ ...@@ -216,7 +216,7 @@ $.fn.dataStatistics = function(options){
if($('.img_btn p').css('color')=='rgb(224, 50, 52)'){ //判断按钮是否可以点击 if($('.img_btn p').css('color')=='rgb(224, 50, 52)'){ //判断按钮是否可以点击
if( options.count !=0){ //判断是可以抢购 if( options.count !=0){ //判断是可以抢购
if(options.platform == 'App'){ if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showHud', 'message' : '抢购中...'})); window.postMessage(JSON.stringify({'action' : 'showHud', 'message' : '抢购中...'}));
} }
$.ajax({ $.ajax({
...@@ -226,15 +226,11 @@ $.fn.dataStatistics = function(options){ ...@@ -226,15 +226,11 @@ $.fn.dataStatistics = function(options){
data: getJavaData({redemptionPrice:options.price,couponId:options.couponId}), data: getJavaData({redemptionPrice:options.price,couponId:options.couponId}),
async: false, async: false,
success: function (res) { success: function (res) {
if(options.platform == 'App'){ if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'dismissHud'})); window.postMessage(JSON.stringify({'action' : 'dismissHud'}));
} }
if (res.resultCode === 1) { 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的定时器 var timer3 = setInterval(()=>{ //1,需要timer2的定时器走完了 才走timer3的定时器
nownumber = nownumber -1; nownumber = nownumber -1;
...@@ -251,11 +247,11 @@ $.fn.dataStatistics = function(options){ ...@@ -251,11 +247,11 @@ $.fn.dataStatistics = function(options){
'couponId' : res.data.couponId, 'couponId' : res.data.couponId,
'title':title, 'title':title,
'price':res.data.preferPrice, 'price':res.data.preferPrice,
'backKey':'reload', 'backType':'reload',
'data':res.data 'data':res.data
} }
} }
if(options.platform == 'App'){ if(options.platform == 'app'){
window.postMessage(JSON.stringify(data)); window.postMessage(JSON.stringify(data));
} }
// 跳转到支付 // 跳转到支付
...@@ -270,7 +266,7 @@ $.fn.dataStatistics = function(options){ ...@@ -270,7 +266,7 @@ $.fn.dataStatistics = function(options){
window.wx.miniProgram.navigateTo({ window.wx.miniProgram.navigateTo({
url: `/pages/Home/pay/pay?data=`+JSON.stringify(data), url: `/pages/Home/pay/pay?data=`+JSON.stringify(data),
}); });
}); });
} }
else if(options.platform == 'H5'){ else if(options.platform == 'H5'){
let userInfo = getLocalStorage() let userInfo = getLocalStorage()
...@@ -279,23 +275,26 @@ $.fn.dataStatistics = function(options){ ...@@ -279,23 +275,26 @@ $.fn.dataStatistics = function(options){
data.sProductName=title; data.sProductName=title;
data.productId=res.data.couponId; data.productId=res.data.couponId;
data.dTotalPrice=res.data.preferPrice; data.dTotalPrice=res.data.preferPrice;
data.customerId=userInfo.customerId;
window.location.href = 'http://127.0.0.1:5500/html/pay.html?sOrderNo='+data.sOrderNo+'&sProductName='+data.sProductName+'&productId='+data.productId+'&dTotalPrice='+data.dTotalPrice+'&CustomerId='+userInfo.customerId; sessionStorage.setItem("payInfo", JSON.stringify(data));
//window.location.href = 'http://127.0.0.1:5500/html/pay.html';
window.location.href = 'http://http://activity.oytour.com/html/pay.html';
} }
}else { }else {
if(options.platform == 'App'){ if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : res.message})); window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : res.message}));
}else { }else {
layer.msg(res.message) layer.msg(res.message)
} }
window.location.reload() //window.location.reload()
} }
}, },
error: function (res) { error: function (res) {
console.log(options.platform) console.log(options.platform)
if(options.platform == 'App'){ if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'dismissHud'})); window.postMessage(JSON.stringify({'action' : 'dismissHud'}));
}else { }else {
...@@ -304,19 +303,28 @@ $.fn.dataStatistics = function(options){ ...@@ -304,19 +303,28 @@ $.fn.dataStatistics = function(options){
layer.msg(res.message) layer.msg(res.message)
} }
}); });
}else { }else { //跳转到跟团游首页
layer.msg('去使用优惠券') let data = {
'action' : 'jump',
'page' : 'teamWalker_2',
'pageData' : {
'backType':'pop',
}
}
if(options.platform == 'app'){
window.postMessage(JSON.stringify(data));
}
} }
}else { }else {
if($('.img_btn p').text() == '活动结束'){ if($('.img_btn p').text() == '活动结束'){
if(options.platform == 'App'){ if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : '活动已结束'})); window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : '活动已结束'}));
}else { }else {
layer.msg('活动已结束') layer.msg('活动已结束')
} }
}else { }else {
if(options.platform == 'App'){ if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : '活动还未开始'})); window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : '活动还未开始'}));
}else { }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