stanley-king 9 år sedan
förälder
incheckning
c83b359dc7
38 ändrade filer med 767 tillägg och 1407 borttagningar
  1. 10 2
      data/model/user_bonus.model.php
  2. 0 403
      data/resource/mobile/bonus/css/base.css
  3. 0 160
      data/resource/mobile/bonus/css/bindtel.css
  4. 0 50
      data/resource/mobile/bonus/css/bomb.css
  5. 22 6
      data/resource/mobile/bonus/css/common.css
  6. 211 0
      data/resource/mobile/bonus/css/content.css
  7. 0 71
      data/resource/mobile/bonus/css/index_commcon.css
  8. 0 60
      data/resource/mobile/bonus/css/over.css
  9. 0 127
      data/resource/mobile/bonus/css/success.css
  10. BIN
      data/resource/mobile/bonus/imgaes/content_bg.png
  11. BIN
      data/resource/mobile/bonus/imgaes/icon_king.png
  12. BIN
      data/resource/mobile/bonus/imgaes/icon_open.png
  13. BIN
      data/resource/mobile/bonus/imgaes/icon_pin.png
  14. BIN
      data/resource/mobile/bonus/imgaes/top_bg.png
  15. 0 157
      data/resource/mobile/bonus/js/rem.js
  16. 22 21
      data/resource/mobile/bonus/js/tel.js
  17. 0 112
      data/resource/mobile/bonus/js/tel_bak.js
  18. 0 161
      data/resource/mobile/bonus/js/touch.js
  19. 0 2
      data/resource/mobile/bonus/js/zepto.js
  20. 2 0
      data/resource/mobile/bonus/js/zepto.min.js
  21. 1 1
      helper/bonus/factory.php
  22. 21 17
      helper/bonus/generator.php
  23. 2 1
      helper/bonus/grab.php
  24. 59 11
      helper/bonus/manager.php
  25. 24 4
      helper/bonus/type.php
  26. 15 1
      helper/bonus/user_bonus.php
  27. 19 4
      helper/bonus_helper.php
  28. 1 1
      helper/sms_helper.php
  29. 23 0
      helper/user_helper.php
  30. 171 29
      mobile/control/bonusex.php
  31. 4 0
      mobile/control/control.php
  32. 11 3
      mobile/control/login.php
  33. 1 2
      mobile/control/member_bonus.php
  34. 53 0
      mobile/templates/default/bonus/bind.php
  35. 29 0
      mobile/templates/default/bonus/content.php
  36. 1 1
      mobile/templates/default/bonus/open.php
  37. 28 0
      mobile/templates/default/bonus/over.php
  38. 37 0
      mobile/templates/default/bonus/success.php

+ 10 - 2
data/model/user_bonus.model.php

@@ -106,7 +106,15 @@ class user_bonusModel extends Model
                             'user_id' => $_SESSION['member_id'],
                             'user_mobile' => $_SESSION['member_mobile'],
                             'user_name' => user_helper::nickname());
-                    } else {
+                    }
+                    else if(user_helper::isVerfiyMobile()) { //如果该会话手机号码曾经认证过,直接绑定
+                        $datas = array('status' => 2,
+                            'grab_time' => time(),
+                            'get_time'  => time(),
+                            'session_id' => $sess_id,
+                            'user_mobile' => $_SESSION['member_mobile']);
+                    }
+                    else {
                         $datas = array('status' => 1,
                             'grab_time' => time(),
                             'session_id' => $sess_id);
@@ -139,7 +147,7 @@ class user_bonusModel extends Model
             $datas['user_id'] = $_SESSION['member_id'];
         }
 
-        $ret = $this->where($condition)->update(array($datas));
+        $ret = $this->where($condition)->update($datas);
         return ($ret);
     }
 }

+ 0 - 403
data/resource/mobile/bonus/css/base.css

@@ -1,403 +0,0 @@
-@charset "UTF-8";
-/**
- * base.css
- * @author hgang
- * Created 2015-12-30.
- */
-/* line 5, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed,
-figure, figcaption, footer, header, hgroup,
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
-  margin: 0;
-  padding: 0;
-  border: 0;
-  font: inherit;
-  font-size: 100%;
-  vertical-align: baseline;
-}
-
-/* line 22, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-html {
-  line-height: 1;
-}
-
-/* line 24, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-ol, ul {
-  list-style: none;
-}
-
-/* line 26, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-table {
-  border-collapse: collapse;
-  border-spacing: 0;
-}
-
-/* line 28, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-caption, th, td {
-  text-align: left;
-  font-weight: normal;
-  vertical-align: middle;
-}
-
-/* line 30, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-q, blockquote {
-  quotes: none;
-}
-/* line 103, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-q:before, q:after, blockquote:before, blockquote:after {
-  content: "";
-  content: none;
-}
-
-/* line 32, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-a img {
-  border: none;
-}
-
-/* line 116, C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/compass-core-1.0.3/stylesheets/compass/reset/_utilities.scss */
-article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
-  display: block;
-}
-
-/**
- * _font.scss
- * @author Huwj
- * Created 2015-08-18 16:40.
- */
-/* 设置各种字号 */
-/* font-size: 11px; */
-/* line 9, ../../sass/_tool/_font.scss */
-.font9 {
-  font-size: 9px;
-}
-
-/* line 10, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font9 {
-  font-size: 27px;
-}
-
-/* line 13, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font9 {
-  font-size: 18px;
-}
-
-.font10 {
-  font-size: 10px;
-}
-
-/* line 10, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font10 {
-  font-size: 30px;
-}
-
-/* line 13, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font10 {
-  font-size: 20px;
-}
-
-.font11 {
-  font-size: 11px;
-}
-
-/* line 10, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font11 {
-  font-size: 33px;
-}
-
-/* line 13, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font11 {
-  font-size: 22px;
-}
-
-/* font-size: 12px; */
-/* line 17, ../../sass/_tool/_font.scss */
-.font12 {
-  font-size: 12px;
-}
-
-/* line 18, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font12 {
-  font-size: 36px;
-}
-
-/* line 21, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font12 {
-  font-size: 24px;
-}
-
-/* font-size: 14px; */
-/* line 26, ../../sass/_tool/_font.scss */
-.font14 {
-  font-size: 14px;
-}
-
-/* line 27, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font14 {
-  font-size: 42px;
-}
-
-/* line 30, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font14 {
-  font-size: 28px;
-}
-
-/* line 33, ../../sass/_tool/_font.scss */
-.font15 {
-  font-size: 15px;
-}
-
-/* line 34, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font15 {
-  font-size: 45px;
-}
-
-/* line 37, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font15 {
-  font-size: 30px;
-}
-
-/* font-size: 16px; */
-/* line 42, ../../sass/_tool/_font.scss */
-.font16 {
-  font-size: 16px;
-}
-
-/* line 43, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font16 {
-  font-size: 48px;
-}
-
-/* line 46, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font16 {
-  font-size: 32px;
-}
-
-.font17 {
-  font-size: 17px;
-}
-
-html[data-dpi="3"] body.iPhone .font17 {
-  font-size:51px;
-}
-
-/* line 55, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font17 {
-  font-size: 34px;
-}
-/* font-size: 18px; */
-/* line 51, ../../sass/_tool/_font.scss */
-.font18 {
-  font-size: 18px;
-}
-
-/* line 52, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font18 {
-  font-size: 54px;
-}
-
-/* line 55, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font18 {
-  font-size: 36px;
-}
-
-/* font-size: 20px; */
-/* line 60, ../../sass/_tool/_font.scss */
-.font20 {
-  font-size: 20px;
-}
-
-/* line 61, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font20 {
-  font-size: 60px;
-}
-
-/* line 64, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font20 {
-  font-size: 40px;
-}
-
-/* font-size: 22px; */
-/* line 69, ../../sass/_tool/_font.scss */
-.font22 {
-  font-size: 22px;
-}
-
-/* line 70, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font22 {
-  font-size: 66px;
-}
-
-/* line 73, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font22 {
-  font-size: 44px;
-}
-
-/* font-size: 24px; */
-/* line 78, ../../sass/_tool/_font.scss */
-.font24 {
-  font-size: 24px;
-}
-
-/* line 79, ../../sass/_tool/_font.scss */
-html[data-dpi="3"] body.iPhone .font24 {
-  font-size: 72px;
-}
-
-/* line 82, ../../sass/_tool/_font.scss */
-html[data-dpi="2"] body.iPhone .font24 {
-  font-size: 48px;
-}
-
-.font28 {
-  font-size:28px;
-}
-
-html[data-dpi="2"] body.iPhone .font28 {
-  font-size: 56px;
-}
-
-html[data-dpi="3"] body.iPhone .font28 {
-  font-size: 84px;
-}
-
-.font24 {
-  font-size:24px;
-}
-
-html[data-dpi="2"] body.iPhone .font24 {
-  font-size: 48px;
-}
-
-html[data-dpi="3"] body.iPhone .font24 {
-  font-size: 72px;
-}
-
-.font34 {
-  font-size:34px;
-}
-
-html[data-dpi="2"] body.iPhone .font34 {
-  font-size: 68px;
-}
-
-html[data-dpi="3"] body.iPhone .font34 {
-  font-size: 102px;
-}
-
-
-/* line 3, ../../sass/_tool/_footer.scss */
-footer {
-  background: #eeeeee;
-  text-align: center;
-}
-/* line 6, ../../sass/_tool/_footer.scss */
-footer .index_foot_content {
-  margin: 0 0 .47rem;
-  display: inline-block;
-}
-/* line 9, ../../sass/_tool/_footer.scss */
-footer .index_foot_content .version {
-  color: #989898;
-  margin-left: .4rem;
-}
-/* line 13, ../../sass/_tool/_footer.scss */
-footer .index_foot_content .line {
-  border-right: 1px solid #A99F9F;
-  padding-right: .4rem;
-}
-
-input[type="button"], input[type="submit"], input[type="reset"] {
-  -webkit-appearance: none;
-}
-
-textarea {  -webkit-appearance: none;}
-input {
-  vertical-align: middle;
-  border: none;
-}
-/* line 11, ../../sass/base/base.scss */
-img {
-  width: 100%;
-  height:100%;
-}
-
-select {
-  border: none;
-  -webkit-appearance: none;
-}
-/* line 15, ../../sass/base/base.scss */
-* {
-  box-sizing: border-box;
-}
-
-/* line 18, ../../sass/base/base.scss */
-html,
-body {
-  width: 100%;
-  min-height: 100%;
-  height: auto;
-}
-
-/* line 24, ../../sass/base/base.scss */
-.fullPage {
-  overflow: hidden;
-  width: 10rem;
-  height: auto;
-  margin: 0 auto;
-}
-
-/* line 30, ../../sass/base/base.scss */
-a {
-  text-decoration: none;
-}
-
-/*# sourceMappingURL=base.css.map */
-/*去除点击a btn 出现一个浅色的遮罩*/
-a,button,input,textarea{
-  /*-webkit-tap-highlight-color: rgba(0,0,0,0);*/
-/*-webkit-user-modify:read-write-plaintext-only;*/
-}
-/*禁止用户选择文字*/
-html{
-  -webkit-user-select:none
-}
-
-.center {
-  text-align: center;
-}
-
-
-.left {
-  float: left;
-}
-
-.middle {
-  vertical-align: middle;
-}
-.right {
-  float: right;
-}
-
-.price {
-  color: #f6467a;
-}
-.clear {
-  clear: both;
-}
-.inline {
-  display: inline-block;
-}
-
-
-
-

+ 0 - 160
data/resource/mobile/bonus/css/bindtel.css

@@ -1,160 +0,0 @@
-html {
-    background: #faf9d7;
-}
-.top {
-    height: 13.4rem;
-    width: 10rem;
-    background: url("../image/top_bg.png") no-repeat;
-    background-size: 100%;
-    padding-top: 2.42rem;
-    position: relative;
-    color: #fff;
-}
-.center_box {
-    width: 7.91rem;
-    margin: 0 auto;
-    overflow: hidden;
-    background: #e64774;
-    border-radius: 1rem;
-    padding-top: 0.64rem;
-    padding-bottom: 2.94rem;
-}
-.ropes {
-    width: 7.64rem;
-    height: 0.73rem;
-    line-height: 0.73rem;
-    margin: 0 auto;
-    background: url("../image/rcope02.png") no-repeat;
-    background-size: 100%;
-    color: #e86d97;
-}
-.tel {
-    width: 0.3rem;
-    height: 0.5rem;
-    background: url("../image/tel_icon.png") no-repeat;
-    background-size: 100%;
-    margin-right: 0.2rem;
-}
-.just_btn {
-    width: 4.8rem;
-    height: 1.3rem;
-    line-height: 1.3rem;
-    color: #c12b26;
-    background: #f6c36e;
-    border-radius: 0.31rem;
-    margin-top: 0.47rem;
-    box-shadow: 0 0.16rem 0 #c93666;
-}
-
-.amount_box {
-    margin-top: 0.66rem;
-    position: relative;
-}
-.amount_box p {
-    width: 6rem;
-    margin: 0 auto;
-    line-height: 0.5rem;
-}
-/*.amount_title {*/
-    /*width: 0.5rem;*/
-    /*position: absolute;*/
-    /*left: 0.35rem;*/
-    /*top: 0.1rem;*/
-    /*color: #84264c;*/
-/*}*/
-
-/*.amount {*/
-    /*width: 6.2rem;*/
-    /*height: 1.19rem;*/
-    /*line-height: 1.19rem;*/
-    /*border-radius: 5px;*/
-    /*letter-spacing: 0.05rem;*/
-    /*color: #d6356d;*/
-    /*background: -webkit-linear-gradient(left, #c3c4c4,#f9f9f9,#c3c4c4); /!* Safari 5.1 - 6.0 *!/*/
-    /*background: -o-linear-gradient(right, #c3c4c4,#f9f9f9,#c3c4c4); /!* Opera 11.1 - 12.0 *!/*/
-    /*background: -moz-linear-gradient(right, #c3c4c4,#f9f9f9,#c3c4c4); /!* Firefox 3.6 - 15 *!/*/
-    /*background: linear-gradient(to right,#c3c4c4,#f9f9f9,#c3c4c4); /!* ±ê×¼µÄÓï·¨ *!/*/
-/*}*/
-.input_tel,.validate {
-    width: 6.2rem;
-    height: 0.97rem;
-    line-height: 0.97rem;
-    margin: 0 auto;
-    padding-left: 0.2rem;
-    background: #fff;
-    color: #f2a2c1;
-    border-radius: 5px;
-}
-.input_tel input{
-    width: 4rem;
-}
-.validate {
-    margin-top: 0.25rem;
-}
-.input_box {
-    margin-top: 0.63rem;
-}
-.validate input {
-    width: 1.8rem;
-}
-.input_box input {
-    border: none;
-    color: #f2a2c1;
-}
-.go_validate {
-    background: #f5b7d0;
-    color: #fff;
-    border-radius: 10px;
-    height: 0.8rem;
-    width: 1.84rem;
-    line-height: 0.8rem;
-    margin-top: 0.1rem;
-    margin-right: 0.1rem;
-}
-.validate input,.input_box input{
-    height: 0.8rem;
-    background: #fff;
-    padding-left: 0.1rem;
-}
-.footer {
-    height: 2.3rem;
-    width: 100%;
-    background: url("../image/foot_bg.png") no-repeat;
-    background-size: 100% 100%;
-    position: fixed;
-    bottom: 0;
-    left: 0;
-}
-
-
-
-.banner {
-    width: 100%;
-    height: 1.88rem;
-    line-height: 1.88rem;
-    background-color: rgba(247,195,110,0.8);
-    position: fixed;
-    bottom: 0;
-    left: 0;
-    color:#fff;
-}
-.banner_title {
-    width: 4.59rem;
-    line-height: 0.55rem;
-}
-.logo {
-    width: 1.5rem;
-    height: 1.5rem;
-    margin-top: 0.3rem;
-    margin-left: 0.73rem;
-    background: url("../image/icon.png") no-repeat;
-    background-size: 100%;
-}
-.down {
-    width: 1.25rem;
-    height: 1.25rem;
-    margin-top: 0.3rem;
-    margin-right: 0.73rem;
-    background: url("../image/down.png") no-repeat;
-    background-size: 100%;
-}

+ 0 - 50
data/resource/mobile/bonus/css/bomb.css

@@ -1,50 +0,0 @@
-.bomb {
-    height: 100%;
-    width: 100%;
-    background: rgba(0,0,0,0.5);
-    position: absolute;
-    top: 0;
-    left: 0;
-    z-index: 999;
-}
-.bomb_box {
-    width: 8.16rem;
-    height: 3.88rem;
-    margin: 0 auto;
-    background:url("../image/bomb_bg.png") no-repeat;
-    background-size: 100%;
-    position: relative;
-    margin-top: 1.69rem;
-    padding-top: 1.09rem;
-}
-.bomb_box p {
-    color: #858585;
-}
-.close {
-    width: 0.59rem;
-    height: 0.59rem;
-    position: absolute;
-    right: 0.2rem;
-    top: 0.2rem;
-    background: url('../image/close.png') no-repeat;
-    background-size: 100%
-}
-.btn div {
-    overflow: hidden;
-    margin-top: 0.5rem ;
-}
-.btn div a {
-    width: 2.44rem;
-    height: 0.94rem;
-    margin: 0 auto;
-    line-height: 0.94rem;
-    border-radius: 5px;
-}
-a.no {
-    background:#f6c36e;
-    color: #fff;
-}
-a.remove {
-    background: #e64774;
-    color: #fff;
-}

+ 22 - 6
data/resource/mobile/bonus/css/common.css

@@ -10,8 +10,17 @@ img
 html,body {
     height: 100%;
     width: 100%;
+    position: relative;
+    font-family: "Helvetica Light","华文细黑";
 }
+
 img {border: none}
+
+a {
+    -webkit-tap-highlight-color:rgba(0,0,0,0);
+    text-decoration: none;
+    color:#ffe7b8 ;
+}
 @media screen and (max-width: 319px){
     html {
         font-size: 12px;
@@ -27,15 +36,12 @@ img {border: none}
         font-size: 14px;
     }
 }
-a {
-    -webkit-tap-highlight-color:rgba(0,0,0,0);
-}
 .maincontent {
     width: 100%;
     height: 100%;
-    background: #ff4e4e;
+    background: #e14f48;
     position: relative;
-    color: #ffeeaa;
+    color: #ffe7b8;
 }
 .bg_position {
     position: absolute;
@@ -113,5 +119,15 @@ a {
     margin-top: 15%;
 }
 .msg_bottom p {
-    font-size: 2.2rem;
+    font-size: 2rem;
+}
+.look {
+    position: absolute;
+    left: 50%;
+    bottom: -20%;
+    width: 7rem;
+    margin-left: -3.5rem;
+}
+.look a {
+    display: block;
 }

+ 211 - 0
data/resource/mobile/bonus/css/content.css

@@ -0,0 +1,211 @@
+.maincontent {
+    background: #fff;
+}
+.top {
+    height: 12%;
+    background: url("../imgaes/content_bg.png") no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    padding:6% 0;
+    line-height: 2.2rem;
+}
+.logo {
+    margin-top: 0.8rem;
+}
+.title {
+    font-size: 1.2rem;
+    padding-left: 0.6rem;
+}
+.prompt {
+    font-size: 1rem;
+    color: #9b9b9b;
+}
+.pro {
+    padding-bottom: 0.5rem;
+}
+.icon_pin {
+    display: inline-block;
+    width: 1.2rem;
+    height: 1.2rem;
+    background: url("../imgaes/icon_pin.png") no-repeat;
+    background-size: 100% 100%;
+    margin-left: 5px;
+    vertical-align: middle;
+}
+div.link a{
+    color: #1927D1;
+    font-size: 1.5rem;
+    display: block;
+}
+.p {
+    color: #454545;
+    font-size: 1.4rem;
+}
+.li {
+    display: table;
+    width: 100%;
+    border-bottom: 1px solid #e3e3e3;
+}
+.list {
+    padding: 0 8%;
+    margin-top: 2rem;
+}
+.text_left {
+    text-align: left;
+    border-bottom: 1px solid #e3e3e3;
+}
+.li_left,.li_right {
+    display: table-cell;
+    width: 50%;
+    line-height: 1.8rem;
+    padding-top: 0.5rem;
+    padding-bottom: 0.3rem;
+}
+.li_left {
+    text-align: left;
+}
+.li_right {
+    text-align: right;
+}
+.king_box {
+    color: #ff8c1e;
+}
+.king {
+    display: inline-block;
+    width: 12px;
+    height: 10px;
+    background: url("../imgaes/icon_king.png") no-repeat;
+    background-size: 100% 100%;
+    margin-right: 5px;
+}
+.name {
+    margin-top: 1.2rem;
+    margin-bottom: 1.6rem;
+    line-height: 1.8rem;
+}
+p.p_name {
+    font-size: 1.5rem;
+}
+
+.price p {
+    color: #454545;
+}
+.price p span {
+    font-size: 4rem;
+    vertical-align: sub;
+}
+.linqu_box {
+    padding: 0 8%;
+}
+.tel_box {
+    border: 1px solid #fe6565;
+    border-radius: 5px;
+    padding: 2% 5%;
+}
+.just_button {
+    background: #ff4e4e;
+    border-radius: 5px;
+    color: #fff;
+    height: 45px;
+    line-height: 46px;
+    margin-top: 15px;
+    font-size: 1.3rem;
+}
+.tel_pro {
+    color: #454545;
+    margin:1rem 0;
+}
+input,button {
+    outline: none;
+    -webkit-appearance: none;
+    border: none;
+    background: #fff;
+    font-size: 1.1rem;
+}
+.tel {
+    height: 36px;
+}
+.yanz {
+    height: 35px;
+}
+.tel {
+    border-bottom: 1px solid #e3e3e3;
+}
+.tel input {
+    height: 77%;
+    width: 98%;
+    display: inline-block;
+}
+.yanz {
+    margin-top: 2%;
+}
+.yanz input,.yanz button{
+    height: 78%;
+    display: inline-block;
+}
+.yanz_num {
+    display: inline-block;
+    width: 56%;
+    height: 100%;
+}
+.yanz input {
+    width: 100%;
+}
+.yanz button {
+    width: 42%;
+    display: inline-block;
+    border-left: 1px solid #e3e3e3;
+}
+#link {
+    display: none;
+    margin-top: 1rem;
+}
+@-webkit-keyframes link {
+    0%{
+        -webkit-transform: translate3d(0,0,0);
+    }
+    50% {
+        -webkit-transform: translate3d(0,0,0) scale(1.2);
+    }
+    100% {
+        -webkit-transform: translate3d(0,0,0) scale(1);
+    }
+}
+.link_but {
+    -webkit-animation: link 1s ease;
+}
+.layer_box {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    top: 0;
+    left: 0;
+    background:rgba(0,0,0,0.8);
+    z-index: 999;
+    font-size: 1.3rem;
+}
+.layer {
+    background: #fff;
+    width: 80%;
+    height: 160px;
+    position: absolute;
+    top: 25%;
+    left: 50%;
+    margin-left: -40%;
+    border-radius: 10px;
+}
+.top_msg{
+    height: 110px;
+    line-height: 110px;
+}
+.top_msg p {
+    height: 100%;
+}
+.bottom_btn {
+    background: #ff4e4e;
+    height: 50px;
+    line-height: 50px;
+    border-bottom-right-radius: 10px;
+    border-bottom-left-radius: 10px;
+    color: #fff;
+}

+ 0 - 71
data/resource/mobile/bonus/css/index_commcon.css

@@ -1,71 +0,0 @@
-body {
-    background: #faf9d7;
-}
-.top {
-    height: 13.4rem;
-    width: 10rem;
-    background: url("../image/top_bg.png") no-repeat;
-    background-size: 100%;
-    padding-top: 2.42rem;
-    position: relative;
-    color: #fff;
-}
-.rope {
-    width: 0.38rem;
-    height: 3.1rem;
-    position: absolute;
-    left: 4.83rem;
-    top: 0;
-    background: url("../image/rcope.png") no-repeat;
-    background-size: 100%;
-}
-.bag_header {
-    width: 7.75rem;
-    height: 4.81rem;
-    margin: 0 auto;
-    background: url("../image/bag_head.png") no-repeat;
-    background-size: 100%;
-    font-weight: normal;
-    padding-top: 1.13rem;
-}
-.bag_header p {
-    margin-bottom: 0.22rem;
-}
-
-.bag_center {
-    width: 7.75rem;
-    height: 6rem;
-    margin: -1px auto;
-    padding-top: 1.5rem;
-    padding-bottom: 2.66rem;
-    background: #e54674;
-    border-bottom-left-radius: 1.1rem;
-    border-bottom-right-radius: 1.1rem;
-}
-.just_btn {
-    width: 4.8rem;
-    height: 1.3rem;
-    line-height: 1.3rem;
-    color: #c12b26;
-    background: #f6c36e;
-    border-radius: 0.31rem;
-    box-shadow: 0 0.16rem 0 #c93666;
-}
-.recommend_box p {
-    width: 2.2rem;
-    height: 0.6rem;
-    margin: 0 auto;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    text-align: left;
-}
-.footer {
-     height: 2.3rem;
-     width: 100%;
-     background: url("../image/foot_bg.png") no-repeat;
-     background-size: 100% 100%;
-     position: fixed;
-     bottom: 0;
-     left: 0;
- }

+ 0 - 60
data/resource/mobile/bonus/css/over.css

@@ -1,60 +0,0 @@
-.top {
-    height: auto;
-}
-.bag_center {
-    padding-top: 0.1rem;
-    padding-bottom: 0.8rem;
-}
-.pro p {
-    line-height: 0.5rem;
-}
-
-.ropes {
-    width: 7.64rem;
-    height: 0.73rem;
-    line-height: 0.73rem;
-    margin: 0 auto;
-    background: url("../image/rcope02.png") no-repeat;
-    background-size: 100%;
-    color: #e86d97;
-}
-.recommend {
-    height: auto;
-    width: 6.34rem;
-    margin: 0 auto;
-    overflow: hidden;
-    background: #d6356d;
-    border-radius:5px;
-    padding-top: 0.2rem;
-    padding-bottom: 0.2rem;
-}
-.recommend_box {
-    width: 50%;
-}
-.recommend_box p {
-    line-height: 0.6rem;
-}
-.img_box {
-    width: 2.08rem;
-    height: 2.08rem;
-    margin: 0 auto;
-    padding: 0.17rem;
-    background: #f6c26e;
-    border-radius: 10px;
-}
-.img_border {
-    width: 1.7rem;
-    height: 1.7rem;
-    border: 2px solid #fff;
-}
-.ropes {
-    margin-top: 0.15rem;
-    margin-bottom: 0.2rem;
-}
-.price_box {
-    margin-top: -0.66rem;
-}
-.later {
-    text-decoration: line-through;
-    color: #e377a3;
-}

+ 0 - 127
data/resource/mobile/bonus/css/success.css

@@ -1,127 +0,0 @@
-html {
-    background: #faf9d7;
-}
-.top {
-   height: auto;
-}
-.bag_header p {
-    width: 5.7rem;
-    line-height: 0.5rem;
-    margin:0 auto 0.22rem auto;
-}
-.price_b {
-    color:#f7c36f;
-}
-.fullPage {
-    position: relative;
-}
-
-
-
-
-.bag_center {
-    padding-top: 0.1rem;
-    padding-bottom: 0.8rem;
-}
-
-
-.ropes {
-    width: 7.64rem;
-    height: 0.73rem;
-    line-height: 0.73rem;
-    margin: 0 auto;
-    background: url("../image/rcope02.png") no-repeat;
-    background-size: 100%;
-    color: #e86d97;
-}
-.recommend {
-    height: auto;
-    width: 6.34rem;
-    margin: 0 auto;
-    overflow: hidden;
-    background: #d6356d;
-    border-radius:5px;
-    padding-top: 0.2rem;
-}
-.recommend_box {
-    width: 50%;
-    padding-bottom: 0.2rem;
-}
-.recommend_box p {
-    width: 2.2rem;
-    height: 0.6rem;
-    margin: 0 auto;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    text-align: left;
-    line-height: 0.6rem;
-    color: #f8dfe8;
-}
-.recommend_title {
-    width: 2.2rem;
-    height: 0.6rem;
-    line-height: 0.6rem;
-    overflow: hidden;
-    margin: 0 auto;
-}
-.img_box {
-    width: 2.08rem;
-    height: 2.08rem;
-    margin: 0 auto;
-    padding: 0.17rem;
-    background: #f6c26e;
-    border-radius: 10px;
-}
-.img_border {
-    width: 1.7rem;
-    height: 1.7rem;
-    border: 2px solid #fff;
-}
-.ropes {
-    margin-top: 0.15rem;
-    margin-bottom: 0.2rem;
-}
-.price_box {
-    margin-top: -0.66rem;
-}
-.later {
-    text-decoration: line-through;
-    color: #e377a3;
-    padding-left: 0.1rem;
-}
-
-
-
-.banner {
-    width: 100%;
-    height: 1.88rem;
-    line-height: 1.88rem;
-    background-color: rgba(247,195,110,0.8);
-    position:fixed;
-    bottom: 0;
-    left: 0;
-    color:#fff;
-}
-.banner_title {
-    width: 4.59rem;
-    line-height: 0.55rem;
-}
-.logo {
-    width: 1.5rem;
-    height: 1.5rem;
-    margin-top: 0.3rem;
-    margin-left: 0.73rem;
-    background: url("../image/icon.png") no-repeat;
-    background-size: 100%;
-}
-.down {
-    width: 1.25rem;
-    height: 1.25rem;
-    margin-top: 0.3rem;
-    margin-right: 0.73rem;
-    background: url("../image/down.png") no-repeat;
-    background-size: 100%;
-}
-
-

BIN
data/resource/mobile/bonus/imgaes/content_bg.png


BIN
data/resource/mobile/bonus/imgaes/icon_king.png


BIN
data/resource/mobile/bonus/imgaes/icon_open.png


BIN
data/resource/mobile/bonus/imgaes/icon_pin.png


BIN
data/resource/mobile/bonus/imgaes/top_bg.png


+ 0 - 157
data/resource/mobile/bonus/js/rem.js

@@ -1,157 +0,0 @@
-/**
- *  鉴于移动端设备参差不齐,
- *  给页面排版带来了很多不便,
- *  现在为了统一设置,
- *  判断不同设备,
- *  根据不同设备的分辨率,
- *  以及其自身的DPI,
- *  设置一个合适当前设备的rem值。
- **/
-!function(window){
-
-    /*console.log(typeof define);
-     console.log(typeof module);
-     console.log(typeof exports);*/
-    var
-    // 使用一些文档原本就有的参数
-    //location = window.location,
-        document = window.document,
-    //docElm = document.documentElement,
-    // 设置版本号
-        setRem_version = '1.0.0',
-    //注册方法名
-        setRem = window.setRem || {};
-    //方法实现
-    setRem = {
-        init: function(opts){
-            /*console.log(opts);*/
-            //var def = opts === false ? false : true;
-            //if(def){
-            //    this.set();
-            //   // this.isComplete();
-            //    //this.test();
-            //}
-            //var def = ;
-            this.set(opts);
-        },
-        // isComplete: function(){
-        //     document.addEventListener('DOMContentLoaded', function(){
-        //         console.log('done');
-        //         if(document.getElementsByClassName){
-        //             console.log('zhichi');
-        //             // document.getElementsByClassName('fullpage')[0].style.height = '100%';
-        //         };
-
-        //     }, !1); 
-        // },
-        tool: function(){
-            //定义获得的dom存放对象
-            var domArr = {};
-            domArr.html = document.getElementsByTagName('html')[0];
-            domArr.head = document.getElementsByTagName('head')[0];
-            domArr.body = document.getElementsByTagName('body')[0];
-            return domArr;
-        },
-        device: function(){
-            //获取当前设备相关参数
-            var deviceArg = {};
-            //是什么设备iPhone OR Android OR iPad OR other
-            deviceArg.name = navigator.appVersion.indexOf('iPhone') > -1 ? 'iPhone' : 'other';
-            deviceArg.name = navigator.appVersion.indexOf('Android') > -1 ? 'Android' : deviceArg.name;
-            deviceArg.name = navigator.appVersion.indexOf('iPad') > -1 ? 'iPad' : deviceArg.name;
-            //当前设备的dpi是几何
-            deviceArg.dpi = window.devicePixelRatio;
-            //当前设备的宽度(单位px,但是是设备宽度,而非其分辨率)
-            //deviceArg.width = window.screen.width;
-
-            //getBoundingClientRect取到的是什么,
-            //为什么用这个,因为android设备取到的不准确特么的
-            deviceArg.width = document.getElementsByTagName('body')[0].getBoundingClientRect().width;
-            deviceArg.height = document.getElementsByTagName('body')[0].getBoundingClientRect().height;
-            //deviceArg.w = document.body.clientWidth;
-            //返回相关信息
-            //console.log(deviceArg);
-            //console.log(deviceArg);
-            return deviceArg;
-        },
-        create: function(opts, type, width,height, dpi){
-            //设置相关参数,拼接meta
-            var domVal = this.tool(),
-                remVal,
-                remHeight,
-                viewport = document.querySelector('meta[name="viewport"]');
-
-            //此属性为当前设备的dpi
-            domVal.html.setAttribute('data-dpi', dpi);
-            remVal = type === 'iPhone' ? width * dpi / 10
-                : (dpi > 1) && (width < 540) ? width / 10 : 540 / 10;
-            remHeight = type === 'iPhone' ? height * dpi / 10
-                : (dpi > 1) && (height < 540) ? height / 10 : 540 / 10;
-            dpi = type === 'iPhone' ? dpi : 1;
-            if (opts.redraw && type === 'iPhone'){
-                remVal = remVal / dpi;
-            }
-            domVal.html.style.fontSize = remVal+ 'px';
-
-            //console.log(remVal);
-            //这里不是dpi,,模仿淘宝,另有深意,粗浅的理解大概是设置的缩放比例。
-            domVal.html.setAttribute('data-dpr', dpi);
-
-            //为不同设备添加一个区分class
-            domVal.body.setAttribute('class', type + ' ' + type + '-height-' + height +' '+ type+ '-width-' +width);
-            //设置 viewport 各个属性
-            //viewport.setAttribute('name', 'viewport');
-            viewport.setAttribute('content', 'width=device-width'
-                + ', initial-scale='+ 1 / dpi
-                + ', maximum-scale=' + 1 / dpi
-                + ', minimum-scale=' + 1 / dpi
-                + ', user-scalable=no');
-            domVal.head.appendChild(viewport);
-
-
-        },
-        set: function(opts){
-
-            // console.log('go on');
-            var deviceVal = this.device();
-            if( deviceVal.name == 'iPhone' ){
-                this.create(opts, 'iPhone', deviceVal.width,deviceVal.height, deviceVal.dpi);
-            }else if( deviceVal.name == 'iPad' ){
-                this.create(opts, 'iPad', deviceVal.width,deviceVal.height, deviceVal.dpi);
-            }else if( deviceVal.name == 'Android' ){
-                this.create(opts, 'Android', deviceVal.width,deviceVal.height, deviceVal.dpi);
-            }else{
-                this.create(opts, 'other', deviceVal.width,deviceVal.height, deviceVal.dpi);
-            }
-            //t = setTimeout(function(){
-            //    document.getElementsByClassName('fullpage')[0].style.height = '100%';
-            //},100);
-            window.setRem = 'end';
-        }
-        // ,
-        // test: function(){
-        //  var testArr = {};
-        //  testArr.android = window.navigator.appVersion.match(/android/gi);
-        //  testArr.iphone = window.navigator.appVersion.match(/iphone/gi);
-        //  testArr.ai = (testArr.android, testArr.iphone);
-        //  console.log(testArr);
-        // }
-    };
-
-    // window.setRem = setRem;
-    setRem.init({redraw: false});
-    addEventListener('resize', function () {
-        setRem.init({redraw: true});
-    }, false);
-    //设置AMD模块依赖
-    if (typeof define === 'function' && define.amd) {
-        define('rem', [], function () {
-            return setRem;
-        })
-    }
-}(window);
-
-
-
-
-

+ 22 - 21
data/resource/mobile/bonus/js/tel.js

@@ -6,7 +6,7 @@ $(function(){
             that.validate('#hack',that.msg.no_tel,that.btnname.just_white);
             //that.validate('#bind',that.msg.no_tel,that.btnname.just_white);
             that.time('#hack');
-            that.close('#close');
+            //that.close('#close');
             that.close('#go');
             that.active();
             that.blurValidatetel('keyup');
@@ -57,7 +57,7 @@ $(function(){
                     tel=new RegExp("^[1][3-8]+\\d{9}");
                 if(thisVal==''||(!tel.test(thisVal))){
                     that.b=false;
-                    return;
+                    return false;
                 }
                 else {
                     that.b=true;
@@ -66,18 +66,17 @@ $(function(){
         },
         //dom结构
         appendDom:function(msg,btnmsg){
-            var dom='<div class="bomb" id="bomb">'+
-                '<div class="bomb_box">'+
-                '<p class="center font14">'+msg+'</p>'+
-                '<div class="btn center">'+
-                '<div>'+
-                '<a href="javascript:void(0)" class="remove inline font14" id="go">'+btnmsg+'</a>'+
+            var dom='<div class="layer_box center" id="bomb">'+
+                '<div class="layer">'+
+                '<div class="top_msg">'+
+                '<p>'+msg+'</p>'+
                 '</div>'+
+                '<div class="bottom_btn">'+
+                '<p id="go">'+btnmsg+'</p>'+
                 '</div>'+
-                '<div class="close" id="close"></div>'+
                 '</div>'+
                 '</div>';
-            $('#fullPage').append(dom);
+            $('body').append(dom);
         },
         //关闭弹出
         close:function(id){
@@ -94,10 +93,10 @@ $(function(){
                         return;
                     }
                     tel = $("#tel_number").val();
-                    $.post($("#get_code_link").val(), {
-                        phone_num: tel
+                    $.post("http://localhost" + "/mobile/index.php?act=login&op=getcode&type=getbonus&client_type=ajax", {
+                        mobile: tel
                     }), function (data, status) {
-                        return;
+                        console.log(data);
                     };
 
                     var yzVal = $('#yanz').val(),
@@ -114,7 +113,7 @@ $(function(){
             $(id).on('touchstart', function () {
                 //判断倒计时是否开始了
                 var text = $(this).text();
-                if (text == '重新发送' || text == '获取') {
+                if (text == '重新发送' || text == '获取验证码') {
                     times();
                 }
                 else {
@@ -128,7 +127,7 @@ $(function(){
             $('#bind').on('touchstart', function () {
                 var b = that.b,
                     yanzVal = $('#yanz').val();
-                if (b == false && yanzVal == '') {
+                if (b == false) {
                     that.appendDom(that.msg.no_tel, that.btnname.just_white);
                 }
                 else {
@@ -139,15 +138,17 @@ $(function(){
                         var yanzVal = $("#yanz").val();
                         var tel = $("#tel_number").val();
                         var alink = $("#url").val();
+                        var bonus_sn = $("#mine_bonus").val();
 
-                        $.post($("#verify_code_link").val(), {
-                            phone_num: tel,
-                            verifyCode: yanzVal
+                        $.post("http://localhost" + "/mobile/index.php?act=bonusex&op=bind&client_type=ajax", {
+                            mobile: tel,
+                            code: yanzVal,
+                            bonus_sn:bonus_sn
                         }, function (data, status) {
-                            //alert(data+status);
-
+                            console.log(data);
                             if (data) {
-                                location.href = alink + "&phone_num=" + tel + "&verifyCode=" + yanzVal;
+                                $('#bind_link').hide();
+                                $('#link').css('display','block').addClass('link_but');
                             } else {
                                 that.appendDom(that.msg.yanz_err, that.btnname.rewrite);
                             }

+ 0 - 112
data/resource/mobile/bonus/js/tel_bak.js

@@ -1,112 +0,0 @@
-$(function(){
-    tel={
-        //总入口
-        init:function(){
-            var that=this;
-            that.validate('#hack',that.msg.no_tel,that.btnname.just_white);
-            that.validate('#bind',that.msg.no_tel,that.btnname.just_white);
-            that.time('#hack');
-            that.close('#close');
-            that.close('#go');
-            that.active();
-        },
-        //弹出信息
-        msg:{
-            no_tel:'请认真填写你的手机号',
-            no_yanz:'请填写验证码',
-            lg:'该手机已经领取过红包',
-            no_lq:'该手机不能领取红包',
-            remove:'获取验证码哦',
-            over:'该手机已经领取过红包',
-            no_pass:'该手机号不能领取红包'
-        },
-        //按钮信息
-        btnname:{
-            just_white:'这就写',
-            check:'知道了'
-        },
-        //判断验证顺序
-        b:false,
-        //插入验证结构
-        validate:function(id,msg,btnmsg){
-            var that=this;
-            $(id).on('touchstart',function(e){
-                e.preventDefault();//阻止浏览器默认事件
-                var telVal=$('#tel_number').val(),
-                    tel=new RegExp("^[1][3-8]+\\d{9}");
-                //console.log(tel.test(telVal));
-                //验证输入手机规则
-                if(telVal==''||(!tel.test(telVal))){
-                    that.appendDom(msg,btnmsg);//插入HTML弹窗结构
-                    that.b=false;
-                }
-                else{
-                    that.b=true;
-                    return;
-                }
-            })
-        },
-        //dom结构
-        appendDom:function(msg,btnmsg){
-            var dom='<div class="bomb" id="bomb">'+
-                '<div class="bomb_box">'+
-                '<p class="center font14">'+msg+'</p>'+
-                '<div class="btn center">'+
-                '<div>'+
-                '<a href="javascript:void(0)" class="remove inline font14" id="go">'+btnmsg+'</a>'+
-                '</div>'+
-                '</div>'+
-                '<div class="close" id="close"></div>'+
-                '</div>'+
-                '</div>';
-            $('#fullPage').append(dom);
-        },
-        //关闭弹出
-        close:function(id){
-            $(id).live('touchstart',function(e){
-                e.preventDefault();
-                $('#bomb').remove();
-            });
-        },
-        //倒计时
-        time:function(id,msg,btnmsg){
-            var that=this,
-                times=function(){
-                    if(that.b==false){
-                        return;
-                    }
-                    var yzVal=$('#yanz').val(),
-                        time=60,
-                        a=setInterval(function(){
-                            time=time-1;
-                            $(id).text(time);
-                            if(time==0) {
-                                clearInterval(a);
-                                $(id).text('重新发送');
-                            }
-                        },1000);
-                };
-            $(id).on('touchstart',function(){
-                //判断倒计时是否开始了
-                var text=$(this).text();
-                if(text=='重新发送'||text=='去获取'){
-                    times();
-                }
-                else{
-                    return;
-                }
-            })
-        },
-        //验证码验证
-        active:function(){
-            var that=this;
-           $('#bind').on('touchstart',function(){
-               if(that.b==true&&$('#yanz').val()==''){
-                   that.appendDom(that.msg.no_yanz,that.btnname.just_white);
-               }
-
-           })
-        }
-    };
-    tel.init();
-});

+ 0 - 161
data/resource/mobile/bonus/js/touch.js

@@ -1,161 +0,0 @@
-;(function($){
-    var touch = {},
-        touchTimeout, tapTimeout, swipeTimeout, longTapTimeout,
-        longTapDelay = 750,
-        gesture
-
-    function swipeDirection(x1, x2, y1, y2) {
-        return Math.abs(x1 - x2) >=
-        Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
-    }
-
-    function longTap() {
-        longTapTimeout = null
-        if (touch.last) {
-            touch.el.trigger('longTap')
-            touch = {}
-        }
-    }
-
-    function cancelLongTap() {
-        if (longTapTimeout) clearTimeout(longTapTimeout)
-        longTapTimeout = null
-    }
-
-    function cancelAll() {
-        if (touchTimeout) clearTimeout(touchTimeout)
-        if (tapTimeout) clearTimeout(tapTimeout)
-        if (swipeTimeout) clearTimeout(swipeTimeout)
-        if (longTapTimeout) clearTimeout(longTapTimeout)
-        touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null
-        touch = {}
-    }
-
-    function isPrimaryTouch(event){
-        return (event.pointerType == 'touch' ||
-            event.pointerType == event.MSPOINTER_TYPE_TOUCH)
-            && event.isPrimary
-    }
-
-    function isPointerEventType(e, type){
-        return (e.type == 'pointer'+type ||
-        e.type.toLowerCase() == 'mspointer'+type)
-    }
-
-    $(document).ready(function(){
-        var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType
-
-        if ('MSGesture' in window) {
-            gesture = new MSGesture()
-            gesture.target = document.body
-        }
-
-        $(document)
-            .bind('MSGestureEnd', function(e){
-                var swipeDirectionFromVelocity =
-                    e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null;
-                if (swipeDirectionFromVelocity) {
-                    touch.el.trigger('swipe')
-                    touch.el.trigger('swipe'+ swipeDirectionFromVelocity)
-                }
-            })
-            .on('touchstart MSPointerDown pointerdown', function(e){
-                if((_isPointerType = isPointerEventType(e, 'down')) &&
-                    !isPrimaryTouch(e)) return
-                firstTouch = _isPointerType ? e : e.touches[0]
-                if (e.touches && e.touches.length === 1 && touch.x2) {
-                    // Clear out touch movement data if we have it sticking around
-                    // This can occur if touchcancel doesn't fire due to preventDefault, etc.
-                    touch.x2 = undefined
-                    touch.y2 = undefined
-                }
-                now = Date.now()
-                delta = now - (touch.last || now)
-                touch.el = $('tagName' in firstTouch.target ?
-                    firstTouch.target : firstTouch.target.parentNode)
-                touchTimeout && clearTimeout(touchTimeout)
-                touch.x1 = firstTouch.pageX
-                touch.y1 = firstTouch.pageY
-                if (delta > 0 && delta <= 250) touch.isDoubleTap = true
-                touch.last = now
-                longTapTimeout = setTimeout(longTap, longTapDelay)
-                // adds the current touch contact for IE gesture recognition
-                if (gesture && _isPointerType) gesture.addPointer(e.pointerId);
-            })
-            .on('touchmove MSPointerMove pointermove', function(e){
-                if((_isPointerType = isPointerEventType(e, 'move')) &&
-                    !isPrimaryTouch(e)) return
-                firstTouch = _isPointerType ? e : e.touches[0]
-                cancelLongTap()
-                touch.x2 = firstTouch.pageX
-                touch.y2 = firstTouch.pageY
-
-                deltaX += Math.abs(touch.x1 - touch.x2)
-                deltaY += Math.abs(touch.y1 - touch.y2)
-            })
-            .on('touchend MSPointerUp pointerup', function(e){
-                if((_isPointerType = isPointerEventType(e, 'up')) &&
-                    !isPrimaryTouch(e)) return
-                cancelLongTap()
-
-                // swipe
-                if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) ||
-                    (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30))
-
-                    swipeTimeout = setTimeout(function() {
-                        touch.el.trigger('swipe')
-                        touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)))
-                        touch = {}
-                    }, 0)
-
-                // normal tap
-                else if ('last' in touch)
-                // don't fire tap when delta position changed by more than 30 pixels,
-                // for instance when moving to a point and back to origin
-                    if (deltaX < 30 && deltaY < 30) {
-                        // delay by one tick so we can cancel the 'tap' event if 'scroll' fires
-                        // ('tap' fires before 'scroll')
-                        tapTimeout = setTimeout(function() {
-
-                            // trigger universal 'tap' with the option to cancelTouch()
-                            // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
-                            var event = $.Event('tap')
-                            event.cancelTouch = cancelAll
-                            touch.el.trigger(event)
-
-                            // trigger double tap immediately
-                            if (touch.isDoubleTap) {
-                                if (touch.el) touch.el.trigger('doubleTap')
-                                touch = {}
-                            }
-
-                            // trigger single tap after 250ms of inactivity
-                            else {
-                                touchTimeout = setTimeout(function(){
-                                    touchTimeout = null
-                                    if (touch.el) touch.el.trigger('singleTap')
-                                    touch = {}
-                                }, 250)
-                            }
-                        }, 0)
-                    } else {
-                        touch = {}
-                    }
-                deltaX = deltaY = 0
-
-            })
-            // when the browser window loses focus,
-            // for example when a modal dialog is shown,
-            // cancel all ongoing events
-            .on('touchcancel MSPointerCancel pointercancel', cancelAll)
-
-        // scrolling the window indicates intention of the user
-        // to scroll, not tap or swipe, so cancel all ongoing events
-        $(window).on('scroll', cancelAll)
-    })
-
-    ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown',
-        'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){
-            $.fn[eventName] = function(callback){ return this.on(eventName, callback) }
-        })
-})(Zepto)

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 2
data/resource/mobile/bonus/js/zepto.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2 - 0
data/resource/mobile/bonus/js/zepto.min.js


+ 1 - 1
helper/bonus/factory.php

@@ -16,7 +16,7 @@ class factory
     {
         try
         {
-            $type = type::crate_by_paramer($paramer);
+            $type = type::crate_by_input($paramer);
 
             $iGen = create_generator($type);
             $iGen->make_type();

+ 21 - 17
helper/bonus/generator.php

@@ -66,7 +66,9 @@ class GeneralGenerator extends IGenerator
 
         if($this->mType->isRandomAmount())
         {
-            $moneys = $this->separate_money($paramer);
+            $moneys = $this->separate_money($paramer,$min_val,$max_val);
+            Model('bonus_type')->edit(array('type_id' => $type_id),array('min_amount' => $min_val,'max_amount' => $max_val));
+
             foreach($moneys as $val)
             {
                 $datas = array('bonus_sn' => make_sn(),
@@ -105,35 +107,29 @@ class GeneralGenerator extends IGenerator
     /**
      * @param $paramer
      */
-    private function separate_money($paramer)
+    private function separate_money($paramer,&$min_val,&$max_val)
     {
         $min_amount = floatval($paramer['min_amount']) * 100;
-        $max_amount = floatval($paramer['max_amount']) * 100;
         $base_amount = $min_amount;
 
         $num = intval($paramer['total_num']);
         $total_amount = floatval($paramer['total_amount']) * 100 - $num * $base_amount;
-        $max_amount = $max_amount - $min_amount;
 
         $ret = array();
         for ($i = 0; $i < $num; $i++) {
-            array_push($ret,$base_amount / 100);
+            array_push($ret,$base_amount);
         }
+
+        $max_amount = $total_amount;
+        $max_val = 0;
         for ($i = 0; $i < $num && $total_amount > 0;)
         {
-            if ($total_amount > 0) {
-                $amount = mt_rand(0, $max_amount);
-            } else {
-                $amount = 0;
-            }
-            if($total_amount < $amount) {
-                $amount = $total_amount;
-            }
+            $amount = mt_rand(0, $max_amount);
 
-            if($ret[$i] * 100 +  $amount <= $base_amount + $max_amount) {
-                $ret[$i] += $amount / 100;
-                $total_amount -= $amount;
-            }
+            $ret[$i] += $amount;
+            $total_amount -= $amount;
+            $max_val = $ret[$i] > $max_val ? $ret[$i] : $max_val;
+            $max_amount = $total_amount;
 
             if($i == $num -1) {
                 $i = 0;
@@ -143,6 +139,14 @@ class GeneralGenerator extends IGenerator
         }
 
         //$y = array_sum($ret); //验证制造的数据是否可以正好相等
+        $max_val = $max_val / 100;
+        $min_val = $ret[0];
+        foreach ($ret as &$val) {
+            $min_val = $min_val > $val ? $val : $min_val;
+            $val = $val / 100;
+        }
+        $min_val = $min_val / 100;
+
         return $ret;
     }
 }

+ 2 - 1
helper/bonus/grab.php

@@ -51,9 +51,10 @@ class general_grab extends IGrab
         $user_bonus = Model('user_bonus');
         $isNew = false;
         $bonus = $user_bonus->grab($type_id,$time_out,$mobile,$session_id,$isNew);
-        $user_bonus = \user_bonus::create_by_param($bonus);
+
         if(!empty($bonus))
         {
+            $user_bonus = user_bonus::create_by_param($bonus);
             if($isNew == true)
             {
                 $bonus_val = $user_bonus->bonus_value();

+ 59 - 11
helper/bonus/manager.php

@@ -10,6 +10,7 @@ namespace bonus;
 
 use \errcode;
 use \Model;
+use \user_helper;
 
 class manager
 {
@@ -31,7 +32,8 @@ class manager
     public function get_typeinfo($type_sn)
     {
         $bonus_info = rcache($type_sn, self::type_prefix, '*');
-        if (empty($bonus_info)) {
+        if (empty($bonus_info))
+        {
             $type = type::create_by_sn($type_sn);
             $user_bonus = Model('user_bonus');
             $bonus_ex= $user_bonus->getTypeBinded(array('type_id' => $type->getType_id()));
@@ -44,9 +46,14 @@ class manager
                     $period = $lasted_time - $type->get_start_time();
                     $type_info['binded_period'] = intval($period / 60);
                 }
+                $type_info['binded_over'] = 1;
             } else {
                 $type_info['binded_period'] = 0;
+                $type_info['binded_over'] = 0;
             }
+            $type_sn = $type->getType_sn();
+            $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn={$type_sn}";
+            $ret['url'] = $url;
 
             $bonus_info = array('type_info' => $type->get_param(),'binded_info' => $bonus_ex);
             wcache($type_sn,array('infos' => serialize($bonus_info)),self::type_prefix);
@@ -57,7 +64,7 @@ class manager
         return $bonus_info;
     }
 
-    public function get_mine($type_sn)
+    public function get_mine_by_typesn($type_sn)
     {
         $bonus = $this->read_session($type_sn);
         if(empty($bonus))
@@ -65,7 +72,7 @@ class manager
             $mod_bonus = Model('user_bonus');
 
             $session_id = $_SESSION['PHPSESSID'];
-            if(isset($_SESSION['member_mobile']) && !empty($_SESSION['member_mobile'])) {
+            if(user_helper::isVerfiyMobile()) {
                 $condition = array('type_sn' => $type_sn,
                                     array('session_id' => $session_id,
                                           'user_mobile' => $_SESSION['member_mobile'],
@@ -98,6 +105,46 @@ class manager
         return $bonus;
     }
 
+    public function get_mine_by_bonussn($bonus_sn)
+    {
+        $bonus = $this->read_session('',$bonus_sn);
+        if(empty($bonus))
+        {
+            $mod_bonus = Model('user_bonus');
+            $session_id = $_SESSION['PHPSESSID'];
+            if(user_helper::isVerfiyMobile()) {
+                $condition = array('bonus_sn' => $bonus_sn,
+                                    array('session_id' => $session_id,
+                                          'user_mobile' => $_SESSION['member_mobile'],
+                                          '_op' => 'or'));
+            } else {
+                $condition = array('session_id' => $session_id,'type_sn' => $bonus_sn);
+            }
+
+            $bonusex = $mod_bonus->get($condition);
+            if(empty($bonusex)) {
+                return false;
+            }
+
+            if(count($bonusex) > 1)
+            {
+                foreach($bonusex as $val)
+                {
+                    if($val['user_mobile'] == $_SESSION['member_mobile']) {
+                        $this->write_session($val);
+                        return $val;
+                    }
+                }
+            }
+            else {
+                $this->write_session($bonusex[0]);
+                return $bonusex[0];
+            }
+        }
+
+        return $bonus;
+    }
+
     public function grab_bonus($type_sn)
     {
         $bonus = $this->read_session($type_sn);
@@ -109,17 +156,18 @@ class manager
                 'member_mobile' => $_SESSION['member_mobile']);
 
             $isNew = false; // 是否是一个新的红包
-            $bonus = factory::grab_bonus($param,$isNew);
-            if($bonus == false) {
-                return array();
+            $bonus_obj = factory::grab_bonus($param,$isNew);
+            if($bonus_obj == false) {
+                return false;
             }
             else
             {
-                $this->write_session($bonus->get_param());
-                if($isNew && $bonus->isBinded()) {
-                    dcache($bonus->type_sn(),self::type_prefix);
+                $this->write_session($bonus_obj->get_param());
+                if($isNew && $bonus_obj->isBinded()) {
+                    dcache($bonus_obj->type_sn(),self::type_prefix);
                 }
             }
+            $bonus = $bonus_obj->get_param();
         }
 
         return $bonus;
@@ -173,8 +221,8 @@ class manager
         $ret = Model('user_bonus')->bind($condition,$mobile);
         if($ret == true) {
             $bonus_val = $user_bonus->bonus_value();
-            Model('bonus_type')->edit(array('type_id' => $type_id,
-                'binded_num' => array('exp', 'binded_num+1'),
+            Model('bonus_type')->edit(array('type_id' => $type_id),
+                array('binded_num' => array('exp', 'binded_num+1'),
                 'remain_amount' => array('exp', "remain_amount-" . "{$bonus_val}")));
 
             $this->clear_session($bonus_sn);

+ 24 - 4
helper/bonus/type.php

@@ -49,7 +49,6 @@ class type
 //    private $max_amount;       // '随机红包最大额度',
 //    private $send_start_date;      // '发送红包时间',
 //    private $send_end_date;      // '发送红包结束时间',
-
 //    private $use_start_date;       // '使用红包最早时间',
 //    private $use_end_date;       // '红包使用截止时间'
 
@@ -68,16 +67,18 @@ class type
             $this->mParam['min_amount'] = 0;
             $this->mParam['max_amount'] = 0;
         }
-        else if($this->isRandomAmount()) {
+        else if($this->isRandomAmount())
+        {
             $this->mParam['fixed_money'] = 0;
             $this->mParam['min_amount'] = 0.01;
-            $max_def = self::def_maxamount * 100;
 
+            $max_def = self::def_maxamount * 100;
             $avg = ($this->mParam['total_amount'] * 100 - $this->mParam['total_num']) / $this->mParam['total_num'];
             $max_val = $avg * 2;
             $max = $max_def > $max_val ?  $max_val : $max_def;
             $this->mParam['max_amount'] = floatval($max) / 100;
         }
+
         $this->mParam['remain_amount'] = $this->mParam['total_amount'];
     }
 
@@ -138,15 +139,34 @@ class type
             return time() > $end_time;
         }
     }
+    public function binded_num() {
+        return $this->mParam['binded_num'];
+    }
     public function binded_over() {
         return intval($this->mParam['total_num']) == intval($this->mParam['binded_num']);
     }
+    public function min_amount() {
+        return $this->mParam['min_amount'];
+    }
+    public function max_amount() {
+        return $this->mParam['max_amount'];
+    }
+    public function isMaxAmount($value)
+    {
+        $max_val = intval(floatval($this->mParam['max_amount']) * 100);
+        return ($max_val == intval($value * 100));
+    }
 
-    static public function crate_by_paramer($paramer)
+    static public function crate_by_input($paramer)
     {
         return new type($paramer,self::create_type);
     }
 
+    static public function crate_by_paramer($paramer)
+    {
+        return new type($paramer,self::load_type);
+    }
+
     static public function create_by_sn($type_sn)
     {
         $bonus_type = Model('bonus_type');

+ 15 - 1
helper/bonus/user_bonus.php

@@ -19,6 +19,8 @@
 //  `grab_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '抢红包时间点',
 //  `session_id` varchar(45) NOT NULL DEFAULT '',
 
+namespace bonus;
+
 class user_bonus
 {
     private $mParamer;
@@ -44,6 +46,7 @@ class user_bonus
         $val = intval(floatval($this->mParamer['bonus_value']) * 100);
         return floatval($val) / 100;
     }
+
     public function type_sn() {
         return $this->mParamer['type_sn'];
     }
@@ -53,6 +56,18 @@ class user_bonus
     public function user_mobile() {
         return $this->mParamer['user_mobile'];
     }
+    public function user_name()
+    {
+        $user_name = $this->mParamer['user_name'];
+        if(empty($user_name)) {
+            $user_name = substr_replace($this->mParamer['user_mobile'], '****', 3, 4);
+        }
+        return $user_name;
+    }
+    public function get_time_format() {
+        $get_time = $this->mParamer['get_time'];
+        return strftime("%m-%d %H:%M",$get_time);
+    }
 
     static public function create_by_param($param) {
         return new user_bonus($param);
@@ -66,5 +81,4 @@ class user_bonus
         }
         return new user_bonus($items[0]);
     }
-
 }

+ 19 - 4
helper/bonus_helper.php

@@ -20,17 +20,27 @@ require_once (BASE_ROOT_PATH . '/helper/predeposit_helper.php');
 
 class bonus_helper
 {
+
     static public function filter_type($type_info) {
-        $fileds = 'type_sn,type_bless,send_type,sender_name,total_amount,total_num,grabed_num,binded_num,send_start_date';
+        $type = \bonus\type::crate_by_paramer($type_info);
+        $fileds = 'type_sn,type_bless,send_type,sender_name,total_amount,total_num,max_amount,grabed_num,binded_num,send_start_date';
         $ret = array();
         field_helper::copy_column($ret,$type_info,$fileds);
         $ret['time_out'] = \bonus\manager::grab_period_timeout;
+        if($type->binded_over()) {
+            $ret['binded_over'] = 1;
+        } else {
+            $ret['binded_over'] = 0;
+        }
+        $type_sn = $type->getType_sn();
+        $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn={$type_sn}";
+        $ret['url'] = $url;
 
         return $ret;
     }
 
     static public function filter_bonus($bonus_info) {
-        $fileds = 'bonus_sn,bonus_value,user_name,user_comment,get_time,status';
+        $fileds = 'bonus_sn,bonus_value,user_name,user_mobile,user_comment,get_time,status';
         $ret = array();
         field_helper::copy_column($ret,$bonus_info,$fileds);
         return $ret;
@@ -55,9 +65,14 @@ class bonus_helper
         return $manager->get_typeinfo($type_sn);
     }
 
-    static public function get_mine($type_sn) {
+    static public function get_mine_by_typesn($type_sn) {
+        $manager = new \bonus\manager();
+        return $manager->get_mine_by_typesn($type_sn);
+    }
+
+    static public function get_mine_by_bonussn($bonus_sn) {
         $manager = new \bonus\manager();
-        return $manager->get_mine($type_sn);
+        return $manager->get_mine_by_bonussn($bonus_sn);
     }
 
     static public function grab_bonus($type_sn)

+ 1 - 1
helper/sms_helper.php

@@ -24,7 +24,7 @@ class sms_helper
         elseif ($type == 'resetpass') { //重置密码需要在登录的状态下才可以执行。
             $itype = Sms::resetpass_code;
         } elseif ($type == 'getbonus') {
-            $itype = Sms::bonus_code;
+            $itype = Sms::getbonus_code;
         }
 
         $cur_time = time();

+ 23 - 0
helper/user_helper.php

@@ -34,4 +34,27 @@ class user_helper
     {
         return ($_SESSION['is_login'] == 1);
     }
+    static public function isVerfiyMobile()
+    {
+        if(self::isLogin()) {
+            return true;
+        }
+        else
+        {
+            if(isset($_SESSION['member_mobile']) && !empty($_SESSION['member_mobile'])) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+    }
+
+    static public function cur_mobile()
+    {
+        if(self::isVerfiyMobile()) {
+            return $_SESSION['member_mobile'];
+        } else {
+            return '';
+        }
+    }
 }

+ 171 - 29
mobile/control/bonusex.php

@@ -11,7 +11,7 @@ defined('InShopNC') or exit('Access Invalid!');
 require_once (BASE_ROOT_PATH . '/helper/bonus_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/predeposit_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/user_helper.php');
-
+require_once (BASE_ROOT_PATH . '/helper/sms_helper.php');
 
 class bonusexControl extends mobileControl
 {
@@ -49,16 +49,24 @@ class bonusexControl extends mobileControl
         }
         $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
 
-        $mine_bonus = bonus_helper::get_mine($type_sn);
-        if($mine_bonus != false) { //显示我抢到的红包,按照状态进行判断
+        $mine_bonus = bonus_helper::get_mine_by_typesn($type_sn);
+        if($mine_bonus != false)
+        { //显示我抢到的红包,按照状态进行判断
+            $bonus = \bonus\user_bonus::create_by_param($mine_bonus);
             $mine_bonus = bonus_helper::filter_bonus($mine_bonus);
-            return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info));
+
+            $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
+            if(!$bonus->isBinded()) {
+                return self::outsuccess($data,"bonus/bind");
+            } else {
+                return self::outsuccess($data,"bonus/content");
+            }
         }
         else
         {
             $type = \bonus\type::crate_by_paramer($type_infos['type_info']);
             if($type->binded_over()) {
-                return self::outerr(errcode::ErrBonusGrabNull,"红包已经被抢光");
+                return self::outerr(errcode::ErrBonusGrabNull,"手慢了,红包派完了","bonus/over");
             } else {
                 return self::outsuccess(array('type_info' => $type_info),"bonus/open");
             }
@@ -76,9 +84,9 @@ class bonusexControl extends mobileControl
             return self::outerr(errcode::ErrBonus,"无此红包.");
         }
 
-        $mine_bonus = bonus_helper::get_mine($type_sn);
+        $mine_bonus = bonus_helper::get_mine_by_typesn($type_sn);
         $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
-        if(!empty($mine_bonus)) { //显示我抢到的红包,按照状态进行判断
+        if($mine_bonus != false) { //显示我抢到的红包,按照状态进行判断
             $mine_bonus = bonus_helper::filter_bonus($mine_bonus);
         }
 
@@ -96,22 +104,62 @@ class bonusexControl extends mobileControl
         if(empty($type_infos)) {
             return self::outerr(errcode::ErrBonus,"无此红包.");
         }
-
-        $mine_bonus = bonus_helper::get_mine($type_sn);
         $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
-        if(!empty($mine_bonus)) { //显示我抢到的红包,按照状态进行判断
+
+        $mine_bonus = bonus_helper::get_mine_by_typesn($type_sn);
+        if($mine_bonus != false)
+        { //显示我抢到的红包,按照状态进行判断
+            $bonus_obj = \bonus\user_bonus::create_by_param($mine_bonus);
             $mine_bonus = bonus_helper::filter_bonus($mine_bonus);
-            return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info));
+
+            if($bonus_obj->isBinded()) {
+                return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
+            }
+            else
+            {
+                if(user_helper::isVerfiyMobile())
+                {
+                    $ret = bonus_helper::bind_bonus($bonus_obj->bonus_sn(),$_SESSION['PHPSESSID'],user_helper::cur_mobile());
+                    if($ret == true) {
+                        $mine_bonus = bonus_helper::get_mine_by_bonussn($bonus_obj->bonus_sn());
+                        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
+                    } else { //todo 此处是绑定错误...
+                        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/bind");
+                    }
+                } else {
+                    return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/bind");
+                }
+            }
         }
         else
         {
             $type = \bonus\type::crate_by_paramer($type_infos['type_info']);
             if($type->binded_over()) {
-                return self::outerr(errcode::ErrBonusGrabNull,"红包已经被抢光");
-            } else {
-                $mine_bonus = bonus_helper::grab_bonus($type_sn);
-                $mine_bonus = bonus_helper::filter_bonus($mine_bonus->get_param());
-                return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info));
+                return self::outerr(errcode::ErrBonusGrabNull,"手慢了,红包派完了","bonus/over");
+            }
+            else
+            {//从库里抢一个红包逻辑
+                $bonus = bonus_helper::grab_bonus($type_sn);
+                if($bonus == false) {
+                    return self::outerr(errcode::ErrBonusGrabNull,"手慢了,红包派完了","bonus/over");
+                }
+                else
+                {
+                    $bonus_obj = \bonus\user_bonus::create_by_param($bonus);
+                    $mine_bonus = bonus_helper::filter_bonus($bonus);
+                    if($bonus_obj->isBinded()) {
+                        $type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
+                        if(empty($type_infos)) {
+                            return self::outerr(errcode::ErrBonus,"无此红包.");
+                        }
+                        $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
+                        $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
+                        return self::outsuccess($data,"bonus/content");
+                    } else {
+                        $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
+                        return self::outsuccess($data,"bonus/bind");
+                    }
+                }
             }
         }
     }
@@ -121,36 +169,51 @@ class bonusexControl extends mobileControl
         if(!isset($_GET['bonus_sn']) || empty($_GET['bonus_sn'])) {
             return self::outerr(errcode::ErrParamter,"请输入红包序列号.");
         }
-
         $bonus_sn = $_GET['bonus_sn'];
-        if($_SESSION['is_login'] == 1) {
-            $mobile = $_SESSION['member_mobile'];
+
+        $mine_bonus = bonus_helper::get_mine_by_bonussn($bonus_sn);
+        if($mine_bonus == false) {
+            return self::outerr(errcode::ErrParamter, "您不能领没有抢到的红包.");
+        }
+
+        $bonus_obj = \bonus\user_bonus::create_by_param($mine_bonus);
+        if($bonus_obj->isBinded()) {
+            $type_sn = $bonus_obj->type_sn();
+            $type_infos = bonus_helper::get_typeinfo($type_sn);
+            $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
+            $mine_bonus = bonus_helper::filter_bonus($mine_bonus);
+            return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
+        }
+
+        if(user_helper::isVerfiyMobile()) {
+            $mobile = user_helper::cur_mobile();
         }
         else
         {
-            if (!isset($_GET['mobile']) || empty($_GET['mobile'])) {
-                return self::outerr(errcode::ErrParamter,"请输入手机号码.");
-            } else {
-                $mobile = $_GET['mobile'];
-                $_SESSION['member_mobile'] = $mobile;
+            $mobile = $_GET['mobile'];
+            $validator = new Validate();
+            $validator->setValidate(Validate::verify_mobile($mobile));
+            $err = $validator->validate();
+            if ($err != '') {
+                return self::outerr(errcode::ErrParamter, $err);
             }
-        }
 
-        if($_SESSION['is_login'] != 1)
-        {
             if(!isset($_GET['code']) || empty($_GET['code'])) {
                 return self::outerr(errcode::ErrParamter, "请输入验证码.");
             }
             $code = $_GET['code'];
-            $ret = sms_helper::check_code(Sms::register_code,$code);
+            $ret = sms_helper::check_code(Sms::getbonus_code,$code);
             if(is_array($ret)) {
                 return self::outerr($ret['code'], $ret['msg']);
+            } else {
+                $_SESSION['member_mobile'] = $mobile;
             }
         }
 
         $ret = bonus_helper::bind_bonus($bonus_sn,$_SESSION['PHPSESSID'],$mobile);
         if($ret == true) {
-            return self::outsuccess(NULL);
+            $mine_bonus = bonus_helper::get_mine_by_bonussn($bonus_sn);
+            return self::outsuccess($mine_bonus);
         } else {
             return self::outerr($ret['code'],$ret['msg']);
         }
@@ -174,4 +237,83 @@ class bonusexControl extends mobileControl
             return self::outerr(errcode::ErrBonusComment,"留言失败.");
         }
     }
+}
+
+function bonus_output_graburl($output)
+{
+    $type_info = $output['type_info'];
+    $type = \bonus\type::crate_by_paramer($type_info);
+    $type_sn = $type->getType_sn();
+    $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=grab&client_type=wap&type_sn={$type_sn}";
+    echo("<a href=\"{$url}\" target=\"_self\" class=\"open\"></a>");
+}
+
+function bonus_output_type($output)
+{
+    echo '<p class="p p_name">';
+    $type_info = $output['type_info'];
+    $type = \bonus\type::crate_by_paramer($type_info);
+
+    echo($type_info['sender_name'] . "的红包");
+    if($type->isRandomAmount()) {
+        echo '<s class="icon_pin"></s>';
+    }
+    echo '</p>';
+    echo '<p class="prompt">' . $type_info['type_bless'] . '</p>';
+}
+
+function bonus_output_mine($output)
+{
+    $mine_bonus = $output['mine_bonus'];
+    if(!empty($mine_bonus))
+    {
+        $bonus = \bonus\user_bonus::create_by_param($mine_bonus);
+        echo('<div class="price">');
+        echo('<p><span>' . $bonus->bonus_value() . '</span>元</p>');
+        echo('</div>');
+        echo('<input type="hidden" id="mine_bonus" value=' ."{$bonus->bonus_sn()}>");
+    }
+
+//    echo('<div class="link">');
+//    echo('<p><a href="javascript:void(0)">请下载熊猫美妆APP</a></p>');
+//    echo('</div>');
+}
+
+function bonus_output_bindedinfo($output)
+{
+    $type_info = $output['type_info'];
+    $type = \bonus\type::crate_by_paramer($type_info);
+
+    echo('<div class="prompt text_left">');
+
+    if($type->binded_over()) {
+        $prompt = "{$type->getTotal_num()}个红包";
+        $prompt .= ",";
+        $period = $type_info['binded_period'];
+        $prompt .= "{$period}分钟领完.";
+    } else {
+        $prompt = "领取 {$type->binded_num()}/{$type->getTotal_num()}";
+    }
+    echo('<p class="prompt pro">' .$prompt. '</p>');
+    echo('</div>');
+
+    $bined_info = $output['binded_info'];
+    if(empty($bined_info)) return;
+    foreach($bined_info as $val)
+    {
+        $bonus = \bonus\user_bonus::create_by_param($val);
+        echo('<div class="li">');
+        echo('<div class="li_left">');
+        echo('<p class="p">' . $bonus->user_name() .'</p>');
+        echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
+        echo('</div>');
+
+        echo('<div class="li_right">');
+        echo('<p class="p">' . $bonus->bonus_value() . '元</p>');
+        if($type->isMaxAmount($bonus->bonus_value()) && $type->isRandomAmount()) {
+            echo('<p class="king_box"><s class="king"></s>手气最佳</p>');
+        }
+        echo('</div>');
+        echo('</div>');
+    }
 }

+ 4 - 0
mobile/control/control.php

@@ -80,6 +80,10 @@ class mobileControl
         }
         else if($_SESSION['client_type'] == 'wap')
         {
+            Tpl::output("error",$msg);
+            if(!empty($page)) {
+                TPL::showpage($page);
+            }
 
         }
         else {

+ 11 - 3
mobile/control/login.php

@@ -22,7 +22,8 @@ class loginControl extends mobileHomeControl
 
     //客户登录身份类型
     protected $client_login_type_array = array(0, 1, 2);
-    private static $fields = 'member_id,member_mobile,member_wxopenid,member_name,member_truename,member_signname,member_nickname,member_avatar,member_sex,member_birthday,member_passwd,member_paypwd,member_email,member_mobile_bind,member_state';
+    private static $fields = 'member_id,member_mobile,member_wxopenid,member_name,member_truename,member_signname,' .
+    'member_nickname,member_avatar,member_sex,member_birthday,member_passwd,member_paypwd,member_email,member_mobile_bind,member_state';
 
     public function __construct()
     {
@@ -126,7 +127,8 @@ class loginControl extends mobileHomeControl
         }
 
         $member_info = $model_member->getMemberInfo($conditions,self::$fields);
-        field_helper::validate_null_string($member_info,'member_mobile,member_wxopenid,member_name,member_nickname,member_truename,member_signname,member_avatar,member_email,member_birthday');
+        field_helper::validate_null_string($member_info,'member_mobile,member_wxopenid,member_name,member_nickname,' .
+            'member_truename,member_signname,member_avatar,member_email,member_birthday');
         field_helper::validate_null_string($member_info,'member_sex','0');
 
         return $member_info;
@@ -196,7 +198,13 @@ class loginControl extends mobileHomeControl
         }
         else
         {
-            $member_info = array('member_mobile' => $mobile, 'member_type' => 0, 'member_passwd' => $password,'member_sex' => 0, 'member_name' => $mobile,'member_mobile_bind' => 1);
+            $member_info = array('member_mobile' => $mobile,
+                'member_type' => 0,
+                'member_passwd' => $password,
+                'member_sex' => 0,
+                'member_name' => $mobile,
+                'member_mobile_bind' => 1);
+
             $success = $model->addMember($member_info);
             if ($success == false) {
                 return self::outerr(errcode::ErrRegister);

+ 1 - 2
mobile/control/member_bonus.php

@@ -68,7 +68,7 @@ class member_bonusControl extends mbMemberControl
             if(isset($_SESSION['send_bonus'])) {
                 unset($_SESSION['send_bonus']);
             }
-            $url = BASE_SITE_URL . "mobile/index.php?act=bonusex&op=open&type_sn={$ret}";
+            $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&type_sn={$ret}";
             return self::outsuccess(array('type_sn' => $ret,'url' => "{$url}"));
         }
     }
@@ -114,7 +114,6 @@ class member_bonusControl extends mbMemberControl
             return self::outsuccess(array('bonus_types' => array(), 'mobile_page' => mobile_page(0)));
         }
 
-
         $ret = array_chunk($items,$this->page_size());
         $pages = count($ret);
         $page_no = $pages >= $this->page_no() ? $this->page_no() : $pages;

+ 53 - 0
mobile/templates/default/bonus/bind.php

@@ -0,0 +1,53 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>熊猫美妆红包</title>
+    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common.css"/>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/content.css"/>
+    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/js/zepto.min.js"></script>
+    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/js/tel.js"></script>
+</head>
+
+<body>
+<div class="maincontent center">
+    <div class="top">
+        <p class="title">红包详情</p>
+        <div class="logo"></div>
+    </div>
+    <div class="name">
+        <?php bonus_output_type($output); ?>
+    </div>
+    <?php bonus_output_mine($output); ?>
+
+    <div class="linqu_box" id="bind_link">
+        <div>
+            <p class="prompt tel_pro">输入手机号领取红包</p>
+        </div>
+        <div class="tel_box">
+            <div class="tel">
+                <input type="tel" placeholder="手机号" id="tel_number"/>
+            </div>
+            <div class="yanz">
+                <div class="yanz_num">
+                    <input type="tel" placeholder="请输入短信验证码" id="yanz"/>
+                </div>
+                <button id="hack">获取验证码</button>
+            </div>
+        </div>
+        <div class="just_button">
+            <p id="bind">提交领取</p>
+        </div>
+    </div>
+    <div class="link" id="link">
+        <p><a href="javascript:void(0)">请下载熊猫美妆APP享用红包</a></p>
+    </div>
+
+    <div class="list">
+        <?php bonus_output_bindedinfo($output); ?>
+    </div>
+</div>
+
+</body>
+</html>

+ 29 - 0
mobile/templates/default/bonus/content.php

@@ -0,0 +1,29 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>熊猫美妆红包</title>
+    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common.css"/>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/content.css"/>
+</head>
+
+<body>
+<div class="maincontent center">
+    <div class="top">
+        <p class="title">红包详情</p>
+        <div class="logo"></div>
+    </div>
+    <div class="name">
+            <?php bonus_output_type($output); ?>
+    </div>
+
+    <div class="list">
+        <?php
+            bonus_output_mine($output);
+            bonus_output_bindedinfo($output);
+        ?>
+    </div>
+</div>
+</body>
+</html>

+ 1 - 1
mobile/templates/default/bonus/open.php

@@ -31,7 +31,7 @@
                     <p><?php echo($output['type_info']['type_bless']); ?></p>
                 </div>
             <div>
-                <a href="javascript:void(0)" target="_self" class="open"></a>
+                <?php bonus_output_graburl($output); ?>
             </div>
         </div>
     </div>

+ 28 - 0
mobile/templates/default/bonus/over.php

@@ -0,0 +1,28 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>熊猫美妆红包</title>
+    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common.css"/>
+</head>
+
+<body>
+<div class="maincontent">
+    <div class="bg_position cloud_left"></div>
+    <div class="bg_position cloud_right"></div>
+    <div class="bg_position dot_left"></div>
+    <div class="bg_position dot_right"></div>
+    <div class="content center">
+        <div class="logo"></div>
+        <div class="msg_bottom">
+            <p>手慢了,红包派完了</p>
+        </div>
+        <div>
+            <p class="look"><a href="javascript:void(0)">查看领取详情></a></p>
+        </div>
+
+    </div>
+</div>
+</body>
+</html>

+ 37 - 0
mobile/templates/default/bonus/success.php

@@ -0,0 +1,37 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>熊猫美妆红包</title>
+    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/base.css"/>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/index_commcon.css"/>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/success.css"/>
+</head>
+<body>
+<div class="fullPage">
+    <div class="top">
+        <div class="rope"></div>
+        <div class="bag_header center">
+            <p class="price_b font24"><span><?php echo($output['bonus_value']) ?></span></p>
+
+            <p class="font14"><?php echo($output['words']) ?></p>
+        </div>
+        <div class="bag_center center">
+           
+    </div>
+    <div class="footer"></div>
+    <div class="banner center">
+        <div class="logo left"></div>
+        <div class="banner_title inline center">
+            <p class="font15 center">立刻去下载(熊猫美妆)</p>
+
+            <p class="font12 center">开启你口袋里的化妆包吧</p>
+        </div>
+        <div class="down right"></div>
+    </div>
+</div>
+<script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/j
+s/rem.js"></script>
+</body>
+</html>