' + message + '
' + ' ' + '/** * */ function trunTableInit() { // 0:未领取,1:领取中,2:已领取 var draw = 0; function drawPrize() { var data = [0, 1, 2, 3, 4, 5, 6, 7]; data = data[Math.floor(Math.random() * data.length)]; var time = 0; switch (data) { case 1: rotateFunc(1, 45, '1元话费'); break; case 2: rotateFunc(2, 90, '9元话费'); break; case 3: rotateFunc(3, 135, '优酷会员'); break; case 4: rotateFunc(4, 180, '爱奇艺会员'); break; case 5: rotateFunc(5, 225, '微博会员月卡'); break; case 6: rotateFunc(6, 270, '花筑旅行580元优惠券'); break; case 7: rotateFunc(7, 315, '货拉拉立减券'); break; default: rotateFunc(0, 0, '100元话费'); } } function drawPrize2() { $.post(getRootPath() + "-s1api" + "/prizewheel/drawPrize", {"fog": ""}, function (result, status) { //console.log(result) var prizes = { 'A001': {'prizeId': 'A001', 'angle': 0, 'prizeName': '100元话费'}, 'A002': {'prizeId': 'A002', 'angle': 45, 'prizeName': '1元话费'}, 'A003': {'prizeId': 'A003', 'angle': 90, 'prizeName': '9元话费'}, 'A004': {'prizeId': 'A004', 'angle': 135, 'prizeName': '优酷会员'}, 'A005': {'prizeId': 'A005', 'angle': 180, 'prizeName': '爱奇艺会员'}, 'A006': {'prizeId': 'A006', 'angle': 225, 'prizeName': '微博会员月卡'}, 'A007': {'prizeId': 'A007', 'angle': 270, 'prizeName': '花筑旅行580元优惠券'}, 'A008': {'prizeId': 'A008', 'angle': 315, 'prizeName': '货拉拉立减券(最高20元)'}, }; var data = prizes[result.data.prize_id]; rotateFunc(data.prizeId, data.angle, data.prizeName); }) } // 抽奖背景闪动 setInterval(function () { $('#rotate-bg').toggleClass('rotate-bg-two'); }, 1000); // awards:奖项,angle:奖项对应的角度 var rotateFunc = function (awards, angle, text, type) { $('#lotteryBtn').stopRotate(); $("#lotteryBtn").rotate({ angle: 0, duration: 5000, animateTo: angle + 1440 + 22, // angle是图片上各奖项对应的角度,1440是我要让指针旋转4圈。所以最后的结束的角度就是这样子^^ callback: function () { // $("#tip_text").html(text); // $('#my_popbg').show(); draw = 2; } }); }; // (抽奖)按钮事件 $("#lotteryBtn").rotate({ bind: { click: function () { if (draw == 1) { return; } draw = 1; var rotation = function () { $("#lotteryBtn").rotate({ angle: 0, animateTo: 360, duration: 5000, callback: rotation }); }; rotation(); drawPrize2();// 开发人员参数:停止位置 } } }); /* ———————————————— 版权声明:本文为CSDN博主「赤砂之蝎我爱罗」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/xb12369/article/details/46416845 */ function getRootPath() { //获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp var curWwwPath = window.document.location.href; //获取主机地址之后的目录,如: uimcardprj/share/meun.jsp var pathName = window.document.location.pathname; var pos = curWwwPath.indexOf(pathName); //获取主机地址,如: http://localhost:8083 var localhostPaht = curWwwPath.substring(0, pos); //获取带"/"的项目名,如:/uimcardprj var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1); return (localhostPaht + projectName); } } function showBingoDialog(message) { var $dialog = $( '
' + message + '
' + ' ' + '