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,39 +211,45 @@
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;
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="#">
var str = ''
for (var i = 0; i < dataList.length; i++) {
str += `<a href="#">
<img src="${dataList[i].customerPhoto}"/>
${dataList[i].customerName}抢到了优惠券
</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(() => {
getTicketList(couponId);
}, TotalSecond);
}, 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;
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 login = true; //判断是否登录
let userInfo = {};
......@@ -252,19 +259,19 @@
userInfo = JSON.parse(localStorage.u);
if (!userInfo.customerId) {
userInfo = {
token:'token',
accountId:'-1'
token: 'token',
accountId: '-1'
}
login=false
// window.location.href = 'https://activity.oytour.com/html/login.html';
login = false
// window.location.href = 'https://activity.oytour.com/html/login.html';
}
} catch (e) {
userInfo = {
token:'token',
accountId:'-1'
}
// window.location.href = 'https://activity.oytour.com/html/login.html';
login=false
token: 'token',
accountId: '-1'
}
// window.location.href = 'https://activity.oytour.com/html/login.html';
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
}
......@@ -316,11 +323,11 @@
var currentTime = '';
localStorage.userInfo = JSON.stringify(userInfo)
if (platform == 'app') {
$('.app_share').css('display', "block");
if (platform == 'app') {
$('.app_share').css('display', "block");
}
if(login == false){
}
if (login == false) {
$('.click_use p').html('立即登录');
}
......@@ -336,16 +343,16 @@
success: function(res) {
if (res.resultCode === 1) {
getTicketList(res.data.couponId);
let num = res.data.repertory; //优惠券总共数量
// let num = 5000; //优惠券总共数量
$('.box_title_2 p').html(res.data.redemptionPrice + '元抢购');
$('.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,51 +615,51 @@
// 跳转到我的是优惠券
$('.click_use').click(function() {
if(login == true){
if (platform == 'app') {
let data = {
if (login == true) {
if (platform == 'app') {
let data = {
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'page': 'mycoupon',
'pageData': {
'action': 'jump', // showToast->一个提示信息 showHud->一个黑色的loading
'page': 'mycoupon',
'pageData': {
}
}
window.postMessage(JSON.stringify(data));
}
window.postMessage(JSON.stringify(data));
}
// 跳转到小程序
if (platform == 'xcx') {
wx.miniProgram.getEnv(function(res) {
window.wx.miniProgram.navigateTo({
url: `/pages/member/Coupon/Coupon`,
// 跳转到小程序
if (platform == 'xcx') {
wx.miniProgram.getEnv(function(res) {
window.wx.miniProgram.navigateTo({
url: `/pages/member/Coupon/Coupon`,
});
});
});
}
//跳转到h5优惠券
if (platform == 'H5') {
window.location.href = 'https://activity.oytour.com/html/coupons.html';
}
//跳转到h5优惠券
if (platform == 'H5') {
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(){
// $('.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,25 +668,25 @@
window.postMessage(JSON.stringify(data));
})
$('.app_share_pyq').click(function () { //在app里分享微信朋友圈
let data = {
'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',
}
}
}
window.postMessage(JSON.stringify(data));
})
$('.app_share_pyq').click(function() { //在app里分享微信朋友圈
let data = {
'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',
}
}
}
window.postMessage(JSON.stringify(data));
})
</script>
</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