Commit 9e64c2ca authored by 黄媛媛's avatar 黄媛媛
parents 39aa226d 68195447
......@@ -21,6 +21,20 @@ p{
padding-top: 0.7rem;
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{
width: 80%;
margin-left: 10%;
......@@ -120,7 +134,7 @@ p{
font-size: 0.3rem;
color: #E03234;
margin-left: 1.91rem;
padding-top: 0.27rem;
padding-top: 0.2rem;
}
.img_bg_p2{
font-size: 0.14rem;
......@@ -135,23 +149,26 @@ p{
align-items: center;
justify-content: center;
margin-left: 2.07rem;
margin-top: 0.08rem;
}
.img_btn p{
font-size: 0.14rem;
color: #E03234;
}
.explain_box{
background: #C72220;
padding: 0.15rem;
}
.explain{
width: 90%;
height: 1.1rem;
width: 100%;
background: #E03234;
margin-left: 5%;
overflow: auto;
}
.explain p{
font-size: 0.14rem;
font-size: 0.12rem;
color: #FFFFFF;
margin: 0.15rem;
line-height: 0.2rem;
}
.img_bg_M .received_img{
......
......@@ -16,11 +16,14 @@
<script type="text/javascript" src="../js/autosize2.js"></script>
<script type="text/javascript" src="../js/jquery-1.10.2.js"></script>
<title>活动</title>
<title>11·18活动主会场</title>
</head>
<body>
<div id="box">
<div class="wx_bg" onclick="hideTips()">
<img src="../images/qsywx.png" alt=""/>
</div>
<div class="box_title">
<img src="../images/G@3x.png" alt="" class="G_img">
<h5>
......@@ -120,8 +123,11 @@
</div>
<div class="explain">
<p></p>
<div class="explain_box">
<div class="explain">
<p></p>
</div>
</div>
</div>
......@@ -148,34 +154,50 @@
<script type="text/javascript" src="../js/layer/layer.js"></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 = 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';
// 如果进入页面没有登录的参数 处理跳到h5页面登录
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){
// 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='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={};
let platform = "H5";
if(localStorage.userInfo){
try{
userInfo=JSON.parse(localStorage.userInfo);
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';
}
}
else{
window.location.href = 'http://activity.oytour.com/html/login.html';
}else{
// 如果进入页面没有登录的参数 处理跳到h5页面登录
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'))
let userInfo ={
customerId: param[0].split('=')[1],
accountId: param[1].split('=')[1],
token: param[2].split('=')[1],
secretKey: param[3].split('=')[1],
// console.log(href.split('?')[1].split("&").indexOf('customerId'))
userInfo ={
customerId: param[0].split('=')[1],
accountId: param[1].split('=')[1],
token: param[2].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 currentTime = '';
localStorage.userInfo = JSON.stringify(userInfo)
......@@ -414,7 +436,7 @@
// 跳转到我的是优惠券
$('.click_use').click(function () {
if(platform == 'App'){
if(platform == 'app'){
let data = {
'action' : 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
......@@ -438,6 +460,10 @@
window.location.href = 'http://activity.oytour.com/html/coupons.html';
}
})
//点击隐藏提示
function hideTips(){
$('.wx_bg').css({'display':'none'})
}
</script>
</body>
......
......@@ -415,7 +415,7 @@
$('.coupons_NavTwo div').click(function(){
$(this).addClass('Coupons_active').siblings().removeClass('Coupons_active');
})
//getAllTicket(0,'',1);
getAllTicket(0,'',1);
})
function showList(){
$('.coupons_tyList').slideToggle(300);
......
......@@ -380,12 +380,17 @@
success: function (res) {
if (res.resultCode === 1) {
layer.msg(res.message);
let customerId=res.data.customerId;
let accountId=res.data.accountId;
let token=res.data.token;
let secretKey=res.data.secretKey;
//window.location.href = 'http://activity.oytour.com/html/GT_activities.html?customerId='+customerId+'&accountId='+accountId+'&token='+token+'&secretKey='+secretKey+'&platform=H5';
window.location.href = 'http://127.0.0.1:5500/html/GT_activities.html?customerId='+customerId+'&accountId='+accountId+'&token='+token+'&secretKey='+secretKey+'&platform=H5';
//存localstorage
let userInfo ={
customerId: res.data.customerId,
accountId: res.data.accountId,
token: res.data.token,
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{
layer.msg(res.message);
}
......
......@@ -7,7 +7,7 @@ $.fn.dataStatistics = function(options){
len:4, //数字是几位数
price:0, //金额
couponId:0, //订单id
platform:'App',
platform:'app',
count:0,
},options || {});
......@@ -216,7 +216,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({
......@@ -226,15 +226,11 @@ $.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;
......@@ -251,11 +247,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));
}
// 跳转到支付
......@@ -270,7 +266,7 @@ $.fn.dataStatistics = function(options){
window.wx.miniProgram.navigateTo({
url: `/pages/Home/pay/pay?data=`+JSON.stringify(data),
});
});
});
}
else if(options.platform == 'H5'){
let userInfo = getLocalStorage()
......@@ -279,23 +275,26 @@ $.fn.dataStatistics = function(options){
data.sProductName=title;
data.productId=res.data.couponId;
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 {
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'showToast', 'message' : res.message}));
}else {
layer.msg(res.message)
}
window.location.reload()
//window.location.reload()
}
},
error: function (res) {
console.log(options.platform)
if(options.platform == 'App'){
if(options.platform == 'app'){
window.postMessage(JSON.stringify({'action' : 'dismissHud'}));
}else {
......@@ -304,19 +303,28 @@ $.fn.dataStatistics = function(options){
layer.msg(res.message)
}
});
}else {
layer.msg('去使用优惠券')
}else { //跳转到跟团游首页
let data = {
'action' : 'jump',
'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