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,39 +211,45 @@ ...@@ -210,39 +211,45 @@
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>`
} }
$('#demo1').html(str); if (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;
// let href='https://127.0.0.1:5500/html/GT_activities.html?customerId=1549&accountId=1182&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NzM0NjY2NjMuMCwiZXhwIjoxNTczNTUzMDYzLjAsInVzZXJJbmZvIjp7InVpZCI6IjExODIiLCJyZXF1ZXN0RnJvbSI6NH19.hX2b2MqSWYmWS0k3YsthxW-T6UxarIm5rdbqCVQtxdQ&secretKey=5d5e16254bd741c486fe2b83b42171d2&platform=app'; // let href='https://127.0.0.1:5500/html/GT_activities.html?customerId=1549&accountId=1182&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NzM0NjY2NjMuMCwiZXhwIjoxNTczNTUzMDYzLjAsInVzZXJJbmZvIjp7InVpZCI6IjExODIiLCJyZXF1ZXN0RnJvbSI6NH19.hX2b2MqSWYmWS0k3YsthxW-T6UxarIm5rdbqCVQtxdQ&secretKey=5d5e16254bd741c486fe2b83b42171d2&platform=app';
let login = true; //判断是否登录 let login = true; //判断是否登录
let userInfo = {}; let userInfo = {};
...@@ -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
} }
...@@ -316,11 +323,11 @@ ...@@ -316,11 +323,11 @@
var currentTime = ''; var currentTime = '';
localStorage.userInfo = JSON.stringify(userInfo) localStorage.userInfo = JSON.stringify(userInfo)
if (platform == 'app') { if (platform == 'app') {
$('.app_share').css('display', "block"); $('.app_share').css('display', "block");
} }
if(login == false){ if (login == false) {
$('.click_use p').html('立即登录'); $('.click_use p').html('立即登录');
} }
...@@ -336,16 +343,16 @@ ...@@ -336,16 +343,16 @@
success: function(res) { success: function(res) {
if (res.resultCode === 1) { if (res.resultCode === 1) {
getTicketList(res.data.couponId); getTicketList(res.data.couponId);
let num = res.data.repertory; //优惠券总共数量 let num = res.data.repertory; //优惠券总共数量
// let num = 5000; //优惠券总共数量 // let num = 5000; //优惠券总共数量
$('.box_title_2 p').html(res.data.redemptionPrice + '元抢购'); $('.box_title_2 p').html(res.data.redemptionPrice + '元抢购');
$('.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,51 +615,51 @@ ...@@ -608,51 +615,51 @@
// 跳转到我的是优惠券 // 跳转到我的是优惠券
$('.click_use').click(function() { $('.click_use').click(function() {
if(login == true){ if (login == true) {
if (platform == 'app') { if (platform == 'app') {
let data = { let data = {
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading 'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'page': 'mycoupon', 'page': 'mycoupon',
'pageData': { 'pageData': {
}
} }
window.postMessage(JSON.stringify(data));
} }
window.postMessage(JSON.stringify(data)); // 跳转到小程序
} if (platform == 'xcx') {
// 跳转到小程序 wx.miniProgram.getEnv(function(res) {
if (platform == 'xcx') { window.wx.miniProgram.navigateTo({
wx.miniProgram.getEnv(function(res) { url: `/pages/member/Coupon/Coupon`,
window.wx.miniProgram.navigateTo({ });
url: `/pages/member/Coupon/Coupon`,
}); });
}); }
} //跳转到h5优惠券
//跳转到h5优惠券 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 { // 没登录去登录页面登录
window.location.href = 'https://activity.oytour.com/html/login.html'
// window.location.href = './login.html'
} }
}else {// 没登录去登录页面登录
window.location.href = 'https://activity.oytour.com/html/login.html'
// window.location.href = './login.html'
}
}) })
//点击隐藏提示 //点击隐藏提示
// 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,25 +668,25 @@ ...@@ -661,25 +668,25 @@
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',
} }
} }
} }
window.postMessage(JSON.stringify(data)); window.postMessage(JSON.stringify(data));
}) })
</script> </script>
</body> </body>
</html> </html>
\ 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