|
@@ -19,12 +19,14 @@ var $lotterys = $('.lottery-item')
|
|
|
var $lotteryBtn = $('.btn-lottery')
|
|
|
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 M = {
|
|
|
getReservedState: function () {
|
|
|
$.ajax({
|
|
|
- url: 'http://kapcdev.webdev2.duowan.com/game/GetZtBook',
|
|
|
+ url: 'http://ka.duowan.com/game/GetZtBook',
|
|
|
dataType: 'jsonp',
|
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
|
jsonp: 'callback',
|
|
@@ -42,7 +44,7 @@ var M = {
|
|
|
},
|
|
|
reservedGame: function () {
|
|
|
$.ajax({
|
|
|
- url: 'http://kapcdev.webdev2.duowan.com/game/ZtBook',
|
|
|
+ url: 'http://ka.duowan.com/game/ZtBook',
|
|
|
dataType: 'jsonp',
|
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
|
jsonp: 'callback',
|
|
@@ -158,8 +160,7 @@ var M = {
|
|
|
},
|
|
|
getCount: function (callback) {
|
|
|
$.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 },
|
|
|
dataType: 'jsonp',
|
|
|
success: function (ret) {
|
|
@@ -177,8 +178,7 @@ var M = {
|
|
|
V.startLottery()
|
|
|
|
|
|
$.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 },
|
|
|
dataType: 'jsonp',
|
|
|
success: function (ret) {
|
|
@@ -350,7 +350,7 @@ var V = {
|
|
|
var d = dialog({
|
|
|
title: "提示",
|
|
|
content: msg,
|
|
|
- skin: "base-ui"
|
|
|
+ skin: "base-ui popup-tips"
|
|
|
}).showModal();
|
|
|
|
|
|
//2秒后自动关闭
|
|
@@ -450,8 +450,8 @@ var C = {
|
|
|
|
|
|
// 弹窗video
|
|
|
$('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();
|
|
|
}
|
|
|
} else {
|
|
|
- dwUDBProxy.kaLogin();
|
|
|
+ if (isH5 || $('body').width() <= 750) {
|
|
|
+ dwUDBProxy.login();
|
|
|
+ } else {
|
|
|
+ dwUDBProxy.kaLogin();
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
|
|
|
// 轮播图
|
|
|
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,
|
|
|
slidesPerView: 'auto',
|
|
|
centeredSlides: true,
|
|
|
loop: true,
|
|
|
loopedSlides: 5,
|
|
|
+ observer: true,
|
|
|
+ observeParents: true,
|
|
|
autoplay: {
|
|
|
disableOnInteraction: false
|
|
|
},
|
|
@@ -509,7 +524,7 @@ var C = {
|
|
|
if (Math.abs(slideProgress) > 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 zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
|
slide.transform('translateX(' + translate + ') scale(' + scale + ')');
|