diff --git a/view/peko/activity/act-kitchen/css/index.css b/view/peko/activity/act-kitchen/css/index.css index 24e8048..7fbfcad 100644 --- a/view/peko/activity/act-kitchen/css/index.css +++ b/view/peko/activity/act-kitchen/css/index.css @@ -40,6 +40,14 @@ html { top: 1.18667rem; } +.header .muciek { + width: 0.8rem; + height: 0.8rem; + position: absolute; + right: 0.1rem; + top: 2.0rem; +} + .header .record_icon { width: 1.57333rem; height: 0.61333rem; diff --git a/view/peko/activity/act-kitchen/css/index.scss b/view/peko/activity/act-kitchen/css/index.scss index dfce7eb..5530e96 100644 --- a/view/peko/activity/act-kitchen/css/index.scss +++ b/view/peko/activity/act-kitchen/css/index.scss @@ -43,6 +43,14 @@ html { top: px2rem(89); } + .muciek { + width: px2rem(60); + height: px2rem(60); + position: absolute; + right: 0.1rem; + top: 2.0rem; + } + .record_icon { width: px2rem(118); height: px2rem(46); diff --git a/view/peko/activity/act-kitchen/images/bo.png b/view/peko/activity/act-kitchen/images/bo.png new file mode 100644 index 0000000..c61764d Binary files /dev/null and b/view/peko/activity/act-kitchen/images/bo.png differ diff --git a/view/peko/activity/act-kitchen/images/jin.png b/view/peko/activity/act-kitchen/images/jin.png new file mode 100644 index 0000000..f25c26a Binary files /dev/null and b/view/peko/activity/act-kitchen/images/jin.png differ diff --git a/view/peko/activity/act-kitchen/index.html b/view/peko/activity/act-kitchen/index.html index d3b1789..40a5ccc 100644 --- a/view/peko/activity/act-kitchen/index.html +++ b/view/peko/activity/act-kitchen/index.html @@ -17,6 +17,7 @@ + @@ -311,6 +312,19 @@ + + + + + + + diff --git a/view/peko/activity/act-kitchen/js/index.js b/view/peko/activity/act-kitchen/js/index.js index a807cba..772efed 100644 --- a/view/peko/activity/act-kitchen/js/index.js +++ b/view/peko/activity/act-kitchen/js/index.js @@ -39,6 +39,9 @@ let type = 1 let pageSize = 20 let page = 1 let pageSizeLack = true; +var audioIf = true; +var backgroundMusic = document.getElementById('backgroundMusic'); +var lotteryMusic = document.getElementById('lotteryMusic'); $(function () { getInfoFromClient() setTimeout(function () { @@ -96,6 +99,9 @@ function getNewestAct () { listItem(roundId); if (startTime <= userComeinTime && userComeinTime < drawStageStartTime) { // 第一階段 + if (audioIf) { + backgroundMusic.play(); + } console.log("第一階段"); countupTimes = Math.floor(((drawStageStartTime - startTime) - (userComeinTime - startTime)) / 1000 + 1); countup(1); @@ -103,6 +109,11 @@ function getNewestAct () { $('.result_popup').hide(); } else if (drawStageStartTime <= userComeinTime && userComeinTime < showResultStageStartTime) { // 第二階段 + backgroundMusic.pause(); + lotteryMusic.currentTime = 0; + lotteryMusic.volume = 100 / 100; + lotteryMusic.play(); + console.log("第二階段"); countupTimes = Math.floor(((showResultStageStartTime - drawStageStartTime) - (userComeinTime - drawStageStartTime)) / 1000 + 1); countup(2); @@ -116,6 +127,10 @@ function getNewestAct () { }, 100); } else if (showResultStageStartTime <= userComeinTime && userComeinTime < endTime) { // 第三階段 + lotteryMusic.pause(); + if (audioIf) { + backgroundMusic.play(); + } console.log("第三階段"); countupTimes = Math.floor(((endTime - showResultStageStartTime) - (userComeinTime - showResultStageStartTime)) / 1000 + 1); countup(3); @@ -300,6 +315,11 @@ function draw (itemId, tais) { $('.box .box_in .sBox').click(function () { var id = $(this).attr('id'); // $(this).children('.qp').show(); + var drawBut = document.getElementById("draw"); + drawBut.pause(); + drawBut.currentTime = 0; // 将当前时间设置为0,可选 + drawBut.play(); + draw(id, $(this)); }) // 去充值按鈕 @@ -491,6 +511,16 @@ $('.shade-mask-fragmentNum .shade-content-fragmentNum .fragmentNum-btn-wrap .con } $('.shade-mask-fragmentNum').hide() }) +$('.muciek').click(function () { + audioIf = !audioIf; + if (audioIf) { + $(this).attr('src', './images/bo.png') + backgroundMusic.play(); + } else { + $(this).attr('src', './images/jin.png') + backgroundMusic.pause(); + } +}) //返回页面 重新请求接口 // var hiddenProperty = 'hidden' in document ? 'hidden' :