Sfoglia il codice sorgente

修改红包页面样式

stanley-king 8 anni fa
parent
commit
9dfdaf0b13

+ 246 - 0
data/resource/mobile/bonus/css/common_rem.css

@@ -0,0 +1,246 @@
+html,
+body,
+p,
+a,
+img
+{
+    padding: 0;
+    margin: 0;
+}
+html {
+    min-height: 100%;
+    height: 100%;
+    font-family: PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif;
+    background: #FFFAF5;
+}
+body {
+    min-height: 100%;
+    height: 100%;
+    position: relative;
+    background: #FFFAF5;
+}
+@font-face {
+    font-family: aAlternate;
+    src:url('../fonts/din-alternate-bold.woff') format('woff')
+}
+img {border: none}
+input,textarea {
+    -webkit-appearance: none;
+    outline: none;
+    resize: none;
+    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;*/
+    /*}*/
+/*}*/
+/*@media screen and (min-width: 320px) and (max-width:374px){*/
+    /*html {*/
+        /*font-size: 12.5px;*/
+    /*}*/
+/*}*/
+/*@media screen and (min-width: 375px){*/
+    /*html {*/
+        /*font-size: 14px;*/
+    /*}*/
+/*}*/
+.maincontent {
+    width: 10rem;
+    height: 100%;
+    margin: 0 auto;
+    background: #e14f48;
+    position: relative;
+    color: #ffe7b8;
+}
+.bg_position {
+    position: absolute;
+}
+.cloud_left,.cloud_right {
+    width: 44px;
+    height: 17px;
+    background: url("../imgaes/cloud.png") no-repeat;
+    background-size: 100% 100%;
+}
+.cloud_left {
+    bottom: 3%;
+    left: 4%;
+}
+.cloud_right {
+    bottom: 3%;
+    right: 4%;
+}
+.dot_right,.dot_left {
+    width: 5px;
+    height: 5px;
+    border-radius: 10px;
+    background: #ff8a6b;
+    z-index: 999;
+}
+.dot_left {
+    top: 2%;
+    left: 3%;
+}
+.dot_right {
+    top: 2%;
+    right: 3%;
+}
+.center {
+    text-align: center;
+}
+.content {
+    width: 100%;
+    height: 60%;
+    background: url("../imgaes/top_bg.png") no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    padding-top: 74px
+}
+.open{
+    position: absolute;
+    width: 7rem;
+    height: 7rem;
+    left: 50%;
+    bottom: 0;
+    margin-left: -3.5rem;
+    margin-bottom: -3.5rem;
+    background: url(../imgaes/icon_open.png) no-repeat;
+    background-size: 100% 100%;
+    z-index: 999;
+}
+.logo {
+    color: #FDD9AA;
+    font-size: 17px;
+    font-weight: bold;
+}
+[data-dpr="2"] .logo {
+    font-size: 34px;
+}
+[data-dpr="3"] .logo {
+    font-size: 54px;
+}
+.msg_box {
+    line-height: 2.4rem;
+}
+.name {
+    font-size: 2rem;
+}
+.msg {
+    font-size: 1.2rem;
+    color: #ffd39b;
+}
+.msg_bottom {
+    margin-top: 75px;
+}
+.msg_bottom p {
+    font-size: 2rem;
+    padding:0 2rem ;
+    line-height: 2.3rem;
+}
+.look {
+    position: absolute;
+    left: 50%;
+    bottom: -20%;
+    width: 7rem;
+    margin-left: -3.5rem;
+}
+.look a {
+    display: block;
+}
+.arrow_icon {
+    display: inline-block;
+    width: 0.8rem;
+    height: 0.8rem;
+    background: url("../imgaes/arrow_icon.jpg") no-repeat;
+    background-size: 100% 100%;
+    vertical-align: middle;
+}
+
+.coin_f {
+    position: absolute;
+    width: 100px;
+    height: 100px;
+    left: 50%;
+    bottom: 0;
+    margin-left: -50px;
+    margin-bottom: -50px;
+    -webkit-perspective: 5000;
+}
+.coin {
+    width: 100%;
+    height: 100%;
+    background: url("../imgaes/coin.png") no-repeat;
+    background-size: 100% 100%;
+    opacity: 0;
+    -webkit-transform: rotateY(0deg);
+}
+@-webkit-keyframes coin {
+    0% {
+        opacity: 0;
+        -webkit-transform: rotateY(0deg);
+    }
+    100% {
+        opacity: 1;
+        -webkit-transform: rotateY(360deg);
+    }
+}
+.gold_coin{
+    -webkit-animation: coin 1s ease-out ;
+}
+.time_over {
+    margin-top: 75px;
+    font-size: 1.4rem;
+    line-height: 1.8rem;
+}
+.bottom_pro {
+    position: absolute;
+    bottom: 8%;
+    left: 0;
+    width: 100%;
+    color: #fff;
+    font-size: 10px;
+    line-height:1.1rem;
+}
+.icon_logo {
+    display: inline-block;
+    width: 0.8rem;
+    height: 0.8rem;
+    background: url("../imgaes/icon_logo.png") no-repeat;
+    background-size: 100% 100%;
+    vertical-align: middle;
+    margin-right: 0.3rem;
+}
+.time_box {
+    background: url("../imgaes/time_bg.png") no-repeat;
+    background-size: 100%;
+    width: 22.5rem;
+    height: 3.54rem;
+    margin: 2.92rem auto 0 auto;
+    font-family: aAlternate;
+    font-weight: bolder;
+    padding-left: 1px;
+}
+.time_box div {
+    float: left;
+    width: 5.3rem;
+    height: 3.54rem;
+    color: #fff;
+    font-size: 3.1rem;
+    letter-spacing: 1.73rem;
+    padding-left: 0.7rem;
+    line-height: 3.7rem;
+}
+.time_box div.min {
+    margin: 0 2.3rem 0 2rem;
+    width: 5.2rem;
+    padding-left: 0.82rem;
+    letter-spacing: 1.72rem;
+}
+.time_box div.second {
+    letter-spacing: 1.69rem;
+}

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

@@ -0,0 +1,403 @@
+body {
+    height: auto;
+    min-height: 100%;
+}
+.maincontent {
+    background: #FFFAF5;
+}
+.top {
+    height: 2.68rem;
+    background: url("../imgaes/content_bg.png") no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    padding-top: 0.21rem;
+}
+.title {
+    font-size: 1.2rem;
+    padding-left: 0.6rem;
+    margin-top: -0.2rem;
+}
+.prompt {
+    font-size: 14px;
+    color: #7E7E7E;
+    margin-top: 0.27rem;
+}
+.list .prompt {
+    margin: 0.1rem 0 0 0;
+}
+[data-dpr="2"] .prompt {
+    font-size: 28px;
+}
+[data-dpr="3"] .prompt {
+    font-size: 42px;
+}
+.pro {
+    padding: 0 0.4rem;
+    font-size: 14px;
+    height: 1.07rem;
+    background: #FAF6F1;
+    line-height: 1.35rem;
+}
+[data-dpr="2"] .pro {
+    font-size: 28px;
+}
+[data-dpr="3"] .pro {
+    font-size: 42px;
+}
+.icon_pin {
+    display: inline-block;
+    width: 0.37rem;
+    height: 0.37rem;
+    background: url("../imgaes/icon_pin.png") no-repeat;
+    background-size: 100% 100%;
+    margin-left: 0.1rem;
+    vertical-align: inherit;
+}
+div.link a{
+    color: #307DD6;
+    font-size: 14px;
+    display: block;
+}
+[data-dpr='2'] div.link a {
+    font-size: 28px;
+}
+[data-dpr='3'] div.link a {
+    font-size: 42px;
+}
+.p {
+    color: #454545;
+    font-size: 16px;
+}
+[data-dpr="2"] .p {
+     font-size: 32px;
+}
+[data-dpr="3"] .p {
+    font-size: 48px;
+}
+.li {
+    display: table;
+    width: 9.2rem;
+    padding: 0.4rem 0.4rem 0.4rem 0.4rem;
+    position: relative;
+}
+.li:before {
+    content: '';
+    position: absolute;
+    width: 9.6rem;
+    height: 1px;
+    bottom: 0;
+    right: 0;
+    -webkit-transform: scaleY(.5);
+    -webkit-transform-origin: 0 0;
+    background: #d9d9d9;
+    z-index: 999;
+}
+.pro {
+    margin-top: 0.67rem;
+    position: relative;
+}
+.pro:after {
+    content: '';
+    position: absolute;
+    width: 10rem;
+    height: 1px;
+    top: 0;
+    right: 0;
+    -webkit-transform: scaleY(.5);
+    -webkit-transform-origin: 0 0;
+    background: #d9d9d9;
+    z-index: 999;
+}
+.pro:before {
+    content: '';
+    position: absolute;
+    width: 10rem;
+    height: 1px;
+    bottom: 0;
+    right: 0;
+    -webkit-transform: scaleY(.5);
+    -webkit-transform-origin: 0 0;
+    background:#d9d9d9;
+    z-index: 999;
+}
+.text_left {
+    text-align: left;
+}
+.li_left,.li_right {
+    display: table-cell;
+    line-height: 0.55rem;
+}
+.li_left {
+    width: 5.25rem;
+    text-align: left;
+    margin-left: 0.2rem;
+}
+.li_right {
+    text-align: right;
+}
+.li_head_image {
+    display: table-cell;
+    width: 1.066666rem;
+    vertical-align: top;
+    padding-right: 0.373rem;
+}
+.li_head_image img {
+    width: 100%;
+    max-height: 1.066666rem;
+    border-radius:2rem;
+}
+.li .p {
+    width: 100%;
+    height: 0.48rem;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: normal;
+}
+.king_box {
+    color: #ffad4a;
+    font-size: 14px;
+}
+[data-dpr="2"] .king_box {
+    font-size: 28px;
+}
+[data-dpr="3"] .king_box {
+    font-size: 42px;
+}
+.king {
+    display: inline-block;
+    width: 0.4rem;
+    height: 0.33333rem;
+    background: url(../imgaes/icon_king.png) no-repeat;
+    background-size: 100% 100%;
+    margin-right: 0.1rem;
+    margin-bottom: 0.05rem;
+    vertical-align: middle;
+}
+.name {
+    margin-top: 1.07rem;
+}
+p.p_name {
+    font-size: 16px;
+    font-weight: bolder;
+}
+[data-dpr="2"] p.p_name {
+    font-size: 32px;
+}
+[data-dpr="3"] p.p_name {
+    font-size: 48px;
+}
+.price p {
+    color: #454545;
+    margin-top: 0.41rem;
+}
+.price p span {
+    font-size: 65px;
+    vertical-align: sub;
+}
+[data-dpr="2"] .price p span{
+    font-size: 130px;
+}
+[data-dpr="3"] .price p span{
+    font-size: 195px;
+}
+.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: 1.2rem;
+    line-height: 1.2rem;
+    margin-top: 15px;
+    font-size: 0.48rem;
+}
+.tel_pro {
+    color: #454545;
+    margin:0.18rem 0;
+}
+input,button {
+    outline: none;
+    -webkit-appearance: none;
+    border: none;
+    background: #FFFAF5;
+    font-size: 0.4rem;
+}
+.tel,.yanz {
+    height: 0.96rem;
+}
+.tel {
+    border-bottom: 1px solid #e3e3e3;
+}
+.tel input {
+    height: 0.96rem;
+    width: 98%;
+    display: inline-block;
+}
+.yanz {
+    margin-top: 2%;
+}
+.yanz input,.yanz button{
+    height: 0.96rem;
+    display: inline-block;
+}
+.yanz_num {
+    display: inline-block;
+    width: 56%;
+    height:0.96rem;
+}
+.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: 0.5rem;
+}
+.layer {
+    background: #fff;
+    width: 8rem;
+    height: 4.27rem;
+    position: fixed;
+    top: 25%;
+    left: 50%;
+    margin-left: -40%;
+    border-radius: 10px;
+}
+.top_msg{
+    height: 2.93rem;
+    line-height:  2.93rem;
+}
+.top_msg p {
+    height: 100%;
+}
+.bottom_btn {
+    background: #ff4e4e;
+    height: 1.3333rem;
+    line-height: 1.3333rem;
+    border-bottom-right-radius: 10px;
+    border-bottom-left-radius: 10px;
+    color: #fff;
+}
+.down_icon {
+    display: inline-block;
+    width: 0.44rem;
+    height: 0.54rem;
+    background: url("../imgaes/down_icon.png") no-repeat;
+    background-size: 100%;
+    margin-right: 0.1rem;
+    vertical-align: middle;
+}
+.hilt {
+    background: url("../imgaes/hilt_bg.png") center right no-repeat;
+    background-size: 100%;
+    display: inline-block;
+    font-size: 11px;
+    font-weight: bold;
+    height:100%;
+    text-align: center;
+    color: #454545;
+    width: 0.77rem;
+    margin-top: 0.1rem;
+}
+[data-dpr="2"] .hilt {
+    font-size: 22px;
+}
+[data-dpr="3"] .hilt {
+    font-size: 33px;
+}
+.list_hilt {
+    position: relative;
+    height: 0.41rem;
+    line-height: 0.41rem;
+    vertical-align: text-bottom;
+    margin-left: 0.1rem;
+}
+.partook_box {
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    height: 6.78rem;
+    background: #f7f7f7;
+}
+.partook_btn {
+    display: table;
+    width: 100%;
+    height: 100%;
+    text-align: center;
+}
+.wx_icon,.py_icon {
+    display: block;
+    width: 2.89rem;
+    height: 2.89rem;
+    margin: 0 auto;
+}
+.wx_icon {
+    background: url("../imgaes/wx_icon.png") center no-repeat;
+    background-size: 100%;
+}
+.py_icon {
+    background: url("../imgaes/py_icon.png") center no-repeat;
+    background-size: 100%;
+}
+.wx,.friend{
+    display: table-cell;
+    width: 50%;
+    color: #4d4d4d;
+    vertical-align: middle;
+}
+.partook_btn p {
+    padding-top: 0.8rem;
+}
+.sender_head {
+    position: absolute;
+    width: 1.6rem;
+    height: 1.6rem;
+    bottom: 0;
+    left: 50%;
+    margin-left: -0.8rem;
+    margin-bottom: -0.8rem;
+    border-radius: 1.6rem;
+    overflow: hidden;
+}
+.sender_head img {
+    width: 100%;
+    text-align: center;
+    -webkit-transform: scale(1.02);
+}
+#my_prompt {
+    margin: 0;
+}

+ 0 - 0
data/resource/mobile/bonus/imgaes/coin.png


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


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


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


+ 0 - 0
data/resource/mobile/bonus/imgaes/icon_open.png


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


+ 27 - 1
helper/bonus/manager.php

@@ -8,6 +8,8 @@
 
 namespace bonus;
 
+require_once (BASE_ROOT_PATH . '/helper/model_helper.php');
+
 use \session_helper;
 use \member_info;
 
@@ -28,6 +30,23 @@ class manager
 
     const type_prefix = 'bonus_type';
 
+    private function avatars($user_ids)
+    {
+        $result = [];
+
+        $mod_member = Model('member');
+        $items = $mod_member->getMemberList(array('member_id' => array('in',$user_ids)));
+        foreach ($items as $item) {
+            $member = new member_info($item);
+            $uid = $member->member_id();
+            $avatar = $member->avatar();
+
+            $result[$uid] = $avatar;
+        }
+
+        return $result;
+    }
+
     public function get_typeinfo($type_sn)
     {
         $bonus_info = rcache($type_sn, self::type_prefix, '*');
@@ -60,11 +79,18 @@ class manager
                 }
             }
 
+            $user_ids = [];
+            $user_ids[] = $type->sender_id();
+            foreach ($bonus_ex as $bonus) {
+                $user_ids[] = intval($bonus['user_id']);
+            }
+            $user_avatars = $this->avatars($user_ids);
+
             $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_info,'binded_info' => $bonus_ex);
+            $bonus_info = array('type_info' => $type_info,'binded_info' => $bonus_ex,'avatars' => $user_avatars);
             wcache($type_sn,array('infos' => serialize($bonus_info)),self::type_prefix);
         }
         else {

+ 9 - 8
helper/bonus_helper.php

@@ -31,9 +31,10 @@ class bonus_helper
     static public function filter_type($type_info)
     {
         $type = \bonus\type::create_by_paramer($type_info);
-        $fileds = 'type_sn,type_bless,send_type,sender_name,total_amount,remain_amount,total_num,max_amount,bonus_rate,grabed_num,binded_num,send_start_date,send_end_date,binded_over,binded_period,grab_lastime,make_type';
-        $ret = array();
-        field_helper::copy_column($ret,$type_info,$fileds);
+        //$fileds = 'type_sn,type_bless,send_type,sender_name,total_amount,remain_amount,total_num,max_amount,bonus_rate,grabed_num,binded_num,send_start_date,send_end_date,binded_over,binded_period,grab_lastime,make_type';
+        //$ret = array();
+        //field_helper::copy_column($ret,$type_info,$fileds);
+        $ret = $type->get_param();
         $ret['time_out'] = \bonus\manager::grab_period_timeout;
         if($type->binded_over()) {
             $ret['binded_over'] = 1;
@@ -57,13 +58,13 @@ class bonus_helper
     }
 
     static public function filter_bonus($bonus_info) {
-        $fileds = 'bonus_sn,bonus_value,user_name,user_mobile,user_comment,get_time,bonus_status';
-        $ret = array();
-        field_helper::copy_column($ret,$bonus_info,$fileds);
+        //$fileds = 'bonus_sn,bonus_value,user_name,user_mobile,user_comment,get_time,bonus_status';
+        //$ret = array();
+        //field_helper::copy_column($ret,$bonus_info,$fileds);
         if(empty($bonus_info['user_name'])) {
-            $ret['user_name'] = substr_replace($bonus_info['user_mobile'], '****', 3, 4);
+            $bonus_info['user_name'] = substr_replace($bonus_info['user_mobile'], '****', 3, 4);
         }
-        return $ret;
+        return $bonus_info;
     }
 
     static public function isFixed($send_type) {

+ 101 - 40
mobile/control/bonusex.php

@@ -12,8 +12,8 @@ require_once (BASE_ROOT_PATH . '/helper/bonus_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/predeposit_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/session_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/sms_helper.php');
-require_once (BASE_MOBILE_PATH . "/control/login.php");
-
+require_once (BASE_ROOT_PATH . '/helper/model_helper.php');
+require_once (BASE_ROOT_PATH . '/helper/bonus_share.php');
 
 class bonusexControl extends mobileControl
 {
@@ -21,9 +21,10 @@ class bonusexControl extends mobileControl
         parent::__construct();
     }
 
-    private function fileter_typeinfos($type_infos,&$type_info,&$binded_info)
+    private function fileter_typeinfos($type_infos,&$type_info,&$binded_info,&$avatars)
     {
         $type_info = bonus_helper::filter_type($type_infos['type_info']);
+        $avatars = $type_infos['avatars'];
 
         $binded_info = array();
         $binded_infos = $type_infos['binded_info'];
@@ -57,7 +58,7 @@ class bonusexControl extends mobileControl
         if(empty($type_infos)) {
             return self::outerr(errcode::ErrBonus,"无此红包.");
         }
-        $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
+        $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
         $type = \bonus\type::create_by_paramer($type_infos['type_info']);
 
         $isMineType = $this->isMineType($type);
@@ -78,7 +79,7 @@ class bonusexControl extends mobileControl
                     $mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
                 }
             }
-            $data = 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,'avatars' => $avatars);
             if($bonus->isBinded() || $isMineType) {
                 return self::outsuccess($data,"bonus/content");
             }
@@ -107,7 +108,10 @@ class bonusexControl extends mobileControl
             else
             {
                 if($type->isEnd() || $type->binded_over()) {
-                    return self::outsuccess(array('type_info' => $type_info,'binded_info' => $binded_info),'bonus/detail');
+                    return self::outsuccess(array('type_info' => $type_info,
+                        'binded_info' => $binded_info,
+                        'avatars' => $avatars),
+                        'bonus/detail');
                 }
                 else {
                     return self::outsuccess(array('type_info' => $type_info),"bonus/open");
@@ -126,7 +130,7 @@ class bonusexControl extends mobileControl
         if(empty($type_infos)) {
             return self::outerr(errcode::ErrBonus,"无此红包.");
         }
-        $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
+        $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
 
         $type = \bonus\type::create_by_paramer($type_infos['type_info']);
         if($type->isStart() == false) {
@@ -138,7 +142,11 @@ class bonusexControl extends mobileControl
             $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/detail');
+        return self::outsuccess(array('type_info' => $type_info,
+            'mine_bonus' => $mine_bonus,
+            'binded_info' => $binded_info,
+            'avatars' => $avatars),
+            'bonus/detail');
     }
 
     public function grabOp()
@@ -152,7 +160,7 @@ class bonusexControl extends mobileControl
         if(empty($type_infos)) {
             return self::outerr(errcode::ErrBonus,"无此红包.");
         }
-        $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
+        $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
 
         $type = \bonus\type::create_by_paramer($type_infos['type_info']);
         if($type->isStart() == false) {
@@ -166,7 +174,7 @@ class bonusexControl extends mobileControl
             $mine_bonus = bonus_helper::filter_bonus($mine_bonus);
 
             if($bonus_obj->isBinded()) {
-                return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
+                return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
             }
             elseif($type->isEnd()) {
                  return self::outsuccess(array('type_info' => $type_info),"bonus/end");
@@ -178,12 +186,12 @@ class bonusexControl extends mobileControl
                     $ret = bonus_helper::bind_bonus($bonus_obj->bonus_sn(),$_SESSION['MPHPSESSID'],session_helper::cur_mobile(),$new_sn);
                     if($ret == true) {
                         $mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
-                        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
+                        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
                     } else {
-                        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/bind");
+                        return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/bind");
                     }
                 } else {
-                    return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/bind");
+                    return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/bind");
                 }
             }
         }
@@ -211,11 +219,11 @@ class bonusexControl extends mobileControl
                         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);
+                        $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
+                        $data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars);
                         return self::outsuccess($data,"bonus/content");
                     } else {
-                        $data = 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,'avatars' => $avatars);
                         return self::outsuccess($data,"bonus/bind");
                     }
                 }
@@ -238,9 +246,9 @@ class bonusexControl extends mobileControl
         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);
+            $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
             $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");
+            return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
         }
 
         $type_sn = $bonus_obj->type_sn();
@@ -284,9 +292,9 @@ class bonusexControl extends mobileControl
             $mine_bonus = bonus_helper::get_mine_by_bonussn($new_bonus_sn);
             $bonus_obj = \bonus\user_bonus::create_by_param($mine_bonus);
             $type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
-            $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
+            $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
 
-            return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info));
+            return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info,'avatars' => $avatars));
         } else {
             return self::outerr($ret['code'],$ret['msg']);
         }
@@ -338,9 +346,9 @@ class bonusexControl extends mobileControl
                 {
                     $bonus = bonus_helper::get_mine_by_bonussn($bonus_obj->bonus_sn());
                     $type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
-                    $this->fileter_typeinfos($type_infos,$type_info,$binded_info);
+                    $this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
 
-                    return self::outsuccess(array('type_info' => $type_info,'mine_bonus' => $bonus,'binded_info' => $binded_info),"bonus/content");
+                    return self::outsuccess(array('type_info' => $type_info,'mine_bonus' => $bonus,'binded_info' => $binded_info,'avatars' => $avatars),"bonus/content");
                 } else {
                     return self::outsuccess(errcode::ErrBonus,"只有拼收起红包才可以摇哦~");
                 }
@@ -428,6 +436,23 @@ function bonus_output_grabinfo($output)
     }
 }
 
+function bonus_output_sender_header($output)
+{
+    $avatar = RESOURCE_SITE_URL . '/mobile/defimg/female.png';
+    $type_info = $output['type_info'];
+    $avatars = $output['avatars'];
+
+    if(!empty($type_info))
+    {
+        $type = \bonus\type::create_by_paramer($type_info);
+        $user_id = $type->sender_id();
+        if(array_key_exists($user_id,$avatars)) {
+            $avatar = $avatars[$user_id];
+        }
+    }
+    return $avatar;
+}
+
 function bonus_output_sender($output)
 {
     $type_info = $output['type_info'];
@@ -470,6 +495,7 @@ function bonus_output_graburl($output)
 
 function bonus_output_type($output)
 {
+    echo '<div class="name">';
     echo '<p class="p p_name" style="color:#454545">';
     $type_info = $output['type_info'];
     $type = \bonus\type::create_by_paramer($type_info);
@@ -478,12 +504,18 @@ function bonus_output_type($output)
         echo '<s class="icon_pin"></s>';
     }
     echo '</p>';
-
     echo '<p class="prompt">' . $type_info['type_bless'] . '</p>';
+    echo '</div>';
 }
 
 function bonus_output_mine($output)
 {
+    if($_SESSION['is_app']) {
+        $show_down = false;
+    } else {
+        $show_down = true;
+    }
+
     $mine_bonus = $output['mine_bonus'];
     if(!empty($mine_bonus)) {
         $bonus = \bonus\user_bonus::create_by_param($mine_bonus);
@@ -492,15 +524,14 @@ function bonus_output_mine($output)
         echo('</div>');
         echo('<input type="hidden" id="mine_bonus" value=' ."{$bonus->bonus_sn()}>");
 
-        if($bonus->isBinded()) {
-            echo('<div class="link" id="links">');
-            echo('<p style="margin: 20px 0"><a href="javascript:void(0)">请下载熊猫美妆APP,享用红包</a></p>');
-            echo('</div>');
-        }
+        $show_down = $bonus->isBinded() && $show_down;
+    } else {
+        $show_down = false;
     }
-    else {
-        echo('<div class="link">');
-        echo('<p style="margin: 20px 0><a href="javascript:void(0)">请下载熊猫美妆APP</a></p>');
+
+    if($show_down) {
+        echo('<div class="link" id="link">');
+        echo('<p><a href="javascript:void(0)"><span class="down_icon"></span>点击下载APP</a></p>');
         echo('</div>');
     }
 }
@@ -565,6 +596,7 @@ function bonus_out_bindedtime($period)
 function bonus_output_bindedinfo($output)
 {
     $type_info = $output['type_info'];
+    $avatars = $output['avatars'];
     $type = \bonus\type::create_by_paramer($type_info);
 
     echo('<div class="prompt text_left">');
@@ -583,24 +615,36 @@ function bonus_output_bindedinfo($output)
     $bined_info = $output['binded_info'];
     if(empty($bined_info)) return;
 
+    echo '<div class="list">';
+
+    $avatar = RESOURCE_SITE_URL . '/mobile/defimg/female.png';
     foreach($bined_info as $val)
     {
         $bonus = \bonus\user_bonus::create_by_param($val);
+        $user_id = $bonus->user_id();
+        if(array_key_exists($user_id,$avatars)) {
+            $avatar = $avatars[$user_id];
+        }
+
         echo('<div class="li">');
+        echo('<div class="li_head_image">');
+        echo('<img src="' . $avatar .'" />');
+        echo('</div>');
+
         echo('<div class="li_left">');
         echo('<p class="p">' . $bonus->user_name() .'</p>');
         if(empty($bonus->user_comment()))
         {
-            if($bonus->user_mobile() == $_SESSION['member_mobile']) {
-                echo ('<p class="prompt" id="my_prompt">');
-                echo ('<a href="javascript:void(0)" id="message" style="color: #1927D1">留言</a>');
-                echo ('</p>');
+            if($bonus->user_id() == $_SESSION['member_id']) {
+                echo('<p class="prompt" id="my_prompt"><a href="javascript:void(0)" id="message" style="color: #1927D1;display:inline-block;padding-top: 0.1rem;">留言</a></p>');
                 echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
             } else {
                 echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
                 echo('<p class="prompt"></p>');
             }
-        } else {
+        }
+        else
+        {
             echo('<p class="prompt">' . $bonus->user_comment() . '</p>');
             echo('<p class="prompt">' . $bonus->get_time_format() . '</p>');
         }
@@ -608,12 +652,14 @@ function bonus_output_bindedinfo($output)
         echo('</div>');
         echo('<div class="li_right">');
         echo('<p class="p">' . $bonus->bonus_value() . '元</p>');
+        echo('<p><span class="hilt">' . $bonus->bonus_rate() . '%</span></p>');
         if($type->binded_over() && $type->isMaxAmount($bonus->bonus_value()) && $type->isRandomAmount()) {
             echo('<p class="king_box"><s class="king"></s>手气最佳</p>');
         }
         echo('</div>');
         echo('</div>');
     }
+    echo('</div>');
 }
 
 function android_downpath()
@@ -622,14 +668,29 @@ function android_downpath()
     return $url;
 }
 
-function share_title()
+function share_title($output)
 {
-    return "丽人丽妆公司特权红包,内购正品行货美妆.";
+    $type_info = $output['type_info'];
+    $type = \bonus\type::create_by_paramer($type_info);
+    return $type->bless();
 }
 
-function share_image()
+function share_subtitle($output)
 {
-    return BASE_SITE_URL + "/panda.png";
+    $type_info = $output['type_info'];
+    $type = \bonus\type::create_by_paramer($type_info);
+    $share_id = $type->share_id();
+    $share = bonus_share::instance()->get($share_id);
+    return $share['sub_title'];
+}
+
+function share_image($output)
+{
+    $type_info = $output['type_info'];
+    $type = \bonus\type::create_by_paramer($type_info);
+    $share_id = $type->share_id();
+    $share = bonus_share::instance()->get($share_id);
+    return $share['img_url'];
 }
 
 

+ 3 - 0
mobile/control/control.php

@@ -76,11 +76,14 @@ class mobileControl
 
     protected function check_app_type()
     {
+        $_SESSION['is_app'] = false;
+
         $client = strtolower(trim($_SERVER['HTTP_CLIENT_TYPE']));
         $version = trim($_SERVER['HTTP_CLIENT_VERSION']);
 
         if (empty($client)) {
             $client = $_POST['client_type'];
+            $_SESSION['is_app'] = true;
         }
 
         if (empty($client) || !in_array($client, $this->client_type_array)) {

+ 15 - 15
mobile/templates/default/bonus/bind.php

@@ -3,22 +3,22 @@
 <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"/>
+    <meta name="format-detection" content="telephone=no" />
+    <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common_rem.css"/>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/content_rem.css"/>
 </head>
-
 <body>
 <div class="maincontent center">
     <div class="top">
-        <p class="title">红包详情</p>
         <div class="logo">
             <p>熊猫美妆</p>
         </div>
+        <div class="sender_head">
+            <img src="<?php echo bonus_output_sender_header($output); ?>"/>
+        </div>
     </div>
-    <div class="name">
-        <?php bonus_output_type($output); ?>
-    </div>
+    <?php bonus_output_type($output); ?>
     <?php bonus_output_mine($output); ?>
 
     <div class="linqu_box" id="bind_link">
@@ -40,13 +40,12 @@
             <p id="bind">提交领取</p>
         </div>
     </div>
+
     <div class="link" id="link">
-        <p><a href="#">请下载熊猫美妆APP享用红包</a></p>
+        <p><a href="javascript:void(0)"><span class="down_icon"></span>点击下载APP</a></p>
     </div>
 
-    <div class="list">
-        <?php bonus_output_bindedinfo($output); ?>
-    </div>
+    <?php bonus_output_bindedinfo($output); ?>
 </div>
 <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>
@@ -74,11 +73,12 @@
     }
     href();
 
-    var bonus_title = "<?php echo($output['type_info']['sender_name']); ?>" + "的熊猫美妆红包" ;
-    var sub_title = "<?php echo share_title(); ?>";
     var url_host=window.location.hostname;
     var url = "http://" + url_host + "/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn=" + "<?php echo($output['type_info']['type_sn']); ?>";
-    var img_url = "<?php echo share_image(); ?>";
+
+    var bonus_title = "<?php echo share_title($output); ?>";
+    var img_url     = "<?php echo share_image($output); ?>";
+    var sub_title   = "<?php echo share_subtitle($output); ?>";
 
     weiXinShare.init({
         title:bonus_title,

+ 7 - 11
mobile/templates/default/bonus/content.php

@@ -13,22 +13,18 @@
 <body>
 <div class="maincontent center">
     <div class="top">
-        <p class="title">红包详情</p>
         <div class="logo">
             <p>熊猫美妆</p>
         </div>
+        <div class="sender_head">
+            <img src="<?php echo bonus_output_sender_header($output); ?>"/>
+        </div>
     </div>
-    <div class="name">
-            <?php bonus_output_type($output); ?>
-    </div>
-
-    <div class="list">
-        <?php
-            bonus_output_mine($output);
-            bonus_output_bindedinfo($output);
-        ?>
-    </div>
+    <?php bonus_output_type($output); ?>
+    <?php bonus_output_mine($output); ?>
+    <?php bonus_output_bindedinfo($output); ?>
 </div>
+
 <script type="text/javascript">
     $(function(){
         function navtodown(){

+ 10 - 21
mobile/templates/default/bonus/detail.php

@@ -3,35 +3,24 @@
 <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"/>
+    <meta name="format-detection" content="telephone=no" />
+    <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/common_rem.css"/>
+    <link rel="stylesheet" href="<?php echo RESOURCE_SITE_URL; ?>/mobile/bonus/css/content_rem.css"/>
 </head>
-
 <body>
 <div class="maincontent center">
     <div class="top">
-        <p class="title">红包详情</p>
         <div class="logo">
             <p>熊猫美妆</p>
         </div>
+        <div class="sender_head">
+            <img src="<?php echo bonus_output_sender_header($output); ?>"/>
+        </div>
     </div>
-
-    <div class="name">
-        <?php bonus_output_type($output); ?>
-    </div>
-    <?php
-        //todo 此处要加是否xiaz
-        echo('<div class="link">');
-        echo('<a href="javascript:void(0)" id="href_link">请下载熊猫美妆APP</a>');
-        echo('</div>');
-    ?>
-
-    <div class="list">
-        <?php
-            bonus_output_bindedinfo($output);
-        ?>
-    </div>
+    <?php bonus_output_type($output); ?>
+    <?php bonus_output_mine($output); ?>
+    <?php bonus_output_bindedinfo($output); ?>
 </div>
 <script type="text/javascript">
     function app()