Browse Source

Merge branch 'talksec' of 121.43.114.153:/home/git/repositories/shopnc into talksec

zhashaonan 6 years atrás
parent
commit
405dbaadc8
2 changed files with 41 additions and 8 deletions
  1. 19 8
      helper/room/tpl_group_home.php
  2. 22 0
      mobile/templates/default/talk/homepage_room.php

+ 19 - 8
helper/room/tpl_group_home.php

@@ -12,11 +12,13 @@ require_once(BASE_ROOT_PATH . '/helper/room/factory.php');
 require_once(BASE_ROOT_PATH . '/helper/url_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/util_helper.php');
 require_once (BASE_ROOT_PATH . '/helper/relation_helper.php');
+require_once (BASE_ROOT_PATH . '/helper/session_helper.php');
 use relation\mem_relation;
 use Exception;
 use url_helper;
 use author_url;
 use util;
+use session_helper;
 
 class tpl_group_home
 {
@@ -344,7 +346,6 @@ class tpl_group_home
             $html.= "<div class=\"weui-cells\">";
             $html.= $this->room_name_btn($click,$name);
             $html.= $this->room_avatar_btn($avartar);
-//            $html.= $this->room_share_btn();
             $html.= $this->room_nickname_btn();
             $html.= "</div>";
 
@@ -394,13 +395,6 @@ class tpl_group_home
         return $html;
     }
 
-    private function room_share_btn(){
-        $html = "
-        
-        ";
-        return $html;
-    }
-
     private function room_cert_btn($click,$level)
     {
         if($click){
@@ -506,6 +500,12 @@ class tpl_group_home
         if(isset($this->participants[$this->cur_user]))
         {
             $html .="<div class=\"weui-cells\">";
+
+            if(session_helper::isapp())
+            {
+                $html.= $this->room_share_btn();
+            }
+
             if ($this->isManager($this->cur_user)) {
                 $pwd = $this->room_info->passwd();
                 if($pwd)
@@ -538,6 +538,7 @@ class tpl_group_home
                         </div>";
                 }
             }
+
             $html .="<div class=\"weui-cell weui-cell_switch\" href=\"javascript:;\">
                         <div class=\"weui-cell__bd\">
                             <p>置顶聊天</p>
@@ -576,6 +577,16 @@ class tpl_group_home
         echo $html;
     }
 
+    private function room_share_btn(){
+        $html = "<div class=\"weui-cell\" id='room_share_btn'>
+                                <div class=\"weui-cell__bd\">
+                                    <p>邀请入群</p>
+                                </div>
+                        </div>";
+        return $html;
+    }
+
+
     public function show_footer_leave_btn(){
         $html = "";
         if (isset($this->participants[$this->cur_user]))

+ 22 - 0
mobile/templates/default/talk/homepage_room.php

@@ -156,6 +156,28 @@
                }
             }
 
+            function share_wake(){
+                if(is_app > 0 && talk_type == 'room')
+                {
+                    var jsonobject = {
+                        action:"share_page",
+                        params: {
+                            path:"",
+                            title:room_name,
+                            sub_title:"加入美妆群,下载熊猫美妆APP,分享故事分享红包",
+                            img_url:room_avatar,
+                            url:'<?php echo  BASE_SITE_URL . "/mobile/index.php?act=index&op=room_invite&client_type=ajax&room_id={$output['param']['talk_id']}"; ?>'
+                        }
+                    };
+                    jsBridge.call_native_handler('on_native_click',JSON.stringify(jsonobject));
+                }
+            }
+
+           $("#room_share_btn").on('click',function(){
+               share_wake();
+           });
+
+
             if($('#add_group_pwd').length > 0 || $('#add_group_apply').length > 0 || $('#add_group').length > 0) {
                 $('html').css({"min-height":"100%",background:"#ffffff"})
             }