wangchuanjin 9 ani în urmă
părinte
comite
8d44d0ed0f

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

@@ -653,7 +653,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")

+ 15 - 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"`           //删除数据
@@ -631,3 +632,17 @@ 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)
+	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() {

+ 3 - 61
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 {
 	//必须是登录之后的已认证用户才可以进入企业社区
@@ -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 + `] }`

+ 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, ""
+}

+ 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;

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

@@ -1,9 +1,28 @@
 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){
+		$(".ent-tab>li:eq(4)").addClass("disabled");
+	}else{
+		DishonestyPaging();
+	}
+	//变更信息如果没有数据,选项卡不可点
+	if(typeof(alterInfo) == "undefined" || alterInfo == null || alterInfo.length == 0){
+		$(".ent-tab>li:eq(3)").addClass("disabled");
+	}
+	//企业黄页如果没有数据,选项卡不可点
+	if((typeof(synopsis) == "undefined" || synopsis == null || synopsis == "") && service.count == 0){
+		$(".ent-tab>li:eq(5)").addClass("disabled");	
+	}else{
+		ServicePaging();
+	}
 	//右侧最新消息
 	$.post("/front/webcontent/getLatestNews",null,function(r){
 		var html = '<ul>';
@@ -13,6 +32,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 +71,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 +84,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>';
@@ -86,6 +110,7 @@ $(function(){
 		$(".ent-mainperson").html(hm);
 	}else{
 		$(".ent-mainperson .ent-findnull").removeClass("hide");
+		$(".ent-tab>li:eq(2)").addClass("disabled");
 	}
 	//联系地址
 	if($address){
@@ -113,19 +138,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 +192,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 +254,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 +266,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 +326,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 +362,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();
 		});
-	});
+	}
 }

+ 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(){

+ 10 - 3
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{

+ 12 - 2
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;
 			}
 		}
 	}
@@ -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){

+ 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/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{

+ 94 - 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,32 @@ 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" style="cursor: pointer;width:90px;" onclick="document.getElementById('upload').click();">
+							{{if .T.entinfo.s_avatar}}
+							<img class='ent-LOGO' src='{{.T.entinfo.s_avatar}}'>
+							{{else}}
+							<img src="/images/services/default.png" style="width: 90px; height: 90px;"><div id="tips" style="text-align: center; width: 90px; position: absolute; color: #fff; top: 64px; background-color: #cccccc;">上传logo</div>
+							{{end}}
+						</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 +127,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 +143,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 +158,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 +210,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({

+ 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.src='/images/ent-logo.png'"></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>

+ 22 - 6
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>
@@ -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,19 @@
 <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 alterInfo = {{.T.res.alterInfo}};
+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;