Эх сурвалжийг харах

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

李广朋 9 жил өмнө
parent
commit
7df598e6a3

+ 0 - 1
core/src/config.json

@@ -30,7 +30,6 @@
     "chatRpc": "127.0.0.1:88",
     "creditRpc": "127.0.0.1:8765",
     "pushRpc": "127.0.0.1:8766",
-    "domainName": "http://www.qimingxing.info",
     "ocr_uid": "120.25.216.197",
     "ocr_servicekey": "c1608f6b-b507-46d4-98de-12e98f613715",
     "ocr_servicecode": "91f6a58d-e418-4e58-8ec2-61b583c55ba2"

+ 1 - 1
core/src/qfw/active/activemanage.go

@@ -255,7 +255,7 @@ func (a *Activemanage) Luckdraw(activecode, id string) error {
 		a.SetSession("s_m_openid", openid)
 		a.SetSession("s_actcode", activecode)
 
-		a.T["signature"] = mob.GetSignature(a.Url())
+		a.T["signature"] = mob.GetSignature(a.Action)
 		u := FindOne("winningrecord", "{'s_openid':'"+openid+"'}")
 		if *u != nil {
 			if ret := redis.Get("other", "cj_"+openid+"_"+time.Now().Format("2006_01_02")); ret == nil {

+ 1 - 1
core/src/qfw/active/flop.go

@@ -95,7 +95,7 @@ func (a *Active) Flop(reqType string, encryptOpenid string) error {
 			flag = 2
 		}
 	}
-	a.T["signature"] = mobile.GetSignature(a.Url())
+	a.T["signature"] = mobile.GetSignature(a.Action)
 	a.T["openid"] = encryptOpenid
 	a.T["cardType"] = cardType
 	a.T["oldCredit"] = oldCredit

+ 0 - 1
core/src/qfw/coreconfig/SysConfig.go

@@ -24,7 +24,6 @@ type config struct {
 	ChatRpc         string      `json:"chatRpc"`
 	PushRpc         string      `json:"pushRpc"`
 	ElasticPoolSize int         `json:"elasticPoolSize"`
-	DomainName      string      `json:"domainName"`
 	Ocr_uid         string      `json:"orc_uid"`
 	Ocr_servicekey  string      `json:"ocr_servicekey"`
 	Ocr_servicecode string      `json:"ocr_servicecode"`

+ 11 - 15
core/src/qfw/mobile/wxmenu.go

@@ -3,6 +3,7 @@ package mobile
 import (
 	"encoding/json"
 	"fmt"
+	"github.com/go-xweb/xweb"
 	"log"
 	"math/rand"
 	"net/rpc"
@@ -27,7 +28,7 @@ func (m *Mobile) Guide(sign string) error {
 	if m.Session().Get("s_m_openid") == nil {
 		return m.Redirect("/swordfish/share/-1")
 	}
-	m.T["signature"] = GetSignature(m.Url())
+	m.T["signature"] = GetSignature(m.Action)
 	m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 	m.T["sign"] = sign
 	if sign == "share" {
@@ -38,7 +39,7 @@ func (m *Mobile) Guide(sign string) error {
 }
 func (m *Mobile) Share(shareid string) error {
 	m.T["shareid"] = shareid
-	m.T["signature"] = GetSignature(m.Url())
+	m.T["signature"] = GetSignature(m.Action)
 	return m.Render("/swordfish/wxshare.html", &m.T)
 }
 
@@ -66,7 +67,7 @@ func (m *Mobile) Wxrssset() error {
 		}
 	}()
 	if m.Session().Get("userId") != nil {
-		m.T["signature"] = GetSignature(m.Url())
+		m.T["signature"] = GetSignature(m.Action)
 		userInfo := mongodb.FindById("user", m.GetSession("userId").(string), nil)
 		if *userInfo != nil {
 			if i_m_guide := (*userInfo)["i_m_guide"]; util.IntAll(i_m_guide) == 0 {
@@ -374,7 +375,7 @@ func (m *Mobile) WxpushView(stype string) error {
 		log.Println("给用户推送出错", e)
 	})
 	if b {
-		//m.T["signature"] = GetSignature(m.Url())
+		//m.T["signature"] = GetSignature(m.Action)
 		m.T["view"] = 1
 		m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 		return m.Render("/swordfish/wxpush.html", &m.T)
@@ -387,7 +388,7 @@ func (m *Mobile) WxpushView(stype string) error {
 func (m *Mobile) WxpushList(s_m_openid string, _id string, msgid string) error {
 	m.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1,"s_type":1}`)
 	m.T["_id"] = _id
-	m.T["signature"] = GetSignature(m.Url())
+	m.T["signature"] = GetSignature(m.Action)
 	return m.Render("/swordfish/wxpush.html", &m.T)
 }
 
@@ -403,7 +404,7 @@ func (m *Mobile) WxpushListInfo(_id string) error {
 	}
 	m.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1,"s_type":1}`)
 	m.T["_id"] = _id
-	m.T["signature"] = GetSignature(m.Url())
+	m.T["signature"] = GetSignature(m.Action)
 	m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 	return m.Render("/swordfish/wxpush.html", &m.T)
 }
@@ -415,22 +416,17 @@ func (m *Mobile) WxpushAjaxReq() error {
 	}, false, false)
 	return nil
 }
-func GetSignature(action string) []string {
-	var url string
-	if strings.HasPrefix(action, "http://") {
-		url = action
-	} else {
-		url = coreconfig.SysConfig.DomainName + action
-	}
+func GetSignature(action *xweb.Action) []string {
+	url := action.Site() + action.Url()
 	var signature []string
-	if ret := redis.Get("other", "wxshare-"+url); ret != nil {
+	if ret := redis.Get("other", "wxsignature-"+url); ret != nil {
 		if d, err := json.Marshal(ret); err == nil {
 			json.Unmarshal(d, &signature)
 		}
 	}
 	if len(signature) == 0 {
 		signature = cutil.GetJSInterfaceParam(url)
-		redis.Put("other", "wxshare-"+url, signature, 90*60) //一个半小时
+		redis.Put("other", "wxsignature-"+url, signature, 90*60) //一个半小时
 	}
 	log.Println(url, "------", signature)
 	return signature

+ 1 - 1
core/src/qfw/search/searchService.go

@@ -37,7 +37,7 @@ func (search *Search) EntCommunity() error {
 	regex, _ := regexp.Compile("(Android|Mobile)")
 	ismobile := regex.FindAllString(search.Header("User-Agent"), -1)
 	if len(ismobile) > 0 {
-		search.T["signature"] = mobile.GetSignature(search.Url())
+		search.T["signature"] = mobile.GetSignature(search.Action)
 		search.Render("/member/incmobile/index.html", &search.T)
 		return nil
 	}

+ 2 - 2
core/src/qfw/search/wxsearchservice.go

@@ -20,14 +20,14 @@ import (
 
 //企业社区首页
 func (n *Wxsearch) WxIndex() error {
-	n.T["signature"] = mobile.GetSignature("http://m.qmx.top" + n.Url())
+	n.T["signature"] = mobile.GetSignature(n.Action)
 	n.Render("/member/incmobile/index.html", &n.T)
 	return nil
 }
 
 //企业列表
 func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
-	n.T["signature"] = mobile.GetSignature("http://m.qmx.top" + n.Url())
+	n.T["signature"] = mobile.GetSignature(n.Action)
 	i_mingpian := n.GetString("i_mingpian") //是否走名片查询
 	if n.Method() == "POST" {
 		//请求是表单提交,走的查询

+ 5 - 5
core/src/web/staticres/microwebsite/mobile/css/font.css

@@ -1,10 +1,10 @@
 @font-face {
 	font-family: 'icomoon';
-	src:url('fonts/icomoon.eot?o3cafj');
-	src:url('fonts/icomoon.eot?#iefixo3cafj') format('embedded-opentype'),
-		url('fonts/icomoon.ttf?o3cafj') format('truetype'),
-		url('fonts/icomoon.woff?o3cafj') format('woff'),
-		url('fonts/icomoon.svg?o3cafj#icomoon') format('svg');
+	src: url('fonts/icomoon.eot');
+	src: url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
+		url('fonts/icomoon.woff') format('woff'),
+		url('fonts/icomoon.ttf') format('truetype'),
+		url('fonts/icomoon.svg') format('svg');
 	font-weight: normal;
 	font-style: normal;
 }

+ 3 - 1
core/src/web/staticres/microwebsite/mobile/css/style.css

@@ -558,7 +558,9 @@ to {bottom:25px;}
     align-items: center;
 }
 .swiper-container-vertical>.swiper-pagination{
-	top: 50px;
+	top: 15px;
+    transform: none;
+	-webkit-transform: none;
 }
 .swiper-pagination-clickable .swiper-pagination-bullet{
 	background-color: silver;

+ 14 - 12
core/src/web/staticres/wxswordfish/main.js

@@ -119,13 +119,16 @@ KeyWordDialog.AppendNode = function(dialogObj,value){
 		return '<div class="keyWordGroup">'
 					+'<lable style="white-space:nowrap;">关键词<font>'+index+'</font></lable>'
 					+'<div><input type="text" onfocus="setFocus(this)" value="'+(value?value:"")+'" placeholder="示例:税务局 软件" maxlength="100"></div>'
-					+'<div>'+(index==1?'':'<img src="/wxswordfish/images/delete.png" class="delete">')+'</div>'
+					+'<div><img src="/wxswordfish/images/delete.png" class="delete"'+(index==1?' style="display: none;"':'')+'></div>'
 				+'</div>';
 	}
 	var count = dialogObj.find(".keyWordGroup").length;
 	if(count >= 10){
 		return;
 	}
+	if(count > 0){
+		dialogObj.find(".keyWordGroup:first").find(".delete").show();
+	}
 	var obj = $(getHtml(count+1,value));
 	dialogObj.find(".addKeyWordArea").before(obj);
 	//自动滚动到底部
@@ -136,6 +139,9 @@ KeyWordDialog.AppendNode = function(dialogObj,value){
 		dialogObj.find(".keyWordGroup").each(function(i){
 			$(this).children("lable").children("font").text(i+1);
 		});
+		if(dialogObj.find(".keyWordGroup").length == 1){
+			dialogObj.find(".keyWordGroup:first").find(".delete").hide();
+		}
 	});
 	if(typeof(value) == "undefined" || value == ""){
 		obj.find("[type='text']").focus();
@@ -499,22 +505,18 @@ $(function(){
 	$("body").append($("#tender-keyword").clone().removeAttr("id").attr("id","bid-keyword"))
 			.append($("#tender-scope").clone().removeAttr("id").attr("id","bid-scope"));
 	var searchnameIsExsit = false;
-	if(msgset == ""){
-		if(typeof(searchname) != "undefined" && searchname.length > 0 ){
+	if(typeof(searchname) != "undefined" && searchname.length > 0 ){
+		searchname = searchname.replace(/\s+/g,"+");
+		if(msgset == ""){
 			msgset = {};
 			msgset[s_type] = {"a_key":[searchname],"s_scope":"A"};
-		}
-	}else{
-		if (typeof(searchname) != "undefined" && searchname.length > 0 ){
+		}else{
 			if(typeof(msgset[s_type]) != "undefined"){
 				var keywordes = msgset[s_type].a_key;
 				if(typeof(keywordes) != "undefined" && keywordes.length > 0){
 					for(var i=0;i<keywordes.length;i++){
-						var keywordesArr = keywordes[i].split("+");
-						for(var k=0;k<keywordesArr.length;k++){
-							if(keywordesArr[k] == searchname){
-								searchnameIsExsit = true;
-							}
+						if(keywordes[i] == searchname){
+							searchnameIsExsit = true;
 						}
 					}
 					if(!searchnameIsExsit){
@@ -572,7 +574,7 @@ $(function(){
 		if(!$("#"+s_type +"-on-off").hasClass("open")){
 			$("#"+s_type+"-on-off").click();
 		}else if(!searchnameIsExsit){//修改关键词
-			commonAjaxReq($("#"+s_type+"-keyword"),s_type);
+			commonAjaxReq(null,s_type);
 		}
 	}
 	//收费规则

+ 11 - 53
core/src/web/staticres/wxswordfish/style.css

@@ -64,12 +64,11 @@ img{
 .operation>.parent-node{
 	background-color: #F8F8F8;
 	width: 100%;
-	height: 40px;
-	line-height: 40px;
+	height: 45px;
+	line-height: 45px;
 	border-bottom: 1px solid #CCCCCC;
 	position: relative;
 	font-size: 16px;
-	padding-left: 5px;
 }
 .parent-node-view{
 	width: 100%;
@@ -79,7 +78,7 @@ img{
 	text-align:center;
 }
 .operation>.parent-node>img{
-	margin-left: 10px;
+	margin-left: 15px;
 	margin-right: 10px;
 	width: 18px;
 	height: 18px;
@@ -94,7 +93,7 @@ img{
 	width: 60px;
 	height: 40px;
 	margin-top: -17px;
-	right: 5px;
+	right: 10px;
 	position: absolute;
 	top: 50%;
 }
@@ -111,6 +110,8 @@ img{
 }
 .operation .on-off.open{
 	background-image: url("/wxswordfish/images/on.png");
+	right: 3px;
+	width: 62px;
 }
 .operation .btn-right img{
 	width: 15px;
@@ -131,7 +132,8 @@ img{
 	width: 8px;
 	height: 15px;
 	float: right;
-	margin-right: 15px;
+	margin-right: 20px;
+	margin-top: 4px;
 }
 .operation .child-node li>div:first-child{
 	
@@ -150,7 +152,7 @@ img{
 	top: 0px;
 	background-color: rgba(0,0,1,.5);
 	display: none;
-	z-index: 11;
+	z-index: 99999;
 }
 .dialog-main{
 	position: absolute;
@@ -506,11 +508,11 @@ img{
 	left: 0px;
 	right: 0px;
 	bottom: 0px;
-	height: 40px;
+	height: 45px;
 	width: 100%;
 	border-top: 1px solid #CCCCCC;
 	background-color: #F8F8F8;
-	z-index: 1;
+	z-index: 9999;
 }
 .bottom-toolbar>li{
 	display: table-cell;
@@ -693,48 +695,4 @@ img{
 	top: 0px;
 	bottom: 0px;
 	display: none;
-}
-.scroller{
-	overflow-y: auto;
-	-webkit-tap-highlight-color: rgba(0,0,0,0);
-	-webkit-transform: translateZ(0);
-	-moz-transform: translateZ(0);
-	-ms-transform: translateZ(0);
-	-o-transform: translateZ(0);
-	transform: translateZ(0);
-	-webkit-touch-callout: none;
-	-webkit-user-select: none;
-	-moz-user-select: none;
-	-ms-user-select: none;
-	user-select: none;
-	-webkit-text-size-adjust: none;
-	-moz-text-size-adjust: none;
-	-ms-text-size-adjust: none;
-	-o-text-size-adjust: none;
-	text-size-adjust: none;
-}
-.iScrollVerticalScrollbar{
-	position: absolute;
-    z-index: 9999;
-    width: 5px;
-    bottom: 2px;
-    top: 2px;
-    right: 3px;
-    overflow: hidden;
-    transform: translateZ(0px);
-    transition-duration: 500ms;
-    opacity: 0;
-}
-.iScrollIndicator{
-	box-sizing: border-box;
-    position: absolute;
-    border: 1px solid rgba(255, 255, 255, 0.901961);
-    border-radius: 4px;
-    width: 100%;
-    transition-duration: 0ms;
-    display: block;
-    transform: translate(0px, 0px) translateZ(0px);
-    background: rgba(0, 0, 0, 0.498039);
-	opacity: 0.5;
-	height: 100px;
 }

+ 15 - 0
core/src/web/templates/common/baiducc.html

@@ -0,0 +1,15 @@
+<script>
+var _hmt = _hmt || [];
+(function() {
+	var hm = document.createElement("script");
+	hm.src = "/baiducc";
+	var s = document.getElementsByTagName("script")[0]; 
+	s.parentNode.insertBefore(hm, s);
+})();
+(function() {
+  var hm = document.createElement("script");
+  hm.src = "//hm.baidu.com/hm.js?ed11a6878299a1692a394c7c038df273";
+  var s = document.getElementsByTagName("script")[0]; 
+  s.parentNode.insertBefore(hm, s);
+})();
+</script>

+ 2 - 7
core/src/web/templates/common/bottom.html

@@ -19,7 +19,6 @@
 <div class="hidden-xs" id="testBottom"></div>
 <div class="hidden">
 <script>
-var _hmt = _hmt || [];
 (function() {
 	var bottomBarRight = (document.body.clientWidth - 1200) / 2 - 42;
 	if(bottomBarRight > 0){
@@ -29,11 +28,6 @@ var _hmt = _hmt || [];
   	$("#backTop").click(function(){
 		$(window).scrollTop(0);
 	});
-	var hm = document.createElement("script");
-	hm.src = "//hm.baidu.com/hm.js?ed198b177e527bb53684db20bb390e77";
-	var s = document.getElementsByTagName("script")[0]; 
-	s.parentNode.insertBefore(hm, s);
-	//
 	var oldBottomBarImgSrc = null;
 	$("#bottom-bar img").mouseover(function(){
 		if(typeof($(this).attr("src")) == "undefined"){
@@ -64,7 +58,8 @@ var _hmt = _hmt || [];
 				$(window).scrollTop(0);
 				break;
 		}
-	});
+	});	
 })();
 </script>
+{{include "/common/baiducc.html"}}
 </div>

+ 14 - 18
core/src/web/templates/swordfish/rssset.html

@@ -347,22 +347,18 @@ $(function(){
 	}
 	var msgset = {{.T.msgset}};
 	var searchvalueIsExsit = false;
-	if(msgset == ""){
-		if(typeof(searchvalue) != "undefined" && searchvalue.length > 0 ){
+	if(typeof(searchvalue) != "undefined" && searchvalue.length > 0 ){
+		searchvalue = searchvalue.replace(/\s+/g,"+");
+		if(msgset == ""){
 			msgset = {};
 			msgset[searchtype] = {"a_key":[searchvalue],"s_scope":"A"};
-		}
-	}else{
-		if (typeof(searchvalue) != "undefined" && searchvalue.length > 0 ){
+		}else{
 			if(typeof(msgset[searchtype]) != "undefined"){
 				var keywordes = msgset[searchtype].a_key;
 				if(typeof(keywordes) != "undefined" && keywordes.length > 0){
 					for(var i=0;i<keywordes.length;i++){
-						var keywordesArr = keywordes[i].split("+");
-						for(var k=0;k<keywordesArr.length;k++){
-							if(keywordesArr[k] == searchvalue){
-								searchvalueIsExsit = true;
-							}
+						if(keywordes[i] == searchvalue){
+							searchvalueIsExsit = true;
 						}
 					}
 					if(!searchvalueIsExsit){
@@ -532,14 +528,8 @@ function appendKeyWord(type,value,isFocus){
 		var html='<div class="swordfish-keyword">'
 					+'<lable>关键词<font>'+index+'</font>:</lable>'
 					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:税务局 软件" maxlength="100">'
-					+'<img src="{{Msg "seo" "cdn"}}/images/swordfish/delete.png">'
-				+'</div>';
-		if (index==1){
-			html='<div class="swordfish-keyword">'
-					+'<lable>关键词<font>'+index+'</font>:</lable>'
-					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:税务局 软件" maxlength="100">'
-				+'</div>';
-		}
+					+'<img src="{{Msg "seo" "cdn"}}/images/swordfish/delete.png"'+(index==1?' style="display: none;"':'')+'>'
+					+'</div>';
 		return html;
 	}
 	var obj = $("#"+type+"-keywords");
@@ -547,6 +537,9 @@ function appendKeyWord(type,value,isFocus){
 	if(count >= 10){
 		return;
 	}
+	if(count > 0){
+		obj.children(".swordfish-keyword:first").children("img").show();
+	}
 	if(count == 9){
 		$("#"+type+"-addkeyword").attr("disabled",true);
 	}
@@ -558,6 +551,9 @@ function appendKeyWord(type,value,isFocus){
 		obj.find(".swordfish-keyword").each(function(i){
 			$(this).children("b").children("font").text(i+1);
 		});
+		if(obj.children(".swordfish-keyword").length == 1){
+			obj.children(".swordfish-keyword:first").children("img").hide();
+		}
 		ajaxReq();
 	});
 	node.children("[type='text']").blur(function(){

+ 1 - 6
core/src/web/templates/swordfish/wxinfocontent.html

@@ -8,12 +8,6 @@
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js"></script>
 <script>
 initShare({{.T.signature}},{{.T.shareid}});
-$(function(){
-	var hm = document.createElement("script");
-	hm.src = "//hm.baidu.com/hm.js?ed198b177e527bb53684db20bb390e77";
-	var s = document.getElementsByTagName("script")[0]; 
-	s.parentNode.insertBefore(hm, s);
-})
 </script>
 <style type="text/css">
 body{
@@ -70,5 +64,6 @@ $(function(){
 })
 </script>
 {{include "/swordfish/wxtoolbar.html"}}
+{{include "/common/baiducc.html"}}
 </body>
 </html>

+ 4 - 4
core/src/web/templates/swordfish/wxpush.html

@@ -7,13 +7,12 @@
 <script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js"></script>
 <script>
+if(sessionStorage){
+	sessionStorage.version="1"
+}
 initShare({{.T.signature}},{{.T.shareid}});
 var b_view = "{{.T.view}}";
 $(function(){
-	var hm = document.createElement("script");
-	hm.src = "//hm.baidu.com/hm.js?ed198b177e527bb53684db20bb390e77";
-	var s = document.getElementsByTagName("script")[0]; 
-	s.parentNode.insertBefore(hm, s);
 	//
 	var width=$(window).width();
 	var height=$(window).height();
@@ -179,5 +178,6 @@ a{
 </head>
 <body>
 {{include "/swordfish/wxtoolbar.html"}}
+{{include "/common/baiducc.html"}}
 </body>
 </html>

+ 9 - 1
core/src/web/templates/swordfish/wxrssset.html

@@ -4,6 +4,14 @@
 <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <meta name="renderer" content="webkit">
+<script>
+if(sessionStorage&&sessionStorage.version=="1"){
+	sessionStorage.version="0"
+	if(sessionStorage.version=="0"){
+		window.location.reload(true)	
+	}
+}
+</script>
 <link href="{{Msg "seo" "cdn"}}/wxswordfish/style.css" rel="stylesheet">
 <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 <script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
@@ -78,7 +86,7 @@
 		<li class="parent-node">
 			<img src="{{Msg "seo" "cdn"}}/wxswordfish/images/feerule.png">
 			收费规则
-			<span style="right:0" class="rule"><img src="{{Msg "seo" "cdn"}}/wxswordfish/images/right.png" style="width: 10px;height: 17px;float: right;"></span>
+			<span style="right:10" class="rule"><img src="{{Msg "seo" "cdn"}}/wxswordfish/images/right.png" style="width: 10px;height: 17px;float: right;"></span>
 		</li>
 	</ul>
 	<!--剑鱼服务协议-->

+ 2 - 2
core/src/web/templates/swordfish/wxsearch.html

@@ -132,7 +132,7 @@ body{
 <div class="kongbai"></div>
 <div class="searchshow hidden">
 		<!--招标 start-->
-	<form action="/member/wxswordfish/searchlist" name="searchone" method="post" style="margin-bottom: auto;">
+	<form action="/member/wxswordfish/searchlist" name="searchone" method="get" style="margin-bottom: auto;">
 		<div onClick="searchbiao(1)" class="searchbs" >
 		<div class="searchzhao1"><img src="{{Msg "seo" "cdn"}}/images/wxjs.png"/></div>
 		<div class="searchzhao2">查询招标公告:</div>
@@ -146,7 +146,7 @@ body{
 	</form>
 		<!--招标 end-->
 		<!--中标 start-->
-	<form action="/member/wxswordfish/searchlist" name="searchtwo" method="post" style="margin-bottom: auto;">
+	<form action="/member/wxswordfish/searchlist" name="searchtwo" method="get" style="margin-bottom: auto;">
 		<div onClick="searchbiao(2)"  class="searchbs" >
 		<div class="searchzhong1"><img src="{{Msg "seo" "cdn"}}/images/wxjs.png"/></div>
 		<div class="searchzhong2">查询中标公告:</div>

+ 30 - 48
core/src/web/templates/swordfish/wxsearchlist.html

@@ -7,19 +7,13 @@
 <link href="{{Msg "seo" "cdn"}}/wxswordfish/style.css" rel="stylesheet">
 {{include "/common/inc.html"}}
 <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
-<script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js"></script>
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/main.js"></script>
 <script src="{{Msg "seo" "cdn"}}/wxswordfish/jquery.resize.js"></script>
-<script src="{{Msg "seo" "cdn"}}/js/iscroll.js"></script>
-<script>
-	var msgset= {{.T.msgset}};
-	initShare({{.T.signature}},{{.T.shareid}});
-</script>
-
 <script type="text/javascript">
+	var msgset= {{.T.msgset}};
 $(function(){
-	
+	initShare({{.T.signature}},{{.T.shareid}});
 	var s_words = [];
 	s_words = {{.T.s_name}};
 	
@@ -27,7 +21,7 @@ $(function(){
 	if (!flog){
 		$(".nullcontent").removeClass("hidden");
 		$(".resbm").addClass("hidden");
-		$(".scroller").addClass("hidden");
+		$("#wrapper").addClass("hidden");
 	}else{
 		$("#resbm").removeClass("hidden");
 		var str = ""
@@ -36,7 +30,7 @@ $(function(){
 		a_visitedindex=temp["a_visitedindex"];
 		a_publishtime=temp["a_publishtime"];
 		f_id=temp["_id"];
-		$(".scroller").append('<div id="ycwords" datatype="'+temp["s_type"]+'">'+str+'</div>')
+		$("#wrapper").append('<div id="ycwords" datatype="'+temp["s_type"]+'">'+str+'</div>')
 		//信息条总数
 		le=$(".tslist").length;
 		//
@@ -122,9 +116,10 @@ $(function(){
 					$(this).attr("href","javascript:void(0);")	
 				}
 			})
-			abt.click(function(){
+			abt.on("click", function(event){
 				var h=$(this).attr("s");
-				open_window(h);
+				var sid=$(this).attr("sid");
+				redirect(h,sid);
 				return false;
 			})
 		},800)
@@ -225,6 +220,7 @@ body{
 .resbm {
     display: table;
     position: fixed;
+	z-index:2000;
     left: 0px;
     right: 0px;
     bottom: 46px;
@@ -258,19 +254,17 @@ body{
 #wrapper,.nullcontent{
 	padding:0px 20px;
 	background-color:#fff;
-	position: absolute;
-    top: 65px;
-	left: 0px;
-	right: 0px;
-	overflow: hidden;
-	z-index: 1;
 }
 .nullcontent{
 	bottom: 46px;
 	padding-top: 30%;
+	position: absolute;
+    top: 65px;
+    left: 0px;
+    right: 0px;
 }
 #wrapper{
-	bottom: 98px;
+	padding-bottom: 98px;
 }
 .tslist{
 	border-bottom: 1px solid #e5e6e9;
@@ -318,16 +312,11 @@ body{
 <i class="glyphicon sousuo"></i>
 </span>
 </div>
-<div id="wrapper">
-	<div class="scroller">
-	
-	</div>
-</div>
-
+<div id="wrapper"></div>
 </div>
 <div class="resbm" >
 <div class="rests">确认关键词的查询结果无误</div>
-<div class="resdy"  onClick="jpmy()">
+<div class="resdy" id="zjdy">
 直接订阅
 </div>
 
@@ -348,7 +337,7 @@ body{
 </form>
 </div>
 <div style="display:none;">
-<form action="/swordfish/page" name="searchtwo" method="post">
+<form action="/swordfish/page" name="searchtwo" method="get">
 	<input name="searchnametwo" id="searchnametwo" value="" style="display:none;"/>
 	<input name="s_typetwo" id="sea_type" value="{{.T.s_type}}" style="display:none;"/>
 </form>
@@ -367,28 +356,21 @@ body{
 		$(".searchzhao3 span").html("");
 		$(".searchzhong3 span").html("");
 	})
-	function open_window(link){
-		if(!/^http/.test(link)){
-			link="http://"+link
-		}
-		window.open("/visit/redirect?url="+escape(link));
-	}
-	function jpmy(){
-		var searchname = $(".searchname").val();
-		document.getElementById("searchnametwo").value = searchname;
-		document.forms['searchtwo'].submit();
+
+function redirect(link,sid){ 
+	if(!/^http/.test(link)){
+		link="http://"+link
 	}
-	$(function(){
-		new IScroll('#wrapper', {
-			scrollbarClass: "myScrollbar",
-			scrollbars: "custom",
-			mouseWheel: true,
-			interactiveScrollbars: true,
-			shrinkScrollbars: 'scale',
-			fadeScrollbars: true,
-			resizeScrollbars: false
-		});
-	});
+	window.location.href="/visit/redirect?id="+sid+"&url="+escape(link)
+}
+
+	$("#zjdy").click(function(){
+			var searchname = $(".searchname").val();
+			document.getElementById("searchnametwo").value = searchname;
+			document.forms['searchtwo'].submit();
+			return false	
+	})
+
 </script>
 </body>
 </html>

+ 2 - 0
push/src/main.go

@@ -10,6 +10,7 @@ import (
 	"net/rpc"
 	"qfw/push"
 	"qfw/push/bid"
+	"qfw/push/listdb"
 	"qfw/push/rpcpush"
 	"qfw/push/tender"
 	"qfw/util"
@@ -29,6 +30,7 @@ func init() {
 	rpcpush.PushInfoScopeDays = util.IntAll(push.PushConfig["pushInfoScopeDays"])
 	tender.MaxPushSize = bid.MaxPushSize
 	mongodb.InitMongodbPool(util.IntAll(push.PushConfig["mgoSize"]), push.PushConfig["mgoAddr"].(string), "qfw")
+	listdb.Inits()
 }
 
 var jobs []push.PushJobFace = []push.PushJobFace{

+ 203 - 54
push/src/qfw/push/dopush/dopush.go

@@ -7,11 +7,13 @@ import (
 	"math/rand"
 	"qfw/push"
 	"qfw/push/dfa"
+	"qfw/push/listdb"
 	"qfw/util"
 	"qfw/util/mongodb"
 	qrpc "qfw/util/rpc"
 	"regexp"
 	"runtime"
+	"sort"
 	"strconv"
 	"strings"
 	"time"
@@ -43,7 +45,45 @@ func (b *Pjob) CreateUserInterestWord() {
 	b.Dfa.AddWord(words...)
 }
 
-//遍历数据只做标题预览
+type sortList []*map[string]interface{}
+
+func (s sortList) Len() int {
+	return len(s)
+}
+
+func (s sortList) Less(i, j int) bool {
+	defer func() {
+		if r := recover(); r != nil {
+			log.Println("[E]", r)
+			for skip := 0; ; skip++ {
+				_, file, line, ok := runtime.Caller(skip)
+				if !ok {
+					break
+				}
+				go log.Printf("%v,%v\n", file, line)
+			}
+		}
+	}()
+	return util.Int64All((*s[i])["publishtime"]) > util.Int64All((*s[j])["publishtime"])
+}
+
+func (s sortList) Swap(i, j int) {
+	defer func() {
+		if r := recover(); r != nil {
+			log.Println("[E]", r)
+			for skip := 0; ; skip++ {
+				_, file, line, ok := runtime.Caller(skip)
+				if !ok {
+					break
+				}
+				go log.Printf("%v,%v\n", file, line)
+			}
+		}
+	}()
+	s[i], s[j] = s[j], s[i]
+}
+
+//内存数据推送
 func (p *Pjob) EachInfoForView(mopenid, words string) map[string]interface{} {
 	defer func() {
 		if r := recover(); r != nil {
@@ -69,76 +109,59 @@ func (p *Pjob) EachInfoForView(mopenid, words string) map[string]interface{} {
 			words: &ss,
 		}
 	} else {
-		*p.Cache = push.InitCache(p.Stype, mopenid,true)
+		*p.Cache = push.InitCache(p.Stype, mopenid, true)
 	}
 	p.CreateUserInterestWord()
-	session := mongodb.GetMgoConn()
-	defer mongodb.DestoryMongoConn(session)
-	q := `{"type":"` + p.Stype + `"}`
-	n, _ := session.DB("qfw").C("bidding").Find(mongodb.ObjToOth(q)).Count()
-	userMap := &map[*push.MemberInterest]*list.List{}
-	if n == 0 {
-		log.Println("预览", p.Stype, "没有数据。")
-	} else {
-		query := session.DB("qfw").C("bidding").Find(mongodb.ObjToOth(q)).Sort("-publishtime").Iter()
-		var returnLastTimeLong int64 = 0
-	L1:
-		for tmp := new(map[string]interface{}); query.Next(tmp); {
-			title := util.ObjToString((*tmp)["title"])
-			if title != "" {
-				//返回匹配到的词组
-				res := p.Dfa.Analy(title)
-				if len(res) > 0 {
-					province := (*tmp)["area"].(string)
-
-					provinceVal := push.GetChoiceCode(province)
-					if "A" != province {
-						(*tmp)["title"] = `[<span class='area'>` + province + `</span>]` + title
-					}
-					for _, v := range res {
-						//根据关键词返回用户指针
-						tw := (*p.Cache)[v]
-						if tw != nil {
-							//遍历用户加入到此条信息上
-							for _, v2 := range *tw {
-								if v2.Province == "A" || v2.ProvinceVal&provinceVal > 0 {
-									s := (*userMap)[v2]
-									if s == nil {
-										s = list.New()
-										(*userMap)[v2] = s
-									}
-									s.PushBack(tmp)
-									if s.Len() > 50 {
-										break L1
-									}
+	userMap := &map[*push.MemberInterest]sortList{}
+	LDB := listdb.GetDb(p.Stype)
+	LDB.Lock.Lock()
+L1:
+	for e := LDB.DB.Back(); e != nil; e = e.Prev() {
+		tmp := e.Value.(*map[string]interface{})
+		title := util.ObjToString((*tmp)["title"])
+		if title != "" {
+			//返回匹配到的词组
+			res := p.Dfa.Analy(title)
+			if len(res) > 0 {
+				province := (*tmp)["area"].(string)
+				provinceVal := push.GetChoiceCode(province)
+				for _, v := range res {
+					//根据关键词返回用户指针
+					tw := (*p.Cache)[v]
+					if tw != nil {
+						//遍历用户加入到此条信息上
+						for _, v2 := range *tw {
+							if v2.Province == "A" || v2.ProvinceVal&provinceVal > 0 {
+								s := (*userMap)[v2]
+								if s == nil {
+									s = sortList{}
+								}
+								s = append(s, tmp)
+								(*userMap)[v2] = s
+								if len(s) > 50 {
+									break L1
 								}
 							}
 						}
 					}
 				}
-				if (*tmp)["comeintime"] != nil {
-					ttmp := (*tmp)["comeintime"].(int64)
-					if ttmp > returnLastTimeLong {
-						returnLastTimeLong = ttmp
-					}
-				}
 			}
-			tmp = new(map[string]interface{})
 		}
 	}
+	LDB.Lock.Unlock()
 	mcontent := map[string]interface{}{}
 	mcontent["s_type"] = p.Stype
 	bmatch := false
-	for kk, vv := range *(userMap) {
+	for kk, v := range *(userMap) {
 		k := *kk
-		v := *vv
 		str := fmt.Sprintf("<div>根据您设置的关键词(%s),给您推送以下"+p.StypeName+"信息:</div>", strings.Join(k.Interest, ";"))
 		//发送内容组合
 		i := 0
 		publishTimes := map[string]interface{}{}
 		publishTitle := map[string]bool{}
-		for ks := v.Front(); ks != nil; ks = ks.Next() {
-			k2 := *(ks.Value.(*map[string]interface{}))
+		sort.Sort(v)
+		for _, kn := range v {
+			k2 := *kn
 			title := strings.Replace(k2["title"].(string), "\n", "", -1)
 			if !publishTitle[title] {
 				publishTitle[title] = true
@@ -164,14 +187,13 @@ func (p *Pjob) EachInfoForView(mopenid, words string) map[string]interface{} {
 			break
 		}
 	}
-
 	return mcontent
 }
 
 func (p *Pjob) DoPush(mopenid, stime string, opr int, ltime int64) bool {
 	log.Println("开始执行任务:", p.StypeName, stime)
 	p.Cache = new(map[string]*[]*push.MemberInterest)
-	*p.Cache = push.InitCache(p.Stype, mopenid,false)
+	*p.Cache = push.InitCache(p.Stype, mopenid, false)
 	p.CreateUserInterestWord()
 	return EachAllBidInfo(p.Stype, "["+p.StypeName+"信息]", p.StypeName, ltime, p.MaxPushSize, p.Dfa, p.Cache, opr)
 }
@@ -367,3 +389,130 @@ func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, stype string, no
 		Url: push.PushConfig["bidViewDomain"].(string) + "/mobile/sess/" + se.EncodeString(k.Openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushlist") + "__" + wid})
 
 }
+
+/**
+//遍历数据只做标题预览
+func (p *Pjob) EachInfoForViewOld(mopenid, words string) map[string]interface{} {
+	defer func() {
+		if r := recover(); r != nil {
+			log.Println("[E]", r)
+			for skip := 0; ; skip++ {
+				_, file, line, ok := runtime.Caller(skip)
+				if !ok {
+					break
+				}
+				go log.Printf("%v,%v\n", file, line)
+			}
+		}
+	}()
+	p.Cache = new(map[string]*[]*push.MemberInterest)
+	if words != "" {
+		pm := push.MemberInterest{
+			Province:    "A",
+			ProvinceVal: 0,
+			Interest:    []string{words},
+		}
+		ss := []*push.MemberInterest{&pm}
+		*p.Cache = map[string]*[]*push.MemberInterest{
+			words: &ss,
+		}
+	} else {
+		*p.Cache = push.InitCache(p.Stype, mopenid,true)
+	}
+	p.CreateUserInterestWord()
+	session := mongodb.GetMgoConn()
+	defer mongodb.DestoryMongoConn(session)
+	q := `{"type":"` + p.Stype + `"}`
+	n, _ := session.DB("qfw").C("bidding").Find(mongodb.ObjToOth(q)).Count()
+	userMap := &map[*push.MemberInterest]*list.List{}
+	if n == 0 {
+		log.Println("预览", p.Stype, "没有数据。")
+	} else {
+		query := session.DB("qfw").C("bidding").Find(mongodb.ObjToOth(q)).Sort("-publishtime").Iter()
+		var returnLastTimeLong int64 = 0
+	L1:
+		for tmp := new(map[string]interface{}); query.Next(tmp); {
+			title := util.ObjToString((*tmp)["title"])
+			if title != "" {
+				//返回匹配到的词组
+				res := p.Dfa.Analy(title)
+				if len(res) > 0 {
+					province := (*tmp)["area"].(string)
+
+					provinceVal := push.GetChoiceCode(province)
+					if "A" != province {
+						(*tmp)["title"] = `[<span class='area'>` + province + `</span>]` + title
+					}
+					for _, v := range res {
+						//根据关键词返回用户指针
+						tw := (*p.Cache)[v]
+						if tw != nil {
+							//遍历用户加入到此条信息上
+							for _, v2 := range *tw {
+								if v2.Province == "A" || v2.ProvinceVal&provinceVal > 0 {
+									s := (*userMap)[v2]
+									if s == nil {
+										s = list.New()
+										(*userMap)[v2] = s
+									}
+									s.PushBack(tmp)
+									if s.Len() > 50 {
+										break L1
+									}
+								}
+							}
+						}
+					}
+				}
+				if (*tmp)["comeintime"] != nil {
+					ttmp := (*tmp)["comeintime"].(int64)
+					if ttmp > returnLastTimeLong {
+						returnLastTimeLong = ttmp
+					}
+				}
+			}
+			tmp = new(map[string]interface{})
+		}
+	}
+	mcontent := map[string]interface{}{}
+	mcontent["s_type"] = p.Stype
+	bmatch := false
+	for kk, vv := range *(userMap) {
+		k := *kk
+		v := *vv
+		str := fmt.Sprintf("<div>根据您设置的关键词(%s),给您推送以下"+p.StypeName+"信息:</div>", strings.Join(k.Interest, ";"))
+		//发送内容组合
+		i := 0
+		publishTimes := map[string]interface{}{}
+		publishTitle := map[string]bool{}
+		for ks := v.Front(); ks != nil; ks = ks.Next() {
+			k2 := *(ks.Value.(*map[string]interface{}))
+			title := strings.Replace(k2["title"].(string), "\n", "", -1)
+			if !publishTitle[title] {
+				publishTitle[title] = true
+				i++
+				str += "<div class='tslist'><span class='xh'>" + fmt.Sprintf("%d", i) + ".</span><a class='bt' target='_blank' sid='" + util.BsonIdToSId(k2["_id"]) + "'  href='" + k2["href"].(string) + "'>" + title + "</a></div>"
+				publishTimes[strconv.Itoa(i)] = k2["publishtime"]
+			}
+		}
+		if len(publishTimes) > 0 {
+			bmatch = true
+			mcontent["a_publishtime"] = publishTimes
+			mcontent["s_content"] = str
+			mcontent["s_words"] = k.Interest
+		}
+	}
+	mcontent["bmatch"] = bmatch
+	if !bmatch {
+		for _, one := range *p.Cache {
+			for _, onep := range *one {
+				mcontent["s_words"] = onep.Interest
+				break
+			}
+			break
+		}
+	}
+
+	return mcontent
+}
+**/

+ 94 - 0
push/src/qfw/push/listdb/listdb.go

@@ -0,0 +1,94 @@
+package listdb
+
+import (
+	"container/list"
+	"log"
+	"qfw/util"
+	"qfw/util/mongodb"
+	"sync"
+	"time"
+)
+
+type ListDB struct {
+	Lock      *sync.Mutex
+	DB        *list.List
+	Stype     string
+	timestamp int64
+}
+
+var fields map[string]interface{} = map[string]interface{}{
+	"type":        1,
+	"comeintime":  1,
+	"publishtime": 1,
+	"title":       1,
+	"area":        1,
+	"href":        1,
+	"areaval":     1,
+}
+
+var Bid, Tender *ListDB
+
+func Inits() {
+	Bid = &ListDB{
+		Lock:      new(sync.Mutex),
+		DB:        list.New(),
+		Stype:     "bid",
+		timestamp: 0,
+	}
+	go Bid.update()
+
+	Tender = &ListDB{
+		Lock:      new(sync.Mutex),
+		DB:        list.New(),
+		Stype:     "tender",
+		timestamp: 0,
+	}
+	go Tender.update()
+}
+
+func GetDb(stype string) *ListDB {
+	switch stype {
+	case "tender":
+		return Tender
+	case "bid":
+		return Bid
+	default:
+		return nil
+	}
+}
+
+func (l *ListDB) update() {
+	l.Lock.Lock()
+	util.Try(func() {
+		q := map[string]interface{}{
+			"type": l.Stype,
+			"comeintime": map[string]interface{}{
+				"$gt": l.timestamp,
+			},
+		}
+		session := mongodb.GetMgoConn()
+		defer mongodb.DestoryMongoConn(session)
+		//此处不排序,谁查谁排序(不排序会造成发布时间乱序)
+		query := session.DB("qfw").C("bidding").Find(q).Select(fields).Sort("publishtime").Iter()
+		for tmp := new(map[string]interface{}); query.Next(tmp); {
+			province := (*tmp)["area"].(string)
+			if "A" != province {
+				title := util.ObjToString((*tmp)["title"])
+				(*tmp)["title"] = `[<span class='area'>` + province + `</span>]` + title
+			}
+			l.DB.PushBack(tmp)
+			last := util.Int64All((*tmp)["comeintime"])
+			if last > l.timestamp {
+				l.timestamp = last
+			}
+			if l.DB.Len() > 120000 {
+				l.DB.Remove(l.DB.Front())
+			}
+			tmp = new(map[string]interface{})
+		}
+	}, func(e interface{}) {
+		log.Println(e)
+	})
+	l.Lock.Unlock()
+	time.AfterFunc(10*time.Minute, l.update)
+}

+ 5 - 2
push/src/qfw/push/rpcpush/rpcpush.go

@@ -15,10 +15,14 @@ type PushInfo struct {
 }
 
 var PushInfoScopeDays int
+var rpcchan = make(chan bool, 50)
 
 //RPC调用结果预览
 func (p *PushInfo) ResultView(data *qrpc.PushData, Reply *[]byte) error {
-	log.Println("rpc_data", data)
+	rpcchan <- true
+	defer func() {
+		<-rpcchan
+	}()
 	util.Try(func() {
 		for k, v := range data.PushType {
 			pj := dopush.Pjob{
@@ -36,7 +40,6 @@ func (p *PushInfo) ResultView(data *qrpc.PushData, Reply *[]byte) error {
 
 //RPC调用推送信息
 func (p *PushInfo) PushMsg(data *qrpc.PushData, Reply *int) error {
-	log.Println("rpc_data", data)
 	util.Try(func() {
 		for k, v := range data.PushType {
 			//昨天到今天的数据

+ 1 - 0
weixin/src/qfw/weixin/msgtxtchandler.go

@@ -55,6 +55,7 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 				w.ReplyText("您已经退出企明星会员认证程序。")
 			}
 			delete(UserSession, r.FromUserName)
+			return
 		}
 		if us.Type == "identify" {
 			processIdentifyMsgTxt(us, w, r)