|
@@ -1,6 +1,8 @@
|
|
var seaLoader = require('seaLoader');
|
|
var seaLoader = require('seaLoader');
|
|
var dialog = require('dialog.js');
|
|
var dialog = require('dialog.js');
|
|
|
|
|
|
|
|
+var Swiper = require('swiper');
|
|
|
|
+
|
|
var codeTpl = __inline("/src/tpl/code.tmpl"); //验证码
|
|
var codeTpl = __inline("/src/tpl/code.tmpl"); //验证码
|
|
var comfirmTpl = __inline("/src/tpl/comfirm.tmpl"); //消耗金币确认框
|
|
var comfirmTpl = __inline("/src/tpl/comfirm.tmpl"); //消耗金币确认框
|
|
var bindWxTpl = __inline("/src/tpl/bindWx.tmpl");//绑定微信弹框
|
|
var bindWxTpl = __inline("/src/tpl/bindWx.tmpl");//绑定微信弹框
|
|
@@ -23,10 +25,10 @@ var M = {
|
|
getReservedState: function () {
|
|
getReservedState: function () {
|
|
$.ajax({
|
|
$.ajax({
|
|
url: 'http://kapcdev.webdev2.duowan.com/game/GetZtBook',
|
|
url: 'http://kapcdev.webdev2.duowan.com/game/GetZtBook',
|
|
- type: 'post',
|
|
|
|
|
|
+ dataType: 'jsonp',
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
|
|
+ jsonp: 'callback',
|
|
success: function (ret) {
|
|
success: function (ret) {
|
|
- console.log(ret);
|
|
|
|
if (ret.result == 1) {
|
|
if (ret.result == 1) {
|
|
var status = ret.data.status;
|
|
var status = ret.data.status;
|
|
if (status == 1) {
|
|
if (status == 1) {
|
|
@@ -41,11 +43,12 @@ var M = {
|
|
reservedGame: function () {
|
|
reservedGame: function () {
|
|
$.ajax({
|
|
$.ajax({
|
|
url: 'http://kapcdev.webdev2.duowan.com/game/ZtBook',
|
|
url: 'http://kapcdev.webdev2.duowan.com/game/ZtBook',
|
|
- type: 'post',
|
|
|
|
|
|
+ dataType: 'jsonp',
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
data: { lottery_id: parseInt(lottery_id) },
|
|
|
|
+ jsonp: 'callback',
|
|
success: function (ret) {
|
|
success: function (ret) {
|
|
- console.log(ret);
|
|
|
|
if (ret.result == 1) {
|
|
if (ret.result == 1) {
|
|
|
|
+ $count.text(1);
|
|
V.showTip('预订成功');
|
|
V.showTip('预订成功');
|
|
} else {
|
|
} else {
|
|
V.showTip(ret.msg);
|
|
V.showTip(ret.msg);
|
|
@@ -155,7 +158,8 @@ var M = {
|
|
},
|
|
},
|
|
getCount: function (callback) {
|
|
getCount: function (callback) {
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: 'http://ka.duowan.com/lottery/count',
|
|
|
|
|
|
+ // url: 'http://ka.duowan.com/lottery/count',
|
|
|
|
+ url: 'http://kapcdev.webdev2.duowan.com/lottery/count',
|
|
data: { lottery_id: lottery_id },
|
|
data: { lottery_id: lottery_id },
|
|
dataType: 'jsonp',
|
|
dataType: 'jsonp',
|
|
success: function (ret) {
|
|
success: function (ret) {
|
|
@@ -173,7 +177,8 @@ var M = {
|
|
V.startLottery()
|
|
V.startLottery()
|
|
|
|
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: 'http://ka.duowan.com/lottery/gacha',
|
|
|
|
|
|
+ // url: 'http://ka.duowan.com/lottery/gacha',
|
|
|
|
+ url: 'http://kapcdev.webdev2.duowan.com/lottery/gacha',
|
|
data: { lottery_id: lottery_id },
|
|
data: { lottery_id: lottery_id },
|
|
dataType: 'jsonp',
|
|
dataType: 'jsonp',
|
|
success: function (ret) {
|
|
success: function (ret) {
|
|
@@ -308,10 +313,10 @@ var V = {
|
|
$lotterys.removeClass('active')
|
|
$lotterys.removeClass('active')
|
|
|
|
|
|
var $current = $lotterys.filter('[data-order=' + lotteryIndex + ']').addClass('active')
|
|
var $current = $lotterys.filter('[data-order=' + lotteryIndex + ']').addClass('active')
|
|
- $lotteryBtn.css({'transform': 'rotate(' + (45 * lotteryIndex + 45) + 'deg)'});
|
|
|
|
-
|
|
|
|
|
|
+ $lotteryBtn.find('.bg').css({'transform': 'rotate(' + (45 * lotteryIndex) + 'deg)'});
|
|
|
|
+
|
|
if (scoreRet && $current.data('score') == scoreRet.gold) {
|
|
if (scoreRet && $current.data('score') == scoreRet.gold) {
|
|
- V.showLottery(scoreRet, $current.children('p').text())
|
|
|
|
|
|
+ V.showLottery(scoreRet, $current.find('p.tip').text())
|
|
$count.text(parseInt($count.text()) - 1)
|
|
$count.text(parseInt($count.text()) - 1)
|
|
lottering = false
|
|
lottering = false
|
|
clearInterval(lotteryTimer)
|
|
clearInterval(lotteryTimer)
|
|
@@ -335,7 +340,6 @@ var V = {
|
|
M.getCount(function (ret) {
|
|
M.getCount(function (ret) {
|
|
$count.text(ret)
|
|
$count.text(ret)
|
|
})
|
|
})
|
|
-
|
|
|
|
},
|
|
},
|
|
showTip: function (msg, timeout) {
|
|
showTip: function (msg, timeout) {
|
|
if (!msg) {
|
|
if (!msg) {
|
|
@@ -445,11 +449,9 @@ var C = {
|
|
|
|
|
|
|
|
|
|
// 弹窗video
|
|
// 弹窗video
|
|
- $('body').on('click', '.mod-primary .btn-play', function () {
|
|
|
|
- $(this).parent().find('.video').fadeIn();
|
|
|
|
- })
|
|
|
|
- $('body').on('click', '.mod-primary .video .icon-close', function () {
|
|
|
|
- $(this).parent().fadeOut();
|
|
|
|
|
|
+ $('body').on('click', '.mod-video .btn-play', function () {
|
|
|
|
+ $(this).closest('.mod-video').find('.cover').fadeOut();
|
|
|
|
+ $(this).closest('.mod-video').find('.video').fadeIn();
|
|
})
|
|
})
|
|
|
|
|
|
//弹框绑定微信
|
|
//弹框绑定微信
|
|
@@ -479,6 +481,54 @@ var C = {
|
|
})
|
|
})
|
|
|
|
|
|
// 轮播图
|
|
// 轮播图
|
|
|
|
+ if ($('.swiper-preview').length > 0) {
|
|
|
|
+ new Swiper('.swiper-preview', {
|
|
|
|
+ watchSlidesProgress: true,
|
|
|
|
+ slidesPerView: 'auto',
|
|
|
|
+ centeredSlides: true,
|
|
|
|
+ loop: true,
|
|
|
|
+ loopedSlides: 5,
|
|
|
|
+ autoplay: {
|
|
|
|
+ disableOnInteraction: false
|
|
|
|
+ },
|
|
|
|
+ navigation: {
|
|
|
|
+ nextEl: '.swiper-button-next',
|
|
|
|
+ prevEl: '.swiper-button-prev',
|
|
|
|
+ },
|
|
|
|
+ pagination: {
|
|
|
|
+ el: '.swiper-pagination',
|
|
|
|
+ bulletActiveClass: 'is-active',
|
|
|
|
+ clickable: true
|
|
|
|
+ },
|
|
|
|
+ on: {
|
|
|
|
+ progress: function(progress) {
|
|
|
|
+ for (i = 0; i < this.slides.length; i++) {
|
|
|
|
+ var slide = this.slides.eq(i);
|
|
|
|
+ var slideProgress = this.slides[i].progress;
|
|
|
|
+ var modify = 1;
|
|
|
|
+ if (Math.abs(slideProgress) > 1) {
|
|
|
|
+ modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
|
|
|
|
+ }
|
|
|
|
+ var translate = slideProgress * modify * 654 + 'px';
|
|
|
|
+ var scale = 1 - Math.abs(slideProgress) / 3;
|
|
|
|
+ var zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
|
|
+ slide.transform('translateX(' + translate + ') scale(' + scale + ')');
|
|
|
|
+ slide.css('zIndex', zIndex);
|
|
|
|
+ slide.css('opacity', 1);
|
|
|
|
+ if (Math.abs(slideProgress) > 3) {
|
|
|
|
+ slide.css('opacity', 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ setTransition: function(transition) {
|
|
|
|
+ for (var i = 0; i < this.slides.length; i++) {
|
|
|
|
+ var slide = this.slides.eq(i)
|
|
|
|
+ slide.transition(transition);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
//复制
|
|
//复制
|
|
if (window.clipboardData) {
|
|
if (window.clipboardData) {
|