Browse Source

add focus

huanggang 7 years ago
parent
commit
5b373d8163
1 changed files with 26 additions and 1 deletions
  1. 26 1
      data/resource/mobile/ugc/js/main.js

+ 26 - 1
data/resource/mobile/ugc/js/main.js

@@ -468,7 +468,7 @@ var ReplyList = function () {
         var scrollTop = $(this).scrollTop();
         var scrollHeight = $(document).height();
         var windowHeight = $(this).height();
-        if ((scrollTop + windowHeight) - scrollHeight > -250 && isLoad == false) {
+        if ((scrollTop + windowHeight) - scrollHeight > -1000 && isLoad == false) {
             getData();
         }
     };
@@ -844,6 +844,31 @@ event($('.msg_btn'), 'click', function () {
     }
 });
 
+event($('.focus'),'touchstart',function(){
+    if (from_app && !logined) {
+        call_native_handler('on_native_click', '{"action":"login"}', function (data) {
+            var jsdata = JSON.parse(data);
+            if (!jsdata.login) {
+                return;
+            }
+            else {
+                logined = true;
+                var url = host + "/mobile/index.php?act=member_ugc&op=subscribe_author&client_type=ajax&special_id=" + specialId;
+                get_ajax(url,function(data){
+                    if (data.code !== 200) {
+                        alert(data.message);
+                        return;
+                    }
+                    $(this).toggle('active');
+                });
+            }
+        });
+    }
+    else {
+        $(this).toggle('active');
+    }
+});
+
 
 $('#submit_btn').on('click', function () {
     var _self = $(this);