Authored by 毕凯

元宵活动 代码整理

@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 <div class="flower flower-l"></div> 5 <div class="flower flower-l"></div>
6 <div class="flower flower-r"></div> 6 <div class="flower flower-r"></div>
7 </div> 7 </div>
8 - <a class="start animated fadeInDown" href="/cuxiao/yuanxiao/info"></a> 8 + <a class="start" href="/cuxiao/yuanxiao/info"></a>
9 <div class="footer"> 9 <div class="footer">
10 - <div class="arrow"></div> 10 + <a class="arrow animated infinite pulse" href="/cuxiao/yuanxiao/info"></a>
11 <div class="yohobuy"></div> 11 <div class="yohobuy"></div>
12 </div> 12 </div>
13 </div> 13 </div>
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <div class="sub-title">&nbsp;开运测试</div> 7 <div class="sub-title">&nbsp;开运测试</div>
8 </div> 8 </div>
9 9
10 - <form class="user"> 10 + <form class="user" method="POST">
11 <div class="user-info nick"> 11 <div class="user-info nick">
12 <div class="title"> 12 <div class="title">
13 昵称 13 昵称
@@ -18,18 +18,19 @@ @@ -18,18 +18,19 @@
18 <div class="title"> 18 <div class="title">
19 生日 19 生日
20 </div> 20 </div>
21 - <input type="date" name="nick" value="2011-12-13"> 21 + <input type="date" name="birthday" value="2011-12-13">
22 </div> 22 </div>
23 <div class="gender"> 23 <div class="gender">
24 <div class="title"> 24 <div class="title">
25 性<br>别 25 性<br>别
26 </div> 26 </div>
27 <div class="icon boy"> 27 <div class="icon boy">
28 - <span class="check"></span> 28 + <span class="check {{#if gender}}checked{{/if}}" data-gender="{{#if gender}}1{{/if}}"></span>
29 </div> 29 </div>
30 <div class="icon girl"> 30 <div class="icon girl">
31 - <span class="check checked"></span> 31 + <span class="check {{#unless gender}}checked{{/if}}" data-gender="{{#if gender}}0{{/if}}"></span>
32 </div> 32 </div>
  33 + <input type="hidden" name="gender" id="gender" value="{{gender}}">
33 </div> 34 </div>
34 </form> 35 </form>
35 36
@@ -39,7 +40,7 @@ @@ -39,7 +40,7 @@
39 </div> 40 </div>
40 </div> 41 </div>
41 42
42 - <div class="mask"> 43 + <div class="mask hide">
43 <div class="modal"> 44 <div class="modal">
44 <div class="icon close"></div> 45 <div class="icon close"></div>
45 <div class="text"> 46 <div class="text">
@@ -23,78 +23,5 @@ @@ -23,78 +23,5 @@
23 </div> 23 </div>
24 </div> 24 </div>
25 </div> 25 </div>
26 -<script type="text/tmpl" id="P1">  
27 - <div class="bg-guang"></div>  
28 - <div class="bg-yuan"></div>  
29 - <div class="title">成为一个大写加粗的</div>  
30 - <div class="chaoren animated infinite pulse"></div>  
31 -</script>  
32 -<script type="text/tmpl" id="P2">  
33 - <div class="bg-bige animated zoomIn"></div>  
34 - <div class="bg-manzai animated zoomIn"></div>  
35 - <div class="bg-ren"></div>  
36 - <div class="title animated infinite pulse"></div>  
37 - <div class="yzbb animated slideInDown"></div>  
38 -</script>  
39 -<script type="text/tmpl" id="P3">  
40 - <div class="bg-yunqi animated zoomIn"></div>  
41 - <div class="shoes animated infinite swing"></div>  
42 - <div class="yeezy animated slideInDown"></div>  
43 -</script>  
44 -<script type="text/tmpl" id="P4">  
45 - <div class="bg-car"></div>  
46 - <div class="hands animated infinite swing"></div>  
47 - <div class="wanghong animated slideInRight"></div>  
48 -</script>  
49 -<script type="text/tmpl" id="M1">  
50 - <div class="bg-majia"></div>  
51 - <div class="bg-yifei animated slideInUp"></div>  
52 - <div class="flyman animated infinite "></div>  
53 -</script>  
54 -<script type="text/tmpl" id="M2">  
55 - <div class="bg-bamei animated slideInRight"></div>  
56 - <div class="meizi animated infinite swing"></div>  
57 - <div class="shoes"></div>  
58 -</script>  
59 -<script type="text/tmpl" id="M3">  
60 - <div class="bg-cloud1 animated slideInRight"></div>  
61 - <div class="bg-chuanzhe animated slideInLeft"></div>  
62 - <div class="shan"></div>  
63 - <div class="rensheng"></div>  
64 - <div class="cloud2 animated slideInRight"></div>  
65 - <div class="shoes animated infinite swing"></div>  
66 -</script>  
67 -<script type="text/tmpl" id="M4">  
68 - <div class="bg-guang"></div>  
69 - <div class="bg-jin1 animated slideInright"></div>  
70 - <div class="ren"></div>  
71 - <div class="jin2 animated slideInDown"></div>  
72 - <div class="jin3 animated slideInDown"></div>  
73 - <div class="shuaiqi animated slideInDown"></div>  
74 -</script>  
75 -<script type="text/tmpl" id="F1">  
76 - <div class="bg-hezi1 animated slideInLeft"></div>  
77 - <div class="bg-hezi2 animated slideInDown"></div>  
78 - <div class="bg-hezi3 animated slideInRight"></div>  
79 - <div class="sun animated infinite zoomIn"></div>  
80 - <div class="kuaidi animated slideInDown"></div>  
81 -</script>  
82 -<script type="text/tmpl" id="F2">  
83 - <div class="bg-love1 animated infinite zoomIn"></div>  
84 - <div class="bg-love2"></div>  
85 - <div class="boy animated slideInRight"></div>  
86 - <div class="girl animated slideInLeft"></div>  
87 - <div class="bidong animated slideInRight"></div>  
88 -</script>  
89 -<script type="text/tmpl" id="F3">  
90 - <div class="bg-bra animated infinite pulse"></div>  
91 - <div class="xiongda animated zoomIn"></div>  
92 -</script>  
93 -<script type="text/tmpl" id="F4">  
94 - <div class="bg-guang animated infinite zoomIn"></div>  
95 - <div class="bg-shoes1 animated slideInLeft"></div>  
96 - <div class="bg-shoes2 animated slideInRight"></div>  
97 - <div class="bg-shoes3 animated slideInDown"></div>  
98 - <div class="style animated slideInUp"></div>  
99 -</script> 26 +{{> cuxiao/yuanxiao/type}}
100 {{> cuxiao/yuanxiao/footer}} 27 {{> cuxiao/yuanxiao/footer}}
@@ -20,9 +20,10 @@ @@ -20,9 +20,10 @@
20 </div> 20 </div>
21 21
22 <div class="footer"> 22 <div class="footer">
23 - <div class="entry"> 23 + <a class="entry" href="/cuxiao/yuanxiao/index">
24 我也要测 24 我也要测
  25 + </a>
25 </div> 26 </div>
26 </div> 27 </div>
27 - </div> 28 +{{> cuxiao/yuanxiao/type}}
28 {{> cuxiao/yuanxiao/footer}} 29 {{> cuxiao/yuanxiao/footer}}
@@ -15,4 +15,9 @@ @@ -15,4 +15,9 @@
15 <div class="footer"> 15 <div class="footer">
16 </div> 16 </div>
17 </div> 17 </div>
  18 + <script type="text/javascript">
  19 + setTimeout(function (){
  20 + location.href = "/cuxiao/yuanxiao/result";
  21 + }, 2000);
  22 + </script>
18 {{> cuxiao/yuanxiao/footer}} 23 {{> cuxiao/yuanxiao/footer}}
  1 +<script type="text/javascript" src="{{staticFile}}/js/libs.js"></script>
1 {{#staticJS}} 2 {{#staticJS}}
2 -<script type="text/javascript" src="{{.}}"></script> 3 +<script type="text/javascript" src="{{../staticFile}}/js/{{.}}"></script>
3 {{/staticJS}} 4 {{/staticJS}}
4 </body> 5 </body>
@@ -12,6 +12,6 @@ @@ -12,6 +12,6 @@
12 <script type="text/javascript"> 12 <script type="text/javascript">
13 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=640){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/640)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window); 13 (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=640){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/640)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
14 </script> 14 </script>
15 - <link rel="stylesheet" href="{{staticCSS}}"> 15 + <link rel="stylesheet" href="{{staticFile}}/css/style.css">
16 </head> 16 </head>
17 <body> 17 <body>
  1 +<script type="text/tmpl" id="P1">
  2 + <div class="bg-guang"></div>
  3 + <div class="bg-yuan"></div>
  4 + <div class="title">成为一个大写加粗的</div>
  5 + <div class="chaoren animated infinite pulse"></div>
  6 +</script>
  7 +<script type="text/tmpl" id="P2">
  8 + <div class="bg-bige animated zoomIn"></div>
  9 + <div class="bg-manzai animated zoomIn"></div>
  10 + <div class="bg-ren"></div>
  11 + <div class="title animated infinite pulse"></div>
  12 + <div class="yzbb animated slideInDown"></div>
  13 +</script>
  14 +<script type="text/tmpl" id="P3">
  15 + <div class="bg-yunqi animated zoomIn"></div>
  16 + <div class="shoes animated infinite swing"></div>
  17 + <div class="yeezy animated slideInDown"></div>
  18 +</script>
  19 +<script type="text/tmpl" id="P4">
  20 + <div class="bg-car"></div>
  21 + <div class="hands animated infinite swing"></div>
  22 + <div class="wanghong animated slideInRight"></div>
  23 +</script>
  24 +<script type="text/tmpl" id="M1">
  25 + <div class="bg-majia"></div>
  26 + <div class="bg-yifei animated slideInUp"></div>
  27 + <div class="flyman animated infinite "></div>
  28 +</script>
  29 +<script type="text/tmpl" id="M2">
  30 + <div class="bg-bamei animated slideInRight"></div>
  31 + <div class="meizi animated infinite swing"></div>
  32 + <div class="shoes"></div>
  33 +</script>
  34 +<script type="text/tmpl" id="M3">
  35 + <div class="bg-cloud1 animated slideInRight"></div>
  36 + <div class="bg-chuanzhe animated slideInLeft"></div>
  37 + <div class="shan"></div>
  38 + <div class="rensheng"></div>
  39 + <div class="cloud2 animated slideInRight"></div>
  40 + <div class="shoes animated infinite swing"></div>
  41 +</script>
  42 +<script type="text/tmpl" id="M4">
  43 + <div class="bg-guang"></div>
  44 + <div class="bg-jin1 animated slideInright"></div>
  45 + <div class="ren"></div>
  46 + <div class="jin2 animated slideInDown"></div>
  47 + <div class="jin3 animated slideInDown"></div>
  48 + <div class="shuaiqi animated slideInDown"></div>
  49 +</script>
  50 +<script type="text/tmpl" id="F1">
  51 + <div class="bg-hezi1 animated slideInLeft"></div>
  52 + <div class="bg-hezi2 animated slideInDown"></div>
  53 + <div class="bg-hezi3 animated slideInRight"></div>
  54 + <div class="sun animated infinite zoomIn"></div>
  55 + <div class="kuaidi animated slideInDown"></div>
  56 +</script>
  57 +<script type="text/tmpl" id="F2">
  58 + <div class="bg-love1 animated infinite zoomIn"></div>
  59 + <div class="bg-love2"></div>
  60 + <div class="boy animated slideInRight"></div>
  61 + <div class="girl animated slideInLeft"></div>
  62 + <div class="bidong animated slideInRight"></div>
  63 +</script>
  64 +<script type="text/tmpl" id="F3">
  65 + <div class="bg-bra animated infinite pulse"></div>
  66 + <div class="xiongda animated zoomIn"></div>
  67 +</script>
  68 +<script type="text/tmpl" id="F4">
  69 + <div class="bg-guang animated infinite zoomIn"></div>
  70 + <div class="bg-shoes1 animated slideInLeft"></div>
  71 + <div class="bg-shoes2 animated slideInRight"></div>
  72 + <div class="bg-shoes3 animated slideInDown"></div>
  73 + <div class="style animated slideInUp"></div>
  74 +</script>
@@ -10,6 +10,7 @@ use Api\Yohobuy; @@ -10,6 +10,7 @@ use Api\Yohobuy;
10 */ 10 */
11 class YuanxiaoController extends HuodongAction 11 class YuanxiaoController extends HuodongAction
12 { 12 {
  13 + const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016yuanxiao/1.0.0';
13 /** 14 /**
14 * 元宵抽签 15 * 元宵抽签
15 */ 16 */
@@ -17,11 +18,7 @@ class YuanxiaoController extends HuodongAction @@ -17,11 +18,7 @@ class YuanxiaoController extends HuodongAction
17 { 18 {
18 $this->_view->display('index', array( 19 $this->_view->display('index', array(
19 'staticTitle' => '元宵抽签', 20 'staticTitle' => '元宵抽签',
20 - 'staticCSS' => 'http://localhost:2222/assets/1.0.0/css/style.css',  
21 - 'staticJS' => array(  
22 - 'http://localhost:2222/assets/1.0.0/js/main.js',  
23 - 'http://localhost:2222/assets/1.0.0/js/home.js'  
24 - ) 21 + 'staticFile' => self::STATIC_FILE
25 )); 22 ));
26 } 23 }
27 24
@@ -32,11 +29,11 @@ class YuanxiaoController extends HuodongAction @@ -32,11 +29,11 @@ class YuanxiaoController extends HuodongAction
32 { 29 {
33 $this->_view->display('info', array( 30 $this->_view->display('info', array(
34 'staticTitle' => '元宵抽签', 31 'staticTitle' => '元宵抽签',
35 - 'staticCSS' => 'http://localhost:2222/assets/1.0.0/css/style.css', 32 + 'staticFile' => self::STATIC_FILE,
36 'staticJS' => array( 33 'staticJS' => array(
37 - 'http://localhost:2222/assets/1.0.0/js/main.js',  
38 - 'http://localhost:2222/assets/1.0.0/js/info.js'  
39 - ) 34 + 'info.js'
  35 + ),
  36 + 'gender' => 1
40 )); 37 ));
41 } 38 }
42 39
@@ -47,11 +44,7 @@ class YuanxiaoController extends HuodongAction @@ -47,11 +44,7 @@ class YuanxiaoController extends HuodongAction
47 { 44 {
48 $this->_view->display('wait', array( 45 $this->_view->display('wait', array(
49 'staticTitle' => '元宵抽签', 46 'staticTitle' => '元宵抽签',
50 - 'staticCSS' => 'http://localhost:2222/assets/1.0.0/css/style.css',  
51 - 'staticJS' => array(  
52 - 'http://localhost:2222/assets/1.0.0/js/main.js',  
53 - 'http://localhost:2222/assets/1.0.0/js/wait.js'  
54 - ) 47 + 'staticFile' => self::STATIC_FILE
55 )); 48 ));
56 } 49 }
57 50
@@ -62,14 +55,13 @@ class YuanxiaoController extends HuodongAction @@ -62,14 +55,13 @@ class YuanxiaoController extends HuodongAction
62 { 55 {
63 $this->_view->display('result', array( 56 $this->_view->display('result', array(
64 'staticTitle' => '元宵抽签', 57 'staticTitle' => '元宵抽签',
  58 + 'staticFile' => self::STATIC_FILE,
65 'result' => array( 59 'result' => array(
66 'name' => '张大龙', 60 'name' => '张大龙',
67 'type' => 'F4' 61 'type' => 'F4'
68 ), 62 ),
69 - 'staticCSS' => 'http://localhost:2222/assets/1.0.0/css/style.css',  
70 'staticJS' => array( 63 'staticJS' => array(
71 - 'http://localhost:2222/assets/1.0.0/js/main.js',  
72 - 'http://localhost:2222/assets/1.0.0/js/result.js' 64 + 'result.js'
73 ) 65 )
74 )); 66 ));
75 } 67 }
@@ -81,15 +73,14 @@ class YuanxiaoController extends HuodongAction @@ -81,15 +73,14 @@ class YuanxiaoController extends HuodongAction
81 { 73 {
82 $this->_view->display('share', array( 74 $this->_view->display('share', array(
83 'staticTitle' => '元宵抽签', 75 'staticTitle' => '元宵抽签',
  76 + 'staticFile' => self::STATIC_FILE,
84 'result' => array( 77 'result' => array(
85 'name' => '张大龙', 78 'name' => '张大龙',
86 'type' => 'P1' 79 'type' => 'P1'
87 ), 80 ),
88 'count' => '78999', // 过万转换成 “16万” 这种形式 81 'count' => '78999', // 过万转换成 “16万” 这种形式
89 - 'staticCSS' => 'http://localhost:2222/assets/1.0.0/css/style.css',  
90 'staticJS' => array( 82 'staticJS' => array(
91 - 'http://localhost:2222/assets/1.0.0/js/main.js',  
92 - // 'http://localhost:2222/assets/1.0.0/js/share.js' 83 + 'share.js'
93 ) 84 )
94 )); 85 ));
95 } 86 }