Browse Source

推送列表

wangshan 5 năm trước cách đây
mục cha
commit
aa29e5355f

+ 7 - 7
src/jfw/modules/weixin/src/wx/wx.go

@@ -102,7 +102,7 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
 	}
 	autoReply_reg, _ := regexp.Compile("剑鱼|招标|中标|订阅|公告|项目|设置|推送")
 	shalong_text, shalong_img := "", ""
-	log.Println(len(autoReply_reg.FindStringIndex(r.Content)))
+	//	log.Println(len(autoReply_reg.FindStringIndex(r.Content)))
 	if strings.Replace(r.Content, " ", "", -1) == "沙龙" {
 		shalong_text, shalong_img = shalongActive.Get()
 	}
@@ -213,8 +213,8 @@ func pcSetUserKeys(user map[string]interface{}, shareid, pccodepre string) (map[
 	result := "fail"
 	subkey := redis.Get("sso", "pc_subscribe_"+shareid)
 	keys := strings.Split(fmt.Sprint(subkey), " ")
-	log.Println(subkey)
-	log.Println(keys)
+	//	log.Println(subkey)
+	//	log.Println(keys)
 	if subkey != nil {
 		if o_jy, ok := user["o_jy"].(map[string]interface{}); ok {
 			if tmp, ok := o_jy["a_key"].([]interface{}); ok {
@@ -242,7 +242,7 @@ func pcSetUserKeys(user map[string]interface{}, shareid, pccodepre string) (map[
 							}
 							if result != "repeat" {
 								keys := strings.Split(fmt.Sprint(subkey), " ")
-								log.Println("==:", keys)
+								//								log.Println("==:", keys)
 								tmp = append(tmp, map[string]interface{}{"key": keys})
 								o_jy["a_key"] = tmp
 								result = "ok"
@@ -329,7 +329,7 @@ func saveUser(u *UserInfo, source, pre, RSource string) (bool, string, string) {
 	isJyopUser := strings.HasPrefix(source, "Jyop")
 	pcresult := "" //pc订阅结果
 	subkey := ""   //pc订阅关键词
-	log.Println("保存用户:", subkey)
+	//	log.Println("保存用户:", subkey)
 	fg := false
 	tusers, ok := tools.MQFW.Find("user", map[string]interface{}{
 		"s_unionid": u.UnionId,
@@ -1396,7 +1396,7 @@ func YjHandle(w http.ResponseWriter, r *http.Request) {
 	} else {
 		tmp := map[string]interface{}{}
 		json.Unmarshal(ret, &tmp)
-		log.Println(tmp)
+		//		log.Println(tmp)
 		url := tmp["url"].(string)
 		w.Write([]byte(url))
 	}
@@ -1559,7 +1559,7 @@ func vipFastSubscribe(user *map[string]interface{}, keyWord, openId string) (ret
 		}
 		if keysCount+len(keysFilter) > 300 {
 			//vip订阅超过300组关键词
-			log.Println("vip订阅超过300组关键词-----")
+			//			log.Println("vip订阅超过300组关键词-----")
 			return -3, strings.Replace(keyWord, "+", " ", -1), hasOldKey
 		}
 	}

+ 32 - 30
src/web/templates/weixin/historypush.html

@@ -96,9 +96,9 @@
 				hasNextPage = sessionStorage.historypushHasNextPage=="true"?true:false;
 				scrollTop = sessionStorage.historypushScrollTop;
 				dataCache = JSON.parse(sessionStorage.historypushDataCache);
-				isVipSub = sessionStorage.isVipSub=="true"?true:false;;
-				isPassCount = sessionStorage.isPassCount=="true"?true:false;;
-				haskey = sessionStorage.haskey=="true"?true:false;;
+				isVipSub = sessionStorage.isVipSub=="true"?true:false;
+				isPassCount = sessionStorage.isPassCount=="true"?true:false;
+				haskey = sessionStorage.haskey=="true"?true:false;
 				isOnTail = sessionStorage.isOnTail;
 				isExpire = sessionStorage.isExpire;
 				userId = sessionStorage.userId;
@@ -109,10 +109,12 @@
 			    }
 				$("#list>*").remove();
 				count = 0;
+				firstPage = dataCache;
 				if(dataCache.length==0){
 					hasNoData();
+				}else{
+					structureHtml(dataCache,true);
 				}
-				structureHtml(dataCache,true);
 				$(window).scrollTop(scrollTop);
 				sessionStorage.removeItem("historypushDataCache");
 				sessionStorage.removeItem("historypushPageIndexCache");
@@ -152,21 +154,6 @@
 						isExpire = data.isExpire;
 						sessionStorage.isExpire = isExpire;
 						sessionStorage.setItem(userId+"_searchTime",firstTime);
-						if(!firstPage.length>0 && !haskey){
-							if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
-								sessionStorage.removeItem("keysetindexToHistory");
-								if(sessionStorage.keysetindexToHistory=="1"){
-									wx.ready(function () {
-										wx.closeWindow();
-									});
-								}else{
-									setTimeout(function(){
-										wx.closeWindow();
-									},2000);
-								}
-								return
-							}
-						}
 						showPage();
 					},
 					error: function(xhr, type){
@@ -248,22 +235,37 @@
 			//地区渲染
   			mapData();
 			if(!isVipSub){
-				history.pushState({},"","");
-				if(isInTSguide){
-					if(localStorage){
-						localStorage.removeItem("tsGuide_status");
-					}
-					window.location.href='/front/tenderSubscribe/guide';
-				}else{
-					window.location.href='/wxkeyset/keyset/index';
-				}
+				$(".normal_set").show();
+				$(".tab_left .area").hide();
 				$(".vip_banner").show();
 				$(".subscribe").css("margin-top","2rem");
 				if(isPassCount){
 					$(".open_remind").show();
 				}
-				$(".normal_set").show();
-				$(".tab_left .area").hide();
+				if(!firstPage.length>0 && !haskey){
+					if(sessionStorage&&(sessionStorage.keysetindexToHistory=="1"||sessionStorage.keysetindexToHistory=="2"||sessionStorage.keysetindexToHistory=="3")){
+						sessionStorage.removeItem("keysetindexToHistory");
+						if(sessionStorage.keysetindexToHistory=="1"){
+							wx.ready(function () {
+								wx.closeWindow();
+							});
+						}else{
+							setTimeout(function(){
+								wx.closeWindow();
+							},2000);
+						}
+						return
+					}
+					history.pushState({},"","");
+					if(isInTSguide){
+						if(localStorage){
+							localStorage.removeItem("tsGuide_status");
+						}
+						window.location.href='/front/tenderSubscribe/guide';
+					}else{
+						window.location.href='/wxkeyset/keyset/index';
+					}
+				}
 			}else{
 				if(!haskey){
 					$(".set_keyword").show();

+ 5 - 0
src/web/templates/weixin/wxkeyset/index.html

@@ -209,6 +209,11 @@ $(function(){
 		if(myArray.length>=10){
 			$("#ten").css("margin-bottom","1rem");
 		}
+		if (myArray.length>0){
+			sessionStorage.haskey = true;
+		}else{
+			sessionStorage.haskey = false;
+		}
 		isfocusing = false;
 		var thisClass = $(this);
 		$(".keyword").attr("readonly",false);