Browse Source

Merge branch 'dev2.0.1' of http://192.168.3.207:10080/qmx/jy into dev2.0.1

wangshan 7 years ago
parent
commit
a7e8be4294

+ 1 - 1
src/jfw/modules/weixin/src/config.json

@@ -16,7 +16,7 @@
 	"tpl_push_id": "cxEH6Ud6uBOyr_tdHvR3efcdApySm2TVd8-f5zgWe8M",
     "tpl_bidopen_id": "3URB-9evmkJ9wntI8iGMEl8_elSAC3wL3ZrQQX-q0cg",
     "tpl_managernotify_id": "LB0XHcbNQKcbgUdDfDncuJW10jay4EfoJ9j-UVh2j5A",
-    "weixinAutoRpl": "感谢使用剑鱼!\n\n1. <a href='http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=1&sn=f9e98da1975f85011ee138a4ee5cfbe8#wechat_redirect'>【产品帮助】</a>\n\n2. <a href='http://www.myfans.cc/30a78e9b78'>【招标社区】</a>\n\n3. <a href='%s'>【搜索招标信息】</a>\n\n4. <a href='%s'>【订阅招标信息】</a>\n\n5.   <a href='%s'>点击这里,查看“%s”的相关招标信息</a>\n\n6.   快速订阅:回复“订阅”加上你的关键词,比如“订阅 教学设备”\n\n7.   如需人工协助,请回复“客服”",
+    "weixinAutoRpl": "感谢使用剑鱼!\n\n1. <a href='%s'>【订阅招标信息】</a>\n\n2. <a href='%s'>【搜索招标信息】</a>\n\n3. <a href='http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=1&sn=f9e98da1975f85011ee138a4ee5cfbe8#wechat_redirect'>【产品帮助】</a>\n\n4.<a href='http://www.myfans.cc/30a78e9b78'>【招标社区】</a> \n\n5.   <a href='%s'>点击这里,查看“%s”的相关招标信息</a>\n\n6.   快速订阅:回复“订阅”加上你的关键词,比如“订阅 教学设备”\n\n7.   如需人工协助,请回复“客服”",
     "autoReplay": {
         "title": "剑鱼招标订阅,和丟标说拜拜",
         "url": "https://mp.weixin.qq.com/s?__biz=MzIyNTM1NDUyNw==&mid=100000001&idx=1&sn=58e6008f0577d529a56c9ed78724decf&scene=1&srcid=0628FMQzB61orhqGhfw7fOqT&key=77421cf58af4a653210128f66c0cd4486112d12cb69b77c0c8f926d725679273cf44f733f8993123ef0295c72b8946ba&ascene=0&uin=NDMwMjg4NTU1&devicetype",

+ 63 - 1
src/jfw/modules/weixin/src/wx/wx.go

@@ -33,6 +33,33 @@ var regKey *regexp.Regexp
 //锁
 var sharelock *sync.Mutex = &sync.Mutex{}
 
+/*扫码锁,目前发现android手机,扫码的时候有时会请求两个,不是微信回调两次,
+是在手机上扫完码之后,看扫码的框里面请求了两次,如果是回调超时,重复回调的话,createtime是一样的,
+目前解决方法是判断回调参数createtime,3秒之内的扫码事件,不再做回复*/
+var scanMap = map[string]int{}
+var scanLock *sync.Mutex = &sync.Mutex{}
+
+type MapScan struct {
+	Map  map[string]int
+	Lock sync.Mutex
+}
+
+func (m *MapScan) GC() {
+	defer util.Catch()
+	m.Lock.Lock()
+	now := time.Now().Unix()
+	for k, v := range m.Map {
+		if now-int64(v) >= 30 {
+			delete(m.Map, k)
+		}
+	}
+	m.Lock.Unlock()
+	time.AfterFunc(15*time.Minute, m.GC)
+}
+
+var MSPOOL = 20
+var MapScans = make([]*MapScan, MSPOOL)
+
 func init() {
 	util.InitInfluxdb(util.ObjToString(config.Sysconfig["influxdb"]))
 	InitSSLClient("./apiclient_cert.pem", "./apiclient_key.pem", "./rootca.pem")
@@ -49,6 +76,11 @@ func init() {
 	//关键词只能包含汉字、字母、数子
 	regKey, _ = regexp.Compile("^([0-9]|[A-Za-z]|[\u4E00-\u9FFF])+$")
 	CountRun(8)
+	for i := 0; i < MSPOOL; i++ {
+		ms := &MapScan{Map: map[string]int{}}
+		go ms.GC()
+		MapScans[i] = ms
+	}
 }
 
 //客服消息处理
@@ -150,7 +182,7 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 				searchWord = string([]rune(searchWord)[:8]) + "..."
 			}
 			searchWordUrl := fmt.Sprintf(config.Sysconfig["proxysess"].(string), se.EncodeString(openid+","+user.UnionId+","+strconv.Itoa(int(time.Now().Unix()))+",searchKeyword")) + "__" + searchWord
-			w.ReplyText(fmt.Sprintf(config.Sysconfig["weixinAutoRpl"].(string), searchUrl, rsssetUrl, searchWordUrl, searchWord))
+			w.ReplyText(fmt.Sprintf(config.Sysconfig["weixinAutoRpl"].(string), rsssetUrl, searchUrl, searchWordUrl, searchWord))
 		}
 	}
 }
@@ -408,6 +440,9 @@ func CheckQmxUser(newUser *map[string]interface{}, UnionId string) (b bool, qmxi
 func Subscribe(w ResponseWriter, r *Request) {
 	defer util.Catch()
 	openid := r.FromUserName
+	if isRepeatCall(openid, r.CreateTime) {
+		return
+	}
 	user, err := Mux.GetUserInfo(openid)
 	var source = ""
 	var pccodepre = ""
@@ -686,6 +721,9 @@ var qrSimpleEncrypt = &util.SimpleEncrypt{"qrcode_jywx2017"}
 func ScanHandler(w ResponseWriter, r *Request) {
 	defer util.Catch()
 	openid := r.FromUserName
+	if isRepeatCall(openid, r.CreateTime) {
+		return
+	}
 	m, b := tools.MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`"}`, `{"_id":1,"s_headimage":1,"o_jy":1}`)
 	shareData := redis.Get("sso", "p_shareData_"+r.EventKey)
 	infoData := map[string]interface{}{}
@@ -1380,3 +1418,27 @@ func downloadUserFace(url string) string {
 	}()
 	return filename
 }
+
+//过滤重复调用
+func isRepeatCall(openId string, createTime int) bool {
+	defer util.Catch()
+	flag := false
+	myMap := MapScans[HashVal(openId)%MSPOOL]
+	myMap.Lock.Lock()
+	if myMap.Map[openId] > 0 && createTime-myMap.Map[openId] <= 2 {
+		log.Println("监测到重复调用。。。", openId, myMap.Map[openId], createTime)
+		flag = true
+	}
+	myMap.Map[openId] = createTime
+	myMap.Lock.Unlock()
+	return flag
+}
+
+//计算代码的hash值
+func HashVal(src string) int {
+	check := 0
+	for i := len(src) / 2; i < len(src); i++ {
+		check += int(src[i])
+	}
+	return check
+}

+ 17 - 8
src/web/staticres/css/dev2/biddingSearch.css

@@ -798,12 +798,11 @@ width:1160px;
   text-align: center;
   line-height: 26px;
 }
-#searchInner .searchControl .seaTender-inner .tabContainer .lucene-table>div>table>tbody>tr:first-child>td {
+#searchInner .searchControl .seaTender-inner .tabContainer .lucene-table>table:last-child>tbody>tr:first-child>td {
 	border-top: 0px;
 }
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene-table table thead {
   font-size: 14px;
-display: block;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene-table table thead tr {
@@ -819,12 +818,6 @@ display: block;
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene-table table tbody tr:nth-of-type(2n) {
   background-color: #f5f5fb;
 }
-#searchInner .searchControl .seaTender-inner .tabContainer .lucene-table>div{
-	overflow-y: auto;
-	max-height: 400px;
-	display: block;
-	width: 1176px;
-}
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene-table table{
 	width: 1157px;
 }
@@ -889,3 +882,19 @@ display: block;
 	position: relative;
 	top: -2px;
 }
+.lucene-table.tabfixed>table:first-child{
+	position: fixed;
+	top: 0px;
+}
+.lucene-table.tabfixed{
+	padding-top: 67px !important;
+}
+.lucene-table.tabfixed.lucene-table{
+	padding-top: 41px !important;
+}
+.lucene-table.tabfixed.entlist{
+	padding-top: 43px !important;
+}
+.lucene-table.tababsolute>table:first-child{
+	position: absolute;
+}

+ 53 - 1
src/web/staticres/js/common.js

@@ -183,4 +183,56 @@ function getScrollWidth() {
   	scroll = oDiv.clientWidth;
   	document.body.removeChild(oDiv);
   	return noScroll-scroll;
-}
+}
+//表头固定
+var TableHeadFixed = function(className,isminus,flag){
+	if(typeof(className) == "undefined"){
+		className = "tabContainer-2"
+	}
+	if(typeof(isminus) == "undefined"){
+		isminus = true;
+	}
+	if(typeof(flag) == "undefined"){
+		flag = true;
+	}
+	var cHeight = document.body.clientHeight;
+	if(cHeight <= 0){
+		cHeight = 500;
+	}
+	var thisFlag = false;
+	$(window).scroll(function(event){
+		if(!$("#right-table").hasClass("active") && flag){
+			return;
+		}
+		var tableHeight = $("."+className).outerHeight();
+		if(tableHeight <= cHeight){
+			return;
+		}
+		var offsetTop = $("."+className).offset().top;
+		var scrollTop = $(this).scrollTop();
+		var oTop = offsetTop;
+		if(isminus){
+			oTop+=20;
+		}
+		if(scrollTop >= oTop){
+			if(offsetTop + tableHeight - scrollTop <= cHeight){
+				if(!thisFlag){
+					$(".lucene-table").addClass("tababsolute");
+					$(".lucene-table>table:first").css("top",scrollTop);
+				}
+				thisFlag = true;
+			}else{
+				if(thisFlag){
+					$(".lucene-table").removeClass("tababsolute");
+					$(".lucene-table>table:first").css("top",0);
+				}
+				thisFlag = false;
+			}
+			$(".lucene-table").addClass("tabfixed");
+		}else{
+			$(".lucene-table").removeClass("tabfixed tababsolute");
+			$(".lucene-table>table:first").css("top",0);
+			thisFlag = false;
+		}
+	});
+}

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

@@ -475,11 +475,11 @@ function appendDatas(datas,flag,isNew){
 	}
 	if(!flag||selectType=="title"){
 		$(".tabContainer-2 .lucene ul").html(listHtml);
-		$(".tabContainer-2 .lucene-table>div>table tbody").html(tableHtml);
+		$(".tabContainer-2 .lucene-table table tbody").html(tableHtml);
 	}else{
 		if(selectType=="all"){
 			$(".tabContainer .lucene ul").html(listHtml);
-			$(".tabContainer .lucene-table>div>table tbody").html(tableHtml);
+			$(".tabContainer .lucene-table table tbody").html(tableHtml);
 		}
 	}
 	$(".tabContainer").css("min-height","");

+ 6 - 13
src/web/templates/pc/biddingsearch_enterprise.html

@@ -234,12 +234,6 @@
 			#searchInner .searchControl .seaTender-inner .tabContainer .lucene-table.entlist table{
 				width: 1200px;
 			}
-			#searchInner .searchControl .seaTender-inner .tabContainer .lucene-table.entlist>div{
-				width: 1220px;
-			}
-			#searchInner .searchControl .seaTender-inner .tabContainer{
-				overflow: inherit;
-			}
 		</style>
 	</head>
 
@@ -479,13 +473,11 @@
 						</tr>
 						</thead>
 					</table>
-					<div>
-						<table>
-							<tbody class="formTable" id="formTable">
-							
-							</tbody>
-						</table>
-					</div>
+					<table>
+						<tbody class="formTable" id="formTable">
+						
+						</tbody>
+					</table>
 				</div>	
 			</div>
 
@@ -693,6 +685,7 @@
 		var tabularflag = "Y";
 		
 		$(function(){
+			new TableHeadFixed("tabContainer-2",searchvalue=="",false);
 			haslogin({{.T.logid}});
 			if(mainList != "" && mainList != null){
 				getSearchTable(mainList);

+ 6 - 7
src/web/templates/pc/classifylist.html

@@ -725,13 +725,11 @@ function priceCss(){
 							</tr>
 						</thead>
 					</table>
-					<div>
-						<table>
-							<tbody>
-								
-							</tbody>
-						</table>
-					</div>
+					<table>
+						<tbody>
+							
+						</tbody>
+					</table>
 				</div>
 			</div>
 			<div class="hasNoData" style="display: none;">
@@ -769,6 +767,7 @@ var industry = {{.T.industry}};
 var res = {{.T.res}}
 var dataId = "";
 $(function(){
+	new TableHeadFixed("tabContainer");
 	//
 	haslogin({{.T.logid}});
 	//

+ 7 - 9
src/web/templates/pc/proproject.html

@@ -506,7 +506,7 @@ $(function(){
 					</ul>
 				</div>
 				<!--全文搜索 表格-->
-				<div class="lucene-table" style="display: none;">
+				<div class="lucene-table nijianlist" style="display: none;">
 					<table>
 						<thead>
 							<tr>
@@ -520,13 +520,11 @@ $(function(){
 							</tr>
 						</thead>
 					</table>
-					<div>
-						<table>
-							<tbody>
-								
-							</tbody>
-						</table>
-					</div>
+					<table>
+						<tbody>
+							
+						</tbody>
+					</table>
 				</div>
 			</div>
 			<div class="hasNoData" style="display: none;">
@@ -550,8 +548,8 @@ $(function(){
 <script type="text/javascript">
 $(function(){
 	haslogin({{.T.logid}},keys);
+	new TableHeadFixed();
 	new JyWebScoket.qrToLab();
-	
 	//
 	$(".j-nav .j-nav-link:eq(3)").addClass("active");
 	$(".q-mark").click(function(){

+ 3 - 7
src/web/templates/pc/supsearch.html

@@ -849,17 +849,12 @@ $(function(){
 								<td width="103">发布日期</td>
 							</tr>
 						</thead>
+					</table>
+					<table>
 						<tbody>
 							
 						</tbody>
 					</table>
-					<div>
-						<table>
-							<tbody>
-								
-							</tbody>
-						</table>
-					</div>
 				</div>
 			</div>
 			<div class="hasNoData" style="display: none;">
@@ -895,6 +890,7 @@ $(function(){
 {{include "/common/baiducc.html"}}
 <script type="text/javascript">
 $(function(){
+	new TableHeadFixed();
 	new JyWebScoket.qrToLab();
 	haslogin({{.T.logid}},keys);
 	//点击超级搜索按钮

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

@@ -129,7 +129,7 @@ function saveData(flag){
 	<div class="content">
 		<div>
 			排除关键词
-			<span>如果设置排除关键词,包含这些关键词的信息都不会推送给您。请谨慎设置。注:只判断文章标题是否包含,不判断正文。不能输入空格。</span>
+			<span>如果设置排除关键词,包含这些关键词的信息都不会推送给您。请谨慎设置。不能输入空格。</span>
 		</div>
 		<div id="keyWordGroups"></div>
 		<div class="add hide">