|
@@ -19,12 +19,14 @@ var $lotterys = $('.lottery-item')
|
|
var $lotteryBtn = $('.btn-lottery')
|
|
var $lotteryBtn = $('.btn-lottery')
|
|
var lotteryTimer, lotteryIndex, lottering = false;
|
|
var lotteryTimer, lotteryIndex, lottering = false;
|
|
|
|
|
|
|
|
+var isH5 = /Android|webOS|iPhone|Windows Phone|iPod|BlackBerry|SymbianOS/i.test(window.navigator.userAgent) && !/[\?&]pc(?:[=&].*|$)/.test(window.location.href)
|
|
|
|
+
|
|
var domain = "http://ka.duowan.com";
|
|
var domain = "http://ka.duowan.com";
|
|
|
|
|
|
var M = {
|
|
var M = {
|
|
getReservedState: function () {
|
|
getReservedState: function () {
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: 'http://kapcdev.webdev2.duowan.com/game/GetZtBook',
|
|
|
|
|
|
+ url: 'http://ka.duowan.com/game/GetZtBook',
|
|
dataType: 'jsonp',
|
|
dataType: 'jsonp',
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
jsonp: 'callback',
|
|
jsonp: 'callback',
|
|
@@ -42,7 +44,7 @@ var M = {
|
|
},
|
|
},
|
|
reservedGame: function () {
|
|
reservedGame: function () {
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: 'http://kapcdev.webdev2.duowan.com/game/ZtBook',
|
|
|
|
|
|
+ url: 'http://ka.duowan.com/game/ZtBook',
|
|
dataType: 'jsonp',
|
|
dataType: 'jsonp',
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
jsonp: 'callback',
|
|
jsonp: 'callback',
|
|
@@ -158,8 +160,7 @@ var M = {
|
|
},
|
|
},
|
|
getCount: function (callback) {
|
|
getCount: function (callback) {
|
|
$.ajax({
|
|
$.ajax({
|
|
- // url: 'http://ka.duowan.com/lottery/count',
|
|
|
|
- url: 'http://kapcdev.webdev2.duowan.com/lottery/count',
|
|
|
|
|
|
+ url: 'http://ka.duowan.com/lottery/count',
|
|
data: { lottery_id: lottery_id },
|
|
data: { lottery_id: lottery_id },
|
|
dataType: 'jsonp',
|
|
dataType: 'jsonp',
|
|
success: function (ret) {
|
|
success: function (ret) {
|
|
@@ -177,8 +178,7 @@ var M = {
|
|
V.startLottery()
|
|
V.startLottery()
|
|
|
|
|
|
$.ajax({
|
|
$.ajax({
|
|
- // url: 'http://ka.duowan.com/lottery/gacha',
|
|
|
|
- url: 'http://kapcdev.webdev2.duowan.com/lottery/gacha',
|
|
|
|
|
|
+ url: 'http://ka.duowan.com/lottery/gacha',
|
|
data: { lottery_id: lottery_id },
|
|
data: { lottery_id: lottery_id },
|
|
dataType: 'jsonp',
|
|
dataType: 'jsonp',
|
|
success: function (ret) {
|
|
success: function (ret) {
|
|
@@ -350,7 +350,7 @@ var V = {
|
|
var d = dialog({
|
|
var d = dialog({
|
|
title: "提示",
|
|
title: "提示",
|
|
content: msg,
|
|
content: msg,
|
|
- skin: "base-ui"
|
|
|
|
|
|
+ skin: "base-ui popup-tips"
|
|
}).showModal();
|
|
}).showModal();
|
|
|
|
|
|
//2秒后自动关闭
|
|
//2秒后自动关闭
|
|
@@ -450,8 +450,8 @@ var C = {
|
|
|
|
|
|
// 弹窗video
|
|
// 弹窗video
|
|
$('body').on('click', '.mod-video .btn-play', function () {
|
|
$('body').on('click', '.mod-video .btn-play', function () {
|
|
- $(this).closest('.mod-video').find('.cover').fadeOut();
|
|
|
|
- $(this).closest('.mod-video').find('.video').fadeIn();
|
|
|
|
|
|
+ $(this).closest('.mod-video').find('.cover').css('display', 'none');
|
|
|
|
+ $(this).closest('.mod-video').find('.video').css('display', 'block');
|
|
})
|
|
})
|
|
|
|
|
|
//弹框绑定微信
|
|
//弹框绑定微信
|
|
@@ -475,19 +475,34 @@ var C = {
|
|
M.reservedGame();
|
|
M.reservedGame();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- dwUDBProxy.kaLogin();
|
|
|
|
|
|
+ if (isH5 || $('body').width() <= 750) {
|
|
|
|
+ dwUDBProxy.login();
|
|
|
|
+ } else {
|
|
|
|
+ dwUDBProxy.kaLogin();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
|
|
// 轮播图
|
|
// 轮播图
|
|
if ($('.swiper-preview').length > 0) {
|
|
if ($('.swiper-preview').length > 0) {
|
|
- new Swiper('.swiper-preview', {
|
|
|
|
|
|
+ var unit = 'px',
|
|
|
|
+ // halfWidth = 654,
|
|
|
|
+ halfWidth = 855,
|
|
|
|
+ previewSwiper = null;
|
|
|
|
+ if(isH5 || $('body').width() <= 750 ) {
|
|
|
|
+ unit = 'rem';
|
|
|
|
+ // halfWidth = 9.08;
|
|
|
|
+ halfWidth = 10.8;
|
|
|
|
+ }
|
|
|
|
+ previewSwiper = new Swiper('.swiper-preview', {
|
|
watchSlidesProgress: true,
|
|
watchSlidesProgress: true,
|
|
slidesPerView: 'auto',
|
|
slidesPerView: 'auto',
|
|
centeredSlides: true,
|
|
centeredSlides: true,
|
|
loop: true,
|
|
loop: true,
|
|
loopedSlides: 5,
|
|
loopedSlides: 5,
|
|
|
|
+ observer: true,
|
|
|
|
+ observeParents: true,
|
|
autoplay: {
|
|
autoplay: {
|
|
disableOnInteraction: false
|
|
disableOnInteraction: false
|
|
},
|
|
},
|
|
@@ -509,7 +524,7 @@ var C = {
|
|
if (Math.abs(slideProgress) > 1) {
|
|
if (Math.abs(slideProgress) > 1) {
|
|
modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
|
|
modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
|
|
}
|
|
}
|
|
- var translate = slideProgress * modify * 654 + 'px';
|
|
|
|
|
|
+ var translate = slideProgress * modify * halfWidth + unit;
|
|
var scale = 1 - Math.abs(slideProgress) / 3;
|
|
var scale = 1 - Math.abs(slideProgress) / 3;
|
|
var zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
var zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
slide.transform('translateX(' + translate + ') scale(' + scale + ')');
|
|
slide.transform('translateX(' + translate + ') scale(' + scale + ')');
|