Ver código fonte

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

wangchuanjin 9 anos atrás
pai
commit
f05fc1f00e

+ 1 - 0
core/src/qfw/swordfish/swordfish.go

@@ -20,6 +20,7 @@ type SwordFish struct {
 	searchinfolist xweb.Mapper `xweb:"/member/swordfish/searchinfolist"` //剑鱼查询
 	wxsearch       xweb.Mapper `xweb:"/member/wxswordfish/search"`       //剑鱼微信查询
 	wxsearchlist   xweb.Mapper `xweb:"/member/wxswordfish/searchlist"`   //剑鱼微信查询结果展示
+	transfer       xweb.Mapper `xweb:"/member/wxswordfish/transfer"`     //剑鱼微信查询结果跳转到我的订阅
 
 }
 

+ 22 - 6
core/src/qfw/swordfish/swordfishmanage.go

@@ -3,6 +3,7 @@ package swordfish
 import (
 	"encoding/json"
 	_ "encoding/json"
+	"fmt"
 	"gopkg.in/mgo.v2/bson"
 	"net/rpc"
 	"qfw/coreconfig"
@@ -13,6 +14,23 @@ import (
 	"time"
 )
 
+//剑鱼查询结果也跳转到我的订阅
+func (s *SwordFish) Transfer() error {
+	s.DisableHttpCache()
+	var flog = "T"
+	if s.Is("GET") {
+		return s.Render("/_error.html")
+	} else {
+		searchname := s.GetString("searchname")
+		id := s.GetSession("userId")
+		fmt.Println("id:", id, "searchname:", searchname)
+		fmt.Println("flog:", flog)
+		s.Write(`{"flog":"` + flog + `"}`)
+	}
+
+	return nil
+}
+
 //跳转到用户中心剑鱼首页
 func (s *SwordFish) Swordfish() error {
 	if ret := redis.Get("other", "swordfish"); ret != nil {
@@ -73,12 +91,7 @@ func (s *SwordFish) Wxprotocol() error {
 
 //剑鱼微信查询页面
 func (s *SwordFish) Wxsearch() error {
-	s.T["keywords"] = ""
-	keywords := s.GetSession("sf_keywords")
-	if keywords != nil {
-		s.T["keywords"] = keywords
-	}
-	return s.Render("/swordfish/wxsearch.html", &s.T)
+	return s.Render("/swordfish/wxsearch.html")
 }
 
 //剑鱼微信查询结果页面
@@ -92,7 +105,10 @@ func (s *SwordFish) Wxsearchlist() error {
 		s_type = "bid"
 	}
 	s.T["keywords"] = keywords
+	s.DelSession("sf_keywords")
+	fmt.Println("keyi :::::", s.GetSession("sf_keywords"))
 	s.SetSession("sf_keywords", keywords)
+	fmt.Println("keyi :::::2222", s.GetSession("sf_keywords"))
 	s.T["s_name"] = s_name
 	s.T["success"] = false
 	s.T["s_type"] = s.GetString("s_type")

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-25 14:50:42"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-25 14:50:42"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-25 16:26:05"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-25 16:26:05"}},"marketisstart":true,"marketrate":300}

+ 1 - 2
core/src/web/templates/swordfish/searchinfolist.html

@@ -21,8 +21,7 @@ $(function(){
 		if (s_words.length >0 ){
 			$("#conlist").html('<div class="text-center"><div ><img style="width:137px;margin-top:60px;" src="/images/findnull.png"></div><div style="margin-bottom:50px;">没有找到和该关键词匹配的信息</div></div>');
 		}else{
-			alert("000000")
-			$("#conlist").html('<div class="text-center" styl="height:300px;"></div>');
+			$("#conlist").html('<div class="text-center" style="height:300px;"></div>');
 		}
 	}else{
 		$("#searchts").removeClass("hidden");

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

@@ -118,7 +118,7 @@ body{
 </head>
 <body>
 
-<div class="wxhead"><span class="tubiao"><img src="{{Msg "seo" "cdn"}}/images/wxjss.png"/></span><input class="form-control searchname" name="searchnameshow" value="{{.T.keywords}}" placeholder="输入关键词查询"/>
+<div class="wxhead"><span class="tubiao"><img src="{{Msg "seo" "cdn"}}/images/wxjss.png"/></span><input class="form-control searchname" name="searchnameshow" value="" placeholder="输入关键词查询"/>
 <span class="xiaochu"><img class="qcimg" src="{{Msg "seo" "cdn"}}/images/wxqc.png"/></span>
 </div>
 <div class="searchshow">

+ 16 - 1
core/src/web/templates/swordfish/wxsearchlist.html

@@ -319,7 +319,7 @@ body{
 </div>
 <div class="resbm" >
 <div class="rests">确认关键词的查询结果无误</div>
-<div class="resdy"  onClick="window.location.href='/swordfish/page';">
+<div class="resdy"  onClick="jpmy()">
 直接订阅
 </div>
 
@@ -359,6 +359,21 @@ body{
 		}
 		window.open("/visit/redirect?url="+escape(link));
 	}
+	function jpmy(){
+		var searchname = $(".searchname").val().replace(/^\s+|\s+$/g,"").replace(/\s+/g,"+");
+		$.ajax({    
+	        type:'post',        
+	        url:'/member/wxswordfish/transfer',    
+	        data:{searchname:searchname},    
+	        cache:false,    
+	        dataType:'json', 
+	        success:function(data){
+				if (data.flog=="T"){
+					window.location.href='/swordfish/page';
+				}
+	        }    
+        }); 
+	}
 </script>
 </body>
 </html>