Commit 026cdfdc authored by 罗超's avatar 罗超

修复气泡

parent efddeeb9
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
...@@ -176,33 +176,34 @@ ...@@ -176,33 +176,34 @@
<script type="text/javascript" src="../js/yql.js"></script> <script type="text/javascript" src="../js/yql.js"></script>
<script> <script>
//横向滚动--> //横向滚动-->
var demo = document.getElementById("demo"); var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1"); var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2"); var demo2 = document.getElementById("demo2");
var lastRequestTime=null; var myvar = null;
var lastRequestTime = null;
demo2.innerHTML = document.getElementById("demo1").innerHTML; demo2.innerHTML = document.getElementById("demo1").innerHTML;
function Marquee() { function Marquee() {
if (demo.scrollLeft - demo2.offsetWidth >= 100) { if (demo.scrollLeft - demo2.offsetWidth >= 0) {
//demo.scrollLeft -= demo1.offsetWidth; demo.style.display = "none";
clearInterval(myvar); clearInterval(myvar);
} else { } else {
demo.scrollLeft++; demo.scrollLeft++;
} }
} }
var myvar = setInterval(Marquee, 25);
function getTicketList(couponId){
let minTimer=1*60*1000; function getTicketList(couponId) {
let maxTimer=5*60*1000; let minTimer = 1 * 60 * 1000;
let maxTimer = 5 * 60 * 1000;
let selectTime = -1; let selectTime = -1;
if(this.lastRequestTime){ if (this.lastRequestTime) {
selectTime=this.lastRequestTime; selectTime = this.lastRequestTime;
} }
let msg={ let msg = {
selectTime:selectTime, selectTime: selectTime,
CouponId:couponId CouponId: couponId
} }
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -210,36 +211,42 @@ ...@@ -210,36 +211,42 @@
contentType: "application/json", contentType: "application/json",
data: getAjaxData("sellorder_get_GetCounponOrderRedis", msg), data: getAjaxData("sellorder_get_GetCounponOrderRedis", msg),
async: false, async: false,
success: function (res) { success: function(res) {
if (res.resultCode === 1) { if (res.resultCode === 1) {
let dataList=res.data; let dataList = res.data;
let CountLen=dataList.length; let CountLen = dataList.length;
var TotalSecond=CountLen*8*1000; var TotalSecond = CountLen * 8 * 1000;
if(TotalSecond>maxTimer){ if (TotalSecond > maxTimer) {
TotalSecond=maxTimer; TotalSecond = maxTimer;
}else if(TotalSecond<minTimer){ } else if (TotalSecond < minTimer) {
TotalSecond=minTimer; TotalSecond = minTimer;
} }
var str='' var str = ''
for(var i=0;i<dataList.length;i++){ for (var i = 0; i < dataList.length; i++) {
str+=`<a href="#"> str += `<a href="#">
<img src="${dataList[i].customerPhoto}"/> <img src="${dataList[i].customerPhoto}"/>
${dataList[i].customerName}抢到了优惠券 ${dataList[i].customerName}抢到了优惠券
</a>` </a>`
} }
if (str != '') {
$('#demo1').html(str); $('#demo1').html(str);
demo.style.display = "block";
demo.scrollLeft -= demo1.offsetWidth;
myvar = setInterval(Marquee, 25);
console.log(demo.scrollLeft)
}
setTimeout(() => { setTimeout(() => {
getTicketList(couponId); getTicketList(couponId);
}, TotalSecond); }, TotalSecond);
} }
}, },
error: function (res) { error: function(res) {
} }
}) })
var date = new Date(); var date = new Date();
var d = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " +date.getHours()+ ":" + date.getMinutes()+":"+date.getSeconds(); var d = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
this.lastRequestTime=d this.lastRequestTime = d
} }
let href = window.location.href; let href = window.location.href;
...@@ -252,19 +259,19 @@ ...@@ -252,19 +259,19 @@
userInfo = JSON.parse(localStorage.u); userInfo = JSON.parse(localStorage.u);
if (!userInfo.customerId) { if (!userInfo.customerId) {
userInfo = { userInfo = {
token:'token', token: 'token',
accountId:'-1' accountId: '-1'
} }
login=false login = false
// window.location.href = 'https://activity.oytour.com/html/login.html'; // window.location.href = 'https://activity.oytour.com/html/login.html';
} }
} catch (e) { } catch (e) {
userInfo = { userInfo = {
token:'token', token: 'token',
accountId:'-1' accountId: '-1'
} }
// window.location.href = 'https://activity.oytour.com/html/login.html'; // window.location.href = 'https://activity.oytour.com/html/login.html';
login=false login = false
} }
} else { } else {
...@@ -277,15 +284,15 @@ ...@@ -277,15 +284,15 @@
href.split('?')[1].indexOf('platform') == -1) { href.split('?')[1].indexOf('platform') == -1) {
// window.location.href = 'https://activity.oytour.com/html/login.html'; // window.location.href = 'https://activity.oytour.com/html/login.html';
userInfo = { userInfo = {
token:'token', token: 'token',
accountId:'-1' accountId: '-1'
} }
login=false login = false
}else { } else {
let param = href.split('?')[1].split("&") ? href.split('?')[1].split("&") : null; let param = href.split('?')[1].split("&") ? href.split('?')[1].split("&") : null;
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]
} }
...@@ -295,10 +302,10 @@ ...@@ -295,10 +302,10 @@
} else { } else {
// window.location.href = 'https://activity.oytour.com/html/login.html'; // window.location.href = 'https://activity.oytour.com/html/login.html';
userInfo = { userInfo = {
token:'token', token: 'token',
accountId:'-1' accountId: '-1'
} }
login=false login = false
} }
...@@ -320,7 +327,7 @@ ...@@ -320,7 +327,7 @@
$('.app_share').css('display', "block"); $('.app_share').css('display', "block");
} }
if(login == false){ if (login == false) {
$('.click_use p').html('立即登录'); $('.click_use p').html('立即登录');
} }
...@@ -343,9 +350,9 @@ ...@@ -343,9 +350,9 @@
$('.box_title h5').html(res.data.remark); $('.box_title h5').html(res.data.remark);
$('.explain p').html('使用说明' + '<br/>' + res.data.instructions); $('.explain p').html('使用说明' + '<br/>' + res.data.instructions);
if(login == false){ if (login == false) {
$('.use_o').html('暂无登录'); $('.use_o').html('暂无登录');
}else { } else {
$('.use_o').html(res.data.contact); $('.use_o').html(res.data.contact);
} }
...@@ -359,7 +366,7 @@ ...@@ -359,7 +366,7 @@
price: res.data.redemptionPrice, price: res.data.redemptionPrice,
couponId: res.data.couponId, couponId: res.data.couponId,
platform: platform, platform: platform,
login:login, login: login,
count: res.data.count, //判断是否可以抢购 0为不可以 count: res.data.count, //判断是否可以抢购 0为不可以
}); //刚进入页面不执行动画 }); //刚进入页面不执行动画
...@@ -470,7 +477,7 @@ ...@@ -470,7 +477,7 @@
let title = $('.img_bg_p1').text() let title = $('.img_bg_p1').text()
let RushbuyTime = { let RushbuyTime = {
RushbuyTime: expirationDate, RushbuyTime: expirationDate,
title:title, title: title,
} }
localStorage.RushbuyTime = JSON.stringify(RushbuyTime) localStorage.RushbuyTime = JSON.stringify(RushbuyTime)
$('.img_bg_p2').html('有效期截止:' + expirationDate) $('.img_bg_p2').html('有效期截止:' + expirationDate)
...@@ -608,7 +615,7 @@ ...@@ -608,7 +615,7 @@
// 跳转到我的是优惠券 // 跳转到我的是优惠券
$('.click_use').click(function() { $('.click_use').click(function() {
if(login == true){ if (login == true) {
if (platform == 'app') { if (platform == 'app') {
let data = { let data = {
...@@ -632,7 +639,7 @@ ...@@ -632,7 +639,7 @@
if (platform == 'H5') { if (platform == 'H5') {
window.location.href = 'https://activity.oytour.com/html/coupons.html'; window.location.href = 'https://activity.oytour.com/html/coupons.html';
} }
}else {// 没登录去登录页面登录 } else { // 没登录去登录页面登录
window.location.href = 'https://activity.oytour.com/html/login.html' window.location.href = 'https://activity.oytour.com/html/login.html'
// window.location.href = './login.html' // window.location.href = './login.html'
} }
...@@ -642,17 +649,17 @@ ...@@ -642,17 +649,17 @@
// function hideTips(){ // function hideTips(){
// $('.wx_bg').css({'display':'none'}) // $('.wx_bg').css({'display':'none'})
// } // }
$('.app_share_hy').click(function () { //在app里分享微信好友 $('.app_share_hy').click(function() { //在app里分享微信好友
let data = { let data = {
'action' : 'share', 'action': 'share',
'shareData' : { 'shareData': {
shareType : '0', shareType: '0',
params : { params: {
type: 'news', type: 'news',
title: '印象之旅11.18同业回馈日', title: '印象之旅11.18同业回馈日',
description: '印象之旅11.18同业回馈日', description: '印象之旅11.18同业回馈日',
webpageUrl: 'https://activity.oytour.com/html/GT_activities.html', webpageUrl: 'https://activity.oytour.com/html/GT_activities.html',
thumbImage : 'http://imgfile.oytour.com/Static/app1118.png', thumbImage: 'http://imgfile.oytour.com/Static/app1118.png',
} }
} }
...@@ -661,17 +668,17 @@ ...@@ -661,17 +668,17 @@
window.postMessage(JSON.stringify(data)); window.postMessage(JSON.stringify(data));
}) })
$('.app_share_pyq').click(function () { //在app里分享微信朋友圈 $('.app_share_pyq').click(function() { //在app里分享微信朋友圈
let data = { let data = {
'action' : 'share', 'action': 'share',
'shareData' : { 'shareData': {
shareType : '1', shareType: '1',
params : { params: {
type: 'news', type: 'news',
title: '印象之旅11.18同业回馈日', title: '印象之旅11.18同业回馈日',
description: '印象之旅11.18同业回馈日', description: '印象之旅11.18同业回馈日',
webpageUrl: 'https://activity.oytour.com/html/GT_activities.html', webpageUrl: 'https://activity.oytour.com/html/GT_activities.html',
thumbImage : 'http://imgfile.oytour.com/Static/app1118.png', thumbImage: 'http://imgfile.oytour.com/Static/app1118.png',
} }
} }
......
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