Created
November 28, 2016 07:44
-
-
Save jackyshan/4a1ccdc88d40959a20d5676e7ad9a8cf to your computer and use it in GitHub Desktop.
阳淘抽奖大转盘js抽奖
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.setInterval(function(){ | |
$.ajax('/lottery/start',{ | |
dataType:'json', | |
success:function(result){ | |
console.log('success') | |
if(result&&result.code==1){ | |
page3.$data.logid = result.data.id | |
if(result.data.typeid != 2 || result.data.typeid != 3 || result.data.typeid != 4 || result.data.typeid != 8) { | |
return; | |
} | |
clearInterval() | |
switch(result.data.typeid) { | |
case 1: | |
page2.whirl(1, 20, '5元减免券'); | |
break; | |
case 2: | |
page2.whirl(2, 70, '55元减免券'); | |
break; | |
case 3: | |
page2.whirl(3, 110, '8.5折优惠券'); | |
break; | |
case 4: | |
page2.whirl(4, 160, '555元运费券'); | |
break; | |
case 5: | |
page2.whirl(5, 200, '5元运费券'); | |
break; | |
case 6: | |
page2.whirl(6, 250, '15元现金券'); | |
break; | |
case 7: | |
page2.whirl(7, 295, '5元现金券'); | |
break; | |
case 8: | |
page2.whirl(8, 340, '555元免单券'); | |
break; | |
} | |
} | |
} | |
}) | |
},10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment