wangshan há 7 anos atrás
pai
commit
cba74e4c75

+ 1 - 1
src/config.json

@@ -4,7 +4,7 @@
     "mongodbName": "qfw",
     "influxaddr": "http://192.168.3.207:8086",
     "influxdb": "jy_logs",
-	"qrModelID":"1",
+	"qrModelID":"2",
 	"numTimeNumber":15,
 	"strTimeNumber":30,
     "elasticsearch": "http://192.168.3.18:9200",

+ 138 - 55
src/jfw/front/websocket.go

@@ -2,14 +2,17 @@ package front
 
 import (
 	"encoding/json"
+	"fmt"
 	"log"
 	"net/http"
 	qutil "qfw/util"
 	"qfw/util/redis"
 	"strings"
+	"sync"
 	"time"
 
-	//"github.com/go-xweb/xweb"
+	"github.com/go-xweb/httpsession"
+	"github.com/go-xweb/xweb"
 	"github.com/gorilla/websocket"
 )
 
@@ -18,72 +21,152 @@ var upgrader = websocket.Upgrader{
 	WriteBufferSize: 1024,
 }
 
+//socket对象放在内存中,待rpc回调使用
+type Wss struct {
+	Conn *websocket.Conn
+	Time int64
+}
+type MapSocket struct {
+	Map  map[string]*Wss
+	Lock sync.Mutex
+}
+
+func (m *MapSocket) GC() {
+	defer qutil.Catch()
+	m.Lock.Lock()
+	now := time.Now().Unix()
+	for k, v := range m.Map {
+		if now-v.Time > 3600 || v.Conn == nil {
+			delete(m.Map, k)
+		}
+	}
+	m.Lock.Unlock()
+	time.AfterFunc(5*time.Minute, m.GC)
+}
+
+var MSPOOL = 20
+var MapSocketArr = make([]*MapSocket, MSPOOL)
+
+//初始化
+func init() {
+	for i := 0; i < MSPOOL; i++ {
+		ms := &MapSocket{Map: map[string]*Wss{}}
+		go ms.GC()
+		MapSocketArr[i] = ms
+	}
+}
+
+//根据代码和ws做映射
+func PutWsByCode(src string, ws *websocket.Conn) {
+	defer qutil.Catch()
+	n := HashVal(src) % MSPOOL
+	ms := MapSocketArr[n]
+	ms.Lock.Lock()
+	ms.Map[src] = &Wss{ws, time.Now().Unix()}
+	ms.Lock.Unlock()
+}
+
+//计算代码的hash值
+func HashVal(src string) int {
+	check := 0
+	for i := len(src) / 2; i < len(src); i++ {
+		check += int(src[i])
+	}
+	return check
+}
+
+//rpc回调,写到前台
+func GetWsByCode(param []string) bool {
+	if len(param) < 2 {
+		return false
+	}
+	src := param[0]
+	openid := param[1]
+	if src == "" {
+		return false
+	}
+	defer qutil.Catch()
+	n := HashVal(src) % MSPOOL
+	ms := MapSocketArr[n]
+	defer func() {
+		ms.Lock.Lock()
+		delete(ms.Map, src)
+		ms.Lock.Unlock()
+	}()
+	ms.Lock.Lock()
+	wss := ms.Map[src]
+	ms.Lock.Unlock()
+	if wss != nil && wss.Conn != nil {
+		infoData := LoginInfo(src, openid, wss.Conn.Sess)
+		sendmessage, _ := json.Marshal(infoData)
+		if err := wss.Conn.WriteMessage(websocket.TextMessage, sendmessage); err != nil {
+			log.Println("socket send fail..", err)
+			return false
+		} else {
+			wss.Conn.Close()
+		}
+		return true
+	} else {
+		return false
+
+	}
+}
+
+//用户登录信息
+func LoginInfo(shareid, openid string, Sess interface{}) (infoData map[string]interface{}) {
+	if Sess == nil {
+		return nil
+	}
+	sess, _ := Sess.(*httpsession.Session)
+	infoData = make(map[string]interface{})
+	if openid != "" {
+		redisheadimg := redis.Get("other", "newUser-"+openid)
+		if redisheadimg == nil {
+			redisheadimg = ""
+		}
+		user, _ := mongodb.FindOneByField("user", `{"s_m_openid":"`+openid+`"}`, `{"s_nickname":1,"s_headimage":1,"s_m_openid":1}`)
+		if user != nil && len(*user) > 0 {
+			infoData["result"] = "ok"
+			infoData["s_nickname"] = fmt.Sprint((*user)["s_nickname"])
+			infoData["s_headimage"] = fmt.Sprint((*user)["s_headimage"])
+			infoData["redisheadimg"] = fmt.Sprint(redisheadimg)
+			infoData["encryptId"] = se.EncodeString(qutil.BsonIdToSId((*user)["_id"]))
+			infoData["shareid"] = shareid
+			(*user)["shareid"] = shareid
+			nick := fmt.Sprint((*user)["s_nickname"])
+			sess.Set("nickname", nick)
+			sess.Set("s_nickname", nick)
+			sess.Set("s_m_openid", fmt.Sprint((*user)["s_m_openid"]))
+			sess.Set("user", *user)
+		}
+	}
+	return infoData
+}
+
 //登录关注
 func ServeWss(w http.ResponseWriter, r *http.Request) {
 	defer qutil.Catch()
 	conn, err := upgrader.Upgrade(w, r, nil)
+	conn.Sess = xweb.RootApp().SessionManager.Session(r, w)
 	var shareIds string
-	var shareid = ""
-	var openid = ""
-	go func() {
+	if err == nil {
 		for {
 			_, shareData, err := conn.ReadMessage()
 			if err != nil {
 				log.Println("前台socket关闭,后台socket断开并退出循环。。。。")
-				shareIds = "close"
-				return
-			}
-			shareIds = string(shareData)
-			if shareIds == "close" {
-				return
+				break
+			} else {
+				shareIds = string(shareData)
+				shareidlist := strings.Split(shareIds, "___")
+				if shareIds != "" && len(shareidlist) > 1 {
+					shareidnum := shareidlist[0]
+					shareidkop := shareidlist[1]
+					PutWsByCode(se.DecodeString(shareidnum), conn)
+					PutWsByCode(se.DecodeString(shareidkop), conn)
+				}
 			}
-			//log.Println("shareData:", shareIds, "---")
 		}
-	}()
-	for {
-		time.Sleep(1 * time.Second)
-		if shareIds == "close" {
-			//log.Println("!!!!socket关闭!!!退出循环")
-			conn.Close()
-			return
-		} else if shareIds == "" {
-			continue
-		}
-		shareidlist := strings.Split(shareIds, "___")
-		if shareIds != "" && len(shareidlist) > 1 {
-			shareidnum := strings.Split(shareIds, "___")[0]
-			shareidkop := strings.Split(shareIds, "___")[1]
-			//log.Println(se.DecodeString(shareidnum) + "--1--" + se.DecodeString(shareidkop))
-			shareid = shareidnum
-			openid = redis.GetStr("sso", "p_usershare_"+se.DecodeString(shareidnum))
-			if openid == "" {
-				openid = redis.GetStr("sso", "p_usershare_"+se.DecodeString(shareidkop))
-				shareid = shareidkop
-			}
-			if openid == "" {
-				shareid = ""
-			}
-		}
-		if shareid == "" {
-			continue
-		}
-		sendmessage, _ := json.Marshal(shareid)
-		if err := conn.WriteMessage(websocket.TextMessage, sendmessage); err != nil {
-			log.Println("socket send fail..", err)
-		}
-		if shareid != "" {
-			//log.Println("登录后正常关闭!!!")
-			conn.Close()
-			return
-		}
-	}
-	//sess := xweb.RootApp().SessionManager.Session(r, w)
-	//log.Println("sess-id:", sess.Id())
-	if err != nil {
-		log.Println(err)
-		return
 	}
-	//conn.Ch = make(chan bool, 1)
 }
 
 //实验室

+ 7 - 18
src/jfw/jyutil/jyutil.go

@@ -34,34 +34,23 @@ func FindMyShareId(activecode, openid string) string {
 	ret, bres := mongodb.FindOne("person_share", "{'s_openid':'"+openid+"','s_businesscode':'"+activecode+"'}")
 	var shareid string
 	if bres {
+		var shareData = make(map[string]interface{})
 		if (*ret)["i_shareid"] == nil {
-			//			if activecode != "" && jy_activeset[activecode] != nil {
-			//				thisact := jy_activeset[activecode].(map[string]interface{})
-			//				activitystartcode := util.ObjToString(thisact["activitystartcode"])
-			//				activityendcode := util.ObjToString(thisact["activityendcode"])
-			//				if activitystartcode != "" && activityendcode != "" {
-			//					ActivityStartCode, _ = strconv.ParseInt(activitystartcode, 10, 64)
-			//					ActivityEndCode, _ = strconv.ParseInt(activityendcode, 10, 64)
-			//				}
-			//			} else {
-			//				ActivityStartCode, _ = strconv.ParseInt(jy_activeset["activitystartcode"].(string), 10, 64)
-			//				ActivityEndCode, _ = strconv.ParseInt(jy_activeset["activityendcode"].(string), 10, 64)
-			//			}
-			//			id := GetShareId(TYPE_INVITE)
-			//			tools.GetShareQR(id)
-			var shareData = make(map[string]interface{})
-			shareData["action"] = "32"
 			data := make(map[string]interface{})
 			data["s_openid"] = openid
 			data["s_businesscode"] = activecode
 			data["i_shareid"] = se.EncodeString(openid + "---" + activecode)
 			data["l_timestamp"] = time.Now().Unix()
 			mongodb.Save("person_share", data)
-			shareid = fmt.Sprintf("%d", openid+"---"+activecode)
-			redis.Put("sso", "p_shareData_"+shareid, shareData, 24*60*60)
+			shareid = openid + "---" + activecode
 		} else {
 			shareid = se.DecodeString((*ret)["i_shareid"].(string))
 		}
+		odata := redis.Get("sso", "p_shareData_"+shareid)
+		if odata == nil {
+			shareData["action"] = "32"
+			redis.Put("sso", "p_shareData_"+shareid, shareData, 24*60*60)
+		}
 	}
 	return shareid
 }

+ 1 - 1
src/jfw/modules/entsesearch/src/web/templates/common/pnc.html

@@ -11,6 +11,6 @@
 <script src="/jylab/entsesearch/js/jquery.cookie.js"></script>
 <script src="/jylab/entsesearch/js/bootstrap.min.js"></script>
 <script src="/jylab/entsesearch/js/jy.js?v={{Msg "seo" "version"}}"></script>
-<script src="/jylab/entsesearch/js/login.js?v={{Msg "seo" "version"}}"></script>
+<!--<script src="/jylab/entsesearch/js/login.js?v={{Msg "seo" "version"}}"></script>-->
 <script src="/jylab/entsesearch/js/common.js?v={{Msg "seo" "version"}}"></script>
 {{Html `<!--[if lt IE 9]><script src="/js/html5shiv.min.js"></script><script src="/jylab/entsesearch/js/respond.min.js"></script><![endif]-->`}}

+ 3 - 3
src/jfw/modules/push/src/qfw/push/dopush/dopush.go

@@ -79,10 +79,10 @@ func DealSend(k *push.MemberInterest, l *list.List, now time.Time, MaxPushSize i
 			//增加行业的处理
 			industry := ""
 			industryclass := "industry"
-			if k2["subscopeclass"] != nil {
-				k2sub, _ := k2["subscopeclass"].([]interface{})
+			if k2["s_subscopeclass"] != nil {
+				k2sub := strings.Split(util.ObjToString(k2["s_subscopeclass"]), ",")
 				if len(k2sub) > 0 {
-					industry, _ = k2sub[0].(string)
+					industry = k2sub[0]
 					if industry != "" {
 						ss := strings.Split(industry, "_")
 						if len(ss) > 1 {

+ 3 - 2
src/jfw/modules/push/src/qfw/push/dopush/dopushes.go

@@ -4,7 +4,6 @@ import (
 	"container/list"
 	"encoding/json"
 	"fmt"
-	"gopkg.in/mgo.v2/bson"
 	"log"
 	"qfw/push"
 	"qfw/push/dfa"
@@ -14,12 +13,14 @@ import (
 	"strings"
 	"sync"
 	"time"
+
+	"gopkg.in/mgo.v2/bson"
 )
 
 const (
 	//industry
 	ShowField = `"_id","title","detail","projectscope","publishtime","toptype","subtype","type","area","href","areaval","infoformat",` +
-		`"projectname","buyer","winner","buyer","budget","bidamount","bidopentime","subscopeclass"`
+		`"projectname","buyer","winner","buyer","budget","bidamount","bidopentime","s_subscopeclass"`
 	FindField      = `"title"`
 	SmartFindField = `"title","projectscope"`
 	SortQuery      = `{"publishtime":"desc"}`

+ 14 - 4
src/jfw/modules/pushent/src/followpush/push.go

@@ -26,7 +26,7 @@ var (
 	IDRange           = `{"range":{"id":{"gt":"%s","lte":"%s"}}}`
 	TERM              = `{"term":{"%s":"%s"}}`
 	SortQuery         = `{"publishtime":"desc"}`
-	ShowField         = `"_id","title","publishtime","area","type","toptype","subtype","winner","href","infoformat"`
+	ShowField         = `"_id","title","publishtime","area","type","toptype","subtype","winner","href","infoformat","s_subscopeclass"`
 	DB                = "bidding"
 	KEEPCOUNT         = 100
 	MaxSearch         = 10000 //缓存中总共加载这么多条
@@ -138,7 +138,7 @@ func EachAllBidInfo(users *[]*PushUser, res *[]map[string]interface{}) *map[*Pus
 			}()
 			winner := util.ObjToString(tmp["winner"])
 			for _, user := range *users {
-				if winner != user.EntName {
+				if winner == "" || winner != user.EntName {
 					continue
 				}
 				s := userMap[user]
@@ -250,12 +250,17 @@ func push(fid interface{}, sname, title, openid string, res *[]map[string]interf
 					tmp["s_eid"] = util.EncodeArticleId2ByCheck(sid)
 					tmp["s_title"] = info["title"]
 					tmp["l_publishtime"] = info["publishtime"]
-					tmp["s_province"] = info["area"]
+					area := util.ObjToString(info["area"])
+					if area == "A" {
+						area = "全国"
+					}
+					tmp["s_province"] = area
 					tmp["s_type"] = util.ObjToString(info["type"])
 					tmp["s_toptype"] = util.ObjToString(info["toptype"])
 					tmp["s_subtype"] = util.ObjToString(info["subtype"])
 					tmp["s_entname"] = util.ObjToString(info["winner"])
 					tmp["s_url"] = util.ObjToString(info["href"])
+					tmp["s_subscopeclass"] = util.ObjToString(info["s_subscopeclass"])
 					*pushArray = append(*pushArray, &tmp)
 				}
 			}
@@ -275,12 +280,17 @@ func push(fid interface{}, sname, title, openid string, res *[]map[string]interf
 				tmp["s_eid"] = util.EncodeArticleId2ByCheck(sid)
 				tmp["s_title"] = info["title"]
 				tmp["l_publishtime"] = info["publishtime"]
-				tmp["s_province"] = info["area"]
+				area := util.ObjToString(info["area"])
+				if area == "A" {
+					area = "全国"
+				}
+				tmp["s_province"] = area
 				tmp["s_type"] = util.ObjToString(info["type"])
 				tmp["s_toptype"] = util.ObjToString(info["toptype"])
 				tmp["s_subtype"] = util.ObjToString(info["subtype"])
 				tmp["s_entname"] = util.ObjToString(info["winner"])
 				tmp["s_url"] = util.ObjToString(info["href"])
+				tmp["s_subscopeclass"] = util.ObjToString(info["s_subscopeclass"])
 				if filterData.IsExists(sid) {
 					continue
 				}

+ 21 - 4
src/jfw/modules/pushproject/src/followpush/push.go

@@ -26,7 +26,7 @@ var (
 	IDRange           = `{"range":{"id":{"gt":"%s","lte":"%s"}}}`
 	TERM              = `{"term":{"%s":"%s"}}`
 	SortQuery         = `{"publishtime":"desc"}`
-	ShowField         = `"_id","title","publishtime","area","type","toptype","subtype","projectname","projectcode","href","infoformat"`
+	ShowField         = `"_id","title","publishtime","area","type","toptype","subtype","projectname","projectcode","href","infoformat","s_subscopeclass"`
 	DB                = "bidding"
 	KEEPCOUNT         = 100
 	MaxSearch         = 10000 //缓存中总共加载这么多条
@@ -143,7 +143,14 @@ func EachAllBidInfo(users *[]*PushUser, res *[]map[string]interface{}) *map[*Pus
 			scode := util.ObjToString(tmp["projectcode"])
 			sname := util.ObjToString(tmp["projectname"])
 			for _, user := range *users {
-				if scode != user.ProjectCode && sname != user.ProjectName {
+				flag := false
+				if sname != "" && sname == user.ProjectName {
+					flag = true
+				}
+				if scode != "" && scode == user.ProjectCode {
+					flag = true
+				}
+				if !flag {
 					continue
 				}
 				s := userMap[user]
@@ -257,13 +264,18 @@ func push(fid interface{}, sname, scode, title, openid string, res *[]map[string
 					tmp["s_eid"] = util.EncodeArticleId2ByCheck(sid)
 					tmp["s_title"] = info["title"]
 					tmp["l_publishtime"] = info["publishtime"]
-					tmp["s_province"] = info["area"]
+					area := util.ObjToString(info["area"])
+					if area == "A" {
+						area = "全国"
+					}
+					tmp["s_province"] = area
 					tmp["s_type"] = util.ObjToString(info["type"])
 					tmp["s_toptype"] = util.ObjToString(info["toptype"])
 					tmp["s_subtype"] = util.ObjToString(info["subtype"])
 					tmp["s_projectname"] = util.ObjToString(info["projectname"])
 					tmp["s_projectcode"] = util.ObjToString(info["projectcode"])
 					tmp["s_url"] = util.ObjToString(info["href"])
+					tmp["s_subscopeclass"] = util.ObjToString(info["s_subscopeclass"])
 					*pushArray = append(*pushArray, &tmp)
 				}
 			}
@@ -286,13 +298,18 @@ func push(fid interface{}, sname, scode, title, openid string, res *[]map[string
 				tmp["s_eid"] = util.EncodeArticleId2ByCheck(sid)
 				tmp["s_title"] = info["title"]
 				tmp["l_publishtime"] = info["publishtime"]
-				tmp["s_province"] = info["area"]
+				area := util.ObjToString(info["area"])
+				if area == "A" {
+					area = "全国"
+				}
+				tmp["s_province"] = area
 				tmp["s_type"] = util.ObjToString(info["type"])
 				tmp["s_toptype"] = util.ObjToString(info["toptype"])
 				tmp["s_subtype"] = util.ObjToString(info["subtype"])
 				tmp["s_projectname"] = util.ObjToString(info["projectname"])
 				tmp["s_projectcode"] = util.ObjToString(info["projectcode"])
 				tmp["s_url"] = util.ObjToString(info["href"])
+				tmp["s_subscopeclass"] = util.ObjToString(info["s_subscopeclass"])
 				if filterData.IsExists(sid) {
 					continue
 				}

+ 39 - 0
src/jfw/modules/weixin/src/wx/scanrpc.go

@@ -0,0 +1,39 @@
+package wx
+
+import (
+	"config"
+	"log"
+	"net/rpc"
+	"qfw/util"
+)
+
+var scanpool = make(chan bool, 20)
+var webrpcaddr string
+var method = "MyfollowRpc.WeixinScan"
+
+func init() {
+	webrpcaddr = config.Sysconfig["webrpcport"].(string)
+}
+
+func SendScanRpc(code []string) {
+	scanpool <- true
+	defer func() {
+		<-scanpool
+	}()
+	util.Try(func() {
+		client, err := rpc.DialHTTP("tcp", webrpcaddr)
+		defer client.Close()
+		if err != nil {
+			log.Println(err.Error())
+			return
+		}
+		var repl bool
+		err = client.Call(method, &code, &repl)
+		if err != nil {
+			log.Println(err.Error())
+		}
+		if !repl {
+			log.Println("scan rpc error!", code)
+		}
+	}, func(e interface{}) {})
+}

+ 12 - 9
src/jfw/modules/weixin/src/wx/wx.go

@@ -411,13 +411,11 @@ func Subscribe(w ResponseWriter, r *Request) {
 	user, err := Mux.GetUserInfo(openid)
 	var source = ""
 	var pccodepre = ""
-	log.Println(strings.Split(r.EventKey, "_"), "绑定关系:", r.EventKey)
 	if len(strings.Split(r.EventKey, "_")) == 2 {
 		source = strings.Split(r.EventKey, "_")[1]
 	} else if len(strings.Split(r.EventKey, "_")) == 3 {
 		source = strings.SplitN(r.EventKey, "_", 2)[1]
 	}
-	log.Println(strings.SplitN(r.EventKey, "_", 2), ":----:", source)
 	shareData := redis.Get("sso", "p_shareData_"+source)
 	infoData := map[string]interface{}{}
 	tmp, _ := json.Marshal(shareData)
@@ -576,7 +574,10 @@ func Subscribe(w ResponseWriter, r *Request) {
 		if source != "" && len(source) > 5 {
 			saveUserLog(source, openid)
 		}
-		redis.Put("sso", "p_usershare_"+source, openid, 600)
+		//redis.Put("sso", "p_usershare_"+source, openid, 600)
+		//修改为rpc回调
+		go SendScanRpc([]string{source, openid})
+
 		//redis.Put("sso", "p_userlogs_"+source, openid, 600)
 	}
 	go saveSubscribe(openid, r.Event, r.EventKey, 1)
@@ -798,8 +799,10 @@ func ScanHandler(w ResponseWriter, r *Request) {
 			}
 		}
 		if pccodepre != "32" {
-			log.Println("扫描登录:", r.EventKey)
-			redis.Put("sso", "p_usershare_"+r.EventKey, openid, 600)
+			//			log.Println("扫描登录:", r.EventKey)
+			//			redis.Put("sso", "p_usershare_"+r.EventKey, openid, 600)
+			//修改为rpc回调
+			go SendScanRpc([]string{r.EventKey, openid})
 		}
 	} else {
 		log.Println("scan-error,mongodb-conn-error")
@@ -1101,7 +1104,7 @@ func LimitCodeHandle(w http.ResponseWriter, r *http.Request) {
 
 //保存用户邀请关系
 func SaveInviteLink(shareid string, myopenid string, isolduser bool) {
-	log.Println("save user invitelink ", myopenid, shareid, isolduser)
+	//log.Println("save user invitelink ", myopenid, shareid, isolduser)
 	sharelock.Lock()
 	//对于老用户的处理
 	if isolduser { //找我自己是不是别人邀请的
@@ -1124,13 +1127,13 @@ func SaveInviteLink(shareid string, myopenid string, isolduser bool) {
 	//	return
 	//}
 	log.Println("保存shareid:", shareid)
-	source_opendid := shareid //(*ret)["s_openid"]
+	//source_opendid := (*ret)["s_openid"]
 	data := map[string]interface{}{
 		"s_target_openid": myopenid,
-		"s_source_openid": source_opendid,
+		"s_source_openid": strings.Split(shareid, "---")[0],
 		"l_timestamp":     time.Now().Unix(),
 		"i_shareid":       shareid,
-		//"s_businesscode":  (*ret)["s_businesscode"],
+		"s_businesscode":  strings.Split(shareid, "---")[1], //(*ret)["s_businesscode"]
 	}
 	tools.MQFW.Save("person_invitelink", data)
 

+ 9 - 0
src/jfw/rpcfollow/rpc.go

@@ -2,6 +2,7 @@
 package rpcfollow
 
 import (
+	"jfw/front"
 	tools "jfw/tools"
 	"log"
 	"qfw/util"
@@ -14,6 +15,14 @@ import (
 
 type MyfollowRpc struct{}
 
+//微信扫码回调登录等操作
+func (c *MyfollowRpc) WeixinScan(param *[]string, ret *bool) error {
+	util.Try(func() {
+		*ret = front.GetWsByCode(*param)
+	}, func(e interface{}) {})
+	return nil
+}
+
 func (c *MyfollowRpc) MyFollowSet(param *frpc.FollowData, ret *string) error {
 	util.Try(func() {
 		*ret = setMyFollowKey(param.OpenId, param.Projectname)

+ 1 - 1
src/seo.json

@@ -12,7 +12,7 @@
             "title": "招标搜索结果_剑鱼招标订阅,全行业招标信息智能推送领导者!"
         }
     },
-	"version":"1402",
+	"version":"1401",
 	"area":{
 		"QG":{
 				"NAME":"全国",

+ 7 - 1
src/web/staticres/css/wxsearch.css

@@ -958,7 +958,7 @@ form{
 }
 .wxsearch .jydq-dialog li,.wxsearch .jytype-dialog li, .wxsearch .industry-dialog li {
 	border-bottom: 1px solid #d9d6d6;
-	padding: 18px 0px 16px;
+	padding: 18px 0px 6px;
 	float: left;
 	width: 100%;
 }
@@ -1646,6 +1646,9 @@ body{
 	padding:0px 20px;
 	background-color:#fff;
 }
+#list>div:last-of-type>.closeadv-bg,#list>div:last-of-type>.closeadv{
+	display: none;
+}
 .nullcontent{
 	padding-top: 10%;
 	position: absolute;
@@ -2191,4 +2194,7 @@ body{
 #supersearchPage .nullcontent{
 	position: relative;
     top: 20px;
+}
+#entsearchPage .wxsearch{
+	margin-top: 0px;
 }

+ 44 - 48
src/web/staticres/js/login.js

@@ -34,11 +34,9 @@ var createWebSocket = function(wsUrl){
 //
 var initEventHandle = function(){
 	ws.onmessage = function(e){
-		loginshareid = e.data;
-		//console.log(loginshareid.substring(1,loginshareid.length-1)+"登录接收:---:"+loginshareid)
-		if(loginshareid!=""){
+		if(e.data!=""){
 			//用户登录
-			logic(loginshareid.substring(1,loginshareid.length-1),mynum);
+			logic(e.data,mynum);
 		}
 	}
 	ws.onerror = function(e){
@@ -193,56 +191,54 @@ var redisUserInfo = function(pid,kid){
 }
 
 //查询用户信息,响应页面登录信息
-var logic = function(shareid,num){
-	$.post("/front/login/"+shareid,function(data){
-			if(data.result=="ok"){
-				//$(".QRLogin").hide();
-				$("#bidLogin").modal("hide")
-				$("#bidcommunity").modal("hide")				
-				clearInterval(loginfg);
-				loginflag = true;
-				processpage(shareid,num);
-				if(ws.readyState==1){
-					ws.send("close");
-					ws.close();
-				}
-				encryptId = data.encryptId
-				//$("#login").html("<img src='"+data.s_headimage+"'><button class='userBtn1'>"+"<div style=\"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:55px;display:inline-block;text-align:center;\">"+data.s_nickname+"</div>"+"<img src='/images/nav-login-down.png'></button>");
-				if(data.s_nickname.length>6){
-					data.s_nickname = data.s_nickname.substring(0,6);
-					data.s_nickname = data.s_nickname + "...";
-				}
-				var hhtml = "<img class='imgShow' onmouseover='openStyle()' onmouseout='closeStyle()' "
-					if(data.redisheadimg!=""){
-						hhtml+="src='"+data.redisheadimg+"'"
-					}else{
-						hhtml+="src='"+data.s_headimage+"'"
-					}
-					hhtml+=" onerror='this.src=\"/images/defaultAvatar.png\"'>"
-						+"<div class='userInfo'>"
-							+"<div class='infoList' style='display:none'>"
-								+"<span class='one'></span>"
-								+"<span class='two'></span>"
-								+"<div class='usernameDiv'>"
-									+data.s_nickname
-								+"</div>"
-								+"<div class='exitDiv' onclick='signout()'>"
-									+"<img id='outImg' src='/images/userexit.png'/>"
-									+"<span>退出</span>"	
-								+"</div>"
-							+"</div>"
-						+"</div>"	
-				$("#login").html(hhtml);
-				infoListCss();	
-				commonMouseEvent();
+var logic = function(infoData,num){
+	var data = $.parseJSON(infoData); 
+	if(data.result=="ok"){
+		//$(".QRLogin").hide();
+		$("#bidLogin").modal("hide")
+		$("#bidcommunity").modal("hide")				
+		clearInterval(loginfg);
+		loginflag = true;
+		processpage(data.shareid,num);
+		if(ws.readyState==1){
+			ws.send("close");
+			ws.close();
+		}
+		encryptId = data.encryptId
+		if(data.s_nickname.length>6){
+			data.s_nickname = data.s_nickname.substring(0,6);
+			data.s_nickname = data.s_nickname + "...";
+		}
+		var hhtml = "<img class='imgShow' onmouseover='openStyle()' onmouseout='closeStyle()' "
+			if(data.redisheadimg!=""){
+				hhtml+="src='"+data.redisheadimg+"'"
+			}else{
+				hhtml+="src='"+data.s_headimage+"'"
 			}
-		})
+			hhtml+=" onerror='this.src=\"/images/defaultAvatar.png\"'>"
+				+"<div class='userInfo'>"
+					+"<div class='infoList' style='display:none'>"
+						+"<span class='one'></span>"
+						+"<span class='two'></span>"
+						+"<div class='usernameDiv'>"
+							+data.s_nickname
+						+"</div>"
+						+"<div class='exitDiv' onclick='signout()'>"
+							+"<img id='outImg' src='/images/userexit.png'/>"
+							+"<span>退出</span>"	
+						+"</div>"
+					+"</div>"
+				+"</div>"	
+		$("#login").html(hhtml);
+		infoListCss();	
+		commonMouseEvent();
+	}
 }
 
 //登录后处理页面逻辑
 var processpage = function(shareid,num){
 	clearInterval(loginfg);
-	saveuserlogs(shareid);
+	//saveuserlogs(shareid);
 	getEntAndSupStatus();
 	switch(num){
 		case "10"://10首页

+ 24 - 1
src/web/templates/weixin/follow/notice.html

@@ -29,6 +29,15 @@
     color: #fff;
     font-size: 14px;
 }
+span.industry {
+    border: 1px solid #25c78c;
+    background: #25c78c;
+    border-radius: 3px;
+    margin: 0px 5px;
+    padding: 1px 3px;
+    color: #fff;
+    font-size: 14px;
+}
 </style>
 <script>
 	initShare({{.T.signature}},{{.T.openid}},"","jy_extend");
@@ -94,10 +103,24 @@ $(function(){
 			}else{
 				area="";
 			}
+			var industry = '';
+			var subscopeclass = a_relationinfo[i].s_subscopeclass;
+			if(subscopeclass){
+				var k2sub = subscopeclass.split(",");
+				if(k2sub.length > 0){
+					industry = k2sub[0];
+					if(industry != ""){
+						var ss = industry.split("_");
+						if(ss.length > 1){
+							industry = '<span class="industry">'+ss[0]+'</span>';
+						}
+					}
+				}
+			}
 			html += '<li>'
 					+'<div class="index">'+(i+1)+'.</div>'
 					+'<a href="javascript:void(0)" class="title'+(isVisited(id)?' visited':'')+'" onclick="beforeRedirect(this,\''+id+'\',\''+a_relationinfo[i].s_url+'\','+isOld+')">'+title+'</a>'
-					+'<div class="time">'+datatype+area+tdf+'</div>'
+					+'<div class="time">'+datatype+area+industry+tdf+'</div>'
 				+'</li>';
 		}
 		html += '<ul>';