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

修复气泡

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