wangchuanjin 7 жил өмнө
parent
commit
c1ea6a8a7f
29 өөрчлөгдсөн 693 нэмэгдсэн , 297 устгасан
  1. 3 3
      src/jfw/modules/app/src/jfw/front/front.go
  2. 40 24
      src/jfw/modules/app/src/web/staticres/jyapp/js/common.js
  3. 3 3
      src/jfw/modules/app/src/web/staticres/jyapp/js/wxSupersearch.js
  4. 17 3
      src/jfw/modules/app/src/web/staticres/jyapp/wxtsguide/main.js
  5. 54 27
      src/jfw/modules/app/src/web/templates/weixin/historypush.html
  6. 55 26
      src/jfw/modules/app/src/web/templates/weixin/resultpreview.html
  7. 55 16
      src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html
  8. 33 9
      src/jfw/modules/app/src/web/templates/weixin/wxpush.html
  9. 40 24
      src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/common.js
  10. 40 24
      src/jfw/modules/followent/src/web/staticres/jylab/followent/js/common.js
  11. 40 24
      src/web/staticres/js/common.js
  12. 2 2
      src/web/staticres/js/proproject.js
  13. 3 3
      src/web/staticres/js/superSearch.js
  14. 3 3
      src/web/staticres/js/wxSupersearch.js
  15. BIN
      src/web/staticres/upload/2017/04/11/201704111440382391.jpg
  16. BIN
      src/web/staticres/upload/2017/04/11/201704111441298250.jpg
  17. BIN
      src/web/staticres/upload/2017/04/11/201704111451578943.jpg
  18. BIN
      src/web/staticres/upload/2017/04/12/201704120830518943.jpg
  19. BIN
      src/web/staticres/upload/2017/04/12/2017041208324410879.jpg
  20. 17 3
      src/web/staticres/wxtsguide/main.js
  21. 2 2
      src/web/templates/pc/bidsearch.html
  22. 1 1
      src/web/templates/pc/bidsearch_static.html
  23. 56 27
      src/web/templates/weixin/historypush.html
  24. 58 26
      src/web/templates/weixin/resultpreview.html
  25. 2 2
      src/web/templates/weixin/search/superSearch.html
  26. 55 16
      src/web/templates/weixin/wxinfocontent.html
  27. 79 18
      src/web/templates/weixin/wxinfocontent_rec.html
  28. 33 9
      src/web/templates/weixin/wxpush.html
  29. 2 2
      src/web/templates/weixin/wxsearchlist.html

+ 3 - 3
src/jfw/modules/app/src/jfw/front/front.go

@@ -263,7 +263,7 @@ func (m *Front) WxpushListInfo(_id string) error {
 					for _, v := range tmps {
 						s_words = append(s_words, v)
 					}
-					words := strings.Join(util.ObjArrToStringArr(s_words), "+")
+					words := "subkey_" + strings.Join(util.ObjArrToStringArr(s_words), "_")
 					return m.Redirect("/jyapp/article/content/" + eid + ".html?keywords=" + url.QueryEscape(words))
 				}
 			}
@@ -286,7 +286,7 @@ func (m *Front) WxpushListInfo(_id string) error {
 					if len(array) == 2 {
 						eid := array[1]
 						s_words, _ := (*tmp)["s_words"].([]interface{})
-						words := strings.Join(util.ObjArrToStringArr(s_words), "+")
+						words := "subkey_" + strings.Join(util.ObjArrToStringArr(s_words), "+")
 						return m.Redirect("/jyapp/article/content/" + eid + ".html?keywords=" + url.QueryEscape(words))
 					}
 				}
@@ -313,7 +313,7 @@ func (m *Front) WxpushListInfo(_id string) error {
 				if len(array) == 2 {
 					eid := array[1]
 					s_words, _ := (*tmp)["s_words"].([]interface{})
-					words := strings.Join(util.ObjArrToStringArr(s_words), "+")
+					words := strings.Join(util.ObjArrToStringArr(s_words), "_")
 					return m.Redirect("/jyapp/article/content/" + eid + ".html?keywords=" + url.QueryEscape(words))
 				}
 			}

+ 40 - 24
src/jfw/modules/app/src/web/staticres/jyapp/js/common.js

@@ -99,9 +99,11 @@ function redirect(zbadd,link,sid,sds){
 	}
 }
 function newredirect(zbadd,link,sid,sds){
-	link = link.replace(/\n/g,"");
-	if(!/^http/.test(link)){
-		link="http://"+link
+	if(link != null && typeof(link) != "undefined"){
+		link = link.replace(/\n/g,"");
+		if(!/^http/.test(link)){
+			link="http://"+link
+		}
 	}
 	if(sds){
 		window.location.href=zbadd+"/jyapp/article/content/"+sid+".html?keywords="+encodeURIComponent(sds);
@@ -112,29 +114,43 @@ function newredirect(zbadd,link,sid,sds){
 function pcredirect(link,sid){
 	window.open("/pcdetail/"+sid+".html");
 }
-function keyWordHighlight(value,oldChar,newChar){
-	try{
-		oldChar = oldChar.replace(/\$/g,"\\$");
-		oldChar = oldChar.replace(/\(/g,"\\(");
-		oldChar = oldChar.replace(/\)/g,"\\)");
-		oldChar = oldChar.replace(/\*/g,"\\*");
-		oldChar = oldChar.replace(/\+/g,"\\+");
-		oldChar = oldChar.replace(/\./g,"\\.");
-		oldChar = oldChar.replace(/\[/g,"\\[");
-		oldChar = oldChar.replace(/\]/g,"\\]");
-		oldChar = oldChar.replace(/\?/g,"\\?");
-		oldChar = oldChar.replace(/\\/g,"\\");
-		oldChar = oldChar.replace(/\//g,"\\/");
-		oldChar = oldChar.replace(/\^/g,"\\^");
-		oldChar = oldChar.replace(/\{/g,"\\{");
-		oldChar = oldChar.replace(/\}/g,"\\}");
-		if(typeof(oldChar) == "undefined" || oldChar == null || oldChar == "" || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
-			return value;
-		}
-		return value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
-	}catch(e){
+function keyWordHighlight(value,oldChars,newChar){
+	if(typeof(oldChars) == "undefined" || oldChars == null || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
 		return value;
 	}
+	var array = [];
+	if(oldChars instanceof Array){
+		array = oldChars.concat();
+	}else{
+		array.push(oldChars);
+	}
+	try{
+		var map = {};
+		for(var i=0;i<array.length;i++){
+			var oldChar = array[i];
+			if(oldChar.replace(/\s+/g,"") == "" || map[oldChar]){
+				continue;
+			}
+			map[oldChar] = true;
+			oldChar = oldChar.replace(/\$/g,"\\$");
+			oldChar = oldChar.replace(/\(/g,"\\(");
+			oldChar = oldChar.replace(/\)/g,"\\)");
+			oldChar = oldChar.replace(/\*/g,"\\*");
+			oldChar = oldChar.replace(/\+/g,"\\+");
+			oldChar = oldChar.replace(/\./g,"\\.");
+			oldChar = oldChar.replace(/\[/g,"\\[");
+			oldChar = oldChar.replace(/\]/g,"\\]");
+			oldChar = oldChar.replace(/\?/g,"\\?");
+			oldChar = oldChar.replace(/\\/g,"\\");
+			oldChar = oldChar.replace(/\//g,"\\/");
+			oldChar = oldChar.replace(/\^/g,"\\^");
+			oldChar = oldChar.replace(/\{/g,"\\{");
+			oldChar = oldChar.replace(/\}/g,"\\}");
+			oldChar = oldChar.replace(/\|/g,"\\|");
+			value = value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
+		}
+	}catch(e){}
+	return value;
 }
 function getWxVersion(){
 	var wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);

+ 3 - 3
src/jfw/modules/app/src/web/staticres/jyapp/js/wxSupersearch.js

@@ -937,8 +937,8 @@ var SuperSearch = {
 			}
 			if(SuperSearch.s_words != ""){
 				var wordsArray = SuperSearch.s_words.split(" ");
-				title = keyWordHighlight(title,wordsArray.join("|"),'<font class="keyword">$1</font>');
-				projectname = keyWordHighlight(projectname,wordsArray.join("|"),'<font class="keyword">$1</font>');
+				title = keyWordHighlight(title,wordsArray,'<font class="keyword">$1</font>');
+				projectname = keyWordHighlight(projectname,wordsArray,'<font class="keyword">$1</font>');
 				if(detail != ""){
 					try{
 					   $("#supersearchPage #tempDiv").html(detail);
@@ -946,7 +946,7 @@ var SuperSearch = {
 					}catch(e){
 					   detail = detail.replace(/</g,"&lt;").replace(/>/g,"&gt;");
 					}
-					detail = keyWordHighlight(detail,wordsArray.join("|"),'<font class="keyword">$1</font>');
+					detail = keyWordHighlight(detail,wordsArray,'<font class="keyword">$1</font>');
 				}
 			}
 			if(detail != ""){

+ 17 - 3
src/jfw/modules/app/src/web/staticres/jyapp/wxtsguide/main.js

@@ -248,7 +248,6 @@ var Guide = {
 	},
 	structurePreviewHtml: function(r,keys){
 		$(".step-3 .com-title .keyword").html(keys.join("、").replace(/\++/g," "));
-		var key = keys.join(" ");
 		var datas = r["data"];
 		if(datas == null || datas.length == 0){
 			$(".step-3 .com-list>ul").remove();
@@ -260,7 +259,22 @@ var Guide = {
 		var ltHtml = "";
 		for(var i=0;i<datas.length;i++){
 			var title = datas[i].title;
-			title = keyWordHighlight(title,key.replace(/\s+/gm,"|").replace(/\++/gm,"|"),"<font class='keyword'>$1</font>");
+			for(var n=0;n<keys.length;n++){
+				var keysTemp = keys[n].replace(/\++/gm," ").split(" ");
+				var isReplace = true;
+				var titleTemp = title;
+				for(var m=0;m<keysTemp.length;m++){
+					var _titleTemp = keyWordHighlight(titleTemp,keysTemp[m],"<font class='keyword'>$1</font>");
+					if(titleTemp == _titleTemp){
+						isReplace = false;
+						break;
+					}
+					titleTemp = _titleTemp;
+				}
+				if(isReplace){
+					title = titleTemp;
+				}
+			}
 			var href = datas[i].href.replace(/\n/g,"");
 			ltHtml += '<li data-url="'+href+'" data-id="'+datas[i]._id+'">'
 						+'<div class="com-index">'+(i+1)+'.</div>'
@@ -299,7 +313,7 @@ var Guide = {
 			$(this).addClass("li-active");
 			var url = $(this).attr("data-url");
 			var id = $(this).attr("data-id");
-			redirect(tsadd,url,id,key.replace(/\s+/gm,"_"));
+			redirect(tsadd,url,id,"subkey_"+keys.join("_").replace(/\s+/g,"+"));
 		});
 	},
 	getKeyWord: function(flag){

+ 54 - 27
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -26,7 +26,7 @@ $(function(){
 	if(firstPage.i_size == 1){
 		var content = $(firstPage[0].s_content).find("a.bt");
 		var words = firstPage[0].s_words;
-		newredirect(zbadd,content.attr("href"),content.attr("eid"),words?words.join("+"):"");
+		newredirect(zbadd,content.attr("href"),content.attr("eid"),words?"subkey_"+words.join("_"):"");
 		return;
 	}
 	$(window).scroll(function(){
@@ -173,7 +173,7 @@ function structureHtml(object){
 		count++;
 		var info = object["o_pushinfo"][i+1];
 		if(words){
-			$(this).attr("words",words.join("+"));
+			$(this).attr("words",words.join("_"));
 		}
 		$(this).find(".xh").html(count+".").wrap('<div class="resnumb"><div class="one"></div></div>');
 		$(this).find("a.bt").attr("s",function(){
@@ -196,7 +196,22 @@ function structureHtml(object){
 			var area = $(this).find(".area").text();
 			var html = $(this).find(".bt").html().replace("[<span class=\"area\">"+area,"").replace("</span>]","");
 			if(words){
-				html = keyWordHighlight(html,words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>');
+				for(var n=0;n<words.length;n++){
+					var keysTemp = words[n].split("+");
+					var isReplace = true;
+					var htmlTemp = html;
+					for(var m=0;m<keysTemp.length;m++){
+						var _htmlTemp = keyWordHighlight(htmlTemp,keysTemp[m],'<font class="keyword">$1</font>');
+						if(htmlTemp == _htmlTemp){
+							isReplace = false;
+							break;
+						}
+						htmlTemp = _htmlTemp;
+					}
+					if(isReplace){
+						html = htmlTemp;
+					}
+				}
 				$(this).find("a.bt").html(html);
 			}
 			$(this).find(".bt").html(html);
@@ -242,10 +257,26 @@ function structureHtml(object){
 		});
 		$(this).append('<div style="clear:both;"></div>');
 		//
-		tablehtml +='<tr onClick="tablejump(\''+$(this).find("a.bt").attr("eid")+'\',\''+$(this).find("a.bt").attr("s")+'\')">'+
+		tablehtml +='<tr onClick="tablejump(\''+$(this).find("a.bt").attr("eid")+'\',\''+$(this).find("a.bt").attr("s")+'\',\''+words.join("_")+'\')">'+
 					'<td>'+count+'</td>'
 		if(typeof(info.projectname) != "undefined"&&info.projectname != ""){
-			var pn = keyWordHighlight(info.projectname,words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>');
+			var pn = info.projectname;
+			for(var n=0;n<words.length;n++){
+				var keysTemp = words[n].split("+");
+				var isReplace = true;
+				var pnTemp = pn;
+				for(var m=0;m<keysTemp.length;m++){
+					var _pnTemp = keyWordHighlight(pnTemp,keysTemp[m],'<font class="keyword">$1</font>');
+					if(pnTemp == _pnTemp){
+						isReplace = false;
+						break;
+					}
+					pnTemp = _pnTemp;
+				}
+				if(isReplace){
+					pn = pnTemp;
+				}
+			}
 			tablehtml +='<td>'+pn+'</td>'
 		}else{
 			tablehtml +='<td>'+$(this).find("a.bt").html()+'</td>'
@@ -336,36 +367,32 @@ function formatDate(date,sl)   {
 
 //
 function appendList(content,tablehtml){
-	var sds =""
 	content.children(".tslist").on("click", function(event){
-		sds = $(this).attr("words");
+		var sds = $(this).attr("words");
 		var h = $(this).find("a.bt").attr("s");
 		var eid = $(this).find("a.bt").attr("eid");
-		if(sessionStorage){
-			sessionStorage.historypushScrollTop = scrollTop;
-			sessionStorage.historypushListCache = listCache;
-			sessionStorage.historypushTableCache = tableCache;
-			sessionStorage.historypushLasttimeCache = lasttime;
-			sessionStorage.historypushNoMoreCache = noMore;
-			sessionStorage.historypushCount = count;
-		}
-		newredirect(zbadd,h,eid,sds);
+		beforeJump(eid,h,sds);
 	});
 	$("#list").append(content);
 	//
-	tablejump = function(eid,h){
+	$("#mytable").append(tablehtml)
+}
+function tablejump(eid,h,sds){
+	if(localStorage){
 		localStorage.setItem("listortable"+{{.T._id}},"T");
-		if(sessionStorage){
-			sessionStorage.historypushScrollTop = scrollTop;
-			sessionStorage.historypushListCache = listCache;
-			sessionStorage.historypushTableCache = tableCache;
-			sessionStorage.historypushLasttimeCache = lasttime;
-			sessionStorage.historypushNoMoreCache = noMore;
-			sessionStorage.historypushCount = count;
-		}
-		newredirect(zbadd,h,eid,sds);
 	}
-	$("#mytable").append(tablehtml)
+	beforeJump(eid,h,sds);
+}
+function beforeJump(eid,h,sds){
+	if(sessionStorage){
+		sessionStorage.historypushScrollTop = scrollTop;
+		sessionStorage.historypushListCache = listCache;
+		sessionStorage.historypushTableCache = tableCache;
+		sessionStorage.historypushLasttimeCache = lasttime;
+		sessionStorage.historypushNoMoreCache = noMore;
+		sessionStorage.historypushCount = count;
+	}
+	newredirect(zbadd,h,eid,"subkey_"+sds);
 }
 </script>
 <style type="text/css">

+ 55 - 26
src/jfw/modules/app/src/web/templates/weixin/resultpreview.html

@@ -16,14 +16,12 @@ var highlightKey = [];
 var noMore = "false";
 var tableCache = "";
 var listCache = "";
-var tablejump = "";
 var wxflag = null;
 if(a_key){
 	for(var i=0;i<a_key.length;i++){
 		keys.push(a_key[i].join(" "));
-		highlightKey.push(a_key[i].join("|"));
 	}
-	sds = keys.join("+");
+	sds = "subkey_"+keys.join("_").replace(/\s+/g,"+");
 }
 var firstPage = {{.T.firstPage}};
 if(firstPage != null && firstPage.length == 1){
@@ -202,14 +200,47 @@ if(firstPage != null && firstPage.length == 1){
 			}
 			var title = list[i].title;
 			//关键词高亮
-			if(highlightKey.length > 0){
-				title = keyWordHighlight(title,highlightKey.join("|").replace(/\+/gm,"|").replace(" ","|"),'<font class="keyword">$1</font>');
-				$(this).find("a.bt").html(html);
+			if(a_key.length > 0){
+				for(var n=0;n<a_key.length;n++){
+					var keysTemp = a_key[n];
+					var isReplace = true;
+					var titleTemp = title;
+					for(var m=0;m<keysTemp.length;m++){
+						var _titleTemp = keyWordHighlight(titleTemp,keysTemp[m],'<font class="keyword">$1</font>');
+						if(titleTemp == _titleTemp){
+							isReplace = false;
+							break;
+						}
+						titleTemp = _titleTemp;
+					}
+					if(isReplace){
+						title = titleTemp;
+					}
+				}
 			}
 			tablehtml +='<tr onClick="tablejump(\''+list[i]._id+'\',\''+list[i].href+'\')" >'+
 						'<td>'+index+'</td>'
 			if(list[i].projectname!=null&&list[i].projectname!=""){
-				tablehtml +='<td>'+keyWordHighlight(list[i].projectname,highlightKey.join("|").replace(/\+/gm,"|").replace(" ","|"),'<font class="keyword">$1</font>')+'</td>'
+				var pn = list[i].projectname;
+				if(a_key.length > 0){
+					for(var n=0;n<a_key.length;n++){
+						var keysTemp = a_key[n];
+						var isReplace = true;
+						var pnTemp = pn;
+						for(var m=0;m<keysTemp.length;m++){
+							var _pnTemp = keyWordHighlight(pnTemp,keysTemp[m],'<font class="keyword">$1</font>');
+							if(pnTemp == _pnTemp){
+								isReplace = false;
+								break;
+							}
+							pnTemp = _pnTemp;
+						}
+						if(isReplace){
+							pn = pnTemp;
+						}
+					}
+				}
+				tablehtml +='<td>'+pn+'</td>'
 			}else{
 				tablehtml +='<td>'+title+'</td>'
 			}
@@ -358,28 +389,10 @@ if(firstPage != null && firstPage.length == 1){
 		htmlObj.on("click", function(event){
 			var h = $(this).find("a.bt").attr("s");
 			var eid = $(this).find("a.bt").attr("eid");
-			if(sessionStorage){
-				sessionStorage.resultpreviewScrollTop = scrollTop;
-				sessionStorage.resultpreviewPageNumCache = pageNum;
-				sessionStorage.resultpreviewListCache = listCache;
-				sessionStorage.resultpreviewTableCache = tableCache;
-				sessionStorage.resultpreviewNoMoreCache = noMore;
-			}
-			newredirect(zbadd,h,eid,sds);
+			beforeJump(eid,h);
 		});
 	    $('#list').append(htmlObj);
 		//
-		tablejump = function(eid,h){
-			if(sessionStorage){
-				sessionStorage.resultpreviewScrollTop = scrollTop;
-				sessionStorage.resultpreviewPageNumCache = pageNum;
-				sessionStorage.resultpreviewTableCache = tableCache;
-				sessionStorage.resultpreviewListCache = listCache;
-				sessionStorage.resultpreviewNoMoreCache = noMore;
-				localStorage.setItem("listortable"+{{.T._id}},"T");
-			}
-			newredirect(zbadd,h,eid,sds);
-		}
 		$("#mytable").append(tableObj);
 	}
 	function noMoreData(me){
@@ -394,6 +407,22 @@ if(firstPage != null && firstPage.length == 1){
 	    // 即使加载出错,也得重置
 	    me.resetload();
 	}
+	function tablejump(eid,h){
+		if(localStorage){
+			localStorage.setItem("listortable"+{{.T._id}},"T");
+		}
+		beforeJump(eid,h);
+	}
+	function beforeJump(eid,h){
+		if(sessionStorage){
+			sessionStorage.resultpreviewScrollTop = scrollTop;
+			sessionStorage.resultpreviewPageNumCache = pageNum;
+			sessionStorage.resultpreviewListCache = listCache;
+			sessionStorage.resultpreviewTableCache = tableCache;
+			sessionStorage.resultpreviewNoMoreCache = noMore;
+		}
+		newredirect(zbadd,h,eid,sds);
+	}
 }
 </script>
 <style type="text/css">

+ 55 - 16
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -1146,22 +1146,61 @@ $(function(){
 		content ='<table>'+content+'</table>'
 	}
 	var wordsArray = new Array();
-	s_words=decodeURIComponent(getParameter("keywords"))
-	if(s_words.indexOf('_')>0){
-		wordsArray = s_words.split("_");
-	}else if(s_words.indexOf("+")>0&&s_words.indexOf(" ")>0){
-		wordsArray = s_words.replace(/\+/g," ").split(" ");
-	}else if(s_words.indexOf("+")>0){
-		wordsArray = s_words.split("+");
-	}else if(s_words.indexOf(" ")>0){
-		wordsArray = s_words.split(" ");
-	}else {
-		wordsArray[0] = s_words;
-	}
-	if(wordsArray!=""&&wordsArray!="undefined"){
-		for(var i=0;i<wordsArray.length;i++){
-			content = keyWordHighlight(content,wordsArray[i],"<span class='jykeyword'>$1</span>");
-			titleCopy = keyWordHighlight(titleCopy,wordsArray[i],"<span class='jykeyword'>$1</span>");
+	s_words=decodeURIComponent(getParameter("keywords"));
+	//订阅词
+	if(/^(subkey_)/.test(s_words)){
+		wordsArray = s_words.replace(/^(subkey_)/,"").split("_");
+		//
+		for(var n=0;n<wordsArray.length;n++){
+			var keysTemp = wordsArray[n].split("+");
+			var isReplace = true;
+			var titleTemp = titleCopy;
+			for(var m=0;m<keysTemp.length;m++){
+				var _titleTemp = keyWordHighlight(titleTemp,keysTemp[m],"<span class='jykeyword'>$1</span>");
+				if(titleTemp == _titleTemp){
+					isReplace = false;
+					break;
+				}
+				titleTemp = _titleTemp;
+			}
+			if(isReplace){
+				titleCopy = titleTemp;
+			}
+		}
+		//
+		for(var n=0;n<wordsArray.length;n++){
+			var keysTemp = wordsArray[n].split("+");
+			var isReplace = true;
+			var contentTemp = content;
+			for(var m=0;m<keysTemp.length;m++){
+				var _contentTemp = keyWordHighlight(contentTemp,keysTemp[m],"<span class='jykeyword'>$1</span>");
+				if(contentTemp == _contentTemp){
+					isReplace = false;
+					break;
+				}
+				contentTemp = _contentTemp;
+			}
+			if(isReplace){
+				content = contentTemp;
+			}
+		}
+	}else{
+		if(s_words.indexOf('_')>0){
+			wordsArray = s_words.split("_");
+		}else if(s_words.indexOf("+")>0&&s_words.indexOf(" ")>0){
+			wordsArray = s_words.replace(/\+/g," ").split(" ");
+		}else if(s_words.indexOf("+")>0){
+			wordsArray = s_words.split("+");
+		}else if(s_words.indexOf(" ")>0){
+			wordsArray = s_words.split(" ");
+		}else {
+			wordsArray[0] = s_words;
+		}
+		if(wordsArray!=""&&wordsArray!="undefined"){
+			for(var i=0;i<wordsArray.length;i++){
+				content = keyWordHighlight(content,wordsArray[i],"<span class='jykeyword'>$1</span>");
+				titleCopy = keyWordHighlight(titleCopy,wordsArray[i],"<span class='jykeyword'>$1</span>");
+			}
 		}
 	}
 	$("#h_content").html(content);

+ 33 - 9
src/jfw/modules/app/src/web/templates/weixin/wxpush.html

@@ -107,13 +107,7 @@ $(function(){
 		jywords = a_key;
 	}
 	//
-	for(var i=0;i<jywords.length;i++){
-		if(i==0){
-			sds +=jywords[i]
-		}else{
-			sds +="+"+jywords[i]
-		}
-	}
+	sds = "subkey_"+jywords.join("_");
 	//
 	document.title = '推送信息';
 	$("body .listcontent").prepend(s_content);
@@ -228,10 +222,40 @@ $(function(){
 		//关键词高亮
 		if(typeof(s_words) != "undefined"){
 			var html = $(this).find("a.bt").html();
-			html = keyWordHighlight(html,s_words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>');
+			for(var n=0;n<s_words.length;n++){
+				var keysTemp = s_words[n].split("+");
+				var isReplace = true;
+				var htmlTemp = html;
+				for(var m=0;m<keysTemp.length;m++){
+					var _htmlTemp = keyWordHighlight(htmlTemp,keysTemp[m],'<font class="keyword">$1</font>');
+					if(htmlTemp == _htmlTemp){
+						isReplace = false;
+						break;
+					}
+					htmlTemp = _htmlTemp;
+				}
+				if(isReplace){
+					html = htmlTemp;
+				}
+			}
 			$(this).find("a.bt").html(html);
 			if(tableptname!=undefined&&tableptname!=""){
-				tableptname= keyWordHighlight(tableptname,s_words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>')
+				for(var n=0;n<s_words.length;n++){
+					var keysTemp = s_words[n].split("+");
+					var isReplace = true;
+					var pnTemp = tableptname;
+					for(var m=0;m<keysTemp.length;m++){
+						var _pnTemp = keyWordHighlight(pnTemp,keysTemp[m],'<font class="keyword">$1</font>');
+						if(pnTemp == _pnTemp){
+							isReplace = false;
+							break;
+						}
+						pnTemp = _pnTemp;
+					}
+					if(isReplace){
+						tableptname = pnTemp;
+					}
+				}
 			}
 		}
 		var tableid = $(this).find("a.bt").attr("eid");

+ 40 - 24
src/jfw/modules/entsesearch/src/web/staticres/jylab/entsesearch/js/common.js

@@ -92,9 +92,11 @@ function redirect(zbadd,link,sid,sds){
 	}
 }
 function newredirect(zbadd,link,sid,sds){
-	link = link.replace(/\n/g,"");
-	if(!/^http/.test(link)){
-		link="http://"+link
+	if(link != null && typeof(link) != "undefined"){
+		link = link.replace(/\n/g,"");
+		if(!/^http/.test(link)){
+			link="http://"+link
+		}
 	}
 	if(sds){
 		window.location.href=zbadd+"/article/content/"+sid+".html?keywords="+encodeURIComponent(sds);
@@ -105,29 +107,43 @@ function newredirect(zbadd,link,sid,sds){
 function pcredirect(link,sid){
 	window.open("/pcdetail/"+sid+".html");
 }
-function keyWordHighlight(value,oldChar,newChar){
-	try{
-		oldChar = oldChar.replace(/\$/g,"\\$");
-		oldChar = oldChar.replace(/\(/g,"\\(");
-		oldChar = oldChar.replace(/\)/g,"\\)");
-		oldChar = oldChar.replace(/\*/g,"\\*");
-		oldChar = oldChar.replace(/\+/g,"\\+");
-		oldChar = oldChar.replace(/\./g,"\\.");
-		oldChar = oldChar.replace(/\[/g,"\\[");
-		oldChar = oldChar.replace(/\]/g,"\\]");
-		oldChar = oldChar.replace(/\?/g,"\\?");
-		oldChar = oldChar.replace(/\\/g,"\\");
-		oldChar = oldChar.replace(/\//g,"\\/");
-		oldChar = oldChar.replace(/\^/g,"\\^");
-		oldChar = oldChar.replace(/\{/g,"\\{");
-		oldChar = oldChar.replace(/\}/g,"\\}");
-		if(typeof(oldChar) == "undefined" || oldChar == null || oldChar == "" || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
-			return value;
-		}
-		return value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
-	}catch(e){
+function keyWordHighlight(value,oldChars,newChar){
+	if(typeof(oldChars) == "undefined" || oldChars == null || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
 		return value;
 	}
+	var array = [];
+	if(oldChars instanceof Array){
+		array = oldChars.concat();
+	}else{
+		array.push(oldChars);
+	}
+	try{
+		var map = {};
+		for(var i=0;i<array.length;i++){
+			var oldChar = array[i];
+			if(oldChar.replace(/\s+/g,"") == "" || map[oldChar]){
+				continue;
+			}
+			map[oldChar] = true;
+			oldChar = oldChar.replace(/\$/g,"\\$");
+			oldChar = oldChar.replace(/\(/g,"\\(");
+			oldChar = oldChar.replace(/\)/g,"\\)");
+			oldChar = oldChar.replace(/\*/g,"\\*");
+			oldChar = oldChar.replace(/\+/g,"\\+");
+			oldChar = oldChar.replace(/\./g,"\\.");
+			oldChar = oldChar.replace(/\[/g,"\\[");
+			oldChar = oldChar.replace(/\]/g,"\\]");
+			oldChar = oldChar.replace(/\?/g,"\\?");
+			oldChar = oldChar.replace(/\\/g,"\\");
+			oldChar = oldChar.replace(/\//g,"\\/");
+			oldChar = oldChar.replace(/\^/g,"\\^");
+			oldChar = oldChar.replace(/\{/g,"\\{");
+			oldChar = oldChar.replace(/\}/g,"\\}");
+			oldChar = oldChar.replace(/\|/g,"\\|");
+			value = value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
+		}
+	}catch(e){}
+	return value;
 }
 function getWxVersion(){
 	var wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);

+ 40 - 24
src/jfw/modules/followent/src/web/staticres/jylab/followent/js/common.js

@@ -93,9 +93,11 @@ function redirect(zbadd,link,sid,sds){
 	}
 }
 function newredirect(zbadd,link,sid,sds){
-	link = link.replace(/\n/g,"");
-	if(!/^http/.test(link)){
-		link="http://"+link
+	if(link != null && typeof(link) != "undefined"){
+		link = link.replace(/\n/g,"");
+		if(!/^http/.test(link)){
+			link="http://"+link
+		}
 	}
 	if(sds){
 		window.location.href=zbadd+"/article/content/"+sid+".html?keywords="+encodeURIComponent(sds);
@@ -106,29 +108,43 @@ function newredirect(zbadd,link,sid,sds){
 function pcredirect(link,sid){
 	window.open("/pcdetail/"+sid+".html");
 }
-function keyWordHighlight(value,oldChar,newChar){
-	try{
-		oldChar = oldChar.replace(/\$/g,"\\$");
-		oldChar = oldChar.replace(/\(/g,"\\(");
-		oldChar = oldChar.replace(/\)/g,"\\)");
-		oldChar = oldChar.replace(/\*/g,"\\*");
-		oldChar = oldChar.replace(/\+/g,"\\+");
-		oldChar = oldChar.replace(/\./g,"\\.");
-		oldChar = oldChar.replace(/\[/g,"\\[");
-		oldChar = oldChar.replace(/\]/g,"\\]");
-		oldChar = oldChar.replace(/\?/g,"\\?");
-		oldChar = oldChar.replace(/\\/g,"\\");
-		oldChar = oldChar.replace(/\//g,"\\/");
-		oldChar = oldChar.replace(/\^/g,"\\^");
-		oldChar = oldChar.replace(/\{/g,"\\{");
-		oldChar = oldChar.replace(/\}/g,"\\}");
-		if(typeof(oldChar) == "undefined" || oldChar == null || oldChar == "" || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
-			return value;
-		}
-		return value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
-	}catch(e){
+function keyWordHighlight(value,oldChars,newChar){
+	if(typeof(oldChars) == "undefined" || oldChars == null || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
 		return value;
 	}
+	var array = [];
+	if(oldChars instanceof Array){
+		array = oldChars.concat();
+	}else{
+		array.push(oldChars);
+	}
+	try{
+		var map = {};
+		for(var i=0;i<array.length;i++){
+			var oldChar = array[i];
+			if(oldChar.replace(/\s+/g,"") == "" || map[oldChar]){
+				continue;
+			}
+			map[oldChar] = true;
+			oldChar = oldChar.replace(/\$/g,"\\$");
+			oldChar = oldChar.replace(/\(/g,"\\(");
+			oldChar = oldChar.replace(/\)/g,"\\)");
+			oldChar = oldChar.replace(/\*/g,"\\*");
+			oldChar = oldChar.replace(/\+/g,"\\+");
+			oldChar = oldChar.replace(/\./g,"\\.");
+			oldChar = oldChar.replace(/\[/g,"\\[");
+			oldChar = oldChar.replace(/\]/g,"\\]");
+			oldChar = oldChar.replace(/\?/g,"\\?");
+			oldChar = oldChar.replace(/\\/g,"\\");
+			oldChar = oldChar.replace(/\//g,"\\/");
+			oldChar = oldChar.replace(/\^/g,"\\^");
+			oldChar = oldChar.replace(/\{/g,"\\{");
+			oldChar = oldChar.replace(/\}/g,"\\}");
+			oldChar = oldChar.replace(/\|/g,"\\|");
+			value = value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
+		}
+	}catch(e){}
+	return value;
 }
 function getWxVersion(){
 	var wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);

+ 40 - 24
src/web/staticres/js/common.js

@@ -162,9 +162,11 @@ function redirect(zbadd,link,sid,sds){
 	}
 }
 function newredirect(zbadd,link,sid,sds){
-	link = link.replace(/\n/g,"");
-	if(!/^http/.test(link)){
-		link="http://"+link
+	if(link != null && typeof(link) != "undefined"){
+		link = link.replace(/\n/g,"");
+		if(!/^http/.test(link)){
+			link="http://"+link
+		}
 	}
 	if(sds){
 		window.location.href=zbadd+"/article/content/"+sid+".html?keywords="+encodeURIComponent(sds);
@@ -175,29 +177,43 @@ function newredirect(zbadd,link,sid,sds){
 function pcredirect(link,sid){
 	window.open("/pcdetail/"+sid+".html");
 }
-function keyWordHighlight(value,oldChar,newChar){
-	try{
-		oldChar = oldChar.replace(/\$/g,"\\$");
-		oldChar = oldChar.replace(/\(/g,"\\(");
-		oldChar = oldChar.replace(/\)/g,"\\)");
-		oldChar = oldChar.replace(/\*/g,"\\*");
-		oldChar = oldChar.replace(/\+/g,"\\+");
-		oldChar = oldChar.replace(/\./g,"\\.");
-		oldChar = oldChar.replace(/\[/g,"\\[");
-		oldChar = oldChar.replace(/\]/g,"\\]");
-		oldChar = oldChar.replace(/\?/g,"\\?");
-		oldChar = oldChar.replace(/\\/g,"\\");
-		oldChar = oldChar.replace(/\//g,"\\/");
-		oldChar = oldChar.replace(/\^/g,"\\^");
-		oldChar = oldChar.replace(/\{/g,"\\{");
-		oldChar = oldChar.replace(/\}/g,"\\}");
-		if(typeof(oldChar) == "undefined" || oldChar == null || oldChar == "" || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
-			return value;
-		}
-		return value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
-	}catch(e){
+function keyWordHighlight(value,oldChars,newChar){
+	if(typeof(oldChars) == "undefined" || oldChars == null || typeof(newChar) == "undefined" || newChar == null || newChar == ""){
 		return value;
 	}
+	var array = [];
+	if(oldChars instanceof Array){
+		array = oldChars.concat();
+	}else{
+		array.push(oldChars);
+	}
+	try{
+		var map = {};
+		for(var i=0;i<array.length;i++){
+			var oldChar = array[i];
+			if(oldChar.replace(/\s+/g,"") == "" || map[oldChar]){
+				continue;
+			}
+			map[oldChar] = true;
+			oldChar = oldChar.replace(/\$/g,"\\$");
+			oldChar = oldChar.replace(/\(/g,"\\(");
+			oldChar = oldChar.replace(/\)/g,"\\)");
+			oldChar = oldChar.replace(/\*/g,"\\*");
+			oldChar = oldChar.replace(/\+/g,"\\+");
+			oldChar = oldChar.replace(/\./g,"\\.");
+			oldChar = oldChar.replace(/\[/g,"\\[");
+			oldChar = oldChar.replace(/\]/g,"\\]");
+			oldChar = oldChar.replace(/\?/g,"\\?");
+			oldChar = oldChar.replace(/\\/g,"\\");
+			oldChar = oldChar.replace(/\//g,"\\/");
+			oldChar = oldChar.replace(/\^/g,"\\^");
+			oldChar = oldChar.replace(/\{/g,"\\{");
+			oldChar = oldChar.replace(/\}/g,"\\}");
+			oldChar = oldChar.replace(/\|/g,"\\|");
+			value = value.replace(new RegExp("("+oldChar+")",'gmi'),newChar);
+		}
+	}catch(e){}
+	return value;
 }
 function getWxVersion(){
 	var wechatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);

+ 2 - 2
src/web/staticres/js/proproject.js

@@ -280,7 +280,7 @@ function appendDatas(datas,isNew){
 		var index = (currentPage - 1) * pageSize + i + 1;
 		var title = datas[i].title;
 		var detail = datas[i].detail;
-		title = keyWordHighlight(title,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
+		title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
 		
 		var type = datas[i].subtype;
 		var bbs = "border-bottom: 1px solid #EBEBEB;";
@@ -326,7 +326,7 @@ function appendDatas(datas,isNew){
 			}
 			//		
 			if(typeof(datas[i].projectname) != "undefined" && datas[i].projectname != null && datas[i].projectname != ""){
-				datas[i].projectname = keyWordHighlight(datas[i].projectname,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
+				datas[i].projectname = keyWordHighlight(datas[i].projectname,searchvalueArray,"<font class='com-highlight'>$1</font>");
 				tableHtml += '<td class="tt-l" width="324"><div>'+datas[i].projectname+'</div></td>';
 			}else{
 				tableHtml += '<td class="tt-l" width="324"><div>'+datas[i].title+'</div></td>';

+ 3 - 3
src/web/staticres/js/superSearch.js

@@ -355,8 +355,8 @@ function appendDatas(datas,flag,isNew){
 			detail = detail.substring(0,200)+"..."
 		}
 		if(flag){
-			title = keyWordHighlight(title,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
-			detail = keyWordHighlight(detail,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
+			title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
+			detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
 		}
 		var type = datas[i].subtype;
 		if(typeof(type) == "undefined" || type == null || type == ""){
@@ -418,7 +418,7 @@ function appendDatas(datas,flag,isNew){
 		tableHtml +='<tr onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank">'
 				+'<td width="48"><div>'+index+'</div></td>'
 		if(typeof(datas[i].projectname) != "undefined" && datas[i].projectname != null && datas[i].projectname != ""){
-			datas[i].projectname = keyWordHighlight(datas[i].projectname,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
+			datas[i].projectname = keyWordHighlight(datas[i].projectname,searchvalueArray,"<font class='com-highlight'>$1</font>");
 			tableHtml += '<td class="tt-l" width="315"><div>'+datas[i].projectname+'</div></td>';
 		}else{
 			tableHtml += '<td class="tt-l" width="315"><div>'+datas[i].title+'</div></td>';

+ 3 - 3
src/web/staticres/js/wxSupersearch.js

@@ -892,8 +892,8 @@ var SuperSearch = {
 			}
 			if(SuperSearch.s_words != ""){
 				var wordsArray = SuperSearch.s_words.split(" ");
-				title = keyWordHighlight(title,wordsArray.join("|"),'<font class="keyword">$1</font>');
-				projectname = keyWordHighlight(projectname,wordsArray.join("|"),'<font class="keyword">$1</font>');
+				title = keyWordHighlight(title,wordsArray,'<font class="keyword">$1</font>');
+				projectname = keyWordHighlight(projectname,wordsArray,'<font class="keyword">$1</font>');
 				if(detail != ""){
 					try{
 					   $("#supersearchPage #tempDiv").html(detail);
@@ -901,7 +901,7 @@ var SuperSearch = {
 					}catch(e){
 					   detail = detail.replace(/</g,"&lt;").replace(/>/g,"&gt;");
 					}
-					detail = keyWordHighlight(detail,wordsArray.join("|"),'<font class="keyword">$1</font>');
+					detail = keyWordHighlight(detail,wordsArray,'<font class="keyword">$1</font>');
 				}
 			}
 			if(detail != ""){

BIN
src/web/staticres/upload/2017/04/11/201704111440382391.jpg


BIN
src/web/staticres/upload/2017/04/11/201704111441298250.jpg


BIN
src/web/staticres/upload/2017/04/11/201704111451578943.jpg


BIN
src/web/staticres/upload/2017/04/12/201704120830518943.jpg


BIN
src/web/staticres/upload/2017/04/12/2017041208324410879.jpg


+ 17 - 3
src/web/staticres/wxtsguide/main.js

@@ -248,7 +248,6 @@ var Guide = {
 	},
 	structurePreviewHtml: function(r,keys){
 		$(".step-3 .com-title .keyword").html(keys.join("、").replace(/\++/g," "));
-		var key = keys.join(" ");
 		var datas = r["data"];
 		if(datas == null || datas.length == 0){
 			$(".step-3 .com-list>ul").remove();
@@ -260,7 +259,22 @@ var Guide = {
 		var ltHtml = "";
 		for(var i=0;i<datas.length;i++){
 			var title = datas[i].title;
-			title = keyWordHighlight(title,key.replace(/\s+/gm,"|").replace(/\++/gm,"|"),"<font class='keyword'>$1</font>");
+			for(var n=0;n<keys.length;n++){
+				var keysTemp = keys[n].replace(/\++/gm," ").split(" ");
+				var isReplace = true;
+				var titleTemp = title;
+				for(var m=0;m<keysTemp.length;m++){
+					var _titleTemp = keyWordHighlight(titleTemp,keysTemp[m],"<font class='keyword'>$1</font>");
+					if(titleTemp == _titleTemp){
+						isReplace = false;
+						break;
+					}
+					titleTemp = _titleTemp;
+				}
+				if(isReplace){
+					title = titleTemp;
+				}
+			}
 			var href = datas[i].href.replace(/\n/g,"");
 			ltHtml += '<li data-url="'+href+'" data-id="'+datas[i]._id+'">'
 						+'<div class="com-index">'+(i+1)+'.</div>'
@@ -299,7 +313,7 @@ var Guide = {
 			$(this).addClass("li-active");
 			var url = $(this).attr("data-url");
 			var id = $(this).attr("data-id");
-			redirect(tsadd,url,id,key.replace(/\s+/gm,"_"));
+			redirect(tsadd,url,id,"subkey_"+keys.join("_").replace(/\s+/g,"+"));
 		});
 	},
 	getKeyWord: function(flag){

+ 2 - 2
src/web/templates/pc/bidsearch.html

@@ -822,8 +822,8 @@ function appendDatas(datas,flag){
 		var title = datas[i].title;
 		var detail = datas[i].detail;
 		if(status == 1){
-			title = keyWordHighlight(title,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
-			detail = keyWordHighlight(detail,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
+			title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
+			detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
 		}
 		var href = datas[i].href.replace(/\n/g,"");
 		var aHref = '/article/content/'+datas[i]._id;

+ 1 - 1
src/web/templates/pc/bidsearch_static.html

@@ -804,7 +804,7 @@ function appendDatas(datas,flag){
 		var index = (currentPage - 1) * pageSize + i + 1;
 		var title = datas[i].title;
 		if(status == 1){
-			title = keyWordHighlight(title,searchvalueArray.join("|"),"<font class='com-highlight'>$1</font>");
+			title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
 		}
 		var href = datas[i].href.replace(/\n/g,"");
 		var aHref = '/pcdetail/'+datas[i]._id;

+ 56 - 27
src/web/templates/weixin/historypush.html

@@ -29,7 +29,7 @@ $(function(){
 	if(firstPage.i_size == 1){
 		var content = $(firstPage[0].s_content).find("a.bt");
 		var words = firstPage[0].s_words;
-		newredirect(zbadd,content.attr("href"),content.attr("eid"),words?words.join("+"):"");
+		newredirect(zbadd,content.attr("href"),content.attr("eid"),words?"subkey_"+words.join("_"):"");
 		return;
 	}
 	$(window).scroll(function(){
@@ -164,6 +164,8 @@ function open_window(link){
 function hasNoData(){
 	$(".listcontent").hide();
 	$(".findnull").css("display","block");
+	$(".showType").hide();
+	$(".showType").next().hide();
 }
 function structureHtml(object){
 	var tablehtml = '';
@@ -174,7 +176,7 @@ function structureHtml(object){
 		count++;
 		var info = object["o_pushinfo"][i+1];
 		if(words){
-			$(this).attr("words",words.join("+"));
+			$(this).attr("words",words.join("_"));
 		}
 		$(this).find(".xh").html(count+".").wrap('<div class="resnumb"><div class="one"></div></div>');
 		$(this).find("a.bt").attr("s",function(){
@@ -197,7 +199,22 @@ function structureHtml(object){
 			var area = $(this).find(".area").text();
 			var html = $(this).find(".bt").html().replace("[<span class=\"area\">"+area,"").replace("</span>]","");
 			if(words){
-				html = keyWordHighlight(html,words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>');
+				for(var n=0;n<words.length;n++){
+					var keysTemp = words[n].split("+");
+					var isReplace = true;
+					var htmlTemp = html;
+					for(var m=0;m<keysTemp.length;m++){
+						var _htmlTemp = keyWordHighlight(htmlTemp,keysTemp[m],'<font class="keyword">$1</font>');
+						if(htmlTemp == _htmlTemp){
+							isReplace = false;
+							break;
+						}
+						htmlTemp = _htmlTemp;
+					}
+					if(isReplace){
+						html = htmlTemp;
+					}
+				}
 				$(this).find("a.bt").html(html);
 			}
 			$(this).find(".bt").html(html);
@@ -243,10 +260,26 @@ function structureHtml(object){
 		});
 		$(this).append('<div style="clear:both;"></div>');
 		//
-		tablehtml +='<tr onClick="tablejump(\''+$(this).find("a.bt").attr("eid")+'\',\''+$(this).find("a.bt").attr("s")+'\')">'+
+		tablehtml +='<tr onClick="tablejump(\''+$(this).find("a.bt").attr("eid")+'\',\''+$(this).find("a.bt").attr("s")+'\',\''+words.join("_")+'\')">'+
 					'<td>'+count+'</td>'
 		if(typeof(info.projectname) != "undefined"&&info.projectname != ""){
-			var pn = keyWordHighlight(info.projectname,words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>');
+			var pn = info.projectname;
+			for(var n=0;n<words.length;n++){
+				var keysTemp = words[n].split("+");
+				var isReplace = true;
+				var pnTemp = pn;
+				for(var m=0;m<keysTemp.length;m++){
+					var _pnTemp = keyWordHighlight(pnTemp,keysTemp[m],'<font class="keyword">$1</font>');
+					if(pnTemp == _pnTemp){
+						isReplace = false;
+						break;
+					}
+					pnTemp = _pnTemp;
+				}
+				if(isReplace){
+					pn = pnTemp;
+				}
+			}
 			tablehtml +='<td>'+pn+'</td>'
 		}else{
 			tablehtml +='<td>'+$(this).find("a.bt").html()+'</td>'
@@ -337,36 +370,32 @@ function formatDate(date,sl)   {
 
 //
 function appendList(content,tablehtml){
-	var sds =""
 	content.children(".tslist").on("click", function(event){
-		sds = $(this).attr("words");
+		var sds = $(this).attr("words");
 		var h = $(this).find("a.bt").attr("s");
 		var eid = $(this).find("a.bt").attr("eid");
-		if(sessionStorage){
-			sessionStorage.historypushScrollTop = scrollTop;
-			sessionStorage.historypushListCache = listCache;
-			sessionStorage.historypushTableCache = tableCache;
-			sessionStorage.historypushLasttimeCache = lasttime;
-			sessionStorage.historypushNoMoreCache = noMore;
-			sessionStorage.historypushCount = count;
-		}
-		newredirect(zbadd,h,eid,sds);
+		beforeJump(eid,h,sds);
 	});
 	$("#list").append(content);
 	//
-	tablejump = function(eid,h){
+	$("#mytable").append(tablehtml)
+}
+function tablejump(eid,h,sds){
+	if(localStorage){
 		localStorage.setItem("listortable"+{{.T._id}},"T");
-		if(sessionStorage){
-			sessionStorage.historypushScrollTop = scrollTop;
-			sessionStorage.historypushListCache = listCache;
-			sessionStorage.historypushTableCache = tableCache;
-			sessionStorage.historypushLasttimeCache = lasttime;
-			sessionStorage.historypushNoMoreCache = noMore;
-			sessionStorage.historypushCount = count;
-		}
-		newredirect(zbadd,h,eid,sds);
 	}
-	$("#mytable").append(tablehtml)
+	beforeJump(eid,h,sds);
+}
+function beforeJump(eid,h,sds){
+	if(sessionStorage){
+		sessionStorage.historypushScrollTop = scrollTop;
+		sessionStorage.historypushListCache = listCache;
+		sessionStorage.historypushTableCache = tableCache;
+		sessionStorage.historypushLasttimeCache = lasttime;
+		sessionStorage.historypushNoMoreCache = noMore;
+		sessionStorage.historypushCount = count;
+	}
+	newredirect(zbadd,h,eid,"subkey_"+sds);
 }
 </script>
 <style type="text/css">

+ 58 - 26
src/web/templates/weixin/resultpreview.html

@@ -18,14 +18,12 @@ var highlightKey = [];
 var noMore = "false";
 var tableCache = "";
 var listCache = "";
-var tablejump = "";
 var wxflag = null;
 if(a_key){
 	for(var i=0;i<a_key.length;i++){
 		keys.push(a_key[i].join(" "));
-		highlightKey.push(a_key[i].join("|"));
 	}
-	sds = keys.join("+");
+	sds = "subkey_"+keys.join("_").replace(/\s+/g,"+");
 }
 var firstPage = {{.T.firstPage}};
 if(firstPage != null && firstPage.length == 1){
@@ -182,6 +180,9 @@ if(firstPage != null && firstPage.length == 1){
 	function hasNoData(){
 		$(".listcontent").hide();
 		$(".findnull").css("display","block");
+		$(".showType").hide();
+		$(".showType").next().hide();
+		$(".app-layout-content-b>div:first").hide();
 	}
 	function getHtml(list,pageNum){
 		var html = '';
@@ -202,14 +203,47 @@ if(firstPage != null && firstPage.length == 1){
 			}
 			var title = list[i].title;
 			//关键词高亮
-			if(highlightKey.length > 0){
-				title = keyWordHighlight(title,highlightKey.join("|").replace(/\+/gm,"|").replace(" ","|"),'<font class="keyword">$1</font>');
-				$(this).find("a.bt").html(html);
+			if(a_key.length > 0){
+				for(var n=0;n<a_key.length;n++){
+					var keysTemp = a_key[n];
+					var isReplace = true;
+					var titleTemp = title;
+					for(var m=0;m<keysTemp.length;m++){
+						var _titleTemp = keyWordHighlight(titleTemp,keysTemp[m],'<font class="keyword">$1</font>');
+						if(titleTemp == _titleTemp){
+							isReplace = false;
+							break;
+						}
+						titleTemp = _titleTemp;
+					}
+					if(isReplace){
+						title = titleTemp;
+					}
+				}
 			}
 			tablehtml +='<tr onClick="tablejump(\''+list[i]._id+'\',\''+list[i].href+'\')" >'+
 						'<td>'+index+'</td>'
 			if(list[i].projectname!=null&&list[i].projectname!=""){
-				tablehtml +='<td>'+keyWordHighlight(list[i].projectname,highlightKey.join("|").replace(/\+/gm,"|").replace(" ","|"),'<font class="keyword">$1</font>')+'</td>'
+				var pn = list[i].projectname;
+				if(a_key.length > 0){
+					for(var n=0;n<a_key.length;n++){
+						var keysTemp = a_key[n];
+						var isReplace = true;
+						var pnTemp = pn;
+						for(var m=0;m<keysTemp.length;m++){
+							var _pnTemp = keyWordHighlight(pnTemp,keysTemp[m],'<font class="keyword">$1</font>');
+							if(pnTemp == _pnTemp){
+								isReplace = false;
+								break;
+							}
+							pnTemp = _pnTemp;
+						}
+						if(isReplace){
+							pn = pnTemp;
+						}
+					}
+				}
+				tablehtml +='<td>'+pn+'</td>'
 			}else{
 				tablehtml +='<td>'+title+'</td>'
 			}
@@ -358,28 +392,10 @@ if(firstPage != null && firstPage.length == 1){
 		htmlObj.on("click", function(event){
 			var h = $(this).find("a.bt").attr("s");
 			var eid = $(this).find("a.bt").attr("eid");
-			if(sessionStorage){
-				sessionStorage.resultpreviewScrollTop = scrollTop;
-				sessionStorage.resultpreviewPageNumCache = pageNum;
-				sessionStorage.resultpreviewListCache = listCache;
-				sessionStorage.resultpreviewTableCache = tableCache;
-				sessionStorage.resultpreviewNoMoreCache = noMore;
-			}
-			newredirect(zbadd,h,eid,sds);
+			beforeJump(eid,h);
 		});
 	    $('#list').append(htmlObj);
 		//
-		tablejump = function(eid,h){
-			if(sessionStorage){
-				sessionStorage.resultpreviewScrollTop = scrollTop;
-				sessionStorage.resultpreviewPageNumCache = pageNum;
-				sessionStorage.resultpreviewTableCache = tableCache;
-				sessionStorage.resultpreviewListCache = listCache;
-				sessionStorage.resultpreviewNoMoreCache = noMore;
-				localStorage.setItem("listortable"+{{.T._id}},"T");
-			}
-			newredirect(zbadd,h,eid,sds);
-		}
 		$("#mytable").append(tableObj);
 	}
 	function noMoreData(me){
@@ -394,6 +410,22 @@ if(firstPage != null && firstPage.length == 1){
 	    // 即使加载出错,也得重置
 	    me.resetload();
 	}
+	function tablejump(eid,h){
+		if(localStorage){
+			localStorage.setItem("listortable"+{{.T._id}},"T");
+		}
+		beforeJump(eid,h);
+	}
+	function beforeJump(eid,h){
+		if(sessionStorage){
+			sessionStorage.resultpreviewScrollTop = scrollTop;
+			sessionStorage.resultpreviewPageNumCache = pageNum;
+			sessionStorage.resultpreviewListCache = listCache;
+			sessionStorage.resultpreviewTableCache = tableCache;
+			sessionStorage.resultpreviewNoMoreCache = noMore;
+		}
+		newredirect(zbadd,h,eid,sds);
+	}
 }
 </script>
 <style type="text/css">

+ 2 - 2
src/web/templates/weixin/search/superSearch.html

@@ -482,7 +482,7 @@
                 }
                 if(s_words != ""){
                     var wordsArray = s_words.split("+");
-                    title = keyWordHighlight(title,wordsArray.join("|"),'<font class="keyword">$1</font>');
+                    title = keyWordHighlight(title,wordsArray,'<font class="keyword">$1</font>');
                     if(detail != ""){
                         try{
                             $("#tempDiv").html(detail);
@@ -490,7 +490,7 @@
                         }catch(e){
                             detail = detail.replace(/</g,"&lt;").replace(/>/g,"&gt;");
                         }
-                        detail = keyWordHighlight(detail,wordsArray.join("|"),'<font class="keyword">$1</font>');
+                        detail = keyWordHighlight(detail,wordsArray,'<font class="keyword">$1</font>');
                     }
                 }
                 if(detail != ""){

+ 55 - 16
src/web/templates/weixin/wxinfocontent.html

@@ -1063,22 +1063,61 @@ $(function(){
 		content ='<table>'+content+'</table>'
 	}
 	var wordsArray = new Array();
-	s_words=decodeURIComponent(getParameter("keywords"))
-	if(s_words.indexOf('_')>0){
-		wordsArray = s_words.split("_");
-	}else if(s_words.indexOf("+")>0&&s_words.indexOf(" ")>0){
-		wordsArray = s_words.replace(/\+/g," ").split(" ");
-	}else if(s_words.indexOf("+")>0){
-		wordsArray = s_words.split("+");
-	}else if(s_words.indexOf(" ")>0){
-		wordsArray = s_words.split(" ");
-	}else {
-		wordsArray[0] = s_words;
-	}
-	if(wordsArray!=""&&wordsArray!="undefined"){
-		for(var i=0;i<wordsArray.length;i++){
-			content = keyWordHighlight(content,wordsArray[i],"<span class='jykeyword'>$1</span>");
-			titleCopy = keyWordHighlight(titleCopy,wordsArray[i],"<span class='jykeyword'>$1</span>");
+	s_words=decodeURIComponent(getParameter("keywords"));
+	//订阅词
+	if(/^(subkey_)/.test(s_words)){
+		wordsArray = s_words.replace(/^(subkey_)/,"").split("_");
+		//
+		for(var n=0;n<wordsArray.length;n++){
+			var keysTemp = wordsArray[n].split("+");
+			var isReplace = true;
+			var titleTemp = titleCopy;
+			for(var m=0;m<keysTemp.length;m++){
+				var _titleTemp = keyWordHighlight(titleTemp,keysTemp[m],"<span class='jykeyword'>$1</span>");
+				if(titleTemp == _titleTemp){
+					isReplace = false;
+					break;
+				}
+				titleTemp = _titleTemp;
+			}
+			if(isReplace){
+				titleCopy = titleTemp;
+			}
+		}
+		//
+		for(var n=0;n<wordsArray.length;n++){
+			var keysTemp = wordsArray[n].split("+");
+			var isReplace = true;
+			var contentTemp = content;
+			for(var m=0;m<keysTemp.length;m++){
+				var _contentTemp = keyWordHighlight(contentTemp,keysTemp[m],"<span class='jykeyword'>$1</span>");
+				if(contentTemp == _contentTemp){
+					isReplace = false;
+					break;
+				}
+				contentTemp = _contentTemp;
+			}
+			if(isReplace){
+				content = contentTemp;
+			}
+		}
+	}else{
+		if(s_words.indexOf('_')>0){
+			wordsArray = s_words.split("_");
+		}else if(s_words.indexOf("+")>0&&s_words.indexOf(" ")>0){
+			wordsArray = s_words.replace(/\+/g," ").split(" ");
+		}else if(s_words.indexOf("+")>0){
+			wordsArray = s_words.split("+");
+		}else if(s_words.indexOf(" ")>0){
+			wordsArray = s_words.split(" ");
+		}else {
+			wordsArray[0] = s_words;
+		}
+		if(wordsArray!=""&&wordsArray!="undefined"){
+			for(var i=0;i<wordsArray.length;i++){
+				content = keyWordHighlight(content,wordsArray[i],"<span class='jykeyword'>$1</span>");
+				titleCopy = keyWordHighlight(titleCopy,wordsArray[i],"<span class='jykeyword'>$1</span>");
+			}
 		}
 	}
 	$("#h_content").html(content);

+ 79 - 18
src/web/templates/weixin/wxinfocontent_rec.html

@@ -637,7 +637,10 @@ var reg =""
 var winner_con = "";
 var title = {{.T.obj.title}};
 var id = {{.T.obj._id}};
+//
 var s_words = {{.T.keywords}};
+s_words=decodeURIComponent(getParameter("keywords"));
+//
 var url = {{.T.obj.url}};
 var type = {{.T.obj.type}};
 var bidopentime = {{.T.obj.bidopentime}};
@@ -730,8 +733,28 @@ function clearup(rp){
 		dtcontent ='<table>'+dtcontent+'</table>'
 	}
 	if(wordsArray!=""&&wordsArray!="undefined"){
-		for(var i=0;i<wordsArray.length;i++){
-			dtcontent = keyWordHighlight(dtcontent,wordsArray[i],"<span class='jykeyword'>$1</span>");
+		if(/^(subkey_)/.test(s_words)){
+			//
+			for(var n=0;n<wordsArray.length;n++){
+				var keysTemp = wordsArray[n].split("+");
+				var isReplace = true;
+				var contentTemp = dtcontent;
+				for(var m=0;m<keysTemp.length;m++){
+					var _contentTemp = keyWordHighlight(contentTemp,keysTemp[m],"<span class='jykeyword'>$1</span>");
+					if(contentTemp == _contentTemp){
+						isReplace = false;
+						break;
+					}
+					contentTemp = _contentTemp;
+				}
+				if(isReplace){
+					dtcontent = contentTemp;
+				}
+			}
+		}else{
+			for(var i=0;i<wordsArray.length;i++){
+				dtcontent = keyWordHighlight(dtcontent,wordsArray[i],"<span class='jykeyword'>$1</span>");
+			}
 		}
 	}
 	$("#h_content").html(dtcontent);
@@ -1331,22 +1354,60 @@ $(function(){
 	if(content.length>10&&content.substring(0,6).toLowerCase() =="<tbody"&&content.substring(content.length-8).toLowerCase()=="</tbody>"){
 		content ='<table>'+content+'</table>'
 	}
-	s_words=decodeURIComponent(getParameter("keywords"))
-	if(s_words.indexOf('_')>0){
-		wordsArray = s_words.split("_");
-	}else if(s_words.indexOf("+")>0&&s_words.indexOf(" ")>0){
-		wordsArray = s_words.replace(/\+/g," ").split(" ");
-	}else if(s_words.indexOf("+")>0){
-		wordsArray = s_words.split("+");
-	}else if(s_words.indexOf(" ")>0){
-		wordsArray = s_words.split(" ");
-	}else {
-		wordsArray[0] = s_words;
-	}
-	if(wordsArray!=""&&wordsArray!="undefined"){
-		for(var i=0;i<wordsArray.length;i++){
-			content = keyWordHighlight(content,wordsArray[i],"<span class='jykeyword'>$1</span>");
-			titleCopy = keyWordHighlight(titleCopy,wordsArray[i],"<span class='jykeyword'>$1</span>");
+	//订阅词
+	if(/^(subkey_)/.test(s_words)){
+		wordsArray = s_words.replace(/^(subkey_)/,"").split("_");
+		//
+		for(var n=0;n<wordsArray.length;n++){
+			var keysTemp = wordsArray[n].split("+");
+			var isReplace = true;
+			var titleTemp = titleCopy;
+			for(var m=0;m<keysTemp.length;m++){
+				var _titleTemp = keyWordHighlight(titleTemp,keysTemp[m],"<span class='jykeyword'>$1</span>");
+				if(titleTemp == _titleTemp){
+					isReplace = false;
+					break;
+				}
+				titleTemp = _titleTemp;
+			}
+			if(isReplace){
+				titleCopy = titleTemp;
+			}
+		}
+		//
+		for(var n=0;n<wordsArray.length;n++){
+			var keysTemp = wordsArray[n].split("+");
+			var isReplace = true;
+			var contentTemp = content;
+			for(var m=0;m<keysTemp.length;m++){
+				var _contentTemp = keyWordHighlight(contentTemp,keysTemp[m],"<span class='jykeyword'>$1</span>");
+				if(contentTemp == _contentTemp){
+					isReplace = false;
+					break;
+				}
+				contentTemp = _contentTemp;
+			}
+			if(isReplace){
+				content = contentTemp;
+			}
+		}
+	}else{
+		if(s_words.indexOf('_')>0){
+			wordsArray = s_words.split("_");
+		}else if(s_words.indexOf("+")>0&&s_words.indexOf(" ")>0){
+			wordsArray = s_words.replace(/\+/g," ").split(" ");
+		}else if(s_words.indexOf("+")>0){
+			wordsArray = s_words.split("+");
+		}else if(s_words.indexOf(" ")>0){
+			wordsArray = s_words.split(" ");
+		}else {
+			wordsArray[0] = s_words;
+		}
+		if(wordsArray!=""&&wordsArray!="undefined"){
+			for(var i=0;i<wordsArray.length;i++){
+				content = keyWordHighlight(content,wordsArray[i],"<span class='jykeyword'>$1</span>");
+				titleCopy = keyWordHighlight(titleCopy,wordsArray[i],"<span class='jykeyword'>$1</span>");
+			}
 		}
 	}
 	$("#h_content").html(content);

+ 33 - 9
src/web/templates/weixin/wxpush.html

@@ -88,13 +88,7 @@ $(function(){
 		jywords = a_key;
 	}
 	//
-	for(var i=0;i<jywords.length;i++){
-		if(i==0){
-			sds +=jywords[i]
-		}else{
-			sds +="+"+jywords[i]
-		}
-	}
+	sds = "subkey_"+jywords.join("_");
 	//
 	if (Object.keys(o_pushinfo).length == 1){
 		document.title = '公告信息';
@@ -222,10 +216,40 @@ $(function(){
 			//关键词高亮
 			if(typeof(s_words) != "undefined"){
 				var html = $(this).find("a.bt").html();
-				html = keyWordHighlight(html,s_words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>');
+				for(var n=0;n<s_words.length;n++){
+					var keysTemp = s_words[n].split("+");
+					var isReplace = true;
+					var htmlTemp = html;
+					for(var m=0;m<keysTemp.length;m++){
+						var _htmlTemp = keyWordHighlight(htmlTemp,keysTemp[m],'<font class="keyword">$1</font>');
+						if(htmlTemp == _htmlTemp){
+							isReplace = false;
+							break;
+						}
+						htmlTemp = _htmlTemp;
+					}
+					if(isReplace){
+						html = htmlTemp;
+					}
+				}
 				$(this).find("a.bt").html(html);
 				if(tableptname!=undefined&&tableptname!=""){
-					tableptname= keyWordHighlight(tableptname,s_words.join("|").replace(/\+/gm,"|"),'<font class="keyword">$1</font>')
+					for(var n=0;n<s_words.length;n++){
+						var keysTemp = s_words[n].split("+");
+						var isReplace = true;
+						var pnTemp = tableptname;
+						for(var m=0;m<keysTemp.length;m++){
+							var _pnTemp = keyWordHighlight(pnTemp,keysTemp[m],'<font class="keyword">$1</font>');
+							if(pnTemp == _pnTemp){
+								isReplace = false;
+								break;
+							}
+							pnTemp = _pnTemp;
+						}
+						if(isReplace){
+							tableptname = pnTemp;
+						}
+					}
 				}
 			}
 			var tableid = $(this).find("a.bt").attr("eid");

+ 2 - 2
src/web/templates/weixin/wxsearchlist.html

@@ -398,7 +398,7 @@ function getHtml(list,pageNum){
 		}
 		if(s_words != ""){
 			var wordsArray = s_words.split("+");
-			title = keyWordHighlight(title,wordsArray.join("|"),'<font class="keyword">$1</font>');
+			title = keyWordHighlight(title,wordsArray,'<font class="keyword">$1</font>');
 			if(detail != ""){
 				try{
 					$("#tempDiv").html(detail);
@@ -406,7 +406,7 @@ function getHtml(list,pageNum){
 				}catch(e){
 					detail = detail.replace(/</g,"&lt;").replace(/>/g,"&gt;");
 				}
-				detail = keyWordHighlight(detail,wordsArray.join("|"),'<font class="keyword">$1</font>');
+				detail = keyWordHighlight(detail,wordsArray,'<font class="keyword">$1</font>');
 			}
 		}
 		if(detail != ""){