zhashaonan 6 년 전
부모
커밋
d2bec42a81

+ 2 - 1
data/resource/mobile/invite_friend/css/main.css

@@ -358,6 +358,7 @@ html {
     line-height: 38px;
     text-align: center;
     -webkit-transform: translateY(-50%);
+    border-radius: 8px;
 }
 .item .call_btn.called {
     background: #999999;
@@ -838,7 +839,7 @@ html {
 .tips_count {
     position: absolute;
     left: 0;
-    top: 1px;
+    top: 2px;
     width: 34px;
     height: 34px;
     line-height: 36px;

+ 2 - 2
mobile/control/control.php

@@ -325,9 +325,9 @@ class mbMemberControl extends mobileControl
 
 function bonus_version()
 {
-    return "v=2018092105";
+    return "v=2018092106";
 }
 function shop_version()
 {
-    return "v=2018092105";
+    return "v=2018092106";
 }

+ 40 - 61
mobile/control/invite_friend.php

@@ -149,17 +149,22 @@ class tpl_invite_friend
 
     public function show()
     {
-        $this->show_relay();
+
 //        if(!empty($this->mTypesn)) {
 //            $this->show_bonus();
 //        }
         $rewared = $this->show_rewared();
         $rewarding = $this->show_rewarding();
+
+        $relay = $this->show_relay();
 //        if($rewared == false && $rewarding == false) {
 //            $this->show_noinvitee();
 //        }
-        $this->show_prompt();
+        $prompt = $this->show_prompt();
+
+        echo $relay.$rewared.$rewarding.$prompt;
     }
+
     private function show_noinvitee()
     {
         echo "<div class=\"bonus_list\">";
@@ -170,42 +175,18 @@ class tpl_invite_friend
     private function show_relay()
     {
         $minfo = $this->mUserInfo;
-        $inviter_id = $minfo->inviter_id();
-//        $str = "<div class=\"user_msg\">
-//                    <div class=\"user\">
-//                        <div class=\"user_img\"><img src=\"{$minfo->avatar()}\"></div>
-//                        <div class=\"user_name\">{$minfo->nickname()}</div>";
-//        echo $str;
-//
-//
-//
-//        if($inviter_id > 0) {
-//            $url = BASE_SITE_URL . "/mobile/index.php?act=invite_friend&op=index&client_type=wap&curuser={$inviter_id}";
-//            $schema = schema_helper::openurl("邀请好友",$url);
-//            $inviter = new member_info($inviter_id);
-//            $str = "<div class=\"invite_user\">
-//                        <a href=\"{$schema}\">
-//                            <span class=\"label\">邀请者:</span><img src=\"{$inviter->avatar()}\" class=\"invite_img\">
-//                        </a>
-//                    </div>";
-//            echo $str;
-//        }
-//
-//        $str =     "</div>
-//                    <div class=\"get_bonus\">
-//                        <div class=\"total\"><span class=\"price\">{$minfo->reward_amount()}</span>元</div>
-//                        <p style='font-size: 28px;color: #666'>邀请好友累计获得收益</p>
-//                    </div>
-//                </div>";
-//        echo $str;
 
-        $str = "<div class=\"text_center mt14\">
-                    <p class=\"l_ht42 f30 col333\">已成功邀请 <span class=\"colDD4545\">30</span> 名小伙伴</p>
-                    <p class=\"l_ht42 f30 col333\">共获得 <span class=\"colDD4545\">{$minfo->reward_amount()}</span> 元红包</p>
+        $total_cnt = $this->reward_member_cnt + $this->rewarding_member_cnt;
+        if($total_cnt > 0) {
+            $str = "<div class=\"text_center mt14\">
+                    <p class=\"l_ht42 f30 col333\">已邀请 <span class=\"colDD4545\">30</span> 名好友,共获得 <span class=\"colDD4545\">{$minfo->reward_amount()}</span> 元红包</p>
                 </div>";
-
-        echo $str;
-
+        }else{
+            $str = "<div class=\"text_center mt14\">
+                    <p class=\"l_ht42 f30 col333\">您尚未邀请好友</p>
+                </div>";
+        }
+        return $str;
     }
 
 //    private function show_bonus()
@@ -221,10 +202,12 @@ class tpl_invite_friend
 //              </div>";
 //    }
 
+    private $reward_member_cnt = 0;
     private function show_rewared()
     {
+        $html = "";
         if(empty($this->mMineInfo) && empty($this->mRewardedInvites)) {
-            return false;
+            return $html;
         }
 
         if(!empty($this->mMineInfo) && $this->mMineInfo->rewared_inviter()) {
@@ -233,26 +216,27 @@ class tpl_invite_friend
             $count = count($this->mRewardedInvites);
         }
 
-        echo "<div class=\"bonus_list\">";
-//        echo "<div class=\"prompt_label\">
-//                    <span class=\"title\">已带来收益的好友<span class=\"invite_num\">({$count})</span></span>
-//              </div>";
+        $this->reward_member_cnt = $count;
+
+        $html .= "<div class=\"bonus_list\">";
 
         if(!empty($this->mMineInfo) && $this->mMineInfo->rewared_inviter()) {
-            $this->show_invitee($this->mMineInfo);
+            $html .= $this->show_invitee($this->mMineInfo);
         }
         foreach ($this->mRewardedInvites as $minfo) {
-            $this->show_invitee($minfo);
+            $html .= $this->show_invitee($minfo);
         }
-        echo "</div>";
+        $html .= "</div>";
 
-        return true;
+        return $html;
     }
 
+    private $rewarding_member_cnt = 0;
     private function show_rewarding()
     {
+        $html = "";
         if(empty($this->mMineInfo) && empty($this->mRewardingInvites)) {
-            return false;
+            return $html;
         }
 
         if(!empty($this->mMineInfo) && $this->mMineInfo->rewared_inviter() == false) {
@@ -261,20 +245,19 @@ class tpl_invite_friend
             $count = count($this->mRewardingInvites);
         }
 
-        echo "<div class=\"bonus_list\">";
-//        echo "<div class=\"prompt_label\">
-//                    <span class=\"title\">尚未带来收益的好友<span class=\"invite_num\">({$count})</span></span>
-//              </div>";
+        $this->rewarding_member_cnt = $count;
+
+        $html .= "<div class=\"bonus_list\">";
 
         if(!empty($this->mMineInfo) && $this->mMineInfo->rewared_inviter() == false) {
-            $this->show_invitee($this->mMineInfo);
+            $html .= $this->show_invitee($this->mMineInfo);
         }
         foreach ($this->mRewardingInvites as $minfo) {
-            $this->show_invitee($minfo);
+            $html .= $this->show_invitee($minfo);
         }
-        echo "</div>";
+        $html .= "</div>";
 
-        return true;
+        return $html;
     }
 
     private function show_prompt()
@@ -290,19 +273,16 @@ class tpl_invite_friend
                     </div>
                 </div>
                 <div class=\"briefing_address\"></div>";
-        echo $str;
+        return $str;
     }
 
     private function show_invitee($minfo)
     {
-        if(empty($minfo)) return;
+        if(empty($minfo)) return "";
         $user = $minfo->member_id();
         $called = $this->mCaller->called($user);
 
-        $url = BASE_SITE_URL . "/mobile/index.php?act=invite_friend&op=index&client_type=wap&curuser={$user}";
-        $schema = schema_helper::openurl("邀请好友",$url);
         $str = "<div class=\"item\">
-                        <a href=\"{$schema}\">
                             <div class=\"user_img\">
                             <img src=\"{$minfo->avatar()}\">
                             </div>
@@ -316,7 +296,6 @@ class tpl_invite_friend
                                <span class=\"arrow\"></span>
                             </div>";
         }
-        $str         .= "</a>";
 
         if($this->mMine)
         {
@@ -327,7 +306,7 @@ class tpl_invite_friend
             }
         }
         $str .= "</div>";
-        echo $str;
+        return $str;
     }
 
     public function show_open()

+ 9 - 9
mobile/templates/default/invite_friend/invite.php

@@ -69,15 +69,15 @@
             }
             e.preventDefault();
         };
-        document.getElementById('rules').addEventListener('click',function(e){
-            document.getElementById('pop').style.display = 'block';
-            window.addEventListener('touchmove',window_no_scroll);
-        });
-        document.getElementById('close_btn').addEventListener('touchend',function(e){
-            e.preventDefault();
-            document.getElementById('pop').style.display = 'none';
-            window.removeEventListener('touchmove',window_no_scroll);
-        });
+        // document.getElementById('rules').addEventListener('click',function(e){
+        //     document.getElementById('pop').style.display = 'block';
+        //     window.addEventListener('touchmove',window_no_scroll);
+        // });
+        // document.getElementById('close_btn').addEventListener('touchend',function(e){
+        //     e.preventDefault();
+        //     document.getElementById('pop').style.display = 'none';
+        //     window.removeEventListener('touchmove',window_no_scroll);
+        // });
         $('.open_bonus_btn').on('click',function(){
             $(this).css('opacity',0);
             $('.open_bonus_link .bonus_top').addClass('open_bonus');