huangdong 6 years ago
parent
commit
c048e991e6

+ 15 - 0
helper/room/tpl_group_home.php

@@ -677,4 +677,19 @@ class tpl_group_home
 
         echo $html;
     }
+
+    public function app_download()
+    {
+        if(isset($this->participants[$this->cur_user]) && !session_helper::isapp())
+        {
+            echo "<div class=\"fixed_bottom\">
+                    <span class=\"flex_logo\"></span>
+                    <div class=\"label\">
+                        <p>熊猫美妆</p>
+                        <p>下载APP即可参与群聊</p>
+                    </div>
+                    <a href=\"#\" class=\"download_app_btn\" id=\"link\">打开APP</a>
+              </div>";
+        }
+    }
 }

+ 31 - 0
mobile/templates/default/member/index.php

@@ -203,6 +203,17 @@
         </div>
         <?php } ?>
     </div>
+
+    <?php if(!session_helper::isapp()) { ?>
+    <div class=\"fixed_bottom\">
+        <span class=\"flex_logo\"></span>
+        <div class=\"label\">
+            <p>熊猫美妆</p>
+            <p>下载APP即可和TA聊天</p>
+        </div>
+        <a href=\"#\" class=\"download_app_btn\" id=\"link\">打开APP</a>
+    </div>
+    <?php } ?>
 <?php }else{ ?>
 
 <?php } ?>
@@ -294,5 +305,25 @@
                 sessionStorage.setItem('is_reload','true');
             })
         });
+
+
+        function app()
+        {
+            var app=navigator.userAgent.toLowerCase(),//判断设备
+                app_nav=navigator.appVersion.toLowerCase(),
+                href='';
+            if (app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
+                href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
+            } else if (app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1) {
+                href = "<?php echo BASE_SITE_URL . "/hfive/android_down/index.html"; ?>";
+            }
+            else {
+                href="javascript:void(0)";
+            }
+
+            return href;
+        }
+
+        $('#link').attr('href',app());
     });
 </script>

+ 37 - 9
mobile/templates/default/talk/homepage_room.php

@@ -87,6 +87,9 @@
 
         /*群二维码*/
         $output['tpl']->show_qrcode();
+
+        /*下载链接*/
+        $output['tpl']->app_download();
     }
 ?>
 
@@ -622,15 +625,19 @@
                             return;
                         }
                         $.toast('进入成功',1000,function(){
-                            var jsonobject = {
-                                action:"chat_to",
-                                params:{
-                                    talk_type:"room",
-                                    talk_id:talk_id,
-                                    name:'<?php echo str_replace("'","",$output['param']['room_name'])?>'
-                                }
-                            };
-                            jsBridge.call_native_handler('on_native_click', JSON.stringify(jsonobject));
+                            if(is_app) {
+                                var jsonobject = {
+                                    action:"chat_to",
+                                    params:{
+                                        talk_type:"room",
+                                        talk_id:talk_id,
+                                        name:'<?php echo str_replace("'","",$output['param']['room_name'])?>'
+                                    }
+                                };
+                                jsBridge.call_native_handler('on_native_click', JSON.stringify(jsonobject));
+                            } else {
+                                window.location.reload();
+                            }
                         });
                     });
             });
@@ -880,6 +887,27 @@
                 this.init();
             };
             var pwdBoard = new PwdBoard();
+
+
+
+        function app()
+        {
+            var app=navigator.userAgent.toLowerCase(),//判断设备
+                app_nav=navigator.appVersion.toLowerCase(),
+                href='';
+            if (app_nav.indexOf('iphone')>-1&&app.indexOf('iphone')){
+                href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lrlz.beautyshop';
+            } else if (app.indexOf('micromessenger')>-1 && app_nav.indexOf('android')>-1) {
+                href = "<?php echo BASE_SITE_URL . "/hfive/android_down/index.html"; ?>";
+            }
+            else {
+                href="javascript:void(0)";
+            }
+
+            return href;
+        }
+
+        $('#link').attr('href',app());
         }
     );
 </script>