zhashaonan 6 lat temu
rodzic
commit
a24863f619

+ 35 - 11
data/resource/mobile/festival/newYear/css/style.css

@@ -67,6 +67,30 @@ img {
     width: 1px;
     background: #f6d8b4;
 }
+.rotate {
+    -webkit-animation: rotate 5s linear infinite;
+}
+@-webkit-keyframes rotate {
+    from {
+        -webkit-transform: rotateZ(0);
+    }
+    to {
+        -webkit-transform: rotateZ(360deg);
+    }
+}
+
+
+.audio_handle {
+    position: absolute;
+    width: 60px;
+    height: 60px;
+    right: 20px;
+    top: 20px;
+    background: url(../image/audio_icon.png) no-repeat;
+    background-size: 100%;
+    z-index: 1000;
+    cursor: pointer;
+}
 .loading_page {
     position: absolute;
     top: 0;
@@ -447,7 +471,7 @@ img {
 }
 .toucai .wish3 {
     width: 142px;
-    height: 300px;
+    height: 272px;
     background: url(../image/page3/toucai/content3.png) no-repeat;
     background-size: 100% 100%;
 }
@@ -463,18 +487,18 @@ img {
 }
 .ruyi .wish1 {
     width: 150px;
-    height: 165px;
+    height: 186px;
     background: url(../image/page3/ruyi/content1.png) no-repeat;
     background-size: 100% 100%;
 }
 .ruyi .wish2 {
     width: 152px;
-    height: 300px;
+    height: 182px;
     background: url(../image/page3/ruyi/content2.png) no-repeat;
     background-size: 100% 100%;
 }
 .ruyi .wish3 {
-    width: 184px;
+    width: 142px;
     height: 272px;
     background: url(../image/page3/ruyi/content3.png) no-repeat;
     background-size: 100% 100%;
@@ -491,13 +515,13 @@ img {
 }
 .daxi .wish1 {
     width: 150px;
-    height: 186px;
+    height: 270px;
     background: url(../image/page3/daxi/content1.png) no-repeat;
     background-size: 100% 100%;
 }
 .daxi .wish2 {
     width: 152px;
-    height: 162px;
+    height: 204px;
     background: url(../image/page3/daxi/content2.png) no-repeat;
     background-size: 100% 100%;
 }
@@ -525,13 +549,13 @@ img {
 }
 .shangji .wish2 {
     width: 152px;
-    height: 194px;
+    height: 300px;
     background: url(../image/page3/shangji/content2.png) no-repeat;
     background-size: 100% 100%;
 }
 .shangji .wish3 {
     width: 142px;
-    height: 210px;
+    height: 330px;
     background: url(../image/page3/shangji/content3.png) no-repeat;
     background-size: 100% 100%;
 }
@@ -547,7 +571,7 @@ img {
 }
 .daji .wish1 {
     width: 150px;
-    height: 240px;
+    height: 362px;
     background: url(../image/page3/daji/content1.png) no-repeat;
     background-size: 100% 100%;
 }
@@ -566,11 +590,11 @@ img {
 
 /*上上*/
 .shangshang .text-bg1 {
-    background: url(../image/page3/da.png) no-repeat;
+    background: url(../image/page3/shang.png) no-repeat;
     background-size: 100% 100%;
 }
 .shangshang .text-bg2 {
-    background: url(../image/page3/ji.png) no-repeat;
+    background: url(../image/page3/shang.png) no-repeat;
     background-size: 100% 100%;
 }
 .shangshang .wish1 {

BIN
data/resource/mobile/festival/newYear/image/audio_icon.png


BIN
data/resource/mobile/festival/newYear/image/page2/qian.gif


BIN
data/resource/mobile/festival/newYear/image/page3/daji/content1.png


BIN
data/resource/mobile/festival/newYear/image/page3/daxi/content1.png


BIN
data/resource/mobile/festival/newYear/image/page3/daxi/content2.png


BIN
data/resource/mobile/festival/newYear/image/page3/ruyi/content1.png


BIN
data/resource/mobile/festival/newYear/image/page3/ruyi/content2.png


BIN
data/resource/mobile/festival/newYear/image/page3/ruyi/content3.png


BIN
data/resource/mobile/festival/newYear/image/page3/shangji/content2.png


BIN
data/resource/mobile/festival/newYear/image/page3/shangji/content3.png


BIN
data/resource/mobile/festival/newYear/image/page3/toucai/content2.png


BIN
data/resource/mobile/festival/newYear/image/page3/toucai/content3.png


+ 18 - 1
data/resource/mobile/festival/newYear/js/newYear.js

@@ -5,6 +5,8 @@ function Page(url,from_app, member_id, bridge, loadImages) {
     this.bridge = bridge;
     this.myslider = null;
     this.loadImages = loadImages;
+    this.soundEffect = $('.sound-effect')[0];
+    this.soundWish = $('.sound-wish')[0];
     this.nickname = '';
     this.bestWish = 0;
     this.result = ['none','toucai','ruyi','daxi','shangji','daji','shangshang', 'other1', 'other2']
@@ -49,7 +51,7 @@ Page.prototype = {
             item: '.item',
             lastLocate: false,
             noslide: [0, 1, 2],
-            // index: 1,
+            // index: 2,
             loadingImgs: self.loadImages,
             onloading: function (data) {
                var loadImg = self.loadImages.length;
@@ -115,6 +117,7 @@ Page.prototype = {
     pageOneStart: function () {
         var self = this;
         $('.page1').on('click','.btn', function () {
+            self.clickSound();
             if (self.fromApp) {
                 self.appInit();
             }
@@ -125,7 +128,10 @@ Page.prototype = {
     },
     pageTwoStart: function () {
         var self = this;
+        self.wishSoundPlay();
         $('.page2 .btn').on('click', function () {
+            self.clickSound();
+            self.wishSoundPause();
             if (!self.bestWish) {
                 self.bestWish = self.randomResult();
                 self.resultAjax(self.bestWish);
@@ -152,6 +158,7 @@ Page.prototype = {
             location.href = 'https://a.lrlz.com/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=44261545875786320384'
         });
         $('.page3 .btn').on('click', function () {
+            self.clickSound();
             self.bonusUp();
         });
     },
@@ -188,6 +195,16 @@ Page.prototype = {
                 alert('网络错误!');
             }
         });
+    },
+    clickSound: function () {
+        this.soundEffect.play();
+        this.soundEffect.currentTime = 0;
+    },
+    wishSoundPlay: function () {
+        this.soundWish.play();
+    },
+    wishSoundPause: function () {
+        this.soundWish.pause();
     }
 
 }

BIN
data/resource/mobile/festival/newYear/mp3/bg.mp3


BIN
data/resource/mobile/festival/newYear/mp3/click.mp3


BIN
data/resource/mobile/festival/newYear/mp3/wish.mp3


+ 2 - 2
mobile/control/control.php

@@ -331,9 +331,9 @@ class mbMemberControl extends mobileControl
 
 function bonus_version()
 {
-    return "v=2018122703";
+    return "v=2018122704";
 }
 function shop_version()
 {
-    return "v=2018122703";
+    return "v=2018122704";
 }

+ 37 - 7
mobile/templates/default/festival/newYear/index.php

@@ -10,6 +10,27 @@ $info = $output['info'];
     <meta name="format-detection" content="telephone=no">
     <title>新年运势</title>
     <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/css/style.css?<?php echo bonus_version(); ?>">
+    <script type="text/javascript">
+        document.addEventListener("WeixinJSBridgeReady", function () {
+            audioAutoPlay('Jaudio');//给个全局函数
+        }, false);
+        document.addEventListener('YixinJSBridgeReady', function () {
+            audioAutoPlay('Jaudio');//给个全局函数
+        }, false);
+        function audioAutoPlay(id) {//全局控制播放函数
+            var audio = document.getElementById(id),
+                play = function () {
+                    audio.play();
+                    document.removeEventListener("touchstart", play, false);
+                };
+            audio.play();
+            document.addEventListener("touchstart", play, false);
+        }
+        var isAppInside = /micromessenger/i.test(navigator.userAgent.toLowerCase()) || /yixin/i.test(navigator.userAgent.toLowerCase());
+        if (!isAppInside) {//给非微信易信浏览器
+            audioAutoPlay();
+        }
+    </script>
 </head>
 
 <body>
@@ -20,6 +41,10 @@ $info = $output['info'];
                 <span class="progress_num">0</span>%</p>
         </div>
     </div>
+    <audio src="<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/mp3/bg.mp3" id="Jaudio" autoplay preload loop="loop"></audio>
+    <div id="speaker_handle" class="audio_handle rotate"></div>
+    <audio src="<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/mp3/click.mp3" preload class="sound-effect"></audio>
+    <audio src="<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/mp3/wish.mp3" preload loop="loop" class="sound-wish"></audio>
     <div class="wrap">
         <div class="item page1">
             <div class="place-wrap">
@@ -64,8 +89,8 @@ $info = $output['info'];
         <div class="item page2">
             <div class="place-wrap">
                 <div class="content">
-<!--                    <img src="--><?php //echo RESOURCE_SITE_URL; ?><!--/mobile/festival/newYear/image/page2/qian.gif" alt="">-->
-                    <div class="steps"></div>
+                    <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/image/page2/qian.gif" alt="">
+<!--                    <div class="steps"></div>-->
                     <div class="btn positon-abs"></div>
                 </div>
             </div>
@@ -140,7 +165,15 @@ $info = $output['info'];
             url = "http://a.lrlz.com/mobile/index.php";
         }
 
-
+        document.getElementById('speaker_handle').addEventListener('click', function () {
+            if ($(this).hasClass('rotate')) {
+                document.getElementById('Jaudio').pause();
+            }
+            else {
+                audioAutoPlay('Jaudio');
+            }
+            $(this).toggleClass('rotate');
+        });
         var pageOneUrl = '<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/image/page1/';
         var pageTwoUrl = '<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/image/page2/';
         var pageThreeUrl = '<?php echo RESOURCE_SITE_URL; ?>/mobile/festival/newYear/image/page3/';
@@ -205,10 +238,7 @@ $info = $output['info'];
 
             pageThreeUrl + 'toucai/content1.png',
             pageThreeUrl + 'toucai/content2.png',
-            pageThreeUrl + 'toucai/content3.png',
-
-
-
+            pageThreeUrl + 'toucai/content3.png'
         ]
         var page = new Page(url, from_app, member_id, bridge, loadImages);
         if (from_app) {