wangchuanjin 7 years ago
parent
commit
4d012ece54

+ 27 - 20
src/web/staticres/js/common.js

@@ -361,24 +361,31 @@ function mySysIsIos(){
 }
 $(function(){
 	//自定义tap
-    $(document).on("touchstart", function(e) {
-        var $target = $(e.target);
-        $target.data("isMoved", 0);
-		$target.data("startTime", Date.now());
-    });
-    $(document).on("touchmove", function(e) {
-        var $target = $(e.target);
-        $target.data("isMoved", 1);
-    });
-    $(document).on("touchend", function(e) {
-        var $target = $(e.target);
-		var startTime = $target.data("startTime");
-		if(Date.now()-startTime>200){
-			return;
-		}
-        if($target.data("isMoved") == 1){
-			return;
-		}
-		$target.trigger("tap");
-    });
+	if("ontouchend" in document){
+		$(document).on("touchstart", function(e) {
+	        var $target = $(e.target);
+	        $target.data("isMoved", 0);
+			$target.data("startTime", Date.now());
+	    });
+	    $(document).on("touchmove", function(e) {
+	        var $target = $(e.target);
+	        $target.data("isMoved", 1);
+	    });
+	    $(document).on("touchend", function(e) {
+	        var $target = $(e.target);
+			var startTime = $target.data("startTime");
+			if(Date.now()-startTime>200){
+				return;
+			}
+	        if($target.data("isMoved") == 1){
+				return;
+			}
+			$target.trigger("tap");
+	    });
+	}else{
+		$(document).on("click", function(e) {
+			var $target = $(e.target);
+			$target.trigger("tap");
+	    });
+	}
 });

+ 5 - 1
src/web/templates/weixin/search/mainSearch.html

@@ -609,7 +609,11 @@
 		popstateFlag = true;
 		initFlag = 0;
 		////
-		$("#searchIndex .inp-search").on("touchend",function () {
+		$("#searchIndex .inp-search").click(function () {
+			SuperSearch.init(true,true,true);
+	    }).on("touchstart",function (e) {
+            e.preventDefault();
+        }).on("touchend",function () {
             SuperSearch.init(true,true,true);
         });
 		//点击帮助

+ 1 - 1
src/web/templates/weixin/wxkeyset/index.html

@@ -171,7 +171,7 @@ $(function(){
 		}
 		removesurp();
 	});
-	$(".keyword").next("img").on("touchstart",function(){
+	$(".keyword").next("img").on("tap",function(){
 		$(".inputText").remove();
 		$(this).prev("[type='text']").val("").focus();
 		saveData();