Преглед на файлове

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

renzheng преди 9 години
родител
ревизия
855d1e3109
променени са 53 файла, в които са добавени 1417 реда и са изтрити 360 реда
  1. 1 1
      common/src/qfw/util/elastic/elasticutil.go
  2. 1 0
      core/src/qfw/front/index.go
  3. 0 11
      core/src/qfw/member/membermanager.go
  4. 17 0
      core/src/qfw/member/yellowpage.go
  5. 4 5
      core/src/qfw/search/search.go
  6. 7 65
      core/src/qfw/search/searchService.go
  7. 2 0
      core/src/qfw/yellowpage/yellowpage.go
  8. 161 55
      core/src/qfw/yellowpage/yellowpagemanager.go
  9. 0 4
      core/src/serviceclassify.json
  10. 1 1
      core/src/timetask.json
  11. 25 13
      core/src/web/staticres/css/entcommunity.css
  12. 6 2
      core/src/web/staticres/css/enterprise.css
  13. 3 3
      core/src/web/staticres/css/qfw.css
  14. 22 7
      core/src/web/staticres/js/enterprise.js
  15. 108 28
      core/src/web/staticres/js/entportrait.js
  16. 25 8
      core/src/web/staticres/js/marketlist.js
  17. 19 7
      core/src/web/staticres/js/paging.js
  18. 11 4
      core/src/web/staticres/js/qfw.js
  19. 14 4
      core/src/web/staticres/js/relation.js
  20. 21 4
      core/src/web/staticres/wxent/qfw-enterprise.js
  21. 21 4
      core/src/web/staticres/wxent/qfw-frontenterprise.js
  22. 2 2
      core/src/web/templates/common/bottom.html
  23. 1 1
      core/src/web/templates/common/centerhead.html
  24. 10 5
      core/src/web/templates/common/enthead.html
  25. 1 1
      core/src/web/templates/common/head.html
  26. 1 1
      core/src/web/templates/common/indexhead.html
  27. 7 7
      core/src/web/templates/common/memberleft.html
  28. 73 0
      core/src/web/templates/common/wsitehead.html
  29. 24 2
      core/src/web/templates/index.html
  30. 1 1
      core/src/web/templates/manage/ad/addad.html
  31. 3 0
      core/src/web/templates/manage/webexpresscontent-new.html
  32. 7 17
      core/src/web/templates/member/accountset/index.html
  33. 97 45
      core/src/web/templates/member/editenterprise.html
  34. 2 2
      core/src/web/templates/member/editservice.html
  35. 29 2
      core/src/web/templates/member/microwebsite.html
  36. 16 7
      core/src/web/templates/member/showenterprise.html
  37. 44 27
      core/src/web/templates/search/entcommunity.html
  38. 3 3
      core/src/web/templates/search/enterpriseList.html
  39. 1 1
      core/src/web/templates/swordfish/rssset.html
  40. 25 10
      core/src/web/templates/yellowpage/enterpriseinfo.html
  41. 34 0
      messageframe/src/util/client.go
  42. 23 0
      messageframe/src/util/event.go
  43. 18 0
      messageframe/src/util/event_test.go
  44. 19 0
      messageframe/src/util/key.go
  45. 132 0
      messageframe/src/util/protocol.go
  46. 32 0
      messageframe/src/util/server.go
  47. 21 0
      messageframe/src/客户端/main.go
  48. 26 0
      messageframe/src/客户端/processbusinessmsg.go
  49. 36 0
      messageframe/src/客户端/processmsg.go
  50. 155 0
      messageframe/src/服务端/main.go
  51. 50 0
      messageframe/src/爬虫监控/main.go
  52. 19 0
      messageframe/src/爬虫监控/processbusinessmsg.go
  53. 36 0
      messageframe/src/爬虫监控/processmsg.go

+ 1 - 1
common/src/qfw/util/elastic/elasticutil.go

@@ -654,7 +654,7 @@ func ConverData(ent *map[string]interface{}) map[string]interface{} {
 	tmp2["s_mobile"] = tmp["s_mobile"]
 	tmp2["s_enturl"] = tmp["s_enturl"]
 	tmp2["s_weixin"] = tmp["s_weixin"]
-
+	tmp2["s_avatar"] = tmp["s_avatar"]
 	return tmp2
 }
 

+ 1 - 0
core/src/qfw/front/index.go

@@ -114,6 +114,7 @@ func (i *Index) GetWebSiteTop() error {
 		if loginType := i.GetSession("loginType"); loginType != nil { //登录类型
 			result["loginType"] = loginType.(string)
 		}
+		result["identWay"] = util.IntAll(i.GetSession("identWay"))
 		if userId := i.GetSession("userId"); userId != nil {
 			result["msgCount"] = msg.GetMsgCount(userId.(string))
 		}

+ 0 - 11
core/src/qfw/member/membermanager.go

@@ -1290,17 +1290,6 @@ func SendIdentCode(code, title, value string, session *httpsession.Session) (fla
 func (m *Member) UpdateMyHeadPic() error {
 	//更新用户头像
 	bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": M{"s_avatar": m.GetString("url")}}, false, false)
-	userInfo := m.GetSession("userInfo").(*map[string]interface{})
-	var role string
-	if (*userInfo)["s_role"] != nil {
-		role = (*userInfo)["s_role"].(string)
-	}
-	if ok, _ := regexp.MatchString("^[9]$", role); ok && bol {
-		//更新企业logo
-		entid := m.GetSession("entid").(string)
-		Update("enterprise", "{'_id':'"+entid+"'}", M{"$set": M{"s_avatar": m.GetString("url")}}, false, false)
-		redis.Del("enterprise", "enterpriseInfo_"+entid)
-	}
 	if bol {
 		UpdateCookieSession(m.Action, m.GetSession("loginType").(string), false, *FindById("user", m.GetSession("userId").(string), nil))
 		return m.Write("y")

+ 17 - 0
core/src/qfw/member/yellowpage.go

@@ -35,6 +35,7 @@ type Yellowpage struct {
 	showEnterprise xweb.Mapper `xweb:"/member/yellowpage/show/enterprise/(\\w+)"`  //显示企黄页信息
 	showService    xweb.Mapper `xweb:"/member/yellowpage/show/showService/(\\w+)"` //显示添加服务页面
 	editService    xweb.Mapper `xweb:"/member/yellowpage/edit/showService/(\\w+)"` //编辑服务页面
+	updateEntLogo  xweb.Mapper `xweb:"POST /member/yellowpage/updateEntLogo"`      //修改企业logo
 
 	addService    xweb.Mapper `xweb:"/member/yellowpage/add/service/addservice"` //增加服务
 	delservice    xweb.Mapper `xweb:"POST /member/service/delservice"`           //删除数据
@@ -230,6 +231,7 @@ func (yp *Yellowpage) Dosave() error {
 	flag := mongodb.Update(ESTYPE, "{'_id':'"+entid+"'}", &dataSet, false, false)
 	redis.Del("enterprise", "enterpriseInfo_"+entid)
 	redis.Del("enterprise", "enterpriseInfo_user_"+entid)
+	redis.DelByCodePattern("enterprise", "ipcity_*")
 	if !flag {
 		status = "n"
 		info = "保存信息失败"
@@ -631,3 +633,18 @@ func checkuser(yp *Yellowpage) bool {
 		return false
 	}
 }
+
+//上传企业logo
+func (yp *Yellowpage) UpdateEntLogo() error {
+	//更新企业logo
+	entid := yp.GetSession("entid").(string)
+	bol := mongodb.Update("enterprise", "{'_id':'"+entid+"'}", map[string]interface{}{"$set": map[string]interface{}{"s_avatar": yp.GetString("url")}}, false, false)
+	redis.Del("enterprise", "enterpriseInfo_"+entid)
+	redis.DelByCodePattern("enterprise", "ipcity_*")
+	if bol {
+		elastic.UpdateEntDoc(entid)
+		return yp.Write("y")
+	} else {
+		return yp.Write("n")
+	}
+}

+ 4 - 5
core/src/qfw/search/search.go

@@ -9,11 +9,10 @@ import (
 
 type Search struct {
 	*xweb.Action
-	getEnterpriseList  xweb.Mapper `xweb:"/search/enterprise/([^.]*)ent([^.]*).html"` //查询企业列表
-	sim                xweb.Mapper `xweb:"POST /search/sim"`                          //即时搜索
-	searchEntSer       xweb.Mapper `xweb:"/searchEntSer/(.*)"`                        //获取企业的服务列表
-	findServiceByEntId xweb.Mapper `xweb:"/front/findServiceByEntId"`                 //获取企业的服务列表
-	entCommunity       xweb.Mapper `xweb:"/front/entCommunity.html"`
+	getEnterpriseList xweb.Mapper `xweb:"/search/enterprise/([^.]*)ent([^.]*).html"` //查询企业列表
+	sim               xweb.Mapper `xweb:"POST /search/sim"`                          //即时搜索
+	searchEntSer      xweb.Mapper `xweb:"/searchEntSer/(.*)"`                        //获取企业的服务列表
+	entCommunity      xweb.Mapper `xweb:"/front/entCommunity.html"`
 }
 
 func init() {

+ 7 - 65
core/src/qfw/search/searchService.go

@@ -32,7 +32,7 @@ func (search *Search) EntCommunity() error {
 		if identEnts != nil && len(*identEnts) > 0 {
 			var enterpriseids []bson.ObjectId
 			for _, v := range *identEnts {
-				if v["s_enterpriseid"] != nil {
+				if v["s_enterpriseid"] != nil && v["s_enterpriseid"].(string) != "" {
 					enterpriseids = append(enterpriseids, bson.ObjectIdHex(v["s_enterpriseid"].(string)))
 				}
 			}
@@ -117,64 +117,6 @@ func (search *Search) SearchEntSer(id string) error {
 	return nil
 }
 
-func (search *Search) FindServiceByEntId() error {
-	if search.Method() == "POST" {
-		id := search.GetString("entId")
-		currentPage, _ := search.GetInteger("currentPage")
-		var res map[string]interface{}
-		if ret := redis.Get("enterprise", "service-"+id+"-"+fmt.Sprint(currentPage)); ret != nil {
-			res = ret.(map[string]interface{})
-		} else {
-			limit, _ := search.GetInteger("pageSize")
-			start := (currentPage - 1) * limit
-			var count int64
-			//分页
-			mustnot := `{"term" : {"i_status" : 1 }}`
-			var fields, collection, query, tempstrquery string
-			collection = "service"
-			tempstrquery = `{"query_string":{"default_field": "s_enterpriseid","query":"` + id + `"}}`
-			servicequery := ""
-			if search.GetSession("entid") == nil || search.GetSession("entid").(string) != id {
-				servicequery = `,"must_not" : [` + mustnot + `]`
-			}
-			query = `{"query": {
-		    "bool": {
-			  "must":[` + tempstrquery + `]` + servicequery + `
-		    }
-		  }}`
-			//需要查到的字段信息
-			fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status","s_pricemy","i_comments","f_price","i_sales"`
-			if currentPage == 1 {
-				count = elastic.Count("service", collection, query)
-			}
-			//查询服务列表数据
-			result := elastic.Get("service", collection, `{"query":{"bool": {"must":[`+tempstrquery+`]`+servicequery+`}},
-		_source:[`+fields+`],
-		sort:{"l_createdate":"desc"},
-		from:`+fmt.Sprintf("%v", start)+`,
-		size:`+fmt.Sprintf("%v", limit)+`
-		}`)
-			for _, v := range *result {
-				b, _ := CheckAuth(v)
-				if b {
-					v["s_isEdit"] = "1"
-				} else {
-					v["s_isEdit"] = "0"
-				}
-				if IntAll(v["i_status"]) == 1 {
-					v["s_remove"] = 1
-				} else {
-					v["s_remove"] = 0
-				}
-			}
-			res = map[string]interface{}{"list": result, "count": count}
-			redis.Put("enterprise", "service-"+id+"-"+fmt.Sprint(currentPage), res, 7*24*60*60)
-		}
-		search.ServeJson(res)
-	}
-	return nil
-}
-
 //企业列表
 func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 	//必须是登录之后的已认证用户才可以进入企业社区
@@ -347,8 +289,8 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 			case "河南", "广西", "黑龙江", "青海", "西藏", "安徽", "山西":
 				ipcity = consts.Scode[tn.Region]
 				if len(ipcity) > 0 {
-					tmp_res := redis.Get("enterprise", ipcity+"_1")
-					tmp_pag := redis.Get("enterprise", ipcity+"_2")
+					tmp_res := redis.Get("enterprise", "ipcity_"+ipcity+"_1")
+					tmp_pag := redis.Get("enterprise", "ipcity_"+ipcity+"_2")
 					if nil != tmp_res && nil != tmp_pag {
 						tmp_res1, oks1 := tmp_res.([]interface{})
 						tmp_pag1, oks2 := tmp_pag.([]interface{})
@@ -371,7 +313,7 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 						      }
 						    }
 						  }
-						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict"]
+						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","RegCapCurName","s_avatar"]
 						,"from":0,
 						"size":` + fmt.Sprintf("%v", perPage) + `,
 						  "sort": [{"_score": "desc"},{"OpSint":"desc"},{"RegCap":"desc"}]
@@ -523,7 +465,7 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 			"s_synopsis":{"force_source": true},
 			"stock":{"force_source": true}
         }
-    },"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid"]
+    },"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid","RegCapCurName","s_avatar"]
 	,"from":` + fmt.Sprintf("%v", ((currentPage-1)*perPage)) + `,
 	"size":` + fmt.Sprintf("%v", perPage) +
 			`,"sort":[` + sort + `] }`
@@ -638,8 +580,8 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 	pagination := front.MakePagination(perPage, currentPage, int(total), querymap, "/search/enterprise/"+reqType+"ent_%s.html")
 
 	if tempBisOne && len(ipcity) > 0 {
-		redis.Put("enterprise", ipcity+"_1", res, 5*86400)
-		redis.Put("enterprise", ipcity+"_2", pagination, 5*86400)
+		redis.Put("enterprise", "ipcity_"+ipcity+"_1", res, 5*86400)
+		redis.Put("enterprise", "ipcity_"+ipcity+"_2", pagination, 5*86400)
 	}
 	return &res, &pagination
 

+ 2 - 0
core/src/qfw/yellowpage/yellowpage.go

@@ -21,6 +21,8 @@ type Yellowpage struct {
 	getRelation xweb.Mapper `xweb:"/member/getRelation"`
 	//获取失信信息
 	getDishonesty xweb.Mapper `xweb:"/front/getDishonesty"`
+	//获取企业的服务列表
+	findServiceByEntId xweb.Mapper `xweb:"/front/findServiceByEntId"`
 }
 
 func (yp *Yellowpage) EnterpriseInfoByRegNO(regNO string) error {

+ 161 - 55
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -5,6 +5,7 @@ import (
 	"container/list"
 	"encoding/json"
 	"fmt"
+	"github.com/go-xweb/httpsession"
 	_ "github.com/go-xweb/xweb"
 	mgo "gopkg.in/mgo.v2"
 	. "gopkg.in/mgo.v2/bson"
@@ -14,6 +15,7 @@ import (
 	"qfw/mobile"
 	"qfw/util"
 	"qfw/util/credit"
+	elastic "qfw/util/elastic"
 	. "qfw/util/mongodb"
 	"qfw/util/redis"
 	"strconv"
@@ -42,7 +44,7 @@ func FormatDate(src *interface{}) string {
 }
 
 func GetEntInfo(id string) map[string]interface{} {
-	res := FindById("enterprise", id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1, "s_synopsis":1, "SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1, "s_enturl, "i_province":1, "i_city":1, "i_area":1,"s_action":1,"s_persion":1,"s_mobile":1,"s_address":1,"s_avatar":1,"s_microwebsite":1,"s_qq":1,"s_submitid":1,"s_email":1,"staffinfo":1}`)
+	res := FindById("enterprise", id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1, "s_synopsis":1, "SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1, "s_enturl, "i_province":1, "i_city":1, "i_area":1,"s_action":1,"s_persion":1,"s_mobile":1,"s_address":1,"s_avatar":1,"s_microwebsite":1,"s_qq":1,"s_submitid":1,"s_email":1,"staffinfo":1,"RegCapCurName":1}`)
 	if res != nil && len(*res) > 0 {
 		id := (*res)["s_submitid"]
 		if id != nil {
@@ -261,33 +263,38 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 			yp.T["res"] = info
 			regNo, _ := info["RegNo"].(string)
 			entName, _ := info["EntName"].(string)
-			relation := redis.Get("enterprise", "relation-"+regNo)
-			if relation == nil {
-				relation = makeRelation(regNo, entName)
-				redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
-			}
-			var nodes *[]map[string]interface{}
-			if d, err := json.Marshal(relation.(map[string]interface{})["nodes"]); err == nil && json.Unmarshal(d, &nodes) == nil && len(*nodes) > 0 {
-				var regNos []string
-				for _, v := range *nodes {
-					if v["type"] == "e" {
-						regNos = append(regNos, v["name"].(string))
-					}
-					if len(regNos) == 6 {
-						break
-					}
-				}
-				if len(regNos) > 0 {
-					relevantEnts := Find("enterprise", M{"RegNo": M{"$in": regNos}}, nil, `{"s_avatar":1,"RegNo":1,"EntName":1}`, false, -1, -1)
-					if relevantEnts != nil && len(*relevantEnts) > 0 {
-						for _, relevantEnt := range *relevantEnts {
-							relevantEnt["_id"] = util.BsonIdToSId(relevantEnt["_id"])
+			//相关企业
+			relation := getRelation(regNo, entName)
+			if relation != nil {
+				var nodes *[]map[string]interface{}
+				if d, err := json.Marshal(relation.(map[string]interface{})["nodes"]); err == nil && json.Unmarshal(d, &nodes) == nil && len(*nodes) > 0 {
+					var regNos []string
+					for _, v := range *nodes {
+						if v["type"] == "e" {
+							regNos = append(regNos, v["name"].(string))
+						}
+						if len(regNos) == 6 {
 							break
 						}
-						yp.T["relevantEnts"] = relevantEnts
+					}
+					if len(regNos) > 0 {
+						relevantEnts := Find("enterprise", M{"RegNo": M{"$in": regNos}}, nil, `{"s_avatar":1,"RegNo":1,"EntName":1}`, false, -1, -1)
+						if relevantEnts != nil && len(*relevantEnts) > 0 {
+							for _, relevantEnt := range *relevantEnts {
+								relevantEnt["_id"] = util.BsonIdToSId(relevantEnt["_id"])
+								break
+							}
+							yp.T["relevantEnts"] = relevantEnts
+						}
 					}
 				}
 			}
+			//失信信息第一页数据
+			yp.T["dishonesty"] = getDishonesty(util.If(info["LegCerNO"] != nil, info["LegCerNO"], "").(string), 1)
+			//服务列表第一页数据
+			yp.T["service"] = findServiceByEntId(id, 1, yp.Session())
+			//关系网数据
+			yp.T["relation"] = relation
 			contentuser, erruser := yp.Render4Cache("/yellowpage/enterpriseinfo.html", &yp.T)
 			if erruser == nil {
 				redis.PutBytes("enterprise", "enterpriseInfo_"+id, &contentuser, 7*ONEDAY)
@@ -395,7 +402,11 @@ func storeNode(data *map[string]interface{}, ls *list.List, dir /*方向反转*/
 	if (*data)["invopstate"] != nil {
 		invopstate = (*data)["invopstate"].(string)
 	}
-	ls.PushBack([]string{invtype, invcerno, invname, entregno, entname, strconv.Itoa(level), fmt.Sprint(invweight), invacconam, fmt.Sprint(regcap), fmt.Sprint(invregcap), legcerno, opstate, invopstate})
+	regcapcurname := ""
+	if (*data)["regcapcurname"] != nil {
+		regcapcurname = (*data)["regcapcurname"].(string)
+	}
+	ls.PushBack([]string{invtype, invcerno, invname, entregno, entname, strconv.Itoa(level), fmt.Sprint(invweight), invacconam, fmt.Sprint(regcap), fmt.Sprint(invregcap), legcerno, opstate, invopstate, regcapcurname})
 }
 
 func findIndex(code string, arr []interface{}) (index int, mtType string) {
@@ -425,11 +436,7 @@ func (yp *Yellowpage) GetRelation() error {
 		if regNo == "" || entName == "" {
 			return nil
 		}
-		relation := redis.Get("enterprise", "relation-"+regNo)
-		if relation == nil {
-			relation = makeRelation(regNo, entName)
-			redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
-		}
+		relation := getRelation(regNo, entName)
 		yp.ServeJson(M{"flag": true, "relation": relation})
 		r := relation.(map[string]interface{})
 		var links *[]map[string]interface{}
@@ -443,6 +450,17 @@ func (yp *Yellowpage) GetRelation() error {
 	}
 	return nil
 }
+func getRelation(regNo, entName string) interface{} {
+	if regNo == "" || entName == "" {
+		return nil
+	}
+	relation := redis.Get("enterprise", "relation-"+regNo)
+	if relation == nil {
+		relation = makeRelation(regNo, entName)
+		redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
+	}
+	return relation
+}
 
 //生成图用的结果
 func makeRelation(mnregno, mnname string) interface{} {
@@ -479,25 +497,27 @@ func makeRelation(mnregno, mnname string) interface{} {
 		//加投资人
 		if _, ok := node[v[1]]; !ok {
 			node[v[1]] = map[string]string{
-				"name":     v[1],
-				"text":     v[2],
-				"type":     v[0],
-				"regcap":   v[9],
-				"level":    v[5],
-				"legcerno": v[10],
-				"opstate":  v[12],
+				"name":          v[1],
+				"text":          v[2],
+				"type":          v[0],
+				"regcap":        v[9],
+				"level":         v[5],
+				"legcerno":      v[10],
+				"opstate":       v[12],
+				"regcapcurname": v[13],
 			}
 		}
 		//加企业
 		if _, ok := node[v[3]]; !ok {
 			node[v[3]] = map[string]string{
-				"name":     v[3],
-				"text":     v[4],
-				"type":     "e",
-				"regcap":   v[8],
-				"level":    v[5],
-				"legcerno": v[10],
-				"opstate":  v[11],
+				"name":          v[3],
+				"text":          v[4],
+				"type":          "e",
+				"regcap":        v[8],
+				"level":         v[5],
+				"legcerno":      v[10],
+				"opstate":       v[11],
+				"regcapcurname": v[13],
 			}
 		}
 	}
@@ -535,18 +555,104 @@ func (yp *Yellowpage) GetDishonesty() error {
 	if yp.Method() == "POST" {
 		legcerNo := yp.GetString("legcerNo")
 		currentPage, _ := yp.GetInteger("currentPage")
-		var res map[string]interface{}
-		if ret := redis.Get("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage)); ret != nil {
-			res = ret.(map[string]interface{})
-		} else {
-			limit, _ := yp.GetInteger("pageSize")
-			start := (currentPage - 1) * limit
-			count := Count("laolai", `{"s_cardnum":"`+legcerNo+`"}`)
-			r := Find("laolai", `{"s_cardnum":"`+legcerNo+`"}`, `{"l_date":-1}`, `{"l_date":1,"iname":1,"court_name":1,"case_code":1,"performance":1}`, false, start, limit)
-			res = map[string]interface{}{"list": r, "count": count}
-			redis.Put("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage), res, 7*24*60*60)
-		}
-		yp.ServeJson(res)
+		yp.ServeJson(getDishonesty(legcerNo, currentPage))
 	}
 	return nil
 }
+func getDishonesty(legcerNo string, currentPage int) map[string]interface{} {
+	var res map[string]interface{}
+	if ret := redis.Get("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage)); ret != nil {
+		res = ret.(map[string]interface{})
+	} else {
+		limit := 10
+		start := (currentPage - 1) * limit
+		count := Count("laolai", `{"s_cardnum":"`+legcerNo+`"}`)
+		r := Find("laolai", `{"s_cardnum":"`+legcerNo+`"}`, `{"l_date":-1}`, `{"l_date":1,"iname":1,"court_name":1,"case_code":1,"performance":1}`, false, start, limit)
+		res = map[string]interface{}{"list": r, "count": count, "pageSize": limit}
+		redis.Put("enterprise", "dishonesty-"+legcerNo+"-"+fmt.Sprint(currentPage), res, 7*24*60*60)
+	}
+	return res
+}
+func (yp *Yellowpage) FindServiceByEntId() error {
+	if yp.Method() == "POST" {
+		id := yp.GetString("entId")
+		currentPage, _ := yp.GetInteger("currentPage")
+		yp.ServeJson(findServiceByEntId(id, currentPage, yp.Session()))
+	}
+	return nil
+}
+func findServiceByEntId(id string, currentPage int, session *httpsession.Session) map[string]interface{} {
+	var res map[string]interface{}
+	if ret := redis.Get("enterprise", "service-"+id+"-"+fmt.Sprint(currentPage)); ret != nil {
+		res = ret.(map[string]interface{})
+	} else {
+		limit := 10
+		start := (currentPage - 1) * limit
+		var count int64
+		//分页
+		mustnot := `{"term" : {"i_status" : 1 }}`
+		var fields, collection, query, tempstrquery string
+		collection = "service"
+		tempstrquery = `{"query_string":{"default_field": "s_enterpriseid","query":"` + id + `"}}`
+		servicequery := ""
+		if session.Get("entid") == nil || session.Get("entid").(string) != id {
+			servicequery = `,"must_not" : [` + mustnot + `]`
+		}
+		query = `{"query": {
+		    "bool": {
+			  "must":[` + tempstrquery + `]` + servicequery + `
+		    }
+		  }}`
+		//需要查到的字段信息
+		fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status","s_pricemy","i_comments","f_price","i_sales"`
+		if currentPage == 1 {
+			count = elastic.Count("service", collection, query)
+		}
+		//查询服务列表数据
+		result := elastic.Get("service", collection, `{"query":{"bool": {"must":[`+tempstrquery+`]`+servicequery+`}},
+		_source:[`+fields+`],
+		sort:{"l_createdate":"desc"},
+		from:`+fmt.Sprintf("%v", start)+`,
+		size:`+fmt.Sprintf("%v", limit)+`
+		}`)
+		for _, v := range *result {
+			b, _ := checkAuth(v)
+			if b {
+				v["s_isEdit"] = "1"
+			} else {
+				v["s_isEdit"] = "0"
+			}
+			if util.IntAll(v["i_status"]) == 1 {
+				v["s_remove"] = 1
+			} else {
+				v["s_remove"] = 0
+			}
+		}
+		res = map[string]interface{}{"list": result, "count": count, "pageSize": limit}
+		redis.Put("enterprise", "service-"+id+"-"+fmt.Sprint(currentPage), res, 7*24*60*60)
+	}
+	return res
+}
+func checkAuth(obj map[string]interface{}) (b bool, err string) {
+	if len(obj) > 0 {
+		//判断有没有预约的情况
+		orders := *(Find("serviceorder", `{"s_serviceid":"`+obj["_id"].(string)+`","i_status":{"$ne":2}}`, nil, `{"i_status":1}`, false, -1, -1))
+		//如果有记录的话,判断是已预约还是已接受
+		if len(orders) != 0 {
+			//判断是否有接受的
+			for _, v := range orders {
+				if util.IntAll(v["i_status"]) == 1 {
+					b = false
+					err = "start"
+					return
+				}
+				if util.IntAll(v["i_status"]) == 3 {
+					b = false
+					err = "comment"
+					return
+				}
+			}
+		}
+	}
+	return true, ""
+}

+ 0 - 4
core/src/serviceclassify.json

@@ -34,10 +34,6 @@
                         "code": "010202",
                         "name": "税务筹划"
                     },
-                    {
-                        "code": "010203",
-                        "name": "会计服务"
-                    },
                     {
                         "code": "010299",
                         "name": "代理报税"

+ 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-08 15:29:54"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-08 15:29:54"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-10 10:08:18"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-10 10:08:18"}},"marketisstart":true,"marketrate":300}

+ 25 - 13
core/src/web/staticres/css/entcommunity.css

@@ -150,23 +150,32 @@ a:focus, a:hover{
 	color: #a0a0a0;
 }
 .ent-indexpage .ent-index-search>.b-com-third{
-	font-size: 18px;
-	width: 70%;
+	position: relative;
 }
 .ent-indexpage .ent-index-search>.b-com-third>input{
-	font-size: inherit;
+	font-size: 18px;
 	height: 45px;
+	width: 490px;
+	
+}
+.ent-indexpage .ent-index-search>.b-com-third>input:focus{
+	border-color: #ccc;
+	box-shadow: none;
 }
 .ent-indexpage .ent-index-search>.b-com-third>span{
+	font-size: 18px;
 	height: 45px;
 	border-width: 0px;
 	background-color: #16A086;
 	color: #ffffff;
-	font-size: inherit;
 	border-radius: 0px;
 	padding-left: 20px;
 	padding-right: 20px;
 	cursor: pointer;
+	width: 98px;
+}
+.ent-indexpage .ent-index-search .immediately{
+	left: 0px;
 }
 .ent-indexpage .ent-index-search .glyphicon{
 	margin-right: 5px;
@@ -177,7 +186,7 @@ a:focus, a:hover{
 	color: #ffffff;
 }
 .ent-indexpage .ent-index-search>.b-com-fourth>a{
-	margin-right: 5px;
+	margin-right: 18px;
 	color: #ffffff;
 }
 .ent-indexpage .ent-index-search>.b-com-fourth>a:hover{
@@ -237,9 +246,6 @@ a:focus, a:hover{
 	display: block;
 	margin-top: 2px;
 }
-.ent-indexpage .carousel{
-	padding-bottom: 50px;
-}
 .ent-indexpage .b-scroll-list .b-adver-content{
 	max-height: 750px;
 }
@@ -350,21 +356,26 @@ a:focus, a:hover{
 .ent-tab li{
 	padding: 0px 20px;
 	border-top-width: 3px;
-	height: 47px;
-	line-height: 47px;
+	height: 50px;
+	line-height: 50px;
 	border-top: 3px solid #F6F8FA;
 	cursor: pointer;
 	border-right: 1px solid #FFFFFF;
 	font-weight: bold;
 }
+.ent-tab li.disabled{
+	cursor: auto;
+	color: #a0a0a0;
+	opacity: 0.5;
+}
 .ent-tab .ent-active{
 	border-top-color: #16a086;
 	background-color: #FFFFFF;
 	color: #16a086;
-	border-right-width: 0px
 }
 .ent-tab-content{
 	margin-top: 10px;
+	min-height: 491px;
 }
 /********************企业画像**********************/
 .entinfo-basicinfo .b-com-content{
@@ -419,13 +430,13 @@ a:focus, a:hover{
 	float: right;
 }
 .entinfo-basicinfo .entinfo-round>div:first-child>div:nth-child(n+1)>span:first-child{
-	width: 70px;
+	width: 80px;
 	text-align: center;
 	vertical-align: super;
 	margin-right: 10px;
 }
 .entinfo-basicinfo .entinfo-round>div:first-child>div:nth-child(n+1)>span:last-child{
-	width: 175px;
+	width: 165px;
 }
 .entinfo-basicinfo .entinfo-round>div>div>span:first-child{
 	background-color: #AEE7D6;
@@ -604,6 +615,7 @@ a:focus, a:hover{
 /********************关系网**********************/
 .entrelation{
 	position: relative;
+	height: inherit;
 }
 .entrelation svg{
 	position: relative;

+ 6 - 2
core/src/web/staticres/css/enterprise.css

@@ -103,7 +103,7 @@ h4 b {color: #999;}
 .tablediv .rowcontent{line-height: 25px;}
 .tablediv .rowcontent .one .icon_gray {font-size:18px; color: #999;width: 32px;}
 .tablediv .rowcontent .two .span999 {color: #999}
-#our .tablediv .rowcontent .two{width:80px; }
+#our .tablediv .rowcontent .two{width:85px; }
 #our .tablediv .rowcontent .twoshort{width:81px; word-spacing: 14px;letter-spacing: 13px;}
 #our .tablediv .rowcontent .three{word-wrap: break-word; word-break: break-all;position: relative;}
 #our .tablediv .rowcontent .four {left:50%;;position:absolute;}
@@ -259,6 +259,10 @@ form{margin-bottom: 0px;}
 
 
 /*========================后台企业名称编辑页========================*/
+.ent-LOGO{
+	max-height: 90px;
+	max-width: 90px;
+}
 #editent .tablediv{
 	margin-top:10px;
 	width:100%;
@@ -267,7 +271,7 @@ form{margin-bottom: 0px;}
 	width:32px;
 }
 #editent .two{
-	width:70px;
+	width:85px!important;
 }
 #editent .three .form-control{
 	display: inline;

+ 3 - 3
core/src/web/staticres/css/qfw.css

@@ -81,7 +81,7 @@ a.new_red:hover, a.new_red:active {
 }
 
 /*即时下拉样式*/
-#immediately div {
+.immediately div {
 	display: block;
 	margin: 0px;
 	margin-top: 5px;
@@ -90,11 +90,11 @@ a.new_red:hover, a.new_red:active {
 	cursor: pointer;
 }
 
-#immediately div:hover {
+.immediately div:hover {
 	background-color: #F0F0F0;
 }
 
-#immediately {
+.immediately {
 	text-align: left;
 	border: 1px solid #E5E5E5;
 	border-top: none;

+ 22 - 7
core/src/web/staticres/js/enterprise.js

@@ -34,7 +34,6 @@ function getCityN(code){
 
 
 function reloadData(obj,name){
-
 	name=name||obj.attr("name")
 	var val=(obj.attr("value")||obj.val());
 	if (val==0) val=""
@@ -148,15 +147,31 @@ $(function(){
 		}else{
 			reloadData($(this))	
 		}	
-	})
-	
+	});
+	//safari浏览器下会先触发chage后触发click
+	var selectReloadDataFlag = false;
+	var selectEvenType = null;
 	$("select[id^=c_]").click(function(){
-		cityMouse=this.id
+		cityMouse=this.id;
+		if(selectEvenType == null){
+			selectEvenType = "click";
+		}
+		if(selectEvenType == "change" && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
+		}
+		clickFlag = true;
 	}).change(function(){
-		if(this.id==cityMouse){
-			reloadData($(this),"city")			
+		if(selectEvenType == null){
+			selectEvenType = "change";
 		}
-	})	
+		if(clickFlag && this.id==cityMouse && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
+		}
+	});
 
 	//处理选择样式
 	$("div[id^=c_] li").click(function(){

+ 108 - 28
core/src/web/staticres/js/entportrait.js

@@ -1,9 +1,20 @@
 var entType = "企业";
-var relation = null;
-var serviceList = null;
-var dishonesty = null;
+var relationEntity = null;
+//var servicePaging = null;
+//var dishonestyPaging = null;
+var hasLoadPagingJs = false;
+var relationFlag = false;
+var identWayFlag = false;
 //解析服务列表
 $(function(){
+	//失信信息如果没有数据,选项卡不可点
+	if(dishonesty.count > 0){
+		DishonestyPaging();
+	}
+	//企业黄页如果没有数据,选项卡不可点
+	if(service.count > 0){
+		ServicePaging();
+	}
 	//右侧最新消息
 	$.post("/front/webcontent/getLatestNews",null,function(r){
 		var html = '<ul>';
@@ -13,6 +24,7 @@ $(function(){
 					+'</span><br><a href="/front/webcontent/'+r[i]._id+'.html">'+r[i].s_title+'</a></li>';
 		}
 		$(".newsInfo").html(html+'</ul><div class="clearfix"></div>');
+		$(".ent-tab-content.b-left").css("min-height",$(".b-right").height());
 	});
 	//主要人员
 	if(typeof(staffinfo) != "undefined" && staffinfo != null && staffinfo.length > 0){
@@ -51,6 +63,10 @@ $(function(){
 		var appendStaffinfo = function(obj,index){
 			var tmp = 0;
 			for(var i=0;i<obj.length;i++){
+				var positionName = obj[i].PositionName;
+				if(typeof(positionName) == "undefined" || positionName == null || positionName == ""){
+					positionName = "监事";
+				}
 				tmp++;
 				if(i==0){
 					hm+='<div class="staffinfo-level-'+index+'">';
@@ -60,7 +76,7 @@ $(function(){
 				}
 				verticalFlag = true;
 				hm+='<div><img src="/images/entcommunity/mainperson'+index+'.png">'
-					+'<span><font class="b-com-name">'+obj[i].Name+'</font><font class="ent-positionName">'+obj[i].PositionName+'</font></span></div>';
+					+'<span><font class="b-com-name">'+obj[i].Name+'</font><font class="ent-positionName">'+positionName+'</font></span></div>';
 				//竖线
 				if(tmp == maxCout && i != obj.length-1){
 					hm+='<a class="staffinfo-vertical"></a>';
@@ -113,19 +129,35 @@ $(function(){
 	});
 	//切换
 	$(".ent-tab>li").click(function(){
+		if($(this).hasClass("disabled")){
+			return;
+		}
+		var index = $(this).index();
 		$(".ent-tab>li").removeClass("ent-active");
 		$(this).addClass("ent-active");
 		$(".ent-tab-content>div").addClass("hide");
 		$(".ent-tab-content>div:eq("+$(this).index()+")").removeClass("hide");
-		if($(this).index() == 1){
+		if(index != 0){
+			//企业概况如果没有数据,选项卡不可点
+			if((!gs || typeof(gs) == "undefined" || gs == null || gs.length == 0) && (typeof(investor) == "undefined" || investor == null || investor.length == 0) && (typeof(OpScope) == "undefined" || OpScope == null || OpScope.length == 0)){
+				$(".ent-tab>li:eq(0)").addClass("disabled");
+			}
+		}
+		if(index != 1){
+			//关系网如果没有数据,选项卡不可点
+			if(relationFlag){
+				$(".ent-tab>li:eq(1)").addClass("disabled");
+			}
+		}
+		if(index == 1){
 			b_afterLogin();
-		}else if($(this).index() == 4 && dishonesty == null){
+		}/*else if($(this).index() == 4 && dishonestyPaging == null){
 			//加载服务列表
-			dishonesty = new Dishonesty();
-		}else if($(this).index() == 5 && serviceList == null){
+			dishonestyPaging = new DishonestyPaging();
+		}else if($(this).index() == 5 && servicePaging == null){
 			//加载服务列表
-			serviceList = new ServiceList();
-		}
+			servicePaging = new ServicePaging();
+		}*/
 	});
 	pcShare();
 });
@@ -151,24 +183,52 @@ function closeMap(){
 	document.getElementById('fade').style.display = 'none';
 	$("html,body").removeClass("overflow-hidden");
 }
-function b_afterLogin(flag){
-	if($(".ent-tab>li:eq(1)").hasClass("ent-active") && relation == null){
+function b_afterLogin(flag,result){
+	//关系网如果没有数据,选项卡不可点
+	if(typeof(result) != "undefined"){
+		identWayFlag = result.identWay == 1;
+	}
+	relationFlag = flag && identWayFlag && (relation == null || typeof(relation) == "undefined" || typeof(relation.links) == "undefined" || relation.links == null || relation.links.length == 0 || typeof(relation.nodes) == "undefined" || relation.nodes == null || relation.nodes.length <= 1);
+	if(!$(".ent-tab>li:eq(1)").hasClass("ent-active") && relationFlag){
+		$(".ent-tab>li:eq(1)").addClass("disabled");
+	}
+	if($(".ent-tab>li:eq(1)").hasClass("ent-active") && relationEntity == null){
 		initRelation();
 	}
 }
 //加载关系网
 function initRelation(){
 	if(isLogined){
-		if($("#entrelation-limit").hasClass("hide")){
-			$(".entrelation").height(500);
-		}
+		/*if($("#entrelation-limit").hasClass("hide")){
+			$(".entrelation").height($(".ent-tab-content").height());
+		}*/
 		var relationNoData = function(){
 			$("#entrelation-limit,#entrelation-nologin").addClass("hide");
-			relation = "";
+			relationEntity = "";
 			$("#entrelation-infovis").hide();
 			$("#entrelation-findnull").removeClass("hide");
 		}
-		$.ajax({
+		if(identWayFlag){
+			if(relationFlag){
+				relationNoData();
+			}else{
+				$("#entrelation-limit,#entrelation-nologin").addClass("hide");
+				$(".entrelation").height($(".ent-tab-content").height());
+				loadJS("/js/d3.v3.min.js",function(){
+					loadJS("/js/geometry.js",function(){
+						loadJS("/js/relation.js",function(){
+							relationEntity = new Relation(legcerNo,regNo,regCapCurName,relation);
+							relationEntity.init();
+						});
+					});
+				});
+			}
+		}else{
+			$("#entrelation-nologin").addClass("hide");
+			$("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
+			$("#entrelation-infovis").hide();
+		}
+		/*$.ajax({
 			url: "/member/getRelation",
 			method: "post",
 			data: {regNo:regNo,entName:entName},
@@ -185,8 +245,8 @@ function initRelation(){
 					loadJS("/js/d3.v3.min.js",function(){
 						loadJS("/js/geometry.js",function(){
 							loadJS("/js/relation.js",function(){
-								relation = new Relation(legcerNo,regNo,r.relation);
-								relation.init();
+								relationEntity = new Relation(legcerNo,regNo,regCapCurName,r.relation);
+								relationEntity.init();
 							});
 						});
 					});
@@ -197,15 +257,15 @@ function initRelation(){
 			error: function(){
 				relationNoData();
 			}
-		});
+		});*/
 	}else{
 		$("#entrelation-limit,#entrelation-nologin").removeClass("hide");
 	}
 }
 //服务列表
-function ServiceList(){
-	loadJS("/js/paging.js",function(){
-		new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},6,function(r){
+function ServicePaging(){
+	this.initServiceList = function(){
+		var paging = new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},service.pageSize,function(r){
 			if((typeof(synopsis) == "undefined" || synopsis == null || synopsis == "") && r.length == 0){
 				$(".ent-yellowpage .ent-findnull").removeClass("hide");
 				$(".ent-yellowpage .ent-layout-down").remove();
@@ -257,13 +317,23 @@ function ServiceList(){
 				}
 				$(this).html(text);
 			});
+		},service);
+		paging.firstPageDatas = null;
+	}
+	if(hasLoadPagingJs){
+		this.initServiceList();
+	}else{
+		var thisClass = this;
+		loadJS("/js/paging.js",function(){
+			hasLoadPagingJs = true;
+			thisClass.initServiceList();
 		});
-	});
+	}
 }
 //失信信息
-function Dishonesty(){
-	loadJS("/js/paging.js",function(){
-		new Paging("dishonestyListPaging","/front/getDishonesty",{legcerNo:legcerNo},1,function(r){
+function DishonestyPaging(){
+	this.initDishonesty = function(){
+		var paging = new Paging("dishonestyListPaging","/front/getDishonesty",{legcerNo:legcerNo},dishonesty.pageSize,function(r){
 			if(r.length == 0){
 				$(".ent-dishonesty .ent-findnull").removeClass("hide");
 				$(".ent-dishonesty .ent-layout-up").remove();
@@ -283,6 +353,16 @@ function Dishonesty(){
 			}
 			$("#dishonestyListPaging").parent().prevAll().remove();
 			$("#dishonestyListPaging").parent().before(html);
+		},dishonesty);
+		paging.firstPageDatas = null;
+	}
+	if(hasLoadPagingJs){
+		this.initDishonesty();
+	}else{
+		var thisClass = this;
+		loadJS("/js/paging.js",function(){
+			hasLoadPagingJs = true;
+			thisClass.initDishonesty();
 		});
-	});
+	}
 }

+ 25 - 8
core/src/web/staticres/js/marketlist.js

@@ -13,14 +13,31 @@ $(function() {
     setLocation(entsel);
   }
 
-  //点击,下拉时间
-  $("select[id^=c_]").click(function() {
-    cityMouse = this.id;
-  }).change(function() {
-    if (this.id == cityMouse) {
-      reloadData($(this), "city");
-    }
-  });
+    //点击,下拉时间
+    //safari浏览器下会先触发chage后触发click
+	var selectReloadDataFlag = false;
+	var selectEvenType = null;
+	$("select[id^=c_]").click(function(){
+		cityMouse=this.id;
+		if(selectEvenType == null){
+			selectEvenType = "click";
+		}
+		if(selectEvenType == "change" && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
+		}
+		clickFlag = true;
+	}).change(function(){
+		if(selectEvenType == null){
+			selectEvenType = "change";
+		}
+		if(clickFlag && this.id==cityMouse && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
+		}
+	});
 	$(".d_tj div").click(function(n){
 			var node=$(n.target);
 			if(!node.hasClass("d_zhpx")){

+ 19 - 7
core/src/web/staticres/js/paging.js

@@ -1,7 +1,8 @@
-var Paging = function(nodeid,url,datas,pageSize,callBack){
+var Paging = function(nodeid,url,datas,pageSize,callBack,firstPageDatas){
 	this.currentPage = 1;
 	this.totalPages = 0;
 	this.count = 0;
+	this.firstPageDatas = firstPageDatas;
 	//初始化
 	this.init = function(){
 		this.totalPages = parseInt((this.count + pageSize - 1) / pageSize);
@@ -36,6 +37,9 @@ var Paging = function(nodeid,url,datas,pageSize,callBack){
 			html += ' id="lastPage"><a>&raquo;</a></li></ul></nav>';
 			$("#"+nodeid).html(html);
 			var thisClass = this;
+			var getThisClass = function(){
+				return thisClass;
+			}
 			$("#"+nodeid+" #firstPage").click(function(){
 				if($(this).hasClass("disabled")){
 					return;
@@ -117,13 +121,21 @@ var Paging = function(nodeid,url,datas,pageSize,callBack){
 		datas["pageSize"] = pageSize;
 		datas["currentPage"] = this.currentPage;
 		var thisClass = this;
-		$.post(url,datas,function(r){
-			if(thisClass.totalPages == 0){
-				thisClass.count = r.count;
-				thisClass.init();
+		if(typeof(this.firstPageDatas) != "undefined" && this.firstPageDatas != null){
+			if(this.totalPages == 0){
+				this.count = this.firstPageDatas.count;
+				this.init();
 			}
-			callBack(r.list);
-		});
+			callBack(this.firstPageDatas.list);
+		}else{
+			$.post(url,datas,function(r){
+				if(thisClass.totalPages == 0){
+					thisClass.count = r.count;
+					thisClass.init();
+				}
+				callBack(r.list);
+			});
+		}
 	}
 	//是否有上一页
 	this.hasPrevPage = function(){

+ 11 - 4
core/src/web/staticres/js/qfw.js

@@ -203,16 +203,23 @@ $(function(){
 });
 
 function makeData(d,_this,b){
-	var s=$("#immediately")
+	var nodeId = "immediately";
+	if(_this.attr("name") == "entIndexSearch"){
+		nodeId += "_main";
+	}
+	var s=$("#"+nodeId);
 	var res=makeImmediately(d,b);
 	if(res){			
 		if(s.size()==0){
 			var w=_this[0].offsetWidth;
-			s=$("<div id='immediately' style='position:absolute;top:40px;display:none;z-index:9999;width:"+w+"px'/>")
+			s=$("<div id='"+nodeId+"' class='immediately' style='position:absolute;top:40px;display:none;z-index:9999;width:"+w+"px'/>")
 			s.appendTo(_this.parent())
 			_this.blur(function(event){
 				//$("#immediately").animate({opacity:"toggle"},700);
-			})
+			});
+			try{
+				immediatelyInitCallBack(_this);
+			}catch(e){}
 		}
 		s.html(res).show()
 	}else{
@@ -322,7 +329,7 @@ function webSiteInit(){
 		//设置用户用心左右布局
 		var memberLeft_marginLeft = 0;
 		if($(".member-content").length == 1 && $(".member-content>.member-left").length == 1 && $(".member-content>.member-right").length == 1){
-			$(".member-right").width($(".member-content").width() - 250 - 55);
+			$(".member-right").width($(".member-content").width() - 250 - 50);
 			if($(".member-content").children(".clearfix").length == 0){
 				$(".member-content").append('<div class="clearfix"></div>');
 			}

+ 14 - 4
core/src/web/staticres/js/relation.js

@@ -1,6 +1,7 @@
-function Relation(legcerNo,regNo,data){
+function Relation(legcerNo,regNo,regCapCurName,data){
 	this.legcerNo = legcerNo;
 	this.regNo = regNo;
+	this.regCapCurName = regCapCurName;
 	this.data = data;
 	this.modleFlag = data.nodes.length>15;
 	this.zoomlevel = 1;
@@ -154,6 +155,7 @@ Relation.prototype.dataProcess = function(){
 				this.index = i;
 				nodeObj["regcap"] = (typeof(d1) == "undefined")?0:d1;
 				nodeObj["legcerno"] = this.legcerNo;
+				nodeObj["regcapcurname"] = this.regCapCurName;
 			}
 		}
 	}
@@ -381,7 +383,7 @@ Relation.prototype.launchFullScreen = function(element) {
 }
 Relation.prototype.cancelFullScreen = function(){
 	this.h = $("#entrelation-infovis").height();  
-	$("#entrelation-fullscreen").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));	
+	$("#entrelation-fullscreen").text("全屏").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));	
 	//force.linkDistance(120).charge(-200).size([w,h]).resume();
 	$("#entrelation-infovis").css({width:this.w,height:this.h});
 	//设置svg标签的宽度与高度
@@ -406,7 +408,7 @@ Relation.prototype.initFullScreen = function(){
 		document.msFullscreenElement;
 	if(!fullscreenElement || fullscreenElement==null){
 		this.redrawflag = true;
-		$("#entrelation-fullscreen").attr("title","退出全屏视图 (F11)");
+		$("#entrelation-fullscreen").text("退出").attr("title","退出全屏视图 (F11)");
 		this.launchFullScreen(this.infovisdiv);
 		var timeout = 100;
 		if(!!window.ActiveXObject || "ActiveXObject" in window){
@@ -764,6 +766,9 @@ Relation.prototype.makeTitle = function(){
 				title = d.text;
 			}
 			var regcap = d.regcap;
+			if(d.type == "ce"){
+				console.info(d);
+			}
 			if(regcap > 0){
 				var lenRegcap = (regcap + "").length;
 				if(lenRegcap > 4 && (regcap + "").indexOf(".") > -1 && (lenRegcap - (regcap + "").indexOf(".")) > 4){
@@ -772,7 +777,12 @@ Relation.prototype.makeTitle = function(){
 				if(title != ""){
 					title += "\n";
 				}
-				title += "注册资本:"+regcap+"万元";
+				title += "注册资本:"+regcap+"万";
+				if(typeof(d.regcapcurname) == "undefined" || d.regcapcurname == null){
+					title += "元";
+				}else{
+					title += d.regcapcurname;
+				}
 			}
 			if(title != ""){
 				if($(this).children("title").length == 0){

+ 21 - 4
core/src/web/staticres/wxent/qfw-enterprise.js

@@ -148,13 +148,30 @@ $(function(){
 		}	
 	})
 	
+	//safari浏览器下会先触发chage后触发click
+	var selectReloadDataFlag = false;
+	var selectEvenType = null;
 	$("select[id^=c_]").click(function(){
-		cityMouse=this.id
+		cityMouse=this.id;
+		if(selectEvenType == null){
+			selectEvenType = "click";
+		}
+		if(selectEvenType == "change" && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
+		}
+		clickFlag = true;
 	}).change(function(){
-		if(this.id==cityMouse){
-			reloadData($(this),"city")			
+		if(selectEvenType == null){
+			selectEvenType = "change";
 		}
-	})	
+		if(clickFlag && this.id==cityMouse && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
+		}
+	});	
 
 	//处理选择样式
 	$("div[id^=c_] li").click(function(){

+ 21 - 4
core/src/web/staticres/wxent/qfw-frontenterprise.js

@@ -140,13 +140,30 @@ $(function(){
 		}	
 	})
 	
+	//safari浏览器下会先触发chage后触发click
+	var selectReloadDataFlag = false;
+	var selectEvenType = null;
 	$("select[id^=c_]").click(function(){
-		cityMouse=this.id
+		cityMouse=this.id;
+		if(selectEvenType == null){
+			selectEvenType = "click";
+		}
+		if(selectEvenType == "change" && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
+		}
+		clickFlag = true;
 	}).change(function(){
-		if(this.id==cityMouse){
-			reloadData($(this),"city")			
+		if(selectEvenType == null){
+			selectEvenType = "change";
+		}
+		if(clickFlag && this.id==cityMouse && !selectReloadDataFlag){
+			reloadData($(this),"city");
+			selectReloadDataFlag = true;
+			selectEvenType = null;
 		}
-	})	
+	});	
 
 	//处理选择样式
 	$("div[id^=c_] li").click(function(){

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

@@ -1,6 +1,6 @@
 {{$userTypeString := printf "%v" (session "userType")}}
 <!-- 底部 -->
-<div id="qfw-bottom">
+<div class="hidden-xs" id="qfw-bottom">
 	<ul class="hidden-xs bottom-bar" id="bottom-bar">
 		<li title="扫码登录"{{if or (session "userType") (eq $userTypeString "0")}} class="invisible"{{end}}><img src="/images/bottom-weixin.png"></li>
 		<li title="联系客服"{{if eq $userTypeString "0"}} class="invisible"{{end}}><a href="http://wpa.qq.com/msgrd?v=3&amp;uin=3240709056&amp;site=qq&amp;menu=yes"><img src="/images/bottom-qq.png"></a></li>
@@ -16,7 +16,7 @@
 		</div>
 	</div>
 </div>
-<div id="testBottom"></div>
+<div class="hidden-xs" id="testBottom"></div>
 <div class="hidden">
 <script>
 var _hmt = _hmt || [];

+ 1 - 1
core/src/web/templates/common/centerhead.html

@@ -9,7 +9,7 @@
 	background-color: #FF5A5F;
 }
 .a-content{
-	margin-top:20px;
+	margin-top:10px;
 }
 .b-head .head-hidemenu li:hover {
     background-color: #FF5A5F;

+ 10 - 5
core/src/web/templates/common/enthead.html

@@ -57,12 +57,10 @@ $(function (){
 		imFind(this)
 	}).focus(function(){
 		imFind(this)
-	})
-	$("body").mouseout(function(e){
-		e=e||window.event
-		if(e.target == this){
+	}).blur(function(){
+		setTimeout(function(){
 			$("#immediately").hide();
-		}
+		},500);
 	});
 });
 function scrollUp(id){
@@ -96,4 +94,11 @@ function scrollUp(id){
 		});
 	}
 }
+function immediatelyInitCallBack(obj){
+	if(obj.attr("id") == "header-searchInput"){
+		$("#immediately").css({width:$("#immediately").width()-30,"left":"15px","top":"38px"});
+	}else if(obj.attr("name") == "entIndexSearch"){
+		$("#immediately_main").css("top","45");
+	}
+}
 </script>

+ 1 - 1
core/src/web/templates/common/head.html

@@ -12,7 +12,7 @@
 		       	<ul class="text-center" id="head-navbar-ul">
 			        <li><img src="/images/nav-fwsc.png" class="visible-xs-inline"><a href="/market/0/list.html">服务市场</a></li>
 					<li class="hidden-xs"><img src="/images/nav-jy.png" class="visible-xs-inline"><a href="/front/swordfish">剑鱼</a></li>
-		            <li><img src="/images/nav-qysq.png" class="visible-xs-inline"><a href="/search/enterprise/ent.html">企业社区</a></li>
+		            <li><img src="/images/nav-qysq.png" class="visible-xs-inline"><a href="/front/entCommunity.html">企业社区</a></li>
 		            <li><img src="/images/nav-zcfg.png" class="visible-xs-inline"><a href="/front/content_zcfg_list.html">政策法规</a></li>
 		            <li><img src="/images/nav-xwzx.png" class="visible-xs-inline"><a href="/front/content_qykb_list.html">新闻资讯</a></li>
 					<li class="hidden-xs"><img src="/images/nav-wgw.png" class="visible-xs-inline"><a href="/front/wsite.html">微官网</a></li>

+ 1 - 1
core/src/web/templates/common/indexhead.html

@@ -1,5 +1,5 @@
 <!---->
-<div class="index-new-head b-head">
+<div class="index-new-head b-head hidden-xs">
 	{{include "/common/top.html"}}
 	<div class="b-nav index-new-nva">
 		<ul>

+ 7 - 7
core/src/web/templates/common/memberleft.html

@@ -84,7 +84,7 @@
 	color:#0099FA;
 }
 .list-group .list-group-item {
-	border:0px;
+	border: 0px;
     font-size: 14px;
     color: #666666;
 	padding: 10px 0px 10px 70px;
@@ -131,15 +131,15 @@ a.list-group-item:hover{
 			</div>
 		</div>
 	</a>
-	<a class="list-group-item" style="padding:5px 2px;">
-	<div style="line-height: 40px;width:248px;height:50px;text-align:center;">
+	<a class="list-group-item" style="padding:5px 2px;border-top:1px solid #E5E6E9;">
+	<div style="line-height: 24px;width:248px;height:50px;text-align:center;">
 		<div onclick="creditModel(1)" style="float:left;width:120px;border-right:1px;">
-<!--			<div style="font-size: 12px;">积分</div>-->
-			<div><i class="glyphicon jinbi" style="width:20px;color:red;font-size:13px;margin-top: -7px;vertical-align: middle;"></i><span style="font-weight:700;font-size:16px;color:#FF5A5F;" class="gold">{{session "i_credit"}}</span><span class="font-size-12" style="color:#999999;"> 积分</span></div>
+			<div style="font-weight: 700;">积分</div>
+			<div><i class="glyphicon jinbi" style="width:20px;color:red;font-size:13px;margin-top: -7px;vertical-align: middle;"></i><span style="font-weight:normal;" class="gold">{{session "i_credit"}}</span><span class="font-size-12 hidden" style="color:#999999;"> 积分</span></div>
 		</div>
-		<div style="height:40px;float:left;width:1px;background-color:#e5e6e9"></div>
+		<div style="height:50px;float:left;width:1px;background-color:#e5e6e9"></div>
 		<div onclick="window.location.href='/member/accountset/index'" style="float:left;width:125px;">
-<!--			<div style="font-size: 12px;">认证</div>-->
+			<div style="font-weight: 700;">认证</div>
 			<div>
 			{{if session "identType"}}
 				{{$identType := session "identType"}}

+ 73 - 0
core/src/web/templates/common/wsitehead.html

@@ -0,0 +1,73 @@
+<!---->
+<div class="index-new-head b-head">
+	{{include "/common/top.html"}}
+	<div class="b-nav index-new-nva">
+		<ul>
+			<li class="b-nav-logo"><a href="/"><img src="/images/logo.png" class="logo"></a></li>
+			<li class="b-nav-link b-nav-main"><a href="/front/content_qykb_list.html">微官网</a></li>
+			
+			<li class="b-h-search hidden">
+				<div class="input-group">
+			        <div class="input-group-btn hide">
+			        	<button type="button" id="header-searchBtn" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><font>服务</font><span class="hide caret margin-l-10"></span></button>
+			        </div> <!--/btn-group -->
+					<form method="post" id="searchForm" action="/front/content_qykb_list.html">
+						<span id="searchFormBtn"><i class="glyphicon sousuo"></i></span>
+				        <input type="text" name="query" class="form-control" id="header-searchInput" placeholder="找新闻资讯" value="{{if .T.querymap}}{{index .T.querymap "query"}}{{end}}">
+						{{if .T.querymap}}
+						<input type="hidden" name="city" id="city" value="{{index .T.querymap "city"}}">
+						<input type="hidden" name="cityNo" id="cityNo" value="{{index .T.querymap "cityNo"}}">
+						<input type="hidden" name="c_author" id="hauthor" value="{{index .T.querymap "c_author"}}">
+						<input type="hidden" name="c_hfl" id="hfl" value="{{index .T.querymap "c_hfl"}}">
+						<input type="hidden" name="c_zb" id="zb" value="{{index .T.querymap "c_zb"}}">
+						{{end}}
+					</form>
+	       		</div><!-- /input-group -->
+			</li>
+			<li class="pull-right b-loginStatus" id="b-loginStatus"></li>
+		</ul>
+	</div>
+</div>
+<script type="text/javascript">
+//顶部是否加载完毕
+var topLoadOver = false;
+var keyCode=0;
+document.onkeydown=function(event){
+    var e = event || window.event || arguments.callee.caller.arguments[0];
+    if(e && e.keyCode==13){ // enter 键
+        keyCode=13
+    }
+};
+
+$(function (){
+	isMobile = !$("#b-loginStatus").is(":visible");
+	$("#searchFormBtn").click(function(){
+		keyCode = 13;
+		$("form#searchForm").submit();
+	});
+	$("form#searchForm").submit(function(){
+		var input_val = $(this).children("[type='text']").val().replace(/^\s+|\s+$/g,"");
+		if(input_val==""){
+			input_val = $("#header-searchInput").attr('placeholder');
+		}
+		if (keyCode==13){
+	 		if(input_val==""||input_val=="请输入关键字"){
+				keyCode=0;
+				return false;
+			}else {
+				$("input[name='words']").val(input_val);
+				keyCode=0;
+				return true;
+			}	
+		}
+	});
+	//
+	$("[id='releaseService']").click(function(){
+		if(isLogined){
+			window.location.href = "/front/reurl";
+		}else{
+			loginModalShow(6);
+		}
+	});
+});
+</script>

+ 24 - 2
core/src/web/templates/index.html

@@ -9,8 +9,30 @@
 <script src="/js/jquery.lazyload.min.js"></script>
 </head>
 <body>
+
+<!---->
+<div class="index-new-head b-head visible-xs">
+	<div style="height:25px;width:100%;background-color:#000;"></div>
+	<div class="b-nav index-new-nva">
+		<ul style="margin-left:15px;">
+			<li class="b-nav-logo index-new-nva-l"><a href="/"><img src="/images/logo.png" class="logo"></a></li>
+			
+		</ul>
+	</div>
+</div>
+<div class="text-center visible-xs" style="margin:40px 20px 20px 20px">
+	<div>
+	 	<p>企明星为了用户有更好的使用体验,</p>
+		<p>已成功把各项功能移植到</p>
+		<p>关注企明星公众号:</p>
+		<p>qmx-cn</p>
+		<p>或扫描二维码</p>
+	</div>
+	<div><img src="/images/u109.png"></div>
+</div>
+
 {{include "/common/indexhead.html"}}
-<div class="a-content a-index">	
+<div class="a-content a-index hidden-xs">	
 	<div class="a-index-head index-new-head">
 		<div class="a-i-h-left hidden-xs index-new-left">
 			<div class="text-center">全部服务分类</div>
@@ -146,7 +168,7 @@
 	</div>
 	-->
 	<div class="a-panel a-qysq">
-		<div class="a-com-title text-center index-new-title"><font><a target="_blank" href="/search/enterprise/ent.html">企业社区</a></font><br/><span class="hidden-xs">官方数据来源,提供详尽企业信息,及时掌握企业社会关系情报</span></div>
+		<div class="a-com-title text-center index-new-title"><font><a target="_blank" href="/front/entCommunity.html">企业社区</a></font><br/><span class="hidden-xs">官方数据来源,提供详尽企业信息,及时掌握企业社会关系情报</span></div>
 		<div class="row index-new-qysq-con text-center">
 			<div id="myCarousel" class="carousel slide" style="height:300px;">  
 			   <!-- 轮播(Carousel)项目 -->

+ 1 - 1
core/src/web/templates/manage/ad/addad.html

@@ -78,7 +78,7 @@ background-color:#FFFFFF;
 		
 	</div>
 </div>
-<div id="upload"></div>
+<div id="upload" style="display: none;"></div>
 {{include "/common/bottom.html"}}
 <style>
 .sonad{

+ 3 - 0
core/src/web/templates/manage/webexpresscontent-new.html

@@ -283,10 +283,13 @@ $(document).ready(function(){
 	}
 function change(i){
 	if (i==1){
+		$(".newscontent span").css("font-size","22px");
 		$(".newscontent").css("font-size","22px");
 	}else if (i==2){
+		$(".newscontent span").css("font-size","18px");
 		$(".newscontent").css("font-size","18px");
 	}else if (i==3){
+		$(".newscontent span").css("font-size","14px");
 		$(".newscontent").css("font-size","14px");
 	}
 	

+ 7 - 17
core/src/web/templates/member/accountset/index.html

@@ -88,16 +88,6 @@ $(function(){
 			$(".member-right").append(html);
 		}
 	}
-	var upLoadType = "LOGO";
-	var updateHeadImg = "#uploadImg";
-	//控制管理员上传头像作为企业logo
-	if(role == "" || /^[9]$/.test(role)){
-		updateHeadImg += ",.previewPic90,.previewPic60";
-	}else{
-		upLoadType = "头像";
-		$("#upLoadHeadImgText").text(upLoadType+":");
-		$("#entLogoArea").remove();
-	}
 	//
 	var s_avatar = "{{.T.s_avatar}}";
 	var headImg = '{{session "headImg"}}';
@@ -123,11 +113,11 @@ $(function(){
 	$("#uploadImg").html('<img class="img-circle'+addClass+'" src="'+s_avatar+'" onerror="'+addJs+'this.src=\''+errorImageUrl+'\'">');
 	//
 	var option={
-		btnname:"上传"+upLoadType,
+		btnname:"上传头像",
 		action:"/filemanage/upload",
 		btnClass:"",
 		afterError:function(data,e){
-			alert("上传"+upLoadType+"失败,请重新上传。");
+			alert("上传头像失败,请重新上传。");
 		},
 		afterUpload:function(data){ //此处可以重写,上传后的处理
 			if(data.flag == true){
@@ -139,13 +129,13 @@ $(function(){
 				  	success: function(result){
 						if (result == "y"){
 							$("#member_headImg").html("<img class='img-circle' src='"+data.url+"'>");
-							$(updateHeadImg).html("<img class='img-circle' src='"+data.url+"'>");
+							$("#uploadImg,.previewPic90,.previewPic60").html("<img class='img-circle' src='"+data.url+"'>");
 						}else{
-							alert("上传"+upLoadType+"失败,请重新上传。");
+							alert("上传头像失败,请重新上传。");
 						}
 					},
 					error: function(){
-						alert("上传"+upLoadType+"失败,请重新上传。");
+						alert("上传头像失败,请重新上传。");
 					}
 				});
 			}else{
@@ -309,7 +299,7 @@ function editInfoComplate(obj,type){
 					</td>
 				</tr>
 				<tr>
-					<td align="right"><b id="upLoadHeadImgText">LOGO:</b></td>
+					<td align="right"><b id="upLoadHeadImgText">头像:</b></td>
 					<td>
 						<div id="uploadImg" style="display: inline-block;width: 160px;">
 							
@@ -324,7 +314,7 @@ function editInfoComplate(obj,type){
 					<td></td>
 					<td colspan="2">
 						<div style="padding: 10px 30px;width: 535px;height: 180px;background-color: #F0F0F0;">
-							<div>你上传的logo将会生成2种头像尺寸,在企业黄页中做为你的企业头像使用:</div>
+							<div>你上传的头像将会生成2种头像尺寸:</div>
 							<div style="margin-top: 10px;margin-right: 40px;display: inline-block;">
 								<div class="previewPic90">
 									<img alt="" class="img-circle defaultHeadImg" src="/images/image_radius_bg.png">

+ 97 - 45
core/src/web/templates/member/editenterprise.html

@@ -74,7 +74,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon lianxiren icon_gray"></span></div> 
-						<div class="two" style="letter-spacing: 5px;">联系人:</div> 
+						<div class="two" style="letter-spacing: 4.5px;">联系人&nbsp;:</div> 
 						<div class="three">
 						<input type="text" id="s_persion" name="s_persion" class="form-control"  value="{{.T.entinfo.s_persion}}"  datatype="*" maxlength="30" nullmsg="请输入联系人 " errormsg="请输入联系人 "></div>
 					<div class="four" > <span class="Validform_checktip">请输入联系人</span></div>
@@ -84,7 +84,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon lianxidianhua icon_gray"></span></div> 
-						<div class="two">联系方式:</div> 
+						<div class="two">联系方式&nbsp;&nbsp;:</div> 
 						<div class="three"><input type="text" name="s_mobile" class="form-control" id="Tel" value="{{.T.entinfo.s_mobile}}"  maxlength="21" ignore="ignore" datatype="m" nullmsg="请输入手机号码" errormsg="手机号码格式错误" ></div> 
 						<div class="four" > <span class="Validform_checktip"></span></div>
 					</div> 
@@ -93,16 +93,35 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon wangzhi icon_gray"></span></div> 
-						<div class="two"><script>document.write(entType)</script>网站:</div> 
+						<div class="two"><script>document.write(entType)</script>网站&nbsp;&nbsp;:</div> 
 						<div class="three"><input type="text" name="s_enturl" class="form-control" id="s_enturl" value="{{.T.entinfo.s_enturl}}" ignore="ignore" datatype="url" nullmsg="请输入企业网站" errormsg="企业网站格式错误"></div> 
 						<div class="four" > <span class="Validform_checktip"></span></div>
 					</div> 
 				</div>
 				
+				<div class="tablediv"> 
+					<div class="rowcontent"> 
+						<div class="one"><span class="glyphicon tupian icon_gray"></span></div> 
+						<div class="two"><script>document.write(entType)</script>LOGO:</div> 
+						<div class="three" id="logoArea">
+							{{if .T.entinfo.s_avatar}}
+							<img class='ent-LOGO cursor-pointer' src='{{.T.entinfo.s_avatar}}' onerror="$(this).next().removeClass('hide');$(this).remove();" onclick="document.getElementById('upload').click();">
+							{{end}}
+							<div{{if .T.entinfo.s_avatar}} class="hide"{{end}}>
+								<img src="/images/services/default.png" style="width: 90px; height: 90px;cursor: pointer;" onclick="document.getElementById('upload').click();">
+								<div id="tips" style="cursor: pointer;text-align: center; width: 90px; position: absolute; color: #fff; top: 64px; background-color: #cccccc;"  onclick="document.getElementById('upload').click();">上传logo</div>
+								<span class="margin-l-10" style="position: relative;top: 33px;">上传一张不超过10M的图片,支持jpg、png、bmp格式。建议尺寸260*260像素</span>
+							</div>
+						</div> 
+						<div class="four"></div>
+						<div id="uploadLogo" class="hide"></div>
+					</div> 
+				</div>
+				
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon qq icon_gray"></span></div> 
-						<div class="two">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Q&nbsp;Q:</div> 
+						<div class="two">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Q&nbsp;Q&nbsp;&nbsp;&nbsp;:</div> 
 						<div class="three"><input type="text" name="s_qq" class="form-control" id="s_qq" value="{{.T.entinfo.s_qq}}" maxlength="30"></div> 
 						<div class="four" > <span class="Validform_checktip"></span></div>
 					</div> 
@@ -111,7 +130,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon weixinhao icon_gray"></span></div> 
-						<div class="two" style="letter-spacing: 5px;">微信号:</div> 
+						<div class="two" style="letter-spacing: 4.5px;">微信号&nbsp;:</div> 
 						<div class="three" id="mblocation"><input type="text" name="s_weixin" class="form-control" id="s_weixin" value="{{.T.entinfo.s_weixin}}" maxlength="20">
 						 <a href="#" class="text-primary "  onClick="uploadBarCode();">上传二维码</a>
 						 <img class="imgs barcode" alt="预览" name="imgurl" style="margin-left:10px;width:35px;height:35px;" src="{{.T.entinfo.s_weixinbarcode}}">
@@ -127,7 +146,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon lianxidizhi icon_gray"></span></div> 
-						<div class="two">联系地址:</div>
+						<div class="two">联系地址&nbsp;&nbsp;:</div>
 						<div class="three">
 							<span id="city_china">
 							<select  class="province cxselect select-control" name="province" data-first-title="全国"></select>
@@ -142,7 +161,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one" style="vertical-align: top;"><span class="glyphicon falvshengming icon_gray"></span> </div> 
-						<div class="two" style="vertical-align: top;"><script>document.write(entType)</script>介绍:</div> 
+						<div class="two" style="vertical-align: top;"><script>document.write(entType)</script>介绍&nbsp;&nbsp;:</div> 
 						<div class="three">
 							<textarea class="form-control" rows="3" id="s_synopsis" name="s_synopsis">{{.T.entinfo.s_synopsis}}</textarea>
 					
@@ -194,45 +213,78 @@ var entType="企业"
 </body>
 
 <script>
-
-	       //
-			$("#s_persion").blur(function(){
-				var str = $("#s_persion").val();
-				if (str == ""){
-			    $("#s_persion").parent().next().children().css("display","inline");
-			    $("#s_persion").parent().next().css("display","inline");
-				}else{
-			    $("#s_persion").parent().next().css("display","none");
-				}
-			  });
-			$("#s_enturl").blur(function(){
-				var str = $("#s_enturl").val();
-				if (str == ""){
-			    $("#s_enturl").parent().next().css("display","inline");
-			    $("#s_enturl").parent().next().css("display","none");
-				}else if ($("#s_enturl").val().length>0&& $("#s_enturl").val().indexOf(".")==-1){
-			    $("#s_enturl").parent().next().css("display","inline");
-			    $("#s_enturl").parent().next().children().css("display","inline").html("公司网站格式错误");
-				}else{
-			    $("#s_enturl").parent().next().css("display","none");
+//
+var option={
+	btnname:"",
+	action:"/filemanage/upload",
+	btnClass:"",
+	afterError:function(data,e){
+		alert("上传LOGO失败,请重新上传。");
+	},
+	afterUpload:function(data){ //此处可以重写,上传后的处理
+		if(data.flag == true){
+			$.ajax({
+			  	type: "POST",
+			  	url: "/member/yellowpage/updateEntLogo",
+			  	data: "url="+data.url,
+			 	dataType: "text",
+			  	success: function(result){
+					if (result == "y"){
+						$("#logoArea").html("<img class='ent-LOGO' src='"+data.url+"'>");
+					}else{
+						alert("上传LOGO失败,请重新上传。");
+					}
+				},
+				error: function(){
+					alert("上传LOGO失败,请重新上传。");
 				}
-			  });
-			/**
-			$("#Tel").blur(function(){	
-				var str = $("#Tel").val();
-				var telReg = !!str.match(/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/);
-				if (str == ""){
-			    $("#Tel").parent().next().css("display","inline");
-			    $("#Tel").parent().next().children().css("display","none");
-				}else if(telReg == false){
-			    $("#Tel").parent().next().css("display","inline");
-			    $("#Tel").parent().next().children().css("display","inline").html("手机号码格式错误");
-				}else{
-			    $("#Tel").parent().next().css("display","none");
-				}
-			  });
-			**/
-			//
+			});
+		}else{
+			alert(data.msg)
+		}
+ 	}
+};
+try{
+	$("#uploadLogo").upload(option);
+}catch(e){}
+     //
+$("#s_persion").blur(function(){
+	var str = $("#s_persion").val();
+	if (str == ""){
+    $("#s_persion").parent().next().children().css("display","inline");
+    $("#s_persion").parent().next().css("display","inline");
+	}else{
+    $("#s_persion").parent().next().css("display","none");
+	}
+  });
+$("#s_enturl").blur(function(){
+	var str = $("#s_enturl").val();
+	if (str == ""){
+    $("#s_enturl").parent().next().css("display","inline");
+    $("#s_enturl").parent().next().css("display","none");
+	}else if ($("#s_enturl").val().length>0&& $("#s_enturl").val().indexOf(".")==-1){
+    $("#s_enturl").parent().next().css("display","inline");
+    $("#s_enturl").parent().next().children().css("display","inline").html("公司网站格式错误");
+	}else{
+    $("#s_enturl").parent().next().css("display","none");
+	}
+  });
+/**
+$("#Tel").blur(function(){	
+	var str = $("#Tel").val();
+	var telReg = !!str.match(/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/);
+	if (str == ""){
+    $("#Tel").parent().next().css("display","inline");
+    $("#Tel").parent().next().children().css("display","none");
+	}else if(telReg == false){
+    $("#Tel").parent().next().css("display","inline");
+    $("#Tel").parent().next().children().css("display","inline").html("手机号码格式错误");
+	}else{
+    $("#Tel").parent().next().css("display","none");
+	}
+  });
+**/
+//
 function btnSaveForm(){
 		//表单验证
 	var validForm = bindValidForm({

+ 2 - 2
core/src/web/templates/member/editservice.html

@@ -362,9 +362,9 @@ function initSecondServiceType(firstsertype){
 <script>
    window.onload=function(){limouseover();}
 	if ($("#isshow_checked3").is(":checked")) {  
-		$("#serviecetype").addClass("hidden");
-	}else{
 		$("#serviecetype").removeClass("hidden");
+	}else{
+		$("#serviecetype").addClass("hidden");
 	};
 	$("#isshow_checked3").click(function(){
 		if ($("#isshow_checked3").is(":checked")) {  

+ 29 - 2
core/src/web/templates/member/microwebsite.html

@@ -44,11 +44,38 @@
 .selected{
 	border: 2px #dd4814 solid !important;
 }
+.b-nav {
+    border-top-color: #FFB200;
+}
+.b-head .b-com-four {
+    background-color: #FFB200;
+}
+body{
+	background-color:#F0F0F0;
+}
+.a-content{
+	margin-top:10px;
+}
+.b-round-dot {
+    background-color: #FFB200;
+}
+.b-head .head-hidemenu li:hover {
+    background-color: #FFB200;
+}
+.b-head .head-hidemenu li:hover .b-round-dot {
+    background-color: rgb(255, 255, 255);
+}
+.index-new-head .head-hidemenu i {
+    color: #FFB200;
+}
+.b-nav-main {
+    background-color: #FFB200;
+}
 </style>
 </head>
 <body>
 <!-- 头部 -->
-{{include "/common/head.html"}}
+{{include "/common/wsitehead.html"}}
 <!-- 中间 -->
 <div class="a-content">
 	<div class="panel panel-default">
@@ -99,7 +126,7 @@
 loginBackType = 1;
 var isPreview = "{{.T.isPreview}}" == "true";
 $(function(){
-	setNavbarActive(5);
+	//setNavbarActive(5);
 	if(!isPreview){
 		$(".step-1 span").each(function(){
 			if($(this).attr("value") == "{{.T.s_microwebsite}}"){

+ 16 - 7
core/src/web/templates/member/showenterprise.html

@@ -89,7 +89,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon lianxiren icon_gray"></span></div> 
-						<div class="two" style="letter-spacing: 5px;">联系人:</div> 
+						<div class="two" style="letter-spacing: 4.5px;">联系人&nbsp;:</div> 
 						<div class="three"><span class="span999">{{.T.entinfo.s_persion}}</span></div>
 					</div> 
 				</div>
@@ -98,7 +98,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon lianxidianhua icon_gray"></span></div> 
-						<div class="two">联系电话:</div> 
+						<div class="two">联系电话&nbsp;&nbsp;:</div> 
 						<div class="three"><span class="span999">{{.T.entinfo.s_mobile}}</span></div>
 					</div> 
 				</div>
@@ -107,16 +107,25 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon wangzhi icon_gray"></span></div> 
-						<div class="two"><script>document.write(entType)</script>网站:</div> 
+						<div class="two"><script>document.write(entType)</script>网站&nbsp;&nbsp;:</div> 
 						<div class="three"><span class="span999">{{.T.entinfo.s_enturl}}</span></div>
 					</div> 
 				</div>
 				{{end}}
+				{{if .T.entinfo.s_avatar }}
+				<div class="tablediv"> 
+					<div class="rowcontent"> 
+						<div class="one"><span class="glyphicon tupian icon_gray"></span></div> 
+						<div class="two"><script>document.write(entType)</script>LOGO:</div> 
+						<div class="three"><img src="{{.T.entinfo.s_avatar}}" class="ent-LOGO" onerror="$(this).parents('.tablediv').remove();$(this).remove();"></div>
+					</div> 
+				</div>
+				{{end}}
 				{{if .T.entinfo.s_qq }}
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon qq icon_gray"></span></div> 
-						<div class="two">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Q&nbsp;Q:</div> 
+						<div class="two">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Q&nbsp;Q&nbsp;&nbsp;&nbsp;:</div> 
 						<div class="three"><span class="span999">{{.T.entinfo.s_qq}}</span></div>
 					</div> 
 				</div>
@@ -125,7 +134,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon weixinhao icon_gray"></span></div> 
-						<div class="two" style="letter-spacing: 5px;">微信号:</div> 
+						<div class="two" style="letter-spacing: 4.5px;">微信号&nbsp;:</div> 
 						<div class="three"><span class="span999">{{.T.entinfo.s_weixin}}</span> 
 						{{if .T.entinfo.s_weixinbarcode}}
 						&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" class="text-primary " onClick="viewBarCode({{.T.entinfo.s_weixinbarcode}});">扫一扫</a>
@@ -138,7 +147,7 @@ var entType="企业"
 				<div class="tablediv"> 
 					<div class="rowcontent"> 
 						<div class="one"><span class="glyphicon lianxidizhi icon_gray"></span></div> 
-						<div class="two">联系地址:</div> 
+						<div class="two">联系地址&nbsp;&nbsp;:</div> 
 						<div class="three">
 							<span class="span999" id="city_china">
 								<select  class="province cxselect select" id="provincesel" name="province" data-first-title="全国"></select>								
@@ -163,7 +172,7 @@ var entType="企业"
 					<div class="tablediv"> 
 						<div class="rowcontent"> 
 							<div class="one" style="vertical-align: top;"><span class="glyphicon falvshengming icon_gray"></span> </div> 
-							<div class="two" style="vertical-align: top;"><script>document.write(entType)</script>介绍:</div> 
+							<div class="two" style="vertical-align: top;"><script>document.write(entType)</script>介绍&nbsp;&nbsp;:</div> 
 							<div class="three">{{.T.entinfo.s_synopsis}}</div>
 						</div> 
 					</div>

+ 44 - 27
core/src/web/templates/search/entcommunity.html

@@ -53,6 +53,16 @@
 {{include "/common/bottom.html"}}
 <script>
 $(function(){
+	//设置即时下拉
+	$("input[name='entIndexSearch']").attr("autocomplete","off").keyup(function(){
+		imFind(this)
+	}).focus(function(){
+		imFind(this)
+	}).blur(function(){
+		setTimeout(function(){
+			$("#immediately_main").hide();
+		},500);
+	});
 	$("#search-btn").click(function(){
 		$("input[name='words']").val($("input[name='entIndexSearch']").val());
 		$("form#searchForm").submit();
@@ -61,39 +71,46 @@ $(function(){
 		$("input[name='words']").val($(this).text());
 		$("form#searchForm").submit();
 	});
-	scrollUp("newIndentEnts");
 	var ents = {{Ad "ent-recommend" 48}};
-	var tmp = 0;
-	var olCount = 0;
-	var html = '';
-	var olHtml = '<ol class="carousel-indicators">';
-	for(var i=0;i<ents.length;i++){
-		if(tmp == 0){
-			olHtml += '<li data-target="#carousel-example-generic" data-slide-to="'+olCount+'"';
-			if(olCount == 0){
-				olHtml += ' class="active"';
+	if(typeof(ents) != "undefined" && ents != null && ents.length > 0){
+		var tmp = 0;
+		var olCount = 0;
+		var html = '';
+		var olHtml = '<ol class="carousel-indicators">';
+		for(var i=0;i<ents.length;i++){
+			if(tmp == 0){
+				olHtml += '<li data-target="#carousel-example-generic" data-slide-to="'+olCount+'"';
+				if(olCount == 0){
+					olHtml += ' class="active"';
+				}
+				olHtml += '><img src="/images/entcommunity/left.png"></li>';
+				olCount++;
 			}
-			olHtml += '><img src="/images/entcommunity/left.png"></li>';
-			olCount++;
-		}
-		tmp++;
-		if(tmp == 1){
-			html += '<div class="item';
-			if(i == 0){
-				html += ' active';
+			tmp++;
+			if(tmp == 1){
+				html += '<div class="item';
+				if(i == 0){
+					html += ' active';
+				}
+			    html += '"><ul>';
+			}
+			html += '<li>'
+						+'<img src="'+ents[i].s_pic+'" onerror="this.src=\'/images/ent-logo.png\'">'
+						+'<a href="/enterprise/'+ents[i].s_id+'.html">'+ents[i].s_remark+'</a>'
+					+'</li>';
+			if(tmp == 8 || i == ents.length-1){
+				tmp = 0;
+				html += '</ul><div class="clearfix"></div></div>';
 			}
-		    html += '"><ul>';
 		}
-		html += '<li>'
-					+'<img src="'+ents[i].s_pic+'" onerror="this.src=\'/images/ent-logo.png\'">'
-					+'<a href="/enterprise/'+ents[i].s_id+'.html">'+ents[i].s_remark+'</a>'
-				+'</li>';
-		if(tmp == 8 || i == ents.length-1){
-			tmp = 0;
-			html += '</ul><div class="clearfix"></div></div>';
+		$(".ent-index-recommend .carousel-inner").html(html);
+		if(olCount > 1){
+			$(".ent-index-recommend .carousel-inner").after(olHtml+'</ol>');
+			$(".ent-indexpage .carousel").height(320);
 		}
 	}
-	$(".ent-index-recommend .carousel-inner").html(html).after(olHtml+'</ol>');
+	$(".ent-indexpage .b-scroll-list .b-adver-content").css("max-height",$(".b-left").height() - 41);
+	scrollUp("newIndentEnts");
 });
 </script>
 </body>

+ 3 - 3
core/src/web/templates/search/enterpriseList.html

@@ -50,7 +50,7 @@
 				{{range $k,$v:=.T.data}}
 					<div class="borderB">
 						<div class="qfw-entcontent-padding">
-							<img src="/images/ent-logo.png">
+							<img src="{{if index $v "s_avatar"}}{{index $v "s_avatar"}}{{else}}null{{end}}" onerror="this.src='/images/ent-logo.png'">
 							<div>
 								<div class="lineb " >
 									<a target="_blank" href="/enterprise/{{index $v "_id"}}.html"><b>
@@ -116,7 +116,7 @@
 										{{end}}
 										{{if index $v "RegCap"}}
 											{{if and (ne $v.RegCapEntType "9600") (ne $v.RegCapEntType "5810")}}
-												<span class="margin-l-15"><font class="b-disabled">注册资本:</font><font  class="lineb " ><script>var d1={{$v.RegCap}};d1=d1?d1:0; var lenD1=(d1+"").length ;if(lenD1>4&&(d1+"").indexOf(".")>-1&&(lenD1-(d1+"").indexOf("."))>4){document.write(d1.toFixed(4))}else{document.write(d1)}</script>万元</font></span>
+												<span class="margin-l-15"><font class="b-disabled">注册资本:</font><font  class="lineb " ><script>var d1={{$v.RegCap}};d1=d1?d1:0; var lenD1=(d1+"").length ;if(lenD1>4&&(d1+"").indexOf(".")>-1&&(lenD1-(d1+"").indexOf("."))>4){document.write(d1.toFixed(4))}else{document.write(d1)}</script>万{{if $v.RegCapCurName}}{{$v.RegCapCurName}}{{else}}{{end}}</font></span>
 											{{end}}
 										{{end}}
 										<br>
@@ -191,7 +191,7 @@
 				{{range $k,$v := $s}}
 					<li{{if eq $k 0}} class="border-t-0"{{end}}>
 						<div>
-							<img src="{{if $v.s_avatar}}{{$v.s_avatar}}{{else}}null{{end}}" onerror="this.src='/images/ent-logo.png'">
+							<img src="{{if $v.s_pic}}{{$v.s_pic}}{{else}}null{{end}}" onerror="this.src='/images/ent-logo.png'">
 							<a href="/enterprise/{{$v.s_id}}.html">{{$v.s_remark}}</a>
 						</div>
 					</li>

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

@@ -356,7 +356,7 @@ $(function(){
 		window.location.href="/front/swordfish";
 	});
 	$("#yjfk").click(function(){
-		$("body").append('<form id="feedbackForm" action="/front/web_feedbacklist.html" method="post" class="hide"><input type="hidden" name="url" value="'+window.location.href+'"></form>');
+		$("body").append('<form id="feedbackForm" action="/front/web_O_help.html" method="post" class="hide"><input type="hidden" name="url" value="'+window.location.href+'"></form>');
 		$("#feedbackForm").submit();
 	});
 	//

+ 25 - 10
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -13,7 +13,7 @@
 <div class="b-content container-fluid">
 	<!--企业名片-->
 	<div class="b-com-head">
-		<img src="/images/ent-logo.png">
+		<img src="{{if .T.res.s_avatar}}{{.T.res.s_avatar}}{{else}}null{{end}}" onerror="this.src='/images/ent-logo.png'">
 		<div class="entinfo-cart">
 			<div class="b-com-first">
 				<font class="b-com-title">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</font>
@@ -73,7 +73,15 @@
 				{{else if .T.res.Nb_email}}
 					<span class="glyphicon youjian2"></span>{{.T.res.Nb_email}}<span class="margin-r-15"></span>
 				{{end}}
-				{{if .T.res.s_enturl}}<span class="glyphicon wangzhi1"></span><a href="{{.T.res.s_enturl}}" target="_brank">{{.T.res.s_enturl}}</a>{{end}}
+				{{if .T.res.s_enturl}}
+					<span class="glyphicon wangzhi1"></span><a href="{{.T.res.s_enturl}}" target="_brank" id="entUrl">{{.T.res.s_enturl}}</a>
+					<script>
+					var entUrl = {{.T.res.s_enturl}};
+					if(!entUrl.startWith("http://") && !entUrl.startWith("https://")){
+						document.getElementById("entUrl").href = "http://"+entUrl;
+					}
+					</script>
+				{{end}}
 				<br>
 				{{if or .T.res.i_province .T.res.i_city .T.res.i_area .T.res.s_address .T.res.Dom}}
 					<span class="glyphicon dizhi margin-0"></span>
@@ -112,10 +120,10 @@
 	<ul class="ent-tab">
 		<li class="ent-active">{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}概况</li>
 		<li>关系网</li>
-		<li>主要人员</li>
-		<li>变更信息</li>
-		<li>失信信息</li>
-		<li class="border-r-0">{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}黄页</li>
+		<li{{if not .T.res.staffinfo}} class="disabled"{{end}}>主要人员</li>
+		<li{{if not .T.res.alterInfo}} class="disabled"{{end}}>变更信息</li>
+		<li{{if eq .T.dishonesty.count 0}} class="disabled"{{end}}>失信信息</li>
+		<li class="{{if and (not .T.res.s_synopsis) (eq .T.service.count 0)}}disabled {{end}}border-r-0">{{if eq .T.res.s_action "01"}}企业{{else if eq .T.res.s_action "02"}}商家{{else if eq .T.res.s_action "03"}}机构{{else}}企业{{end}}黄页</li>
 	</ul>
 	<div class="ent-tab-content b-left">
 		<div>
@@ -162,7 +170,7 @@
 								<br><img src="/images/entcommunity/triangle.png">
 							</span>
 							{{if .T.res.RegNo}}<div><span>注册号</span><span>{{.T.res.RegNo}}</span></div>{{end}}
-							{{if .T.res.IndustryPhyName}}<div><span>行业</span><span>{{.T.res.IndustryPhyName}}</span></div>{{end}}
+							{{if .T.res.EntTypeName}}<div><span>企业类型</span><span>{{.T.res.EntTypeName}}</span></div>{{end}}
 						</div>
 						<!--成立日期-->
 						<div class="entinfo-estdate">
@@ -179,7 +187,7 @@
 							{{if .T.res.RegCap}}
 								{{if and (ne .T.res.EntType "9600") (ne .T.res.EntType "5810")}}
 									<span>注册资本</span>
-									<span><script>var d1={{.T.res.RegCap}};d1=d1?d1:0; var lenD1=(d1+"").length ;if(lenD1>4&&(d1+"").indexOf(".")>-1&&(lenD1-(d1+"").indexOf("."))>4){document.write(d1.toFixed(4))}else{document.write(d1)}</script>万元</span>
+									<span><script>var d1={{.T.res.RegCap}};d1=d1?d1:0; var lenD1=(d1+"").length ;if(lenD1>4&&(d1+"").indexOf(".")>-1&&(lenD1-(d1+"").indexOf("."))>4){document.write(d1.toFixed(4))}else{document.write(d1)}</script>万{{if .T.res.RegCapCurName}}{{.T.res.RegCapCurName}}{{else}}{{end}}</span>
 								{{else}}
 									<span class="entinfo-disabled">注册资本</span>
 									<span></span>
@@ -195,8 +203,8 @@
 						<!--公司类型-->
 					  	<div class="entinfo-enttype">
 							<div>
-								<span{{if not .T.res.EntTypeName}} class="entinfo-disabled"{{end}}>企业类型</span>
-								<span>{{if .T.res.EntTypeName}}{{.T.res.EntTypeName}}{{end}}</span>
+								<span{{if not .T.res.IndustryPhyName}} class="entinfo-disabled"{{end}}>行业</span>
+								<span>{{if .T.res.IndustryPhyName}}{{.T.res.IndustryPhyName}}{{end}}</span>
 							</div>
 							<img src="/images/entcommunity/gongsileixing.png">
 						</div>
@@ -444,11 +452,18 @@
 <script type="text/javascript">
 var entId = {{.T.res._id}};
 var regNo = {{.T.res.RegNo}};
+var regCapCurName = {{.T.res.RegCapCurName}};
 var legcerNo = {{.T.res.LegCerNO}};
 var entName = {{.T.res.EntName}};
 var staffinfo = {{.T.res.staffinfo}};
 var synopsis = {{.T.res.s_synopsis}};
 var relevantEnts = {{.T.relevantEnts}};
+var dishonesty = {{.T.dishonesty}};
+var gs = {{.T.res.gs}};
+var investor = {{.T.res.investor}};
+var OpScope = {{.T.res.OpScope}};
+var service = {{.T.service}};
+var relation = {{.T.relation}};
 //联系地址
 //定义默认的郑州经纬度
 var ptlat=113.69884285509,  ptlng=34.791342526551;

+ 34 - 0
messageframe/src/util/client.go

@@ -0,0 +1,34 @@
+//客户端封装
+package util
+
+import (
+	"fmt"
+	"net"
+	"os"
+)
+
+//出错检测
+func checkError(err error) {
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "出错了: %s", err.Error())
+		os.Exit(1)
+	}
+}
+
+//
+func StartClient(parseEvent func([]byte), serveraddr string) (*Writer, net.Conn) {
+	tcpAddr, err := net.ResolveTCPAddr("tcp4", serveraddr)
+	checkError(err)
+
+	conn, err := net.DialTCP("tcp", nil, tcpAddr)
+	checkError(err)
+	//接受消息
+	messageQueue := make(chan RawData, 2000) //并发1000
+	go processMsg(messageQueue, parseEvent)
+	//从流中提取消息
+	go forwardMessage(conn, messageQueue)
+	//需要构造写缓冲区
+	w := NewWriter(conn, make(chan RawData, 20))
+	go w.processWrite()
+	return w, conn
+}

+ 23 - 0
messageframe/src/util/event.go

@@ -0,0 +1,23 @@
+package util
+
+//只有事件,发送类型
+const (
+	EVENT_RETURN_MACHINE_ID    = iota
+	EVENT_REQUEST_HEARTBEAT    //心跳
+	EVENT_RETURN_HEARTBEAT     //
+	EVENT_PUBLISH_MYSERVICES   //发布我的服务
+	EVENT_REQUEST_SPIDER_STATE //获取爬虫状态
+	EVENT_RECIVE_SPIDER_STATE  //接受爬虫状态
+	EVENT_RECIVE_CALLBACK      //调用返回,用于调用服务需要同步返回值
+
+	//------------------------
+	SERVICE_ECPS_SPIDER_HN //河南爬虫
+	SERVICE_ECPS_SPIDER_HB //河北爬虫
+
+	//-------发送方式----------------
+	SENDTO_TYPE_RAND_RECIVER = 0 //发送给任一服务接收者,默认是这种模式
+	SENDTO_TYPE_ALL          = 1 //发送给所有客户端
+	SENDTO_TYPE_ALL_RECIVER  = 2 //发送给所有指定服务接收者
+	SENDTO_TYPE_P2P          = 3 //发送给指定客户端
+
+)

+ 18 - 0
messageframe/src/util/event_test.go

@@ -0,0 +1,18 @@
+package util
+
+import (
+	"log"
+	"regexp"
+	"testing"
+)
+
+func TestEvent(t *testing.T) {
+	log.Println(SENDTO_TYPE_RAND_RECIVER, SENDTO_TYPE_P2P)
+}
+
+func TestReg(t *testing.T) {
+	reg, _ := regexp.Compile("<[^/]*</strong>")
+	msg := `<strong..sldfkjsdlf>238947askdlfjasldfj</strong>abcdefg`
+	ret := reg.ReplaceAllString(msg, "")
+	log.Println(ret)
+}

+ 19 - 0
messageframe/src/util/key.go

@@ -0,0 +1,19 @@
+package util
+
+import (
+	"math/rand"
+)
+
+const (
+	KEY = "abcdefghhijklmnopqrstuvwxyz0123456789ABCDEFJHIJKLMNOPQRSTUVWXYZ"
+)
+
+//
+func UUID(length int) string {
+	var ret string
+	for i := 0; i < length; i++ {
+		pos := rand.Intn(61)
+		ret += KEY[pos : pos+1]
+	}
+	return ret
+}

+ 132 - 0
messageframe/src/util/protocol.go

@@ -0,0 +1,132 @@
+package util
+
+//底层网络通信协议
+import (
+	"bufio"
+	"encoding/binary"
+	"encoding/json"
+	"fmt"
+	"io"
+	"net"
+)
+
+//自定义数据格式,Header(4字节)+Frame
+//
+type Reader struct {
+	conn   net.Conn
+	reader *bufio.Reader
+	buffer [4]byte
+}
+
+//
+type Writer struct {
+	conn       net.Conn
+	writeQueue chan RawData
+}
+
+//
+type RawData []byte //流数据
+
+//
+func NewReader(c net.Conn) *Reader {
+	return &Reader{
+		conn:   c,
+		reader: bufio.NewReader(c),
+	}
+}
+
+//
+func NewWriter(c net.Conn, wq chan RawData) *Writer {
+	return &Writer{
+		conn:       c,
+		writeQueue: wq,
+	}
+}
+
+//读取头部
+func (p *Reader) readHeader() (int32, error) {
+	buf := p.buffer[:4]
+	if _, err := io.ReadFull(p.reader, buf); err != nil {
+		return 0, err
+	}
+	size := int32(binary.BigEndian.Uint32(buf))
+	if size < 0 || size > 16384000 {
+		return 0, fmt.Errorf("Incorrect frame size (%d)", size)
+	}
+	return size, nil
+}
+
+//读取完整一帧数据,防止粘包
+func (p *Reader) readFrame(size int) ([]byte, error) {
+	var buf []byte
+	if size <= len(p.buffer) {
+		buf = p.buffer[0:size]
+	} else {
+		buf = make([]byte, size)
+	}
+	_, err := io.ReadFull(p.reader, buf)
+	return buf, err
+}
+
+//读取数据写入队列
+func forwardMessage(c net.Conn, queue chan<- RawData) {
+	defer c.Close()
+	logReader := NewReader(c)
+	for {
+		size, err := logReader.readHeader()
+		if err != nil {
+			break
+		}
+		data, err := logReader.readFrame(int(size))
+		if err != nil {
+			break
+		}
+		queue <- RawData(data)
+	}
+}
+
+//从队列中读取数据,定期处理
+func processMsg(q <-chan RawData, parseEvent func([]byte)) {
+	for {
+		select {
+		case msg := <-q:
+			parseEvent(msg)
+		}
+	}
+}
+
+//写数据
+func (w *Writer) Write(bs []byte) {
+	data := Enpacket(bs)
+	w.writeQueue <- RawData(data)
+}
+
+//写入的是对象,一般用map[string]interface{}
+func (w *Writer) WriteObj(obj interface{}) {
+	w.writeQueue <- RawData(EnpacketObj(obj))
+}
+
+//封包
+func Enpacket(bs []byte) []byte {
+	head := make([]byte, 4)
+	binary.BigEndian.PutUint32(head, uint32(len(bs)))
+	data := append(head)
+	data = append(data, bs...)
+	return data
+}
+
+//封包
+func EnpacketObj(obj interface{}) []byte {
+	bs, _ := json.Marshal(obj)
+	return Enpacket(bs)
+}
+
+//从缓冲区读取
+func (w *Writer) processWrite() {
+	for {
+		select {
+		case msg := <-w.writeQueue:
+			w.conn.Write(msg)
+		}
+	}
+}

+ 32 - 0
messageframe/src/util/server.go

@@ -0,0 +1,32 @@
+//服务端封装
+package util
+
+import (
+	"fmt"
+	"net"
+)
+
+//启动服务端
+func StartServer(parseEvent func([]byte),
+	processconnection func(conn net.Conn),
+	addr string) {
+	netListen, err := net.Listen("tcp", addr)
+	if err != nil {
+		fmt.Println(err.Error())
+	}
+	defer netListen.Close()
+	fmt.Println("等待连接,服务地址:", addr)
+	//接受消息
+	messageQueue := make(chan RawData, 2000) //并发1000
+	go processMsg(messageQueue, parseEvent)
+	for {
+		conn, err := netListen.Accept()
+		if err != nil {
+			continue
+		} else {
+			//告诉客户端ID,每次发消息都要携带自己ID
+			processconnection(conn)
+		}
+		go forwardMessage(conn, messageQueue)
+	}
+}

+ 21 - 0
messageframe/src/客户端/main.go

@@ -0,0 +1,21 @@
+package main
+
+import (
+	"net"
+	"time"
+	"util"
+)
+
+//
+var w *util.Writer //通常只使用writer,不要使用conn
+var conn net.Conn
+var my_id string //所有通信都要使用的
+var my_services []int = []int{util.SERVICE_ECPS_SPIDER_HN, util.EVENT_REQUEST_SPIDER_STATE}
+
+func main() {
+	w, conn = util.StartClient(func(data []byte) {
+		ProcessMsg(data)
+	}, "127.0.0.1:6060")
+	defer conn.Close()
+	time.Sleep(10 * time.Minute)
+}

+ 26 - 0
messageframe/src/客户端/processbusinessmsg.go

@@ -0,0 +1,26 @@
+package main
+
+import (
+	"log"
+	"util"
+)
+
+//业务消息处理
+func ProcessBusinessMsg(data map[string]interface{}) {
+	if v, ok := data["event"]; ok {
+		event := int(v.(float64))
+		switch event {
+		case util.EVENT_REQUEST_SPIDER_STATE: //回应,,请求爬虫状态
+			w.WriteObj(map[string]interface{}{
+				"myid":       my_id,
+				"event":      util.EVENT_RECIVE_SPIDER_STATE,
+				"sendtotype": util.SENDTO_TYPE_ALL_RECIVER,
+				"data":       "状态良好",
+			})
+		case util.SERVICE_ECPS_SPIDER_HN: //爬取河南工商公示数据
+			log.Println("爬河南公示数据")
+		default:
+			log.Println("服务器发过来的请求,我无法处理", data)
+		}
+	}
+}

+ 36 - 0
messageframe/src/客户端/processmsg.go

@@ -0,0 +1,36 @@
+package main
+
+import (
+	"encoding/json"
+	"log"
+	"time"
+	"util"
+)
+
+//通用事件处理(一般不要改这个文件)
+func ProcessMsg(msg []byte) {
+	tmp := map[string]interface{}{}
+	json.Unmarshal(msg, &tmp)
+	if v, ok := tmp["event"]; ok {
+		event := int(v.(float64))
+		switch event {
+		case util.EVENT_RETURN_MACHINE_ID: //服务端分配id,发布我能处理的时间
+			my_id = tmp["data"].(string)
+			w.WriteObj(map[string]interface{}{
+				"myid":  my_id,
+				"event": util.EVENT_PUBLISH_MYSERVICES,
+				"data":  my_services,
+			})
+			log.Println("服务器回应了机器ID")
+		case util.EVENT_REQUEST_HEARTBEAT: //请求的心跳,回应心跳请求
+			w.WriteObj(map[string]interface{}{
+				"myid":  my_id,
+				"event": util.EVENT_RETURN_HEARTBEAT,
+				"data":  time.Now().Unix(),
+			})
+			log.Println("对服务器回应了本机心跳")
+		default: //业务处理
+			ProcessBusinessMsg(tmp)
+		}
+	}
+}

+ 155 - 0
messageframe/src/服务端/main.go

@@ -0,0 +1,155 @@
+package main
+
+import (
+	"encoding/json"
+	"flag"
+	"log"
+	"math/rand"
+	"net"
+	"sync"
+	"time"
+	"util"
+)
+
+type Client struct {
+	conn      net.Conn
+	timestamp int64
+}
+
+var lock sync.Mutex
+
+//所有的请求
+var allclient map[string]*Client = make(map[string]*Client)
+
+//服务与提供者对应表
+var allservice map[int][]string = make(map[int][]string)
+
+//
+
+//心跳检测,每隔20秒检测一次
+func GC() {
+	now := time.Now().Unix()
+	for k, v := range allclient {
+		if now-v.timestamp > gcinterval*3 {
+			//3次GC未回应心跳
+			v.conn.Close()
+			removeClient(k)
+			continue
+		}
+		_, err := v.conn.Write(util.EnpacketObj(map[string]interface{}{
+			"event": util.EVENT_REQUEST_HEARTBEAT,
+		}))
+		if err != nil { //发心跳包出错
+			v.conn.Close()
+			removeClient(k)
+		}
+	}
+	time.AfterFunc(time.Duration(gcinterval)*time.Second, GC)
+}
+
+//删除服务节点
+func removeClient(myid string) {
+	lock.Lock()
+	delete(allclient, myid)
+	for k, v := range allservice {
+		for j, smid := range v {
+			if smid == myid {
+				allservice[k] = append(v[:j], v[j+1:]...)
+				break
+			}
+		}
+	}
+	lock.Unlock()
+	log.Println("删除节点", myid, allservice)
+}
+
+//处理客户端发过来的消息
+func processmsg(msg []byte) {
+	tmp := map[string]interface{}{}
+	json.Unmarshal(msg, &tmp)
+	my_id := tmp["myid"].(string)
+	if v, ok := tmp["event"]; ok {
+		event := int(v.(float64))
+		switch event {
+		//TODO 只写需要特殊处理的时间,其他都走default
+		case util.EVENT_RETURN_HEARTBEAT: //心跳回应包处理
+			allclient[my_id].timestamp = int64(tmp["data"].(float64))
+			log.Println("更新", my_id, "的心跳时间")
+		case util.EVENT_PUBLISH_MYSERVICES: //客户端发布了自己的服务
+			services := tmp["data"].([]interface{}) //一个客户端提供多个可处理的服务
+			for _, v := range services {
+				service := int(v.(float64))
+				allservice[service] = append(allservice[service], my_id)
+			}
+			log.Println("所有服务", allservice)
+		default: //处理业务事件
+			//识别发送类型
+			var sttype int
+			if sendtotype, ok := tmp["sendtotype"]; ok {
+				sttype = int(sendtotype.(float64))
+			} else {
+				sttype = util.SENDTO_TYPE_RAND_RECIVER
+			}
+			bs := util.Enpacket(msg)            //待发送数据
+			if sttype == util.SENDTO_TYPE_ALL { //发送给所有节点
+				for service_machine_id, v := range allclient { //发所有,不支持的不处理
+					if service_machine_id == my_id { //广播不用发给自己
+						continue
+					}
+					v.conn.Write(bs)
+				}
+			}
+			if v, ok := allservice[event]; ok {
+				switch sttype {
+				case util.SENDTO_TYPE_RAND_RECIVER: //随机选择一个节点提供服务,允许出错尝试3次
+					for i := 0; i < 3; i++ {
+						service_machine_id := v[rand.Intn(len(v))]
+						_, err := allclient[service_machine_id].conn.Write(bs)
+						if err == nil {
+							break
+						} else {
+							removeClient(service_machine_id)
+						}
+					}
+				case util.SENDTO_TYPE_ALL_RECIVER:
+					if v, ok := allservice[event]; ok {
+						for _, service_machine_id := range v {
+							if service_machine_id == my_id { //广播不用发给自己
+								continue
+							}
+							allclient[service_machine_id].conn.Write(bs)
+						}
+					}
+				case util.SENDTO_TYPE_P2P:
+					to := tmp["to"].(string)
+					if v2, ok2 := allclient[to]; ok2 {
+						v2.conn.Write(bs)
+					}
+				}
+
+			}
+		}
+	}
+}
+
+var port string
+var gcinterval int64
+
+//
+func main() {
+	flag.StringVar(&port, "p", "6060", "开放端口")
+	flag.Int64Var(&gcinterval, "g", 20, "GC间隔时间")
+	flag.Parse()
+	//心跳检测
+	go GC()
+	//启动服务
+	util.StartServer(func(data []byte) {
+		//接受消息处理
+		processmsg(data)
+	}, func(c net.Conn) { //连接后返回UUID
+		uuid := util.UUID(32)
+		c.Write(util.EnpacketObj(map[string]interface{}{"event": util.EVENT_RETURN_MACHINE_ID, "data": uuid}))
+		allclient[uuid] = &Client{conn: c, timestamp: time.Now().Unix()}
+	}, ":"+port)
+
+}

+ 50 - 0
messageframe/src/爬虫监控/main.go

@@ -0,0 +1,50 @@
+package main
+
+import (
+	"flag"
+	"log"
+	"net"
+	"time"
+	"util"
+)
+
+//
+var w *util.Writer //通常只使用writer,不要使用conn
+var conn net.Conn
+var my_id string                                              //所有通信都要使用的
+var my_services []int = []int{util.EVENT_RECIVE_SPIDER_STATE} //接受爬虫状态
+
+func GC() {
+	w.WriteObj(map[string]interface{}{
+		"myid":       my_id,
+		"event":      util.EVENT_REQUEST_SPIDER_STATE,
+		"sendtotype": util.SENDTO_TYPE_ALL_RECIVER,
+	})
+	time.AfterFunc(20*time.Second, GC) //20秒查一次爬虫状态
+}
+
+func main() {
+	var serveraddr string
+	var dogc bool
+	flag.StringVar(&serveraddr, "s", "127.0.0.1:6060", "服务端地址")
+	flag.BoolVar(&dogc, "g", false, "是否运行GC,主监控控制gc就可以了,其他点,可以制作查看")
+	flag.Parse()
+	log.Println(serveraddr, dogc)
+	w, conn = util.StartClient(func(data []byte) {
+		ProcessMsg(data)
+	}, serveraddr)
+	defer conn.Close()
+	time.Sleep(10 * time.Second) //等,回应machineid
+	if dogc {
+		go GC()
+	}
+	//模拟发100个河南爬虫任务
+	for i := 0; i < 100; i++ { //
+		w.WriteObj(map[string]interface{}{
+			"myid":  my_id,
+			"event": util.SERVICE_ECPS_SPIDER_HN,
+			"data":  "下载数据要携带的参数",
+		})
+	}
+	time.Sleep(10 * time.Minute)
+}

+ 19 - 0
messageframe/src/爬虫监控/processbusinessmsg.go

@@ -0,0 +1,19 @@
+package main
+
+import (
+	"log"
+	"util"
+)
+
+//业务消息处理
+func ProcessBusinessMsg(data map[string]interface{}) {
+	if v, ok := data["event"]; ok {
+		event := int(v.(float64))
+		switch event {
+		case util.EVENT_RECIVE_SPIDER_STATE: //收到爬虫状态
+			log.Println(data)
+		default:
+			log.Println("服务器发过来的请求,我无法处理", data)
+		}
+	}
+}

+ 36 - 0
messageframe/src/爬虫监控/processmsg.go

@@ -0,0 +1,36 @@
+package main
+
+import (
+	"encoding/json"
+	"log"
+	"time"
+	"util"
+)
+
+//通用时间处理
+func ProcessMsg(msg []byte) {
+	tmp := map[string]interface{}{}
+	json.Unmarshal(msg, &tmp)
+	if v, ok := tmp["event"]; ok {
+		event := int(v.(float64))
+		switch event {
+		case util.EVENT_RETURN_MACHINE_ID: //服务端分配id,发布我能处理的时间
+			my_id = tmp["data"].(string)
+			w.WriteObj(map[string]interface{}{
+				"myid":  my_id,
+				"event": util.EVENT_PUBLISH_MYSERVICES,
+				"data":  my_services,
+			})
+			log.Println("服务器回应了机器ID")
+		case util.EVENT_REQUEST_HEARTBEAT: //请求的心跳,回应心跳请求
+			w.WriteObj(map[string]interface{}{
+				"myid":  my_id,
+				"event": util.EVENT_RETURN_HEARTBEAT,
+				"data":  time.Now().Unix(),
+			})
+			log.Println("对服务器回应了本机心跳")
+		default:
+			ProcessBusinessMsg(tmp)
+		}
+	}
+}