Browse Source

Merge branch 'develop' into release

wangchuanjin 9 years ago
parent
commit
d6cd1273aa
100 changed files with 3476 additions and 1936 deletions
  1. 0 2
      common/src/github.com/go-xweb/xweb/filter.go
  2. 96 49
      common/src/main.go
  3. 13 0
      common/src/qfw/util/common.go
  4. 4 5
      common/src/qfw/util/elastic/elasticutil.go
  5. 5 3
      common/src/qfw/util/encrypt_test.go
  6. 111 64
      common/src/qfw/util/mongodb/mongodbSim.go
  7. 45 46
      common/src/qfw/util/mongodb/mongodbutil_test.go
  8. 6 0
      common/src/qfw/util/rpc/push.go
  9. 10 0
      common/src/qfw/util/rpc/weixin.go
  10. BIN
      core/doc/表初步设计及功能划分.xlsx
  11. 13 1
      core/src/config.json
  12. 28 26
      core/src/qfw/coreconfig/SysConfig.go
  13. 1 1
      core/src/qfw/coreutil/weixinrpc.go
  14. 34 3
      core/src/qfw/coreutil/weixinrpc_test.go
  15. 20 5
      core/src/qfw/front/index.go
  16. 37 15
      core/src/qfw/manage/auditing.go
  17. 1 1
      core/src/qfw/member/credit/creditdetail.go
  18. 2 0
      core/src/qfw/member/member.go
  19. 9 5
      core/src/qfw/member/memberindex.go
  20. 113 22
      core/src/qfw/member/membermanager.go
  21. 462 0
      core/src/qfw/member/service.go
  22. 158 503
      core/src/qfw/member/yellowpage.go
  23. 35 7
      core/src/qfw/microwebsite/microwebsite.go
  24. 1 1
      core/src/qfw/mobile/wxmenu.go
  25. 27 6
      core/src/qfw/search/searchService.go
  26. 17 7
      core/src/qfw/search/wxsearchservice.go
  27. 26 0
      core/src/qfw/searchmarket/demand.go
  28. 46 2
      core/src/qfw/searchmarket/service.go
  29. 13 12
      core/src/qfw/swordfish/swordfish.go
  30. 15 0
      core/src/qfw/swordfish/swordfishmanage.go
  31. 2 18
      core/src/qfw/yellowpage/yellowpage.go
  32. 145 221
      core/src/qfw/yellowpage/yellowpagemanager.go
  33. 1 1
      core/src/serviceclassify.json
  34. 1 1
      core/src/timetask.json
  35. 114 228
      core/src/web/staticres/css/dev-qfw.css
  36. 226 74
      core/src/web/staticres/css/entcommunity.css
  37. 2 2
      core/src/web/staticres/css/enterprise.css
  38. 145 0
      core/src/web/staticres/css/membercenter.css
  39. 129 2
      core/src/web/staticres/css/mobile/incmobile.css
  40. 99 8
      core/src/web/staticres/css/qfw.css
  41. 2 7
      core/src/web/staticres/css/swordfish.css
  42. BIN
      core/src/web/staticres/fonts.zip
  43. BIN
      core/src/web/staticres/fonts/qimingxing.eot
  44. BIN
      core/src/web/staticres/fonts/qimingxing.svg
  45. BIN
      core/src/web/staticres/fonts/qimingxing.ttf
  46. BIN
      core/src/web/staticres/fonts/qimingxing.woff
  47. BIN
      core/src/web/staticres/images/bianjixinxi.png
  48. BIN
      core/src/web/staticres/images/bottom_bg_b.png
  49. BIN
      core/src/web/staticres/images/buxuqiu.png
  50. BIN
      core/src/web/staticres/images/ent_authe.png
  51. BIN
      core/src/web/staticres/images/ent_authe_a.png
  52. BIN
      core/src/web/staticres/images/fabuxinxi.png
  53. BIN
      core/src/web/staticres/images/other_authe.png
  54. BIN
      core/src/web/staticres/images/other_authe_a.png
  55. BIN
      core/src/web/staticres/images/person_authe.png
  56. BIN
      core/src/web/staticres/images/person_authe_a.png
  57. BIN
      core/src/web/staticres/images/swordfish/calendar.png
  58. BIN
      core/src/web/staticres/images/swordfish/clocks.png
  59. BIN
      core/src/web/staticres/images/swordfish/sf_01.png
  60. BIN
      core/src/web/staticres/images/swordfish/sf_02.png
  61. BIN
      core/src/web/staticres/images/swordfish/sf_03.png
  62. BIN
      core/src/web/staticres/images/swordfish/sf_04.png
  63. BIN
      core/src/web/staticres/images/swordfish/sf_05.png
  64. BIN
      core/src/web/staticres/images/swordfish/sf_06.png
  65. BIN
      core/src/web/staticres/images/swordfish/sorry.png
  66. BIN
      core/src/web/staticres/images/swordfish/sunlight.png
  67. BIN
      core/src/web/staticres/images/u906.png
  68. BIN
      core/src/web/staticres/images/u908.png
  69. 101 0
      core/src/web/staticres/js/baiduMap.js
  70. 1 0
      core/src/web/staticres/js/chart.js
  71. 1 1
      core/src/web/staticres/js/demand.js
  72. 29 0
      core/src/web/staticres/js/entcommunity.js
  73. 11 2
      core/src/web/staticres/js/enterprise.js
  74. 212 107
      core/src/web/staticres/js/entportrait.js
  75. 0 84
      core/src/web/staticres/js/geocoder.js
  76. 43 2
      core/src/web/staticres/js/qfw.js
  77. 1 1
      core/src/web/staticres/wxent/qfw-enterprise.js
  78. 45 10
      core/src/web/templates/_error.html
  79. 41 65
      core/src/web/templates/common/authentication.html
  80. 2 2
      core/src/web/templates/common/bottom.html
  81. 1 44
      core/src/web/templates/common/centerhead.html
  82. 6 0
      core/src/web/templates/common/errorhead.html
  83. 3 3
      core/src/web/templates/common/head.html
  84. 0 1
      core/src/web/templates/common/inc.html
  85. 2 2
      core/src/web/templates/common/indexhead.html
  86. 37 85
      core/src/web/templates/common/login.html
  87. 106 63
      core/src/web/templates/common/memberleft.html
  88. 263 0
      core/src/web/templates/common/newsfhead.html
  89. 1 1
      core/src/web/templates/common/newshead.html
  90. 1 1
      core/src/web/templates/common/reghead.html
  91. 6 9
      core/src/web/templates/common/swordfishhead.html
  92. 7 7
      core/src/web/templates/common/top.html
  93. 1 1
      core/src/web/templates/common/wsitehead.html
  94. 74 57
      core/src/web/templates/enterprise/detail.html
  95. 142 0
      core/src/web/templates/enterprise/relation.html
  96. 10 12
      core/src/web/templates/index.html
  97. 36 18
      core/src/web/templates/manage/tj.html
  98. 27 8
      core/src/web/templates/manage/web_help.html
  99. 1 1
      core/src/web/templates/manage/webactivitycontent.html
  100. 51 1
      core/src/web/templates/manage/webmobindex.html

+ 0 - 2
common/src/github.com/go-xweb/xweb/filter.go

@@ -58,7 +58,6 @@ func (s *LoginFilter) Do(w http.ResponseWriter, req *http.Request) bool {
 	if s.OriUrlName != "" {
 		redirect = redirect + "?" + s.OriUrlName + "=" + url.QueryEscape(req.URL.String())
 	}
-
 	for _, cr := range s.AskLoginUrls {
 		if !cr.MatchString(requestPath) {
 			continue
@@ -72,7 +71,6 @@ func (s *LoginFilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		}
 		return has
 	}
-
 	if len(s.AnonymousUrls) == 0 {
 		return true
 	}

+ 96 - 49
common/src/main.go

@@ -3,23 +3,27 @@ package main
 import (
 	"fmt"
 	"gopkg.in/mgo.v2/bson"
-	"strconv"
-	"strings"
-
 	"log"
 	"os"
+	util "qfw/util"
 	"qfw/util/elastic"
 	. "qfw/util/mongodbutil"
+	"strconv"
+	"strings"
 )
 
 var N = 200
 
 //生enterprise表
 func main() {
+	//src.exe 192.168.3.18:27080 192.168.3.18:27090 http://192.168.3.18:9800 enterprise all enterprise enterprise 2000
 	// 参数 mongodb(网站库) mongodb(公示库) elastic collection area index-db inde-type N
-
+	log.Println("-------------开始-----------------")
+	isEnterprise := os.Args[4] == "enterprise"
 	initConfig(os.Args[1], "web", "qfw")
-	initConfig(os.Args[2], "ecps", "qfw")
+	if os.Args[4] == "enterprise" {
+		initConfig(os.Args[2], "ecps", "qfw")
+	}
 	InitMongodbPool()
 	elastic.InitElastic(os.Args[3])
 	if len(os.Args[8]) > 0 {
@@ -28,76 +32,119 @@ func main() {
 			N = n1
 		}
 	}
-	ecps_session := GetMgoConn("ecps")
 	var m map[string]interface{}
 	if os.Args[5] == "all" {
 		m = nil
 	} else {
 		m = bson.M{"Area": os.Args[5]}
 	}
-	log.Printf("%v", m)
-	i := 0
-	query := ecps_session.DB("qfw").C(os.Args[4]).Find(m).Iter()
+	log.Printf("检索条件:%v", m)
+	var dbType = "web"
+	if isEnterprise {
+		dbType = "ecps"
+	}
+	count := Count(os.Args[4], dbType, "qfw", dbType)
+	totalPages := ((count + N - 1) / N)
+	log.Println(util.If(isEnterprise, "公式库", "网站库"), os.Args[4], "表有", count, "条数据", "一共", totalPages, "页")
+	sess := GetMgoConn(dbType)
+	defer DestoryMongoConn(dbType, sess)
+	query := sess.DB("qfw").C(os.Args[4]).Find(m).Iter()
 	arr := make([]map[string]interface{}, 0)
+	i := 0
 	for tmp := make(map[string]interface{}); query.Next(tmp); i++ {
-		arr = append(arr, elastic.ConverData(&tmp))
-		if i%N == 0 && i != 0 {
-			elastic.BulkSave(os.Args[6], os.Args[7], &arr, true)
-			arr = make([]map[string]interface{}, 0)
+		if i >= 12690000 {
+			arr = append(arr, elastic.ConverData(&tmp))
+			if len(arr) == N {
+				elastic.BulkSave(os.Args[6], os.Args[7], &arr, true)
+				arr = make([]map[string]interface{}, 0)
+			}
+		}
+		if i%N == 0 {
 			log.Printf("当前索引位置:=%d \n", i)
 		}
 	}
+	log.Println("剩余.....", len(arr))
 	if len(arr) > 0 {
 		elastic.BulkSave(os.Args[6], os.Args[7], &arr, true)
 		arr = make([]map[string]interface{}, 0)
 	}
-
-	//生成带名片索引
-	i = 0
-	count := Count("enterprise", "web", "qfw", m)
-	log.Println("网站库,一共", count, "条数据")
-	for {
-		limit := i + N
-		if limit > count {
-			limit = count
-		}
-		query := *Find("enterprise", "web", "qfw", m, nil, nil, false, i, i+N)
-		regNos := make([]string, 0)
-		arr := make([]map[string]interface{}, 0)
-		if len(query) > 0 {
-			for _, v := range query {
-				if v["_id"] != nil {
-					regno := fmt.Sprint(v["RegNo"])
-					regNos = append(regNos, "\""+regno+"\"")
-					delete(v, "_id")
-				}
+	if isEnterprise {
+		//生成带名片索引
+		i = 0
+		count := Count("enterprise", "web", "qfw", m)
+		log.Println("网站库enterprise表,一共", count, "条数据")
+		for {
+			limit := i + N
+			if limit > count {
+				limit = count
 			}
-
-			findstr := `{"RegNo":{"$in":[` + strings.Join(regNos, ",") + `]}}`
-			query1 := *Find("enterprise", "ecps", "qfw", findstr, nil, nil, false, -1, -1)
-			for _, v := range query {
-				for _, _v := range query1 {
-					if fmt.Sprint(_v["RegNo"]) == fmt.Sprint(v["RegNo"]) {
+			query := *Find("enterprise", "web", "qfw", m, nil, nil, false, i, i+N)
+			regNos := make([]string, 0)
+			arr := make([]map[string]interface{}, 0)
+			if len(query) > 0 {
+				for _, v := range query {
+					if v["_id"] != nil {
+						regno := fmt.Sprint(v["RegNo"])
+						regNos = append(regNos, "\""+regno+"\"")
 						delete(v, "_id")
-						if len(v) > 1 {
-							for field, value := range v {
-								_v[field] = value
+					}
+				}
+
+				findstr := `{"RegNo":{"$in":[` + strings.Join(regNos, ",") + `]}}`
+				query1 := *Find("enterprise", "ecps", "qfw", findstr, nil, nil, false, -1, -1)
+				for _, v := range query {
+					for _, _v := range query1 {
+						if fmt.Sprint(_v["RegNo"]) == fmt.Sprint(v["RegNo"]) {
+							delete(v, "_id")
+							if len(v) > 1 {
+								for field, value := range v {
+									_v[field] = value
+								}
+								arr = append(arr, elastic.ConverData(&_v))
 							}
-							arr = append(arr, elastic.ConverData(&_v))
 						}
 					}
 				}
+				elastic.BulkSave(os.Args[6], os.Args[7], &arr, true)
+			}
+			if i >= count {
+				break
+			} else {
+				i = i + N
 			}
-			elastic.BulkSave(os.Args[6], os.Args[7], &arr, true)
+			log.Printf("当前索引位置:=%d \n", i)
 		}
-		if i >= count {
-			break
+	}
+	log.Println("-------------结束-----------------")
+}
+func main1() {
+	// 参数 mongodb(网站库) elastic collection query
+	initConfig(os.Args[1], "web", "qfw")
+	InitMongodbPool()
+	log.Println("初始化完毕")
+	elastic.InitElastic(os.Args[2])
+	log.Println("elatic初始化完毕")
+	query := ""
+	if len(os.Args) > 4 && os.Args[4] != "" {
+		query = os.Args[4]
+		query = strings.Replace(query, "^", "$", -1)
+	}
+	log.Println("query:", query)
+	list := *Find(os.Args[3], "web", "qfw", query, nil, nil, false, -1, -1)
+	log.Println("len:", len(list))
+	log.Println("查询完毕")
+	var i = 0
+	for i <= len(list) {
+		var tmp []map[string]interface{}
+		if i+100 >= len(list) {
+			tmp = list[i:len(list)]
 		} else {
-			i = i + N
+			tmp = list[i : i+100]
 		}
-		log.Printf("当前索引位置:=%d \n", i)
+		elastic.BulkSave(os.Args[3], os.Args[3], &tmp, true)
+		log.Println("当前索引:", i)
+		i = i + 100
 	}
-
 }
 func initConfig(ip, alias, db string) {
 	conf := *new(PoolConfig)

+ 13 - 0
common/src/qfw/util/common.go

@@ -407,3 +407,16 @@ func EndWith(value, str string) bool {
 	ok, _ := regexp.MatchString(str+"$", value)
 	return ok
 }
+
+//出错拦截
+func Catch() {
+	if r := recover(); r != nil {
+		for skip := 0; ; skip++ {
+			_, file, line, ok := runtime.Caller(skip)
+			if !ok {
+				break
+			}
+			go log.Printf("%v,%v\n", file, line)
+		}
+	}
+}

+ 4 - 5
common/src/qfw/util/elastic/elasticutil.go

@@ -511,7 +511,6 @@ func UpdateEntDoc(id string) bool {
 	b := false
 	map2 := map[string]interface{}{}
 	util.ReadConfig(&map2)
-	log.Println(map2)
 	ent := mongodbutil.FindById("enterprise", map2["entMongodbAlias"].(string), map2["entMongodbName"].(string), id, "")
 	_ent := mongodb.FindById("enterprise", id, "")
 	if _ent != nil && len(*_ent) > 0 {
@@ -519,7 +518,6 @@ func UpdateEntDoc(id string) bool {
 			(*ent)[k] = v
 		}
 	}
-	log.Println(ent)
 	if ent != nil {
 		b = UpdateNewDoc("enterprise", "enterprise", ConverData(ent))
 	}
@@ -607,6 +605,10 @@ func ConverData(ent *map[string]interface{}) map[string]interface{} {
 
 	tmp2["RecCap"] = tmp["RecCap"]
 	tmp2["RegCap"] = tmp["RegCap"]
+	tmp2["excDirect"] = false
+	if tmp["excDirect"] != nil && len(tmp["excDirect"].([]interface{})) > 0 {
+		tmp2["excDirect"] = true
+	}
 	tmp2["IndustryPhy"] = tmp["IndustryPhy"]
 	tmp2["IndustryPhyName"] = tmp["IndustryPhyName"]
 	tmp2["RegOrg"] = tmp["RegOrg"]
@@ -625,9 +627,6 @@ func ConverData(ent *map[string]interface{}) map[string]interface{} {
 	if tmp["Nb_email"] != nil {
 		tmp2["Nb_email"] = tmp["Nb_email"]
 	}
-	if tmp["Nb_email"] != nil {
-		tmp2["Nb_email"] = tmp["Nb_email"]
-	}
 	if tmp["Nb_tel"] != nil {
 		tmp2["Nb_tel"] = tmp["Nb_tel"]
 	}

+ 5 - 3
common/src/qfw/util/encrypt_test.go

@@ -23,11 +23,13 @@ func Test_sim(t *testing.T) {
 	//s2 := "GyUlIhEDDjcfWCAyIl4xBkgsERYiLAwZLCg9VkkbLj4zMRYDPRs5ATVZOxccPAkzFxw7CCpEFj41QlRAQFdFXlRMQVZcHRIbBgsWBxYcFQwEBwoa"
 
 	//s3 := "RFYoal5bCFdXWQoQB0JuWwlXAQFZCUVfFj4JMFtT"
-	s4 := "oJULtwzXo6EFV1Ah-XeyRBimXGM8"
+	s4 := "oHwE_wGFScDzGRPAWNaT0ZE9vDn8"
 	se := SimpleEncrypt{Key: "topnet"}
-	log.Println("=====", se.EncodeString(s4+",uid,111,swordfishaction"))
+	log.Println("=====", se.EncodeString(s4+",uid,111,rssset"))
 	log.Println("=====", se.EncodeString(",1349385977,ASD"))
-	log.Println("---", se.DecodeString("GyUlIhEDSGheAzEpJl8kHB9oVEwmLRkDPTN/CB1AHQtcX1RFHkNGWgYLFgcWHFNTRVwbAQ=="))
+	//log.Println("---", se.DecodeString("GyUlIhEDSGheAzEpJl8kHB9oVEwmLRkDPTN/CB1AHQtcX1RFHkNGWgYLFgcWHFNTRVwbAQ=="))
+	log.Println("---", se.DecodeString("GycHKzoDMykjDSEOMz0gLzI6FTtANCBNAiseVkkBHQtcX1FCRlpCV1JDR0MHFhUBBwccBxYA"))
+
 	now := time.Now()
 	tom := time.Date(now.Year(), now.Month(), now.Day(), 18, 0, 0, 0, time.Local)
 	log.Println(now.Unix(), tom.Unix(), 1453686600-1453716000)

+ 111 - 64
common/src/qfw/util/mongodb/mongodbSim.go

@@ -1,10 +1,14 @@
 package mongodb
 
 import (
-	mgo "gopkg.in/mgo.v2"
+	"fmt"
 	"log"
-	"runtime"
+	"qfw/util"
+	"strings"
 	"time"
+
+	mgo "gopkg.in/mgo.v2"
+	. "gopkg.in/mgo.v2/bson"
 )
 
 type MongodbSim struct {
@@ -15,18 +19,7 @@ type MongodbSim struct {
 }
 
 func (m *MongodbSim) InitPool() {
-	defer func() {
-		if r := recover(); r != nil {
-			log.Println("[E]", r)
-			for skip := 1; ; skip++ {
-				_, file, line, ok := runtime.Caller(skip)
-				if !ok {
-					break
-				}
-				go log.Printf("%v,%v\n", file, line)
-			}
-		}
-	}()
+	defer util.Catch()
 	m.pool = make(chan *mgo.Session, m.Size)
 	for i := 0; i < m.Size; i++ {
 		sess, err := m.createConn()
@@ -37,18 +30,7 @@ func (m *MongodbSim) InitPool() {
 }
 
 func (m *MongodbSim) GetMgoConn() (session *mgo.Session) {
-	defer func() {
-		if r := recover(); r != nil {
-			log.Println("[E]", r)
-			for skip := 1; ; skip++ {
-				_, file, line, ok := runtime.Caller(skip)
-				if !ok {
-					break
-				}
-				go log.Printf("%v,%v\n", file, line)
-			}
-		}
-	}()
+	defer util.Catch()
 	select {
 	case session = <-m.pool:
 		err := session.Ping()
@@ -79,22 +61,11 @@ func (m *MongodbSim) createConn() (sess *mgo.Session, err error) {
 
 //统计
 func (m *MongodbSim) Count(c string, query interface{}) int {
+	defer util.Catch()
 	sess := m.GetMgoConn()
 	//log.Println("count:", m.Size, m.MongodbAddr, m.DbName, sess, m.GetMgoConn(), m)
 	var n int = 0
 	if sess != nil {
-		defer func() {
-			if r := recover(); r != nil {
-				log.Println("[E]", r)
-				for skip := 1; ; skip++ {
-					_, file, line, ok := runtime.Caller(skip)
-					if !ok {
-						break
-					}
-					go log.Printf("%v,%v\n", file, line)
-				}
-			}
-		}()
 		defer m.DestoryMongoConn(sess)
 		coll := sess.DB(m.DbName).C(c)
 		var err error
@@ -107,21 +78,10 @@ func (m *MongodbSim) Count(c string, query interface{}) int {
 }
 
 func (m *MongodbSim) Update(c string, query interface{}, set interface{}, upsert bool, multi bool) bool {
+	defer util.Catch()
 	sess := m.GetMgoConn()
 	b := true
 	if sess != nil {
-		defer func() {
-			if r := recover(); r != nil {
-				log.Println("[E]", r)
-				for skip := 1; ; skip++ {
-					_, file, line, ok := runtime.Caller(skip)
-					if !ok {
-						break
-					}
-					go log.Printf("%v,%v\n", file, line)
-				}
-			}
-		}()
 		defer m.DestoryMongoConn(sess)
 		coll := sess.DB(m.DbName).C(c)
 		var err error
@@ -135,7 +95,7 @@ func (m *MongodbSim) Update(c string, query interface{}, set interface{}, upsert
 			}
 		}
 		if nil != err {
-			log.Println("CountError", err)
+			log.Println("UpdateError", err)
 			b = false
 		}
 	}
@@ -144,22 +104,10 @@ func (m *MongodbSim) Update(c string, query interface{}, set interface{}, upsert
 
 //批量插入
 func (m *MongodbSim) SaveBulk(c string, doc ...map[string]interface{}) bool {
+	defer util.Catch()
 	sess := m.GetMgoConn()
 	b := true
 	if sess != nil {
-		defer func() {
-			b = false
-			if r := recover(); r != nil {
-				log.Println("[E]", r)
-				for skip := 1; ; skip++ {
-					_, file, line, ok := runtime.Caller(skip)
-					if !ok {
-						break
-					}
-					go log.Printf("%v,%v\n", file, line)
-				}
-			}
-		}()
 		defer m.DestoryMongoConn(sess)
 		coll := sess.DB(m.DbName).C(c)
 		bulk := coll.Bulk()
@@ -176,3 +124,102 @@ func (m *MongodbSim) SaveBulk(c string, doc ...map[string]interface{}) bool {
 	}
 	return b
 }
+
+func (m *MongodbSim) Save(c string, doc interface{}) string {
+	defer util.Catch()
+	sess := m.GetMgoConn()
+	if sess != nil {
+		defer m.DestoryMongoConn(sess)
+		coll := sess.DB(m.DbName).C(c)
+		obj := ObjToM(doc)
+		id := NewObjectId()
+		(*obj)["_id"] = id
+		err := coll.Insert(obj)
+		if nil != err {
+			log.Println("SaveError", err)
+			return ""
+		}
+		return (strings.Split(fmt.Sprintf("%s", id), `"`)[1])
+	}
+	return ""
+}
+
+//查询单条对象
+func (m *MongodbSim) FindOne(c string, query interface{}) (*map[string]interface{}, bool) {
+	return m.FindOneByField(c, query, nil)
+}
+
+//查询单条对象
+func (m *MongodbSim) FindOneByField(c string, query interface{}, fields interface{}) (*map[string]interface{}, bool) {
+	defer util.Catch()
+	res, ok := m.Find(c, query, nil, fields, true, -1, -1)
+	if nil != res && len(*res) > 0 {
+		return &((*res)[0]), ok
+	}
+	return nil, ok
+}
+
+//查询单条对象
+func (m *MongodbSim) FindById(c string, query string, fields interface{}) (*map[string]interface{}, bool) {
+	defer util.Catch()
+	sess := m.GetMgoConn()
+	var res map[string]interface{}
+	b := false
+	if sess != nil {
+		defer m.DestoryMongoConn(sess)
+		res = make(map[string]interface{})
+		coll := sess.DB(m.DbName).C(c)
+		var err error
+		err = coll.FindId(ObjectIdHex(query)).Select(ObjToOth(fields)).One(&res)
+		if nil != err {
+			log.Println("FindByIdError", err)
+		}
+		b = true
+	}
+	return &res, b
+}
+
+//底层查询方法
+func (m *MongodbSim) Find(c string, query interface{}, order interface{}, fields interface{}, single bool, start int, limit int) (*[]map[string]interface{}, bool) {
+	defer util.Catch()
+	sess := m.GetMgoConn()
+	var res []map[string]interface{}
+	b := false
+	if sess != nil {
+		defer m.DestoryMongoConn(sess)
+		res = make([]map[string]interface{}, 1)
+		coll := sess.DB(m.DbName).C(c)
+		var err error
+		if single {
+			err = coll.Find(ObjToM(query)).Select(ObjToOth(fields)).One(&res[0])
+		} else if start > -1 {
+			err = coll.Find(ObjToM(query)).Select(ObjToOth(fields)).Sort(ObjToArr(order)...).Skip(start).Limit(limit).All(&res)
+		} else {
+			err = coll.Find(ObjToM(query)).Select(ObjToOth(fields)).Sort(ObjToArr(order)...).All(&res)
+		}
+		if nil != err {
+			log.Println("FindError", err)
+		}
+		b = true
+	}
+	return &res, b
+}
+
+//删除对象
+func (m *MongodbSim) Del(c string, query interface{}) bool {
+	defer util.Catch()
+	sess := m.GetMgoConn()
+	b := false
+	if sess != nil {
+		defer m.DestoryMongoConn(sess)
+		coll := sess.DB(m.DbName).C(c)
+		_, err := coll.RemoveAll(ObjToM(query))
+		if nil != err {
+			log.Println("DelError", err)
+			b = false
+		} else {
+			b = true
+		}
+	}
+	return b
+}

+ 45 - 46
common/src/qfw/util/mongodb/mongodbutil_test.go

@@ -1,14 +1,15 @@
 package mongodb
 
 import (
-	"sync"
 	"fmt"
-	. "gopkg.in/mgo.v2/bson"
 	"log"
+	"qfw/util"
 	"regexp"
+	"sync"
 	"testing"
 	"time"
-	"qfw/util"
+
+	. "gopkg.in/mgo.v2/bson"
 )
 
 func Test_orAnd(t *testing.T) {
@@ -103,19 +104,19 @@ func Test_aggregate(t *testing.T) {
 //检测query正确性
 func Test_nextQuery(t *testing.T) {
 	InitMongodbPool(2, "192.168.3.18:27080", "qfw")
-		sess := GetMgoConn()
-		defer DestoryMongoConn(sess)
+	sess := GetMgoConn()
+	defer DestoryMongoConn(sess)
 	for i := 0; i < 50; i++ {
 		log.Println("-----", i)
 
 		query := sess.DB("qfw").C("enterprise").Find(nil).Select(map[string]interface{}{
-			"_id":   1,
+			"_id": 1,
 		}).Iter()
 		res := map[ObjectId]int{}
 		for tmp := make(map[string]interface{}); query.Next(tmp); {
-			util.Try(func(){
+			util.Try(func() {
 				res[tmp["_id"].(ObjectId)]++
-			},func(e interface{}){})
+			}, func(e interface{}) {})
 			tmp = make(map[string]interface{})
 		}
 
@@ -128,58 +129,56 @@ func Test_nextQuery(t *testing.T) {
 	}
 }
 
+type Person struct {
+	Name string
+	Age  int
+}
 
-	type Person struct{
-		Name string
-		Age int
-	}
-func Test_range(t *testing.T){
+func Test_range(t *testing.T) {
 
-	for t:=0;t<100;t++{
-		log.Println("-------",t)
+	for t := 0; t < 100; t++ {
+		log.Println("-------", t)
 
-	m1:=&map[*Person]string{}
-	
-	for i:=0;i<1000000;i++{
-		p:=Person{
-			Name:fmt.Sprintf("N-%d",i),
-			Age:i,
+		m1 := &map[*Person]string{}
+
+		for i := 0; i < 1000000; i++ {
+			p := Person{
+				Name: fmt.Sprintf("N-%d", i),
+				Age:  i,
+			}
+			(*m1)[&p] = fmt.Sprintf("String-%d", i)
 		}
-		(*m1)[&p]=fmt.Sprintf("String-%d",i)
-	}
-	m2:=map[int]int{}
-	ws:=new(sync.WaitGroup)
-	sm:=new(sync.Mutex)
-	
-	for k,_:=range *m1{
-		kk:=*k
-		ws.Add(1)
-		go func(p Person){
-			defer ws.Done()
-			sm.Lock()
-			m2[p.Age]++
-			sm.Unlock()
-		}(kk)
-	}
-	ws.Wait()
-	
-	for k, v := range m2 {
+		m2 := map[int]int{}
+		ws := new(sync.WaitGroup)
+		sm := new(sync.Mutex)
+
+		for k, _ := range *m1 {
+			kk := *k
+			ws.Add(1)
+			go func(p Person) {
+				defer ws.Done()
+				sm.Lock()
+				m2[p.Age]++
+				sm.Unlock()
+			}(kk)
+		}
+		ws.Wait()
+
+		for k, v := range m2 {
 			if v > 1 {
 				log.Println(k, v)
 			}
 		}
-	
-		}
-}
 
+	}
+}
 
 func Test_Credit(t *testing.T) {
 	//InitMongodbPool(1, "10.116.86.154:27080", "qfw")
 	//u:=FindById("user","55a30cdfaf53744fca000b51",nil)
 	//cre:=util.IntAll((*u)["credit_a"])
 	//cre2:=util.Int64All((*u)["credit_a"])
-	 s :=int64(1152921504606848907)
-	log.Println(s,int(s))
+	s := int64(1152921504606848907)
+	log.Println(s, int(s))
 
 }
-

+ 6 - 0
common/src/qfw/util/rpc/push.go

@@ -5,3 +5,9 @@ type PushData struct {
 	PushType map[string]string
 	Words    string
 }
+type FollowPush struct {
+	ProjectName string
+	ProjectCode string
+	InfoId      string
+	FollowId    string
+}

+ 10 - 0
common/src/qfw/util/rpc/weixin.go

@@ -24,3 +24,13 @@ type BonusMsg struct {
 	Actname     string `json:"act_name"`     //活动名称
 	Remark      string `json:"remark"`       //说明
 }
+type Article struct {
+	Title       string `json:"title"`
+	Description string `json:"description"`
+	PicUrl      string `json:"picurl"`
+	Url         string `json:"url"`
+}
+type News struct {
+	ToUser   string //用户id
+	Articles []Article
+}

BIN
core/doc/表初步设计及功能划分.xlsx


+ 13 - 1
core/src/config.json

@@ -36,5 +36,17 @@
 	"entMongodbServers": "192.168.3.18:27090",
 	"entMongodbPoolSize": 5,
     "entMongodbName": "qfw",
-	"entMongodbAlias":"B"
+	"entMongodbAlias":"B",
+	"followEnterprise":10,
+	"atrrTitle": {
+        "s_persion": [0,99],
+        "s_mobile": [1,99],
+        "s_email": [2,99],
+        "s_enturl": [3,99],
+        "s_address": [4,99],
+        "i_scale": [5,99],
+        "s_descript": [6,99],
+        "s_industry": [7,99],
+		"s_avatar": [8,99]
+    }
 }

+ 28 - 26
core/src/qfw/coreconfig/SysConfig.go

@@ -5,32 +5,34 @@ package coreconfig
 
 //系统配置
 type config struct {
-	Webserverport      string      `json:"webServerPort"` //web服务器端口
-	Redisservers       string      `json:"redisServers"`  //redis缓存服务器列表
-	Useredis           bool        `json:"useRedis"`
-	Mongodbservers     string      `json:"mongodbServers"` //mongodb节点
-	MongodbPoolSize    int         `json:"mongodbPoolSize"`
-	MongodbName        string      `json:"mongodbName"`
-	Elasticsearch      string      `json:"elasticsearch"`
-	Smtp               smtp        `json:"smtp"`
-	Sms                sms         `json:"sms"`
-	Entrelation        entrelation `json:"entrelation”`
-	Allownfiletype     string      `json:"allownfiletype"`
-	Filesize           int         `json:"filesize"`
-	TemplateCache      bool        `json:"templateCache"`
-	HttpCache          bool        `json:"httpCache"`
-	MailFailureTime    int         `json:"mailFailureTime"`
-	ChatServer         string      `json:"chatServer"`
-	ChatRpc            string      `json:"chatRpc"`
-	PushRpc            string      `json:"pushRpc"`
-	ElasticPoolSize    int         `json:"elasticPoolSize"`
-	Ocr_uid            string      `json:"orc_uid"`
-	Ocr_servicekey     string      `json:"ocr_servicekey"`
-	Ocr_servicecode    string      `json:"ocr_servicecode"`
-	EntMongodbservers  string      `json:"entMongodbServers"` //mongodb节点
-	EntMongodbPoolSize int         `json:"entMongodbPoolSize"`
-	EntMongodbName     string      `json:"entMongodbName"`
-	EntMongodbAlias    string      `json:"entMongodbAlias"`
+	Webserverport      string                 `json:"webServerPort"` //web服务器端口
+	Redisservers       string                 `json:"redisServers"`  //redis缓存服务器列表
+	Useredis           bool                   `json:"useRedis"`
+	Mongodbservers     string                 `json:"mongodbServers"` //mongodb节点
+	MongodbPoolSize    int                    `json:"mongodbPoolSize"`
+	MongodbName        string                 `json:"mongodbName"`
+	Elasticsearch      string                 `json:"elasticsearch"`
+	Smtp               smtp                   `json:"smtp"`
+	Sms                sms                    `json:"sms"`
+	Entrelation        entrelation            `json:"entrelation”`
+	Allownfiletype     string                 `json:"allownfiletype"`
+	Filesize           int                    `json:"filesize"`
+	TemplateCache      bool                   `json:"templateCache"`
+	HttpCache          bool                   `json:"httpCache"`
+	MailFailureTime    int                    `json:"mailFailureTime"`
+	ChatServer         string                 `json:"chatServer"`
+	ChatRpc            string                 `json:"chatRpc"`
+	PushRpc            string                 `json:"pushRpc"`
+	ElasticPoolSize    int                    `json:"elasticPoolSize"`
+	Ocr_uid            string                 `json:"orc_uid"`
+	Ocr_servicekey     string                 `json:"ocr_servicekey"`
+	Ocr_servicecode    string                 `json:"ocr_servicecode"`
+	EntMongodbservers  string                 `json:"entMongodbServers"` //mongodb节点
+	EntMongodbPoolSize int                    `json:"entMongodbPoolSize"`
+	EntMongodbName     string                 `json:"entMongodbName"`
+	EntMongodbAlias    string                 `json:"entMongodbAlias"`
+	FollowEnterprise   int                    `json:"followEnterprise"`
+	AtrrTitle          map[string]interface{} `json:"atrrTitle"`
 }
 type smtp struct {
 	Addr     string `json:"addr"`

+ 1 - 1
core/src/qfw/coreutil/weixinrpc.go

@@ -8,7 +8,7 @@ import (
 	qrpc "qfw/util/rpc"
 )
 
-var rpcserver = "120.25.216.197:83"
+var rpcserver = "127.0.0.1:83"
 
 func init() {
 	weixinrpc := util.ObjToString(coreconfig.MessageConfig["weixinrpc"])

+ 34 - 3
core/src/qfw/coreutil/weixinrpc_test.go

@@ -18,9 +18,30 @@ const (
 )
 
 func TestWeixinRpc(t *testing.T) {
-	rpcserver = "112.74.194.135:91"
-	SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: "oJULtwzXo6EFV1Ah-XeyRBimXGM8", Title: "冻结通知", Remark: "时间:2015-12-22", Detail: "企明星通知", Result: "冻结内容通知"})
-
+	itm := new(qrpc.ImgTextMsg)
+	itm.ToUser = "oJULtw8sMXxZX7b-DvqpxIdl47zg"
+	itm.MsgType = "news"
+	var articles qrpc.Articles
+	articles.Title = "title"
+	articles.Description = "description"
+	articles.Url = "http://cdn2.qmx.top:9002/images/logo.png"
+	articles.Picurl = "http://cdn2.qmx.top:9002/images/logo.png"
+	itm.News.Articles = append(itm.News.Articles, articles)
+	//ff, _ := ioutil.ReadFile("../../test.png") //我还是喜欢用这个快速读文件
+	log.Println(itm)
+	//UploadMedia(&qrpc.File{Openid: "oJULtw8sMXxZX7b-DvqpxIdl47zg", Data: ff})
+	//SendImgTextMsg(itm)
+	s := &qrpc.NotifyMsg{
+		Openid: "o8-2pwHj1s_tv3nnRxrH9cD2ngkk",
+		Title:  "识别验证码",
+		Detail: "企明星",
+		Result: "您有一个待识别的验证码,点击下方“详情”查看",
+		Url:    "http://www.qmx.top/images/logo.png",
+	}
+	//log.Println(s)
+	//SendIdentifyTplMsg(s)
+	//PostImage(&qrpc.NotifyMsg{Openid: "oJULtw8sMXxZX7b-DvqpxIdl47zg"})
+	SendManagerNotifyMsg(s)
 }
 
 type MsgStruct struct {
@@ -114,3 +135,13 @@ func Test_credit(t *testing.T) {
 	client.Call("CreditRpc.InCreadit", &data, &reply)
 	log.Println("reply:", reply)
 }
+func Test_dddda(t *testing.T) {
+	var s []map[string]interface{}
+	s = append(s, map[string]interface{}{"bbb": 1, "aaa": 2})
+	ss := new([]map[string]interface{})
+	ss = &s
+	for _, v := range *ss {
+		delete(v, "aaa")
+	}
+	log.Println(s)
+}

+ 20 - 5
core/src/qfw/front/index.go

@@ -24,6 +24,7 @@ import (
 type Index struct {
 	*xweb.Action
 	loadIndex     xweb.Mapper `xweb:"/"`                    //访问首页
+	pcIndex       xweb.Mapper `xweb:"/pcIndex"`             //访问电脑版首页
 	loadIndex1    xweb.Mapper `xweb:"/aa/(\\w+)"`           //访问首页
 	getWebSiteTop xweb.Mapper `xweb:"/front/getWebSiteTop"` //获取网站顶部内容
 	advertAjaxRqe xweb.Mapper `xweb:"/front/advertAjaxRqe"` //首页ajax请求
@@ -38,6 +39,14 @@ func (i *Index) LoadIndex1(id string) error {
 
 //加载首页
 func (i *Index) LoadIndex() error {
+	i.SetSession("pcVisit", false)
+	return loadIndex(true, i.Action)
+}
+func (i *Index) PcIndex() error {
+	i.SetSession("pcVisit", true)
+	return loadIndex(false, i.Action)
+}
+func loadIndex(flag bool, i *xweb.Action) error {
 	id := i.GetString("id")
 	if id != "" && len(id) == 10 {
 		c := i.GetString("c")
@@ -54,12 +63,14 @@ func (i *Index) LoadIndex() error {
 		if v, e := base64.StdEncoding.DecodeString(userInfo.Value); e == nil && json.Unmarshal(v, &ui) == nil {
 			r := *FindById("user", ui["loginId"], nil)
 			if r[ui["loginType"]] != nil {
-				UpdateCookieSession(i.Action, ui["loginType"], false, r)
+				UpdateCookieSession(i, ui["loginType"], false, r)
 			}
 		}
 	}
 
-	if ret := redis.Get("other", "/"); ret != nil {
+	if ret := redis.Get("other", "/"); ret != nil && flag {
+		return i.SetBody([]byte(ret.(string)))
+	} else if ret := redis.Get("other", "/pcIndex"); ret != nil && !flag {
 		return i.SetBody([]byte(ret.(string)))
 	} else {
 		i.T["serviceClassify"] = coreconfig.ServiceClassify
@@ -104,8 +115,12 @@ func (i *Index) LoadIndex() error {
 			}
 		}
 		//
-		content, _ := i.Render4Cache("/index.html", &xweb.T{"data": data, "pagination": pagination, "zkdata": zkdata, "entdata": entdata, "sfdata": sfdata})
-		redis.Put("other", "/", string(content), 60*60*2) //设置首页缓存
+		content, _ := i.Render4Cache("/index.html", &xweb.T{"data": data, "pagination": pagination, "zkdata": zkdata, "entdata": entdata, "sfdata": sfdata, "flag": flag})
+		if flag {
+			redis.Put("other", "/", string(content), 60*60*2) //设置首页缓存
+		} else {
+			redis.Put("other", "/pcIndex", string(content), 60*60*2) //设置首页缓存
+		}
 		return i.SetBody(content)
 	}
 }
@@ -217,7 +232,7 @@ func (i *Index) Reurl() error {
 	if i.GetSession("entid") == nil || i.GetSession("entid").(string) == "" {
 		i.Redirect("/member/show/memberindex")
 	} else {
-		str := "/member/yellowpage/show/showService/" + i.GetSession("entid").(string)
+		str := "/member/service/add"
 		i.Redirect(str)
 	}
 	return nil

+ 37 - 15
core/src/qfw/manage/auditing.go

@@ -85,19 +85,41 @@ func (s *SystemManage) Countlist() {
 	comparebefore := s.GetString("comparebefore")
 	compareafter := s.GetString("compareafter")
 	comparetype := s.GetString("comparetype")
-	//第一条图标数据
-	t1, _ := time.ParseInLocation("2006-01-02 15:04:05", timebefore+" 00:00:00", time.Local)
-	t2, _ := time.ParseInLocation("2006-01-02 15:04:05", timeafter+" 23:59:59", time.Local)
-	condition := M{"intime": M{"$gte": t1.Unix(), "$lte": t2.Unix()}}
-	fields := M{comparetype: 1, "intime": 1}
-	timers := *Find("tj", condition, `{"intime": 1}`, fields, false, -1, -1)
-	//第二条图标数据
-	c1, _ := time.ParseInLocation("2006-01-02 15:04:05", comparebefore+" 00:00:00", time.Local)
-	c2, _ := time.ParseInLocation("2006-01-02 15:04:05", compareafter+" 23:59:59", time.Local)
-	condition = M{"intime": M{"$gte": c1.Unix(), "$lte": c2.Unix()}}
-	fields = M{comparetype: 1, "intime": 1}
-	cors := *Find("tj", condition, `{"intime": 1}`, fields, false, -1, -1)
-	s.ServeJson(M{"t": timers, "c": cors})
+	checked := s.GetString("checked")
+
+	if comparetype != "nfish" {
+		//第一条图标数据
+		t1, _ := time.ParseInLocation("2006-01-02 15:04:05", timebefore+" 00:00:00", time.Local)
+		t2, _ := time.ParseInLocation("2006-01-02 15:04:05", timeafter+" 23:59:59", time.Local)
+		condition := M{"intime": M{"$gte": t1.Unix(), "$lte": t2.Unix()}}
+		fields := M{comparetype: 1, "intime": 1}
+		timers := *Find("tj", condition, `{"intime": 1}`, fields, false, -1, -1)
+		//第二条图标数据
+		cors := make([]map[string]interface{}, 0)
+		if checked == "1" {
+			c1, _ := time.ParseInLocation("2006-01-02 15:04:05", comparebefore+" 00:00:00", time.Local)
+			c2, _ := time.ParseInLocation("2006-01-02 15:04:05", compareafter+" 23:59:59", time.Local)
+			condition = M{"intime": M{"$gte": c1.Unix(), "$lte": c2.Unix()}}
+			fields = M{comparetype: 1, "intime": 1}
+			cors = *Find("tj", condition, `{"intime": 1}`, fields, false, -1, -1)
+		}
+		s.ServeJson(M{"t": timers, "c": cors})
+	} else {
+		t1, _ := time.ParseInLocation("2006-01-02 15:04:05", timebefore+" 00:00:00", time.Local)
+		t2, _ := time.ParseInLocation("2006-01-02 15:04:05", timeafter+" 00:00:00", time.Local)
+		condition := M{"l_date": M{"$gte": t1.Unix(), "$lte": t2.Unix()}}
+		timers := *Find("web_viewcount", condition, `{"l_date": 1}`, `{"l_date":1,"i_viewcount":1}`, false, -1, -1)
+		ns := make([]map[string]interface{}, 0)
+		for _, v := range timers {
+			var tmp = make(map[string]interface{})
+			tmp["_id"] = v["_id"]
+			tmp["intime"] = v["l_date"]
+			tmp["nfish"] = v["i_viewcount"]
+			ns = append(ns, tmp)
+		}
+		log.Println(ns)
+		s.ServeJson(M{"t": ns, "c": "[]"})
+	}
 }
 
 func (s *SystemManage) Count() {
@@ -498,7 +520,7 @@ func (s *SystemManage) Updateaudit() error {
 				Update("user", "{'_id':'"+s_submitid+"'}", `{"$set":{"i_identificationway":1,"s_audit_record_id":"`+_id+`"}}`, true, false)
 				s_result = util.GetPropertie("ptcindentify.false.result", coreconfig.MessageConfig).(string)
 				s_remark = util.GetPropertie("ptcindentify.false.remark", coreconfig.MessageConfig).(string)
-			} else if i_identificationtype == "1" && s_comauthenttype == "2" {
+			} else if i_identificationtype == "1" && s_comauthenttype == "2" { //企业追加营业执照
 				data["i_comauthenttype"] = 2
 				//更新用户表,
 				Update("user", "{'_id':'"+s_submitid+"'}", `{"$set":{"i_identificationway":1,"s_audit_record_id":"`+_id+`"}}`, true, false)
@@ -796,7 +818,7 @@ func (s *SystemManage) Updateaudit() error {
 					}
 					member.UpdateSession(s.Action, r)
 				}, func(e interface{}) {})
-				redis.Del("enterprise", "enterpriseInfo_"+s_enterpriseid, "enterpriseInfo_user_"+s_enterpriseid)
+				redis.Del("enterprise", "enterpriseInfo_"+s_enterpriseid)
 			}()
 		} else {
 			flag = "false"

+ 1 - 1
core/src/qfw/member/credit/creditdetail.go

@@ -177,7 +177,7 @@ func (c *credit) CreditList() error {
 		for i := 0; i < len(r); i++ {
 			r[i]["index"] = (i + 1) + (currentPage-1)*limit
 			d := r[i]["l_date"]
-			r[i]["l_date"] = util.FormatDateWithObj(&d, util.Date_Full_Layout)
+			r[i]["l_date"] = util.FormatDateWithObj(&d, "2006/01/02 15:04:05")
 		}
 		c.ServeJson(M{"list": r, "count": count})
 		return nil

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

@@ -34,6 +34,7 @@ type Member struct {
 	sendYearIdentCode  xweb.Mapper `xweb:"/front/sendYearIdentCode"`           //发送认证年报邮箱验证码
 	checkYearIdentCode xweb.Mapper `xweb:"/front/checkYearIdentCode"`          //验证输入的验证码
 	checkConMail       xweb.Mapper `xweb:"/member/accountset/checkConMail"`    //验证输入的邮箱是否是没认证的企业邮箱
+	myFollowEnts       xweb.Mapper `xweb:"/member/myFollowEnts"`               //我关注的企业
 	//weixinCallBack     xweb.Mapper `xweb:"/weixinCallBack"`                    //微信授权后的回调地址
 	//qqCallBack         xweb.Mapper `xweb:"/qqCallBack"`                        //QQ授权后的回调地址
 }
@@ -53,4 +54,5 @@ func init() {
 	xweb.AddAction(&BidManage{})
 	xweb.AddAction(&MyAppointment{})
 	xweb.AddAction(&OrderManage{})
+	xweb.AddAction(&Service{})
 }

+ 9 - 5
core/src/qfw/member/memberindex.go

@@ -11,7 +11,6 @@ import (
 	"log"
 	"qfw/coreconfig"
 	"qfw/coreutil"
-	"qfw/member/message"
 	"qfw/util"
 	. "qfw/util/mongodb"
 	qrpc "qfw/util/rpc"
@@ -212,7 +211,6 @@ func (m *MemberIndex) CheckPersonalStatus() error {
 			ist := util.IntAll(mobj["i_identificationstatus"]) //审核
 			it := util.IntAll(mobj["i_identificationtype"])
 			cty := util.IntAll(mobj["i_comauthenttype"]) //企业认证类型:1营业执照,2名片,3年报邮箱
-			s_tid := mobj["s_enterpriseid"].(string)
 			b := false
 			info := ""
 			otherinfo := ""
@@ -271,7 +269,7 @@ func (m *MemberIndex) CheckPersonalStatus() error {
 					m.ServeJson(&map[string]string{
 						"type": "4",
 						"cty":  fmt.Sprintf("%d", cty),
-						"url":  "/member/yellowpage/show/enterprise/" + s_tid,
+						"url":  "/member/enterprise/show",
 					})
 				}
 			}
@@ -288,9 +286,15 @@ func (m *MemberIndex) CheckPersonalStatus() error {
 
 //会员中心首页
 func (m *MemberIndex) ShowMemberIndex() error {
-	m.T["pageName"] = "用户中心"
 	GetNotPassReason(m.Action)
-	m.T["res"] = message.GetMsgList(m.Action.GetSession("userId").(string), 0, 5, -1)
+	userId := m.GetSession("userId").(string)
+	m.T["msgset"] = FindById("user", userId, `{"o_msgset":1}`)
+	m.T["pushlist"] = Find("wxpush", &map[string]interface{}{
+		"s_uid": userId,
+		"a_publishtime": map[string]interface{}{
+			"$exists": true,
+		},
+	}, `{"l_date":-1}`, `{"a_visitedindex":1,"s_words":1,"a_publishtime":1,"s_content":1}`, false, 0, 1)
 	return m.Render("/member/memberindex.html", &m.T)
 }
 

+ 113 - 22
core/src/qfw/member/membermanager.go

@@ -13,6 +13,7 @@ import (
 	"github.com/go-xweb/httpsession"
 	"github.com/go-xweb/xweb"
 	. "gopkg.in/mgo.v2/bson"
+	"html/template"
 	"io/ioutil"
 	"log"
 	"math/rand"
@@ -149,7 +150,7 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
 
 				Update("enterprise", `{"_id":"`+entid+`"}`, `{'$set':{'s_action':'01','s_avatar':'`+s_avatar+`','s_submitid':'`+uid+`'}}`, false, false)
 				elastic.UpdateEntDoc(entid)
-				redis.Del("enterprise", "enterpriseInfo_"+entid, "enterpriseInfo_user_"+entid)
+				redis.Del("enterprise", "enterpriseInfo_"+entid)
 			}()
 		}
 	}
@@ -427,46 +428,48 @@ func (m *Member) RegisterComplete() error {
 //登录
 func (m *Member) Login() {
 	var status string = "n"
-	var info, freeze, code string
+	var entId interface{}
+	var userType, freeze, identWay int
 	s_pwd := m.GetString("s_pwd") //密码
 	if s_pwd != "" {              //密码为空不可登录
-		var loginType string            //登录类型
 		s_name := m.GetString("s_name") //用户名
 		r := FindOne("user", M{"$or": []M{M{"s_name": s_name}, M{"s_phone": s_name}, M{"s_email": s_name}}})
 		if r == nil || len(*r) == 0 {
-			info = "s_error" //用户不存在
+			status = "s_error" //用户不存在
 		} else {
-			if s_name == (*r)["s_name"].(string) {
-				loginType = "s_name"
-			} else if (*r)["s_phone"] != nil && s_name == (*r)["s_phone"].(string) {
-				loginType = "s_phone" //手机登录
-			} else if (*r)["s_email"] != nil && s_name == (*r)["s_email"].(string) {
-				loginType = "s_email" //邮箱登录
-			}
 			if GetMd5String(s_pwd) != (*r)["s_pwd"] {
-				info = "p_error" //密码错误
+				status = "p_error" //密码错误
 			} else {
+				var loginType string //登录类型
+				status = "y"
+				if s_name == (*r)["s_name"].(string) {
+					loginType = "s_name"
+				} else if (*r)["s_phone"] != nil && s_name == (*r)["s_phone"].(string) {
+					loginType = "s_phone" //手机登录
+				} else if (*r)["s_email"] != nil && s_name == (*r)["s_email"].(string) {
+					loginType = "s_email" //邮箱登录
+				}
 				//获取绑定企业信息
-				if (*r)["s_enterpriseid"] != nil && (*r)["s_enterpriseid"].(string) != "" {
-					code = (*r)["s_enterpriseid"].(string)
-					//enter := *FindOne("enterprise", `M{"_id":"`+r["s_enterpriseid"].(string)+`"}`)
-					enter := *FindById("enterprise", (*r)["s_enterpriseid"].(string), nil)
+				identWay = IntAll((*r)["i_identificationway"])
+				entId = (*r)["s_enterpriseid"]
+				if identWay == 1 && entId != nil && entId.(string) != "" {
+					enter := *FindById("enterprise", entId.(string), `{"_id":-1,"OpLocDistrict":1}`)
 					if enter != nil && enter["OpLocDistrict"] != nil {
 						(*r)["opLocDistrict"] = enter["OpLocDistrict"]
 					}
 				}
-				status = strconv.Itoa((*r)["i_type"].(int)) //用户类型
-				freeze = fmt.Sprint((*r)["i_freeze"])       //冻结状态
-				if freeze != "2" {
+				userType = IntAll((*r)["i_type"]) //用户类型
+				freeze = IntAll((*r)["i_freeze"]) //冻结状态
+				if freeze != 2 {
 					//更新session、cookie
 					UpdateCookieSession(m.Action, loginType, m.GetString("rememberMe") == "y", *r)
 				}
 			}
 		}
 	} else {
-		info = "p_error" //密码错误
+		status = "p_error" //密码错误
 	}
-	m.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\",\"freeze\":\"" + freeze + "\",\"code\":\"" + code + "\"}")
+	m.ServeJson(M{"status": status, "freeze": freeze, "identWay": identWay, "userType": userType, "entId": entId})
 }
 
 //找回密码之后直接登录
@@ -749,7 +752,6 @@ func (m *Member) Accountset() error {
 //编辑用户昵称
 func (m *Member) EditNickName() {
 	nickname := m.GetString("value") //用户昵称
-	log.Println(nickname)
 	bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": M{"s_nickname": nickname}}, false, false)
 	if bol {
 		//更新session、cookie
@@ -1395,3 +1397,92 @@ func getSmsCount(value string) int {
 	}
 	return count
 }
+
+//我关注的企业
+func (m *Member) MyFollowEnts() error {
+	r := Find("follow_enterprise", `{"s_userid":"`+m.GetSession("userId").(string)+`"}`, `{"l_createdate":-1}`, `{"_id":1,"s_entid":1}`, false, -1, -1)
+	pcVisit, _ := m.GetSession("pcVisit").(bool)
+	regex, _ := regexp.Compile("(Android|Mobile)")
+	ismobile := len(regex.FindAllString(m.Header("User-Agent"), -1)) > 0 && !pcVisit
+	if r != nil && len(*r) > 0 {
+		var entIds string
+		for k, v := range *r {
+			if k > 0 {
+				entIds += ","
+			}
+			entIds += `"` + v["s_entid"].(string) + `"`
+		}
+		ents := elastic.GetPage("enterprise", "enterprise", `{"_id":{"$in":[`+entIds+`]}}`, "", `"_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid","RegCapCurName","s_avatar"`, -1, -1)
+		if r != nil && len(*r) > 0 {
+			var userIds []ObjectId
+			for _, ent := range *ents {
+				ent["_id"] = BsonIdToSId(ent["_id"])
+				EntName, _ := ent["EntName"].(string)
+				tmpNo := ent["EntType"]
+				ent["RegCapEntType"] = tmpNo
+				if tmpNo != nil {
+					switch tmpNo.(string) {
+					case "4500", "6800", "6810", "6820", "7100", "7110", "7120", "7130", "7190", "9200", "6840", "2100", "2110", "2120", "2121", "2122", "2123", "2130", "2140", "2150", "2151", "2152", "2190", "2200", "2210", "2211", "2212", "2213", "2219", "2220", "2221", "2222", "2223", "2229", "4000", "4300", "4310", "4320", "4330", "4340", "4550", "4551", "4552", "4553", "4560", "5800", "5810", "5820":
+						ent["EntType"] = "5810"
+					}
+				}
+				//处理分公司
+				if ent["RegCapEntType"] != nil && ent["RegCapEntType"].(string) != "" {
+					RegCapEntType := ent["RegCapEntType"].(string)
+					if RegCapEntType == "5810" || RegCapEntType == "6810" || RegCapEntType == "7310" || RegCapEntType == "3200" || RegCapEntType == "3100" {
+						ent["RegCapEntType"] = "5810"
+					} else if len(RegCapEntType) > 1 {
+						if RegCapEntType[:1] == "2" {
+							ent["RegCapEntType"] = "5810"
+						}
+					}
+				}
+				entlerp, _ := ent["LeRep"].(string)
+				tmpentno, _ := ent["RegNo"].(string)
+				ent["RegNo"] = template.HTML(tmpentno)
+				if tmpNo == "9600" && strings.Contains(EntName, tmpentno) {
+					ent["EntName"] = template.HTML(strings.Replace(EntName, tmpentno, entlerp, -1))
+				} else {
+					ent["EntName"] = template.HTML(EntName)
+				}
+				ent["tmpentno"] = template.HTML(tmpentno)
+				LeRep, _ := ent["LeRep"].(string)
+				ent["LeRep"] = template.HTML(LeRep)
+				OpScope, _ := ent["OpScope"].(string)
+				if len(OpScope) > 0 {
+					ent["OpScope"] = template.HTML(OpScope)
+				}
+				stock, _ := ent["stock"].(string)
+				if len(stock) > 0 {
+					ent["stock"] = template.HTML(stock)
+				}
+				tmpdate, _ := ent["EstDate"]
+				if tmpdate != nil {
+					ent["EstDate"] = FormatDateWithObj(&tmpdate, Date_Short_Layout)
+				} else {
+					ent["EstDate"] = ""
+				}
+				if ent["s_submitid"] != nil && ent["s_submitid"].(string) != "" {
+					userIds = append(userIds, ObjectIdHex(ent["s_submitid"].(string)))
+				}
+			}
+			if len(userIds) > 0 {
+				users := Find("user", M{"_id": M{"$in": entIds}}, nil, `{"_id":1,"i_comauthenttype":1}`, false, -1, -1)
+				for _, ent := range *ents {
+					for _, user := range *users {
+						if ent["s_submitid"] == BsonIdToSId(user["_id"]) {
+							ent["i_comauthenttype"] = user["i_comauthenttype"]
+							continue
+						}
+					}
+				}
+			}
+		}
+		m.T["ents"] = ents
+	}
+
+	if ismobile {
+		return m.Render("/member/incmobile/myfollow.html", &m.T)
+	}
+	return m.Render("/member/myfollow.html", &m.T)
+}

+ 462 - 0
core/src/qfw/member/service.go

@@ -0,0 +1,462 @@
+/******服务的增正删改*******/
+package member
+
+import (
+	"fmt"
+	"github.com/go-xweb/xweb"
+	"gopkg.in/mgo.v2/bson"
+	coreconfig "qfw/coreconfig"
+	"qfw/coreutil"
+	"qfw/redpackage"
+	"qfw/util"
+	"qfw/util/credit"
+	"qfw/util/elastic"
+	. "qfw/util/fsw"
+	"qfw/util/mongodb"
+	msg "qfw/util/msg"
+	"qfw/util/redis"
+	qrpc "qfw/util/rpc"
+	"strings"
+	"time"
+)
+
+type K map[string]interface{}
+
+type Service struct {
+	*xweb.Action
+	save   xweb.Mapper `xweb:"/member/service/save"`        //增加服务
+	del    xweb.Mapper `xweb:"POST /member/service/delete"` //删除数据
+	find   xweb.Mapper `xweb:"POST /member/service/find"`   //查找要修改数据
+	remove xweb.Mapper `xweb:"POST /member/service/remove"` //下架服务
+	edit   xweb.Mapper `xweb:"/member/service/edit/(.*)"`   //编辑
+	add    xweb.Mapper `xweb:"/member/service/add"`         //详情
+}
+
+//编辑与保存企业黄页中添加服务信息
+func (yp *Service) Save() error {
+	//判断用户是否审核通过
+	if yp.GetSession("identWay") != 1 {
+		yp.ServeJson(&map[string]interface{}{
+			"msg": "用户没有通过审核",
+		})
+		return nil
+	}
+	var info string = "保存成功"
+	var status string = "y"
+	var isshows = ""
+
+	enterpriseid := yp.GetSession("entid").(string)
+	enterprisename := yp.GetSession("entname").(string)
+	//行政区划
+	serentid := yp.GetString("enterpriseid")
+	opLocD := yp.GetSession("opLocDistrict")
+	identType := yp.GetSession("identType")
+	comauthenttype := yp.GetSession("comauthenttype")
+	serviceid := yp.GetString("serviceid")
+	sname := Repl(yp.GetString("servicename"))
+	firstservicetype := Repl(yp.GetString("s_firstservicetype"))
+	secondservicetype := Repl(yp.GetString("s_secondservicetype"))
+	phone := yp.GetString("s_phone")
+	province := yp.GetString("province")
+	city := yp.GetString("city")
+	area := yp.GetString("area")
+
+	//当只选择了省
+	if len(city) == 1 || len(city) == 0 {
+		opLocD = province
+	} else {
+		opLocD = area
+	}
+	//是否只选择了市
+	if len(area) == 1 || len(area) == 0 {
+		opLocD = city
+	} else {
+		opLocD = area
+	}
+
+	userid := yp.GetSession("userId")
+	username := yp.GetString("username")
+	images := yp.GetString("imgurl")
+	price, _ := yp.GetFloat("s_price")
+	s_introduvtion := Repl(yp.GetStringComm("s_introduvtion"))
+	//获取复选框中的信息
+	isshow := yp.GetSlice("isshow")
+	for _, v := range isshow {
+		isshows = v + "," + isshows
+	}
+	doc := make(map[string]interface{})
+	doc["s_name"] = sname
+	doc["s_pservicecode"] = firstservicetype
+	doc["s_servicecode"] = secondservicetype
+	doc["s_name"] = sname
+	//检面议是否选中
+	if price == 0 {
+		doc["s_pricemy"] = "1"
+	} else {
+		doc["f_price"] = price
+		doc["s_pricemy"] = "0"
+	}
+	doc["f_price"] = price
+	doc["s_introduction"] = s_introduvtion
+	doc["s_createuserid"] = userid
+	doc["s_createusername"] = username
+	doc["s_images"] = images
+	doc["l_createdate"] = time.Now().Unix()
+	//时间戳
+	doc["l_timestamp"] = time.Now().Unix()
+	if len(serviceid) == 0 {
+		//点击数
+		doc["i_hits"] = 0
+		//预约数
+		doc["i_appcounts"] = 0
+		//成交数
+		doc["i_sales"] = 0
+		//评论数
+		doc["i_comments"] = 0
+		//总分
+		doc["i_score"] = 0
+	}
+
+	//企业信息
+	doc["s_enterpriseid"] = enterpriseid
+	doc["s_enterprisename"] = enterprisename
+	doc["s_phone"] = phone
+	doc["s_isshow"] = isshows
+	doc["s_opLocDistrict"] = opLocD          //行政区划代码
+	doc["i_identType"] = identType           //认证状态
+	doc["i_comauthenttype"] = comauthenttype //企业认证标识:1:营业执照;2:企业名片;3:企业邮箱
+	doc["i_status"] = 0
+	var tempFlag = false
+	//当服务ID不为空的时候执行编辑方法
+	if len(serviceid) > 0 && serentid == yp.GetSession("entid") {
+		docSet := map[string]interface{}{
+			"$set": doc,
+		}
+		//更新服务
+		//判断是否能删除
+		b, _ := CheckAuth(K{"_id": serviceid})
+		if b == false {
+			return nil
+		}
+		tempFlag = mongodb.Update("service", "{'_id':'"+serviceid+"'}", &docSet, false, false)
+		//更新企业表,服务表
+		if tempFlag {
+			//将数据存到elastic中
+			doc = *mongodb.FindById("service", serviceid, nil)
+			//更新服务表到elastic
+			elastic.UpdateNewDoc("service", "service", doc)
+		}
+
+	} else {
+		doc["i_status"] = 0
+		_id := mongodb.Save("service", doc)
+		doc["_id"] = _id
+		tempFlag = len(_id) > 0
+		//发服务送积分
+		if tempFlag {
+			if credit.AIsHasDo(credit.A_FFW, util.Int64All(yp.GetSession("credit_a"))) {
+				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.B_FFW, "B", nil, yp.Action)
+			} else {
+				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.A_FFW, "A", nil, yp.Action)
+				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.B_FFW, "B", nil, yp.Action)
+			}
+		}
+	}
+	currentuser := mongodb.FindById("user", yp.GetSession("userId").(string), nil)
+	if len(*currentuser) != 0 && (*currentuser)["s_provider"] == nil {
+		mongodb.Update("user", `{"_id":"`+yp.GetSession("userId").(string)+`"}`, `{"$set":{"s_provider":1}}`, true, false)
+	}
+	if tempFlag {
+		//删除缓存信息
+		redis.Del("enterprise", "enterpriseInfo_"+util.ObjToString(yp.GetSession("entid")))
+		//将数据存到elastic中
+		flag2 := elastic.UpdateNewDoc("service", "service", doc)
+		//Insertservicenames(enterpriseid)
+		if !flag2 {
+			status = "n"
+		}
+	} else {
+		status = "n"
+	}
+	//如果是新增操作,进入发红包逻辑
+	if len(serviceid) == 0 && tempFlag && false {
+		//活动有效日期
+		valid := time.Now().After(time.Unix(coreconfig.RedPackage.StartDate, 0)) && time.Now().Before(time.Unix(coreconfig.RedPackage.EndDate, 0))
+		//判断用户是否是第一次发服务
+		valid = valid && mongodb.Count("service", `{"s_createuserid":"`+userid.(string)+`"}`) == 1
+		//判断注册日期,必须在活动日期之间
+		if valid {
+			userInfo := mongodb.FindById("user", userid.(string), `{"l_registedate":1,"s_m_openid":1,"i_identificationtype":1,"i_identificationway":1}`)
+			var openid, nickName string
+			if nickNameTmp := yp.GetSession("nickName"); nickNameTmp != nil && nickNameTmp.(string) != "" {
+				nickName = nickNameTmp.(string)
+			} else {
+				nickName = enterprisename
+			}
+			if openidTmp := (*userInfo)["s_m_openid"]; openidTmp != nil && openidTmp.(string) != "" {
+				openid = openidTmp.(string)
+			} else {
+				valid = false
+			}
+			if l_registedate, ok := (*userInfo)["l_registedate"].(int64); valid && ok {
+				registeDate := time.Unix(l_registedate, 0)
+				//必须是活动期间注册的用户
+				valid = registeDate.After(time.Unix(coreconfig.RedPackage.StartDate, 0)) && registeDate.Before(time.Unix(coreconfig.RedPackage.EndDate, 0))
+				//认证通过
+				valid = valid && util.IntAll((*userInfo)["i_identificationway"]) == 1
+				//个人认证不发红包
+				valid = valid && util.IntAll((*userInfo)["i_identificationtype"]) != 2
+				//判断该用户是否有红包记录,如果没有并且之前验证通过就发红包
+				valid = valid && mongodb.Count("redpackage", `{"s_openid":"`+openid+`"}`) == 0
+			} else {
+				valid = false
+			}
+			if valid {
+				//第一次发红包
+				yp.SetSession("firstredtype", "y")
+				go func() {
+					//发微信消息
+					title := coreconfig.RedPackage.Weixin["successtitle"].(string)
+					remark := coreconfig.RedPackage.Weixin["successremark"].(string)
+					detail := coreconfig.RedPackage.Weixin["sendname"].(string)
+					coreutil.SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: openid, Title: title, Detail: detail, Remark: remark})
+					//邮件过来的用户才可以发红包
+					if promotion := mongodb.FindOne("promotion_log", `{"s_uid":"`+userid.(string)+`"}`); promotion != nil && len(*promotion) > 0 && (*promotion)["s_type"] != nil && (*promotion)["s_type"].(string) == "email" {
+						//红包一天内5000个,0:00--8:00之间不能发红包
+						today := time.Now()
+						if today.After(time.Date(today.Year(), today.Month(), today.Day(), 8, 0, 0, 0, time.Local)) && mongodb.Count("redpackage", bson.M{"i_year": today.Year(), "i_month": today.Month(), "i_day": today.Day()}) <= 5000 {
+							amount := redpackage.GetAmount() * 100 //“元”转换为“分”,程序随机获取的红包金额以“元”为单位,微信红包以“分”为单位
+							bm := qrpc.BonusMsg{Mchbillno: fmt.Sprint(today.Unix()),
+								Sendname:    coreconfig.RedPackage.Weixin["sendname"].(string),
+								Reopenid:    openid,
+								Totalamount: amount,
+								Totalnum:    1,
+								Wishing:     coreconfig.RedPackage.Weixin["wishing"].(string),
+								Actname:     coreconfig.RedPackage.Weixin["actname"].(string),
+								Remark:      coreconfig.RedPackage.Weixin["remark"].(string),
+							}
+							//红包发送成功
+							if coreutil.PayBonus(&bm) {
+								//发站内消息
+								m := &msg.Msg{
+									Msgtype:   1,
+									Title:     coreconfig.RedPackage.Msg["title"].(string),
+									Content:   coreconfig.RedPackage.Msg["content"].(string),
+									ReceiveId: userid.(string),
+								}
+								m.SaveMsg()
+								//保存红包成功记录
+								redpackage := make(bson.M)
+								redpackage["s_userid"] = userid.(string)
+								redpackage["s_username"] = nickName
+								redpackage["s_openid"] = openid
+								redpackage["s_billno"] = bm.Mchbillno
+								redpackage["s_name"] = bm.Actname
+								redpackage["i_amount"] = amount
+								redpackage["l_createdate"] = today.Unix()
+								redpackage["i_year"] = today.Year()
+								redpackage["i_month"] = today.Month()
+								redpackage["i_day"] = today.Day()
+								mongodb.Save("redpackage", redpackage)
+							}
+						} else {
+							//保存红包失败记录
+							redpackage := make(bson.M)
+							redpackage["s_userid"] = userid.(string)
+							redpackage["s_username"] = nickName
+							redpackage["s_openid"] = openid
+							redpackage["l_createdate"] = today.Unix()
+							redpackage["i_year"] = today.Year()
+							redpackage["i_month"] = today.Month()
+							redpackage["i_day"] = today.Day()
+							mongodb.Save("reissueredpackage", redpackage)
+						}
+					}
+				}()
+			}
+		}
+	}
+	return yp.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\"}")
+}
+
+//删除服务
+func (u *Service) Del() error {
+	if u.Method() == "POST" {
+		if u.GetSession("identWay") != 1 {
+			u.ServeJson(&map[string]interface{}{
+				"msg": "用户没有通过审核",
+			})
+			return nil
+		}
+		//判断是否能删除
+		id := u.GetString("id")
+		entid := u.GetSession("entid")
+		index := "service"
+		itype := "service"
+		query := &map[string]interface{}{
+			"_id":            bson.ObjectIdHex(id),
+			"s_enterpriseid": entid,
+		}
+		//先删除mongodb中数据
+		b, _ := CheckAuth(K{"_id": id})
+
+		if b == false {
+			u.ServeJson(&map[string]interface{}{
+				"msg": "删除失败,请确定没有未处理的预约以及用户都已评论!",
+			})
+			return nil
+		}
+		flag := mongodb.Del("service", query)
+		if flag {
+			//再删除elasticsearch中的数据
+			flag2 := elastic.DelById(index, itype, id)
+			if flag2 {
+				redis.Del("enterprise", "enterpriseInfo_"+util.ObjToString(entid))
+				u.ServeJson(&map[string]interface{}{
+					"msg": "删除服务成功!",
+				})
+
+			} else {
+				u.ServeJson(&map[string]interface{}{
+					"msg": "删除服务失败!",
+				})
+			}
+			//Insertservicenames(entid.(string))
+		} else {
+			u.ServeJson(&map[string]interface{}{
+				"msg": "删除服务失败!",
+			})
+		}
+	}
+	return nil
+}
+
+//下架服务
+func (u *Service) Remove() error {
+	if u.Method() == "POST" {
+		//判断用户是否审核通过
+		if u.GetSession("identWay") != 1 {
+			u.ServeJson(&map[string]interface{}{
+				"msg": "用户没有通过审核",
+			})
+			return nil
+		}
+		//判断是否能下架
+		id := u.GetString("id")
+		entid := u.GetSession("entid")
+		index := "service"
+		itype := "service"
+		query := &map[string]interface{}{
+			"_id":            bson.ObjectIdHex(id),
+			"s_enterpriseid": entid,
+		}
+		//先删除mongodb中数据
+		b, _ := CheckAuth(K{"_id": id})
+
+		if b == false {
+			u.ServeJson(&map[string]interface{}{
+				"msg": "下架失败,请确定没有未处理的预约以及用户都已评论!",
+			})
+			return nil
+		}
+		obj := *mongodb.FindOne("service", query)
+		if len(obj) > 0 {
+			sid := strings.Split(fmt.Sprintf("%s", obj["_id"]), `"`)[1]
+			flag := mongodb.Update("service", `{"_id":"`+sid+`"}`, bson.M{"$set": bson.M{"i_status": 1}}, false, false)
+			if flag {
+				//修改elasticsearch中的数据
+				isUpdate := elastic.UpdateNewDoc(index, itype, mongodb.FindById("service", sid, nil))
+
+				if isUpdate {
+					redis.Del("enterprise", "enterpriseInfo_"+util.ObjToString(entid))
+					u.ServeJson(&map[string]interface{}{
+						"msg": "下架成功!",
+					})
+
+				} else {
+					u.ServeJson(&map[string]interface{}{
+						"msg": "下架服务失败!",
+					})
+				}
+				//Insertservicenames(entid.(string))
+			} else {
+				u.ServeJson(&map[string]interface{}{
+					"msg": "下架服务失败!",
+				})
+			}
+		}
+	}
+	return nil
+}
+
+//修改前找到此服务
+func (u *Service) Find() error {
+	if u.Method() == "POST" {
+		id := u.GetString("id")
+		res := map[string]interface{}{}
+		res["data"] = mongodb.FindById("service", id, `{"id":0}`)
+		u.ServeJson(&res)
+	}
+	return nil
+}
+
+//编辑服务页面
+func (yp *Service) Edit(id string) error {
+	//此处需要增加判断,是自己的服务才可以编辑
+
+	//判断用户是否审核通过
+	if yp.GetSession("identWay") != 1 {
+		return yp.Redirect("/member/accountset/index")
+	}
+	res := mongodb.FindById("service", id, `{"id":0}`)
+	yp.T["service"] = &res
+	tmp := (*res)
+	serentid := tmp["s_enterpriseid"].(string)
+	screateid := tmp["s_createuserid"].(string)
+	if screateid == yp.GetSession("userId") && serentid == yp.GetSession("entid") {
+
+		yp.T["serviceName"] = "编辑产品服务信息"
+		yp.T["serviceClassify"] = coreconfig.ServiceClassify
+		yp.T["pricemy"] = ""
+		opLocD := yp.GetSession("opLocDistrict")
+		yp.T["opLocDistrict"] = opLocD
+
+		//res["f_price"] = fmt.Sprintf("%.2f", res["f_price"])
+		//格式化价格
+		if tmp["s_pricemy"] != "1" {
+			if tmp["f_price"] == nil {
+				yp.T["price"] = 0
+			} else {
+				price := fmt.Sprintf("%.2f", tmp["f_price"])
+				yp.T["price"] = price
+			}
+		} else {
+			yp.T["pricemy"] = tmp["s_pricemy"]
+		}
+		yp.T["pservicecode"] = tmp["s_pservicecode"]
+		yp.T["servicecode"] = tmp["s_servicecode"]
+		yp.T["introduction"] = tmp["s_introduction"]
+		yp.T["editflog"] = "Y"
+		yp.T["images"] = tmp["s_images"]
+		yp.T["entid"] = serentid
+		yp.T["serviceid"] = id
+
+	} else {
+		return yp.Redirect("/member/service/add")
+	}
+	//根据服务ID获取服务信息
+	return yp.Render("/member/editservice.html", &yp.T)
+}
+
+//显示增加编辑服务页面
+func (yp *Service) Add() error {
+	if yp.GetSession("identWay") != 1 {
+		return yp.Redirect("/member/accountset/index")
+	}
+	yp.T["entid"] = yp.GetSession("entid")
+	yp.T["serviceName"] = "添加产品服务信息"
+	yp.T["serviceClassify"] = coreconfig.ServiceClassify
+	opLocD := yp.GetSession("opLocDistrict")
+	yp.T["opLocDistrict"] = opLocD
+	return yp.Render("/member/editservice.html", &yp.T)
+}

+ 158 - 503
core/src/qfw/member/yellowpage.go

@@ -5,558 +5,137 @@
 package member
 
 import (
+	"encoding/hex"
 	"fmt"
-	"github.com/bluemonday-master"
 	"github.com/go-xweb/xweb"
 	"gopkg.in/mgo.v2/bson"
 	"log"
 	"net/http"
 	coreconfig "qfw/coreconfig"
-	"qfw/coreutil"
-	"qfw/redpackage"
 	"qfw/util"
 	"qfw/util/credit"
 	"qfw/util/elastic"
 	. "qfw/util/fsw"
 	"qfw/util/mongodb"
-	msg "qfw/util/msg"
+	mongodbutil "qfw/util/mongodbutil"
 	"qfw/util/redis"
-	qrpc "qfw/util/rpc"
 	yps "qfw/yellowpage"
 	"strings"
 	"time"
 )
 
-type K map[string]interface{}
 type Yellowpage struct {
 	*xweb.Action
-	editEnterprise xweb.Mapper `xweb:"/member/yellowpage/edit/enterprise/(\\w+)"`  //编辑
-	dosave         xweb.Mapper `xweb:"/member/yellowpage/dosave/enterprise"`       //保存企业黄页信息
-	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+)"` //编辑服务页面
-	upLoadEntImg   xweb.Mapper `xweb:"POST /member/yellowpage/upLoadEntImg"`       //上传企业相关图片
+	editEnterprise xweb.Mapper `xweb:"/member/enterprise/edit"`              //编辑
+	showEnterprise xweb.Mapper `xweb:"/member/enterprise/show"`              //显示企黄页信息
+	save           xweb.Mapper `xweb:"/member/enterprise/save"`              //保存企业黄页信息
+	upLoadEntImg   xweb.Mapper `xweb:"POST /member/enterprise/upLoadEntImg"` //上传企业相关图片
+	follow         xweb.Mapper `xweb:"POST /member/enterprise/follow"`       //关注企业
+	wxFollow       xweb.Mapper `xweb:"POST /wx/member/enterprise/follow"`    //手机关注企业
+	isFollowed     xweb.Mapper `xweb:"POST /member/enterprise/isFollowed"`   //查询关注状态
+	entCount       xweb.Mapper `xweb:"POST /member/enterprise/entcount"`     //查询关注企业数量
 
-	addService    xweb.Mapper `xweb:"/member/yellowpage/add/service/addservice"` //增加服务
-	delservice    xweb.Mapper `xweb:"POST /member/service/delservice"`           //删除数据
-	findservice   xweb.Mapper `xweb:"POST /member/service/findservice"`          //查找要修改数据
-	removeservice xweb.Mapper `xweb:"POST /member/service/removeservice"`        //下架服务
 }
 
 const ESTYPE string = "enterprise"
 
-//修改前找到此服务
-func (u *Yellowpage) Findservice() error {
-	if u.Method() == "POST" {
-		id := u.GetString("id")
-		res := map[string]interface{}{}
-		res["data"] = mongodb.FindById("service", id, `{"id":0}`)
-		u.ServeJson(&res)
-	}
-	return nil
-}
-
-//删除服务
-func (u *Yellowpage) Delservice() error {
-	if u.Method() == "POST" {
-		if checkuser(u) == false {
-			u.ServeJson(&map[string]interface{}{
-				"msg": "用户没有通过审核",
-			})
-			return nil
-		}
-		//判断是否能删除
-		id := u.GetString("id")
-		entid := u.GetSession("entid")
-		index := "service"
-		itype := "service"
-		query := &map[string]interface{}{
-			"_id":            bson.ObjectIdHex(id),
-			"s_enterpriseid": entid,
-		}
-		//先删除mongodb中数据
-		b, _ := CheckAuth(K{"_id": id})
-
-		if b == false {
-			u.ServeJson(&map[string]interface{}{
-				"msg": "删除失败,请确定没有未处理的预约以及用户都已评论!",
-			})
-			return nil
-		}
-		flag := mongodb.Del("service", query)
-		if flag {
-			//再删除elasticsearch中的数据
-			redis.DelByCodePattern("enterprise", "service-"+entid.(string)+"-*")
-			flag2 := elastic.DelById(index, itype, id)
-			if flag2 {
-				u.ServeJson(&map[string]interface{}{
-					"msg": "删除服务成功!",
-				})
-
-			} else {
-				u.ServeJson(&map[string]interface{}{
-					"msg": "删除服务失败!",
-				})
-			}
-			//Insertservicenames(entid.(string))
-		} else {
-			u.ServeJson(&map[string]interface{}{
-				"msg": "删除服务失败!",
-			})
-		}
-	}
-	return nil
-}
-
-//下架服务
-func (u *Yellowpage) Removeservice() error {
-	if u.Method() == "POST" {
-		//判断用户是否审核通过
-		if checkuser(u) == false {
-			u.ServeJson(&map[string]interface{}{
-				"msg": "用户没有通过审核",
-			})
-			return nil
-		}
-		//判断是否能下架
-		id := u.GetString("id")
-		entid := u.GetSession("entid")
-		index := "service"
-		itype := "service"
-		query := &map[string]interface{}{
-			"_id":            bson.ObjectIdHex(id),
-			"s_enterpriseid": entid,
-		}
-		//先删除mongodb中数据
-		b, _ := CheckAuth(K{"_id": id})
-
-		if b == false {
-			u.ServeJson(&map[string]interface{}{
-				"msg": "下架失败,请确定没有未处理的预约以及用户都已评论!",
-			})
-			return nil
-		}
-		obj := *mongodb.FindOne("service", query)
-		if len(obj) > 0 {
-			sid := strings.Split(fmt.Sprintf("%s", obj["_id"]), `"`)[1]
-			flag := mongodb.Update("service", `{"_id":"`+sid+`"}`, bson.M{"$set": bson.M{"i_status": 1}}, false, false)
-			if flag {
-				redis.DelByCodePattern("enterprise", "service-"+entid.(string)+"-*")
-				//修改elasticsearch中的数据
-				isUpdate := elastic.UpdateNewDoc(index, itype, mongodb.FindById("service", sid, nil))
-
-				if isUpdate {
-					u.ServeJson(&map[string]interface{}{
-						"msg": "下架成功!",
-					})
-
-				} else {
-					u.ServeJson(&map[string]interface{}{
-						"msg": "下架服务失败!",
-					})
-				}
-				//Insertservicenames(entid.(string))
-			} else {
-				u.ServeJson(&map[string]interface{}{
-					"msg": "下架服务失败!",
-				})
-			}
-		}
-	}
-	return nil
-}
-
-//编辑企业黄页的信息
-func (yp *Yellowpage) EditEnterprise(id string) error {
-	//判断用户是否登录,如果没有登录直接返回首页
-	if yp.GetSession("userId") == nil {
-		return yp.Redirect("/")
-	}
-	id = strings.Split(id, "#")[0]
-
-	yp.T["entinfo"] = yps.GetEntInfo(id)
-
-	yp.T["entid"] = id
-
-	return yp.Render("/member/editenterprise.html", &yp.T)
-}
-
-//保存企业黄页的信息
-func (yp *Yellowpage) Dosave() error {
-	var info string = "保存成功"
-	var status string = "y"
-	//判断用户是否登录,如果没有登录直接返回首页
-	if yp.GetSession("userId") == nil {
-		return yp.Redirect("/")
+func (u *Yellowpage) EntCount() {
+	sessionId := u.GetSession("userId")
+	if sessionId == "" {
+		u.ServeJson("0")
+	} else {
+		log.Println(sessionId)
+		c := *mongodb.Find("follow_enterprise", bson.M{"s_userid": sessionId}, nil, nil, false, -1, -1)
+		u.ServeJson(len(c))
 	}
 
-	data := make(map[string]interface{})
-
-	var entid string = yp.GetString("id")
-	//过滤XSS
-	s_synopsis := Repl(yp.GetStringComm("s_synopsis"))
-
-	html := strings.ToLower(s_synopsis)
-	p := bluemonday.UGCPolicy()
-	p.AllowElements("s", "blockquote", "sup", "sub", "ol", "li", "ul", "b", "div", "strong", "p", "table", "span", "em", "u", "td", "tr", "tbody", "th", "thead", "i")
-	p.AllowAttrs("style", "align", "width", "height").OnElements("s", "blockquote", "sup", "sub", "ol", "li", "ul", "b", "div", "strong", "p", "table", "span", "em", "u", "td", "tr", "tbody", "th", "thead", "i")
-
-	html = p.Sanitize(html)
-	s_synopsis = html
-
-	data["s_synopsis"] = s_synopsis
-
-	data["s_persion"] = Repl(yp.GetString("s_persion"))
-	data["s_mobile"] = Repl(yp.GetString("s_mobile"))
-	data["s_enturl"] = Repl(yp.GetString("s_enturl"))
-	data["s_qq"] = Repl(yp.GetString("s_qq"))
-	data["s_weixin"] = Repl(yp.GetString("s_weixin"))
-	province, _ := yp.GetInt("province")
-	data["i_province"] = province
-	city, _ := yp.GetInt("city")
-	data["i_city"] = city
-	area, _ := yp.GetInt("area")
-	data["i_area"] = area
-	data["s_address"] = Repl(yp.GetString("s_address"))
-
-	dataSet := map[string]interface{}{
-		"$set": data,
-	}
-	//向mongodb库中写数据
-	flag := mongodb.Update(ESTYPE, "{'_id':'"+entid+"'}", &dataSet, false, false)
-	redis.Del("enterprise", "enterpriseInfo_"+entid)
-	redis.Del("enterprise", "enterpriseInfo_user_"+entid)
-	elastic.UpdateEntDoc(entid)
-	redis.DelByCodePattern("enterprise", "ipcity_*")
-	if !flag {
-		status = "n"
-		info = "保存信息失败"
-	} else { //首次创建企业名片,送积分
-		if !credit.AIsHasDo(credit.A_CJMP, util.Int64All(yp.GetSession("credit_a"))) {
-			credit.UpuserCreditSession(util.ObjToString(yp.GetSession("userId")), credit.A_CJMP, "A", nil, yp.Action)
-		}
-	}
-	return yp.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\"}")
 }
 
-//用户登录后转到黄页选择模板与编辑黄页界面
-func (yp *Yellowpage) ShowEnterprise(id string) error {
-	if yp.GetSession("userId") == nil {
-		return yp.Redirect("/")
-	}
+//我的黄页
+func (yp *Yellowpage) ShowEnterprise() error {
 	//判断用户是否审核通过
 	if checkuser(yp) == false {
 		return yp.Redirect("/member/accountset/index", http.StatusFound)
 	}
-	id = strings.Split(id, "#")[0]
-
-	yp.T["entinfo"] = yps.GetEntInfo(id)
-
-	yp.T["entid"] = id
-	yp.T["serviceClassify"] = coreconfig.ServiceClassify
-
-	opLocD := yp.GetSession("opLocDistrict")
-	yp.T["opLocDistrict"] = opLocD
-	return yp.Render("/member/showenterprise.html", &yp.T)
+	return yps.CommonEntInfo(yp.Action, yp.GetSession("entid").(string), 1, false)
 }
 
-//显示增加编辑服务页面
-func (yp *Yellowpage) ShowService(id string) error {
-	//判断用户是否登录,如果没有登录直接返回首页
-	if yp.GetSession("userId") == nil {
-		return yp.Redirect("/")
-	}
-	yp.T["entid"] = id
-	yp.T["serviceName"] = "添加产品服务信息"
-	yp.T["serviceClassify"] = coreconfig.ServiceClassify
-
-	yp.T["entinfo"] = yps.GetEntInfo(id)
-	opLocD := yp.GetSession("opLocDistrict")
-	yp.T["opLocDistrict"] = opLocD
-	return yp.Render("/member/editservice.html", &yp.T)
-}
-
-//编辑服务页面
-func (yp *Yellowpage) EditService(id string) error {
-	//判断用户是否登录,如果没有登录直接返回首页
-	if yp.GetSession("userId") == nil {
-		return yp.Redirect("/")
-	}
+//编辑企业黄页的信息
+func (yp *Yellowpage) EditEnterprise() error {
 	//判断用户是否审核通过
 	if checkuser(yp) == false {
 		return yp.Redirect("/member/accountset/index", http.StatusFound)
 	}
-	yp.T["serviceName"] = "编辑产品服务信息"
-	yp.T["serviceClassify"] = coreconfig.ServiceClassify
-
-	opLocD := yp.GetSession("opLocDistrict")
-	yp.T["opLocDistrict"] = opLocD
-
-	res := mongodb.FindById("service", id, `{"id":0}`)
-	//res["f_price"] = fmt.Sprintf("%.2f", res["f_price"])
-	yp.T["service"] = &res
-	tmp := (*res)
-	serentid := tmp["s_enterpriseid"].(string)
-	//格式化价格
-	if tmp["f_price"] == nil {
-		yp.T["price"] = 0
-	} else {
-		price := fmt.Sprintf("%.2f", tmp["f_price"])
-		yp.T["price"] = price
-	}
-
-	yp.T["entinfo"] = yps.GetEntInfo(serentid)
-	yp.T["entid"] = serentid
-	//根据服务ID获取服务信息
-
-	return yp.Render("/member/editservice.html", &yp.T)
+	return yps.CommonEntInfo(yp.Action, yp.GetSession("entid").(string), 2, false)
 }
 
-//编辑与保存企业黄页中添加服务信息
-func (yp *Yellowpage) AddService() error {
-	var info string = "保存成功"
-	var status string = "y"
-	var isshows = ""
-
-	enterpriseid := yp.GetSession("entid").(string)
-	enterprisename := yp.GetSession("entname").(string)
-	//行政区划
-	opLocD := yp.GetSession("opLocDistrict")
-	identType := yp.GetSession("identType")
-	comauthenttype := yp.GetSession("comauthenttype")
-	serviceid := yp.GetString("serviceid")
-	sname := Repl(yp.GetString("servicename"))
-	firstservicetype := Repl(yp.GetString("s_firstservicetype"))
-	secondservicetype := Repl(yp.GetString("s_secondservicetype"))
-	phone := yp.GetString("s_phone")
-	province := yp.GetString("province")
-	city := yp.GetString("city")
-	area := yp.GetString("area")
-
-	//当只选择了省
-	if len(city) == 1 || len(city) == 0 {
-		opLocD = province
-	} else {
-		opLocD = area
-	}
-	//是否只选择了市
-	if len(area) == 1 || len(area) == 0 {
-		opLocD = city
-	} else {
-		opLocD = area
-	}
-
-	userid := yp.GetSession("userId")
-	username := yp.GetString("username")
-	images := yp.GetString("imgurl")
-	price, _ := yp.GetFloat("s_price")
-	s_introduvtion := Repl(yp.GetStringComm("s_introduvtion"))
-	//获取复选框中的信息
-	isshow := yp.GetSlice("isshow")
-	for _, v := range isshow {
-		isshows = v + "," + isshows
-	}
-	doc := make(map[string]interface{})
-	doc["s_name"] = sname
-	doc["s_pservicecode"] = firstservicetype
-	doc["s_servicecode"] = secondservicetype
-	doc["s_name"] = sname
-	//检面议是否选中
-	if price == 0 {
-		doc["s_pricemy"] = "1"
+//保存企业黄页的信息
+func (yp *Yellowpage) Save() error {
+	status := "n"
+	s_persion := Repl(yp.GetString("s_persion"))
+	//联系人不能为空
+	if s_persion == "" {
+		status = "personError"
 	} else {
-		doc["f_price"] = price
-		doc["s_pricemy"] = "0"
-	}
-	doc["f_price"] = price
-	doc["s_introduction"] = s_introduvtion
-	doc["s_createuserid"] = userid
-	doc["s_createusername"] = username
-	doc["s_images"] = images
-	doc["l_createdate"] = time.Now().Unix()
-	//时间戳
-	doc["l_timestamp"] = time.Now().Unix()
-	if len(serviceid) == 0 {
-		//点击数
-		doc["i_hits"] = 0
-		//预约数
-		doc["i_appcounts"] = 0
-		//成交数
-		doc["i_sales"] = 0
-		//评论数
-		doc["i_comments"] = 0
-		//总分
-		doc["i_score"] = 0
-	}
-
-	//企业信息
-	doc["s_enterpriseid"] = enterpriseid
-	doc["s_enterprisename"] = enterprisename
-	doc["s_phone"] = phone
-	doc["s_isshow"] = isshows
-	doc["s_opLocDistrict"] = opLocD          //行政区划代码
-	doc["i_identType"] = identType           //认证状态
-	doc["i_comauthenttype"] = comauthenttype //企业认证标识:1:营业执照;2:企业名片;3:企业邮箱
-	doc["i_status"] = 0
-	var tempFlag = false
-	//当服务ID不为空的时候执行编辑方法
-	if len(serviceid) > 0 {
-		docSet := map[string]interface{}{
-			"$set": doc,
-		}
-		//更新服务
-		//判断是否能删除
-
-		b, _ := CheckAuth(K{"_id": serviceid})
-		if b == false {
-			return nil
-		}
-
-		flag := mongodb.Update("service", "{'_id':'"+serviceid+"'}", &docSet, false, false)
-		//更新企业表,服务表
-		if flag {
-			//将数据存到elastic中
-			doc["_id"] = serviceid
-			tempFlag = true
-			//更新服务表到elastic
-			elastic.UpdateNewDoc("service", "service", mongodb.FindById("service", serviceid, nil))
-
+		data := make(map[string]interface{})
+		data["s_persion"] = s_persion
+		entid := yp.GetSession("entid").(string)
+		data["s_persion"] = Repl(yp.GetString("s_persion"))
+		data["s_mobile"] = Repl(yp.GetString("s_mobile"))
+		data["s_enturl"] = Repl(yp.GetString("s_enturl"))
+		data["s_qq"] = Repl(yp.GetString("s_qq"))
+		data["s_weixin"] = Repl(yp.GetString("s_weixin"))
+		data["s_email"] = Repl(yp.GetString("s_email"))
+		province, _ := yp.GetInt("i_province")
+		data["i_province"] = province
+		city, _ := yp.GetInt("i_city")
+		data["i_city"] = city
+		area, _ := yp.GetInt("i_area")
+		data["i_area"] = area
+		data["s_address"] = Repl(yp.GetString("s_address"))
+		//权重
+		atrrTitle := coreconfig.SysConfig.AtrrTitle
+		web := mongodb.FindById(ESTYPE, entid, `{"_id":-1,"attrWeight":1}`)
+		var attrWeight []byte
+		if tmp, ok := (*web)["attrWeight"].(string); ok {
+			attrWeight, _ = hex.DecodeString(tmp)
+		} else {
+			attrWeight = make([]byte, 30)
 		}
-
-	} else {
-		doc["i_status"] = 0
-		_id := mongodb.Save("service", doc)
-		doc["_id"] = _id
-		tempFlag = len(_id) > 0
-		//发服务送积分
-		if tempFlag {
-			if credit.AIsHasDo(credit.A_FFW, util.Int64All(yp.GetSession("credit_a"))) {
-				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.B_FFW, "B", nil, yp.Action)
+		for k, v := range atrrTitle {
+			arr, _ := v.([]interface{})
+			index := util.IntAll(arr[0])
+			weight := util.IntAll(arr[1])
+			if weight < int(attrWeight[index]) {
+				delete(data, k)
 			} else {
-				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.A_FFW, "A", nil, yp.Action)
-				credit.UpuserCreditSession(yp.GetSession("userId").(string), credit.B_FFW, "B", nil, yp.Action)
+				attrWeight[index] = byte(weight)
 			}
 		}
-	}
-	currentuser := mongodb.FindById("user", yp.GetSession("userId").(string), nil)
-	log.Println(currentuser)
-	if len(*currentuser) != 0 && (*currentuser)["s_provider"] == nil {
-		mongodb.Update("user", `{"_id":"`+yp.GetSession("userId").(string)+`"}`, `{"$set":{"s_provider":1}}`, true, false)
-	}
-	log.Println((*currentuser)["s_provider"])
-	if tempFlag {
-		//删除缓存信息
-		redis.Del("enterprise", "enterpriseInfo_"+enterpriseid)
-		redis.Del("enterprise", "enterpriseInfo_user_"+enterpriseid)
-		redis.DelByCodePattern("enterprise", "service-"+enterpriseid+"-*")
-		//将数据存到elastic中
-		flag2 := elastic.UpdateNewDoc("service", "service", doc)
-		//Insertservicenames(enterpriseid)
-		if !flag2 {
-			status = "n"
+		data["attrWeight"] = hex.EncodeToString(attrWeight)
+		dataSet := map[string]interface{}{
+			"$set": data,
 		}
-	} else {
-		status = "n"
-	}
-	//如果是新增操作,进入发红包逻辑
-	if len(serviceid) == 0 && tempFlag && false {
-		//活动有效日期
-		valid := time.Now().After(time.Unix(coreconfig.RedPackage.StartDate, 0)) && time.Now().Before(time.Unix(coreconfig.RedPackage.EndDate, 0))
-		//判断用户是否是第一次发服务
-		valid = valid && mongodb.Count("service", `{"s_createuserid":"`+userid.(string)+`"}`) == 1
-		//判断注册日期,必须在活动日期之间
-		if valid {
-			userInfo := mongodb.FindById("user", userid.(string), `{"l_registedate":1,"s_m_openid":1,"i_identificationtype":1,"i_identificationway":1}`)
-			var openid, nickName string
-			if nickNameTmp := yp.GetSession("nickName"); nickNameTmp != nil && nickNameTmp.(string) != "" {
-				nickName = nickNameTmp.(string)
-			} else {
-				nickName = enterprisename
-			}
-			if openidTmp := (*userInfo)["s_m_openid"]; openidTmp != nil && openidTmp.(string) != "" {
-				openid = openidTmp.(string)
-			} else {
-				valid = false
-			}
-			if l_registedate, ok := (*userInfo)["l_registedate"].(int64); valid && ok {
-				registeDate := time.Unix(l_registedate, 0)
-				//必须是活动期间注册的用户
-				valid = registeDate.After(time.Unix(coreconfig.RedPackage.StartDate, 0)) && registeDate.Before(time.Unix(coreconfig.RedPackage.EndDate, 0))
-				//认证通过
-				valid = valid && util.IntAll((*userInfo)["i_identificationway"]) == 1
-				//个人认证不发红包
-				valid = valid && util.IntAll((*userInfo)["i_identificationtype"]) != 2
-				//判断该用户是否有红包记录,如果没有并且之前验证通过就发红包
-				valid = valid && mongodb.Count("redpackage", `{"s_openid":"`+openid+`"}`) == 0
-			} else {
-				valid = false
-			}
-			if valid {
-				//第一次发红包
-				yp.SetSession("firstredtype", "y")
-				go func() {
-					//发微信消息
-					title := coreconfig.RedPackage.Weixin["successtitle"].(string)
-					remark := coreconfig.RedPackage.Weixin["successremark"].(string)
-					detail := coreconfig.RedPackage.Weixin["sendname"].(string)
-					coreutil.SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: openid, Title: title, Detail: detail, Remark: remark})
-					//邮件过来的用户才可以发红包
-					if promotion := mongodb.FindOne("promotion_log", `{"s_uid":"`+userid.(string)+`"}`); promotion != nil && len(*promotion) > 0 && (*promotion)["s_type"] != nil && (*promotion)["s_type"].(string) == "email" {
-						//红包一天内5000个,0:00--8:00之间不能发红包
-						today := time.Now()
-						if today.After(time.Date(today.Year(), today.Month(), today.Day(), 8, 0, 0, 0, time.Local)) && mongodb.Count("redpackage", bson.M{"i_year": today.Year(), "i_month": today.Month(), "i_day": today.Day()}) <= 5000 {
-							amount := redpackage.GetAmount() * 100 //“元”转换为“分”,程序随机获取的红包金额以“元”为单位,微信红包以“分”为单位
-							bm := qrpc.BonusMsg{Mchbillno: fmt.Sprint(today.Unix()),
-								Sendname:    coreconfig.RedPackage.Weixin["sendname"].(string),
-								Reopenid:    openid,
-								Totalamount: amount,
-								Totalnum:    1,
-								Wishing:     coreconfig.RedPackage.Weixin["wishing"].(string),
-								Actname:     coreconfig.RedPackage.Weixin["actname"].(string),
-								Remark:      coreconfig.RedPackage.Weixin["remark"].(string),
-							}
-							//红包发送成功
-							if coreutil.PayBonus(&bm) {
-								//发站内消息
-								m := &msg.Msg{
-									Msgtype:   1,
-									Title:     coreconfig.RedPackage.Msg["title"].(string),
-									Content:   coreconfig.RedPackage.Msg["content"].(string),
-									ReceiveId: userid.(string),
-								}
-								m.SaveMsg()
-								//保存红包成功记录
-								redpackage := make(bson.M)
-								redpackage["s_userid"] = userid.(string)
-								redpackage["s_username"] = nickName
-								redpackage["s_openid"] = openid
-								redpackage["s_billno"] = bm.Mchbillno
-								redpackage["s_name"] = bm.Actname
-								redpackage["i_amount"] = amount
-								redpackage["l_createdate"] = today.Unix()
-								redpackage["i_year"] = today.Year()
-								redpackage["i_month"] = today.Month()
-								redpackage["i_day"] = today.Day()
-								mongodb.Save("redpackage", redpackage)
-							}
-						} else {
-							//保存红包失败记录
-							redpackage := make(bson.M)
-							redpackage["s_userid"] = userid.(string)
-							redpackage["s_username"] = nickName
-							redpackage["s_openid"] = openid
-							redpackage["l_createdate"] = today.Unix()
-							redpackage["i_year"] = today.Year()
-							redpackage["i_month"] = today.Month()
-							redpackage["i_day"] = today.Day()
-							mongodb.Save("reissueredpackage", redpackage)
-						}
+		//向mongodb库中写数据
+		if mongodb.Update(ESTYPE, "{'_id':'"+entid+"'}", &dataSet, false, false) {
+			status = "y"
+			go func() {
+				util.Try(func() {
+					redis.Del("enterprise", "enterpriseInfo_"+entid)
+					redis.DelByCodePattern("enterprise", "ipcity_*")
+					elastic.UpdateEntDoc(entid)
+					//首次创建企业名片,送积分
+					if !credit.AIsHasDo(credit.A_CJMP, util.Int64All(yp.GetSession("credit_a"))) {
+						credit.UpuserCreditSession(util.ObjToString(yp.GetSession("userId")), credit.A_CJMP, "A", nil, yp.Action)
 					}
-				}()
-			}
+				}, func(e interface{}) {
+					log.Println(e)
+				})
+			}()
 		}
 	}
-	return yp.Write("{\"info\":\"" + info + "\",\"status\":\"" + status + "\"}")
+	yp.ServeJson(&map[string]interface{}{"status": status})
+	return nil
 }
 
 /**
@@ -652,3 +231,79 @@ func (yp *Yellowpage) UpLoadEntImg() error {
 		return yp.Write("n")
 	}
 }
+
+//手机关注企业
+func (yp *Yellowpage) WxFollow() error {
+	entName := yp.GetString("entName")
+	userId := yp.GetSession("userId").(string)
+	status := "N"
+	if len(userId) > 0 {
+		e := mongodbutil.FindOne("enterprise", coreconfig.SysConfig.EntMongodbAlias, coreconfig.SysConfig.EntMongodbName, `{"EntName":"`+entName+`"}`)
+		if (*e)["_id"] != nil {
+			entId := strings.Split(fmt.Sprintf("%s", (*e)["_id"]), `"`)[1]
+			if mongodb.Count("follow_enterprise", `{"s_userid":"`+userId+`"}`) >= coreconfig.SysConfig.FollowEnterprise {
+				status = "M"
+			} else if mongodb.Count("follow_enterprise", `{"s_userid":"`+userId+`","s_entid":"`+entId+`"}`) == 0 {
+				userInfo := yp.GetSession("userInfo").(*map[string]interface{})
+				if len(mongodb.Save("follow_enterprise", bson.M{
+					"s_userid":     userId,
+					"s_entid":      entId,
+					"s_m_openid":   (*userInfo)["s_m_openid"],
+					"l_createdate": time.Now().Unix(),
+				})) > 0 {
+					status = "Y"
+				}
+			}
+		}
+	}
+	yp.ServeJson(bson.M{"status": status})
+	return nil
+}
+
+//关注企业
+func (yp *Yellowpage) Follow() error {
+	defer util.Catch()
+	entId := yp.GetString("entId")
+	flag, _ := yp.GetBool("flag")
+	userId := yp.GetSession("userId").(string)
+	status := "n"
+	if flag {
+		data := mongodb.FindOne("follow_enterprise", `{"s_userid":"`+userId+`","s_entid":"`+entId+`"}`)
+		if data != nil && len(*data) > 0 {
+			(*data)["s_followid"] = util.BsonIdToSId((*data)["_id"])
+			delete((*data), "_id")
+			mongodb.Save("follow_enterprise_back", data)
+		}
+		if mongodb.Del("follow_enterprise", `{"s_userid":"`+userId+`","s_entid":"`+entId+`"}`) {
+			status = "y"
+		}
+	} else {
+		if mongodb.Count("follow_enterprise", `{"s_userid":"`+userId+`"}`) >= coreconfig.SysConfig.FollowEnterprise {
+			status = "m"
+		} else if mongodb.Count("follow_enterprise", `{"s_userid":"`+userId+`","s_entid":"`+entId+`"}`) == 0 {
+			userInfo := yp.GetSession("userInfo").(*map[string]interface{})
+			if len(mongodb.Save("follow_enterprise", bson.M{
+				"s_userid":     userId,
+				"s_entid":      entId,
+				"s_m_openid":   (*userInfo)["s_m_openid"],
+				"l_createdate": time.Now().Unix(),
+			})) > 0 {
+				status = "y"
+			}
+		}
+	}
+	yp.ServeJson(bson.M{"status": status})
+	return nil
+}
+
+//是否关注
+func (yp *Yellowpage) IsFollowed() error {
+	entId := yp.GetString("entId")
+	userId := yp.GetSession("userId").(string)
+	status := "n"
+	if mongodb.Count("follow_enterprise", `{"s_userid":"`+userId+`","s_entid":"`+entId+`"}`) > 0 {
+		status = "y"
+	}
+	yp.ServeJson(bson.M{"status": status})
+	return nil
+}

+ 35 - 7
core/src/qfw/microwebsite/microwebsite.go

@@ -6,10 +6,12 @@ package microwebsite
 
 import (
 	"encoding/base64"
+	"encoding/hex"
 	"encoding/json"
 	"github.com/go-xweb/xweb"
 	. "gopkg.in/mgo.v2/bson"
 	. "qfw/coreconfig"
+	coreconfig "qfw/coreconfig"
 	. "qfw/util"
 	elastic "qfw/util/elastic"
 	"qfw/util/fsw"
@@ -237,11 +239,12 @@ func (m *MicroWebsite) AjaxPorcess() error {
 			entObj["s_synopsis"] = fsw.Repl(m.GetStringComm("s_synopsis")) //修改企业简介
 			break
 		}
-		if len(entObj) > 0 {
-			Update("enterprise", "{'_id':'"+entId+"'}", M{"$set": entObj}, false, false)
-		}
+		setAttrWeight(entId, entObj)
 		//修改企业信息
-		elastic.UpdateEntDoc(entId) //更新该企业的elastic数据
+		if len(entObj) > 0 && Update("enterprise", "{'_id':'"+entId+"'}", M{"$set": entObj}, false, false) {
+			redis.Del("enterprise", "enterpriseInfo_"+entId) //清除该企业的redis缓存
+			elastic.UpdateEntDoc(entId)                      //更新该企业的elastic数据
+		}
 	} else if reqType == "addService" {
 		tempId := m.GetString("tempId")
 		serviceObj := make(M)
@@ -307,9 +310,12 @@ func (m *MicroWebsite) AjaxPorcess() error {
 		} else {
 			field = "s_qrcode"
 		}
-		b := Update("enterprise", "{'_id':'"+entId+"'}", M{"$set": M{field: m.GetString("src")}}, false, false)
+		data := M{field: m.GetString("src")}
+		setAttrWeight(entId, data)
+		b := Update("enterprise", "{'_id':'"+entId+"'}", M{"$set": data}, false, false)
 		if b {
-			elastic.UpdateEntDoc(entId) //更新该企业的elastic数据
+			redis.Del("enterprise", "enterpriseInfo_"+entId) //清除该企业的redis缓存
+			elastic.UpdateEntDoc(entId)                      //更新该企业的elastic数据
 			result["status"] = "y"
 		}
 	} else if reqType == "serviceImg" { //修改服务图片
@@ -321,7 +327,29 @@ func (m *MicroWebsite) AjaxPorcess() error {
 			result["status"] = "y"
 		}
 	}
-	redis.Del("enterprise", "enterpriseInfo_"+entId) //清除该企业的redis缓存
 	m.ServeJson(result)
 	return nil
 }
+
+//权重
+func setAttrWeight(entid string, data M) {
+	atrrTitle := coreconfig.SysConfig.AtrrTitle
+	web := FindById("enterprise", entid, `{"_id":-1,"attrWeight":1}`)
+	var attrWeight []byte
+	if tmp, ok := (*web)["attrWeight"].(string); ok {
+		attrWeight, _ = hex.DecodeString(tmp)
+	} else {
+		attrWeight = make([]byte, 30)
+	}
+	for k, v := range atrrTitle {
+		arr, _ := v.([]interface{})
+		index := IntAll(arr[0])
+		weight := IntAll(arr[1])
+		if weight < int(attrWeight[index]) {
+			delete(data, k)
+		} else {
+			attrWeight[index] = byte(weight)
+		}
+	}
+	data["attrWeight"] = hex.EncodeToString(attrWeight)
+}

+ 1 - 1
core/src/qfw/mobile/wxmenu.go

@@ -420,7 +420,7 @@ func (m *Mobile) WxpushListInfo(_id string) error {
 func (m *Mobile) WxpushAjaxReq() error {
 	index, _ := m.GetInteger("index")
 	mongodb.Update("wxpush", `{"_id":"`+m.GetString("_id")+`"}`, map[string]interface{}{
-		"$push": map[string]interface{}{"a_visitedindex": index},
+		"$addToSet": map[string]interface{}{"a_visitedindex": index},
 	}, false, false)
 	return nil
 }

+ 27 - 6
core/src/qfw/search/searchService.go

@@ -4,6 +4,7 @@ import (
 	"encoding/base64"
 	"encoding/json"
 	"fmt"
+	"github.com/go-xweb/httpsession"
 	"github.com/go-xweb/xweb"
 	"gopkg.in/mgo.v2/bson"
 	"html/template"
@@ -34,9 +35,10 @@ type EntInfo struct {
 
 //企业社区首页
 func (search *Search) EntCommunity() error {
+	pcVisit, _ := search.GetSession("pcVisit").(bool)
 	regex, _ := regexp.Compile("(Android|Mobile)")
 	ismobile := regex.FindAllString(search.Header("User-Agent"), -1)
-	if len(ismobile) > 0 {
+	if len(ismobile) > 0 && !pcVisit {
 		search.T["signature"] = mobile.GetSignature(search.Action)
 		search.Render("/member/incmobile/index.html", &search.T)
 		return nil
@@ -158,7 +160,7 @@ func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 		}
 		//查询生成列表数据
 		data, pagination := searhWebContentent(querymap, n, reqType)
-
+		appendFollow(data, n.Session())
 		//查询送积分
 		queryStr := querymap["query"]
 		if len(queryStr) > 0 {
@@ -182,6 +184,7 @@ func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 
 		json.Unmarshal(bs, &querymap)
 		data, pagination := searhWebContentent(querymap, n, reqType)
+		appendFollow(data, n.Session())
 		n.Render("/search/enterpriseList.html", &xweb.T{"querymap": querymap, "data": data, "pagination": pagination})
 	}
 	return nil
@@ -189,6 +192,23 @@ func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 	//return n.Render("/search/entcommunity.html")
 	//}
 }
+func appendFollow(data *[]map[string]interface{}, session *httpsession.Session) {
+	userId := session.Get("userId")
+	if userId == nil {
+		return
+	}
+	follows := Find("follow_enterprise", `{"s_userid":"`+userId.(string)+`"}`, nil, `{"s_entid":1}`, false, -1, -1)
+	if follows != nil && len(*follows) > 0 {
+		for _, d := range *data {
+			for _, f := range *follows {
+				if f["s_entid"] == BsonIdToSId(d["_id"]) {
+					d["followFlag"] = true
+					continue
+				}
+			}
+		}
+	}
+}
 
 //即时搜索
 func (n *Search) Sim() error {
@@ -298,6 +318,7 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 	tempBisOne := false
 	ipcity := ""
 	var total int64 = 500
+	fmt.Println("cityNo:", cityNo)
 	if cityNo == "" && len(queryStr) == 0 {
 		querymap["cityNo"] = "1"
 		tn, er := ip.Find(n.Protocol())
@@ -330,7 +351,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","RegCapCurName","s_avatar"]
+						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid","RegCapCurName","s_avatar","excDirect"]
 						,"from":0,
 						"size":` + fmt.Sprintf("%v", perPage) + `,
 						  "sort": [{"_score": "desc"},{"OpSint":"desc"},{"RegCap":"desc"}]
@@ -482,15 +503,15 @@ 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","RegCapCurName","s_avatar"]
+    },"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid","RegCapCurName","s_avatar","excDirect"]
 	,"from":` + fmt.Sprintf("%v", ((currentPage-1)*perPage)) + `,
 	"size":` + fmt.Sprintf("%v", perPage) +
 			`,"sort":[` + sort + `] }`
 
 		total = elastic.Count("enterprise", "enterprise", tempQuery)
 	}
-	if total > 500 {
-		total = 500
+	if total > 400 {
+		total = 400
 	}
 	//查询列表数据
 	client := elastic.GetEsConn()

+ 17 - 7
core/src/qfw/search/wxsearchservice.go

@@ -50,7 +50,7 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
 		} else {
 			data = wxsearhWebContentent(querymap, n, reqType)
 		}
-		rs := FormatData(data)
+		rs := FormatData(data, n.Action)
 		querymap["entcard"] = n.GetString("mingpian")
 		if n.GetString("currentPage") != "" {
 			n.SetHeader("Pragma", "No-cache")
@@ -63,13 +63,13 @@ func (n *Wxsearch) WxgetEnterpriseList(reqType, param /*参数*/ string) error {
 		//反转生成map
 		querymap := map[string]string{}
 		data := wxsearhWebContentent(querymap, n, reqType)
-		rs := FormatData(data)
+		rs := FormatData(data, n.Action)
 		n.Render("/member/incmobile/list.html", &xweb.T{"data": rs, "querymap": querymap})
 	}
 	return nil
 }
 
-func FormatData(data *[]map[string]interface{}) string {
+func FormatData(data *[]map[string]interface{}, action *xweb.Action) string {
 	entinfos := make([]map[string]string, 0)
 	if data == nil {
 		return ""
@@ -88,6 +88,16 @@ func FormatData(data *[]map[string]interface{}) string {
 			"OpLocDistrict": fmt.Sprint(v["OpLocDistrictName"]),
 			"EstDate":       estDate,
 			"OpStateName":   fmt.Sprint(v["OpStateName"]),
+			"status":        "n",
+			"excDirect":     fmt.Sprint(v["excDirect"]),
+		}
+		//是否关注
+		entId := tmp["_id"]
+		userId := action.GetSession("userId").(string)
+		if userId != "" {
+			if Count("follow_enterprise", `{"s_userid":"`+userId+`","s_entid":"`+entId+`"}`) > 0 {
+				tmp["status"] = "y"
+			}
 		}
 		entinfos = append(entinfos, tmp)
 	}
@@ -142,7 +152,7 @@ func wxsearhWebContentent(querymap map[string]string, n *Wxsearch, reqType strin
 						      }
 						    }
 						  }
-						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","RegCapCurName","s_avatar"]
+						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","RegCapCurName","s_avatar","excDirect"]
 						,"from": ` + fmt.Sprintf("%v", ((currentPage-1)*perPage)) + `,
 						"size":` + fmt.Sprintf("%v", perPage) + `,
 						  "sort": [{"_score": "desc"},{"OpSint":"desc"},{"RegCap":"desc"}]
@@ -283,7 +293,7 @@ func wxsearhWebContentent(querymap map[string]string, n *Wxsearch, reqType strin
 			"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","RegCapCurName","s_avatar"]
+    },"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid","RegCapCurName","s_avatar","excDirect"]
 	,"from":` + fmt.Sprintf("%v", ((currentPage-1)*perPage)) + `,
 	"size":` + fmt.Sprintf("%v", perPage) +
 			`,"sort":[` + sort + `] }`
@@ -372,7 +382,7 @@ func wxsearhWebContentent(querymap map[string]string, n *Wxsearch, reqType strin
 			tmpdate, _ := res[i]["EstDate"]
 
 			//res[i]["OperatorLabel"] = getDiffName(EntType)[0]
-			if tmpdate != nil {
+			if tmpdate != nil && IntAll(tmpdate) != 0 {
 				res[i]["EstDate"] = FormatDateWithObj(&tmpdate, Date_Short_Layout)
 			} else {
 				res[i]["EstDate"] = ""
@@ -413,7 +423,7 @@ func wxsearhWebContententMp(querymap map[string]string, n *Wxsearch, reqType str
 	    "_source": [
 	        "_id","EntName","RegOrgName","RegNo","EntType",
 	        "LeRep","EstDate","OpLocDistrictName","OpStateName",
-	        "s_servicenames","s_action","OpLocDistrict","s_submitid"
+	        "s_servicenames","s_action","OpLocDistrict","s_submitid","excDirect"
 	    ],
 	    "from": 0,"size": 10,
 	    "sort": [{"OpSint": "desc","RegCap": "desc"}]

+ 26 - 0
core/src/qfw/searchmarket/demand.go

@@ -32,6 +32,32 @@ type Demand struct {
 	getpcode    xweb.Mapper `xweb:"POST /market/pcode"`
 	quote       xweb.Mapper `xweb:"POST /market/quote"` //查询服务商报价
 	blogin      xweb.Mapper `xweb:"/market/demand/blogin"`
+	demandList  xweb.Mapper `xweb:"/market/demand/list"`
+}
+
+//需求列表
+func (d *Demand) DemandList() error {
+	id := d.GetString("id")
+	if d.Is("GET") {
+		return d.Render("/market/demandview/" + id + ".html")
+	} else {
+		limit, _ := d.GetInteger("pageSize")
+		currentPage, _ := d.GetInteger("currentPage")
+		start := (currentPage - 1) * limit
+		var count int
+		var r []map[string]interface{}
+		searchtype := "demand"
+		tempQuery := `{"query":{"bool":{"must":[{"term":{"s_enterpriseid":"` + id + `"}}],"must_not": { "terms" : {"i_status":[4]}}}}}`
+		sort := `{"l_createdate":"desc"}`
+		if currentPage == 1 {
+			count = int(Count(searchtype, searchtype, tempQuery))
+		}
+		//
+		query := `{"query":{"bool":{"must":[{"term":{"s_enterpriseid":"` + id + `"}}],"must_not": { "terms" : {"i_status":[4]}}}},"from":` + fmt.Sprintf("%v", start) + `,"size":` + fmt.Sprintf("%v", limit) + `,"sort":[` + sort + `]}`
+		r = *Get(searchtype, searchtype, query)
+		d.ServeJson(M{"list": r, "count": count})
+		return nil
+	}
 }
 
 func (d *Demand) Index(id string) error {

+ 46 - 2
core/src/qfw/searchmarket/service.go

@@ -16,6 +16,7 @@ import (
 	mongo "qfw/util/mongodb"
 	mutil "qfw/util/mongodbutil"
 	//	"qfw/util/redis"
+	"qfw/util/elastic"
 	"strings"
 	"time"
 )
@@ -34,6 +35,41 @@ type Service struct {
 	commentinfo xweb.Mapper `xweb:"POST /market/commentinfo"`
 	//回复
 	reply xweb.Mapper `xweb:"/market/service/reply"`
+	//服务列表
+	slist xweb.Mapper `xweb:"/market/service/list"`
+}
+
+//服务列表
+func (s *Service) Slist() error {
+	id := s.GetString("id")
+	if s.Is("GET") {
+		return s.Render("/market/detail/" + id + ".html")
+	} else {
+		limit, _ := s.GetInteger("pageSize")
+		currentPage, _ := s.GetInteger("currentPage")
+		start := (currentPage - 1) * limit
+		var count int
+		var r []map[string]interface{}
+		query := `{"query": {
+		    "bool": {
+			  "must":[
+				{"term":{"s_enterpriseid":"` + id + `"}},
+				{"query_string": {"default_field": "s_isshow","query": "*3*"}}
+			  ],
+			  "must_not":[{"term":{"i_status":1}}]
+		    }
+		  }`
+		queryCount := query + "}"
+		queryList := query + `,"from":` + fmt.Sprintf("%v", start) + `,"size":` + fmt.Sprintf("%v", limit) + `,"sort":[{"l_createdate":"desc"}]}`
+		searchtype := "service"
+		if currentPage == 1 {
+			count = int(elastic.Count(searchtype, searchtype, queryCount))
+		}
+		//
+		r = *elastic.Get(searchtype, searchtype, queryList)
+		s.ServeJson(M{"list": r, "count": count})
+		return nil
+	}
 }
 
 //服务展示
@@ -41,6 +77,7 @@ func (s *Service) ServiceInfo(params string) error {
 	paramsa := strings.Split(params, "_")
 	isComment := 0
 	s.T["isal"] = 0
+	s.T["candoit"] = ""
 	//1个则是普通查看
 	if len(paramsa) > 0 {
 		id := paramsa[0]
@@ -66,6 +103,11 @@ func (s *Service) ServiceInfo(params string) error {
 			if len(servicecode) > 2 {
 				serviceTypeName = serviceTypeName + coreconfig.GetServiceName(servicecode)
 			}
+			serentid := sinfo["s_enterpriseid"].(string)
+			screateid := sinfo["s_createuserid"].(string)
+			if screateid == s.GetSession("userId") && serentid == s.GetSession("entid") {
+				s.T["candoit"] = "Y"
+			}
 			sinfo["servicetypename"] = serviceTypeName
 			if sinfo["s_enterpriseid"] != nil {
 				_id := sinfo["s_enterpriseid"].(string)
@@ -87,7 +129,6 @@ func (s *Service) ServiceInfo(params string) error {
 				einfo1 := *mutil.FindOne("enterprise", coreconfig.SysConfig.EntMongodbAlias, coreconfig.SysConfig.EntMongodbName, `{"_id":"`+_id+`"}`)
 				for k, v := range einfo1 {
 					einfo[k] = v
-					log.Println("sdfsdf")
 				}
 				//取自身评价
 				if s.T["status"] != nil && s.T["status"].(string) == "appendcomment" && s.GetSession("userId") != nil {
@@ -164,7 +205,10 @@ func (s *Service) ServiceInfo(params string) error {
 				} else {
 					s.T["style"] = "0"
 				}
-				einfo["_id"] = strings.Split(fmt.Sprintf("%s", einfo["_id"]), `"`)[1]
+				fmt.Println("einfoid:", einfo["_id"])
+				if einfo["_id"] != "" && einfo["_id"] != nil {
+					einfo["_id"] = strings.Split(fmt.Sprintf("%s", einfo["_id"]), `"`)[1]
+				}
 				s.T["einfo"] = einfo //企业信息
 
 				return s.Render("/service/detail.html")

+ 13 - 12
core/src/qfw/swordfish/swordfish.go

@@ -9,18 +9,19 @@ import (
 
 type SwordFish struct {
 	*xweb.Action
-	swordfish      xweb.Mapper `xweb:"/front/swordfish"`                 //剑鱼
-	rssSet         xweb.Mapper `xweb:"/member/swordfish/rssset"`         //订阅消息设置
-	infolist       xweb.Mapper `xweb:"/member/swordfish/infolist"`       //剑鱼
-	swordfishlist  xweb.Mapper `xweb:"/member/swordfish/swordfishlist"`  //剑鱼列表
-	setVisited     xweb.Mapper `xweb:"/member/swordfish/setVisited"`     //已经访问过的列表
-	visitRedirect  xweb.Mapper `xweb:"/visit/redirect"`                  //剑鱼跳转访问请求,后续统计
-	protocol       xweb.Mapper `xweb:"/member/swordfish/protocol"`       //剑鱼协议
-	wxprotocol     xweb.Mapper `xweb:"/member/swordfish/wxprotocol"`     //微信剑鱼协议
-	searchinfolist xweb.Mapper `xweb:"/member/swordfish/searchinfolist"` //剑鱼查询
-	wxsearch       xweb.Mapper `xweb:"/member/wxswordfish/search"`       //剑鱼微信查询
-	wxsearchlist   xweb.Mapper `xweb:"/member/wxswordfish/searchlist"`   //剑鱼微信查询结果展示
-	transfer       xweb.Mapper `xweb:"/member/wxswordfish/transfer"`     //剑鱼微信查询结果跳转到我的订阅
+	swordfish      xweb.Mapper `xweb:"/front/swordfish"`                     //剑鱼
+	rssSet         xweb.Mapper `xweb:"/member/swordfish/rssset"`             //订阅消息设置
+	infolist       xweb.Mapper `xweb:"/member/swordfish/infolist"`           //剑鱼
+	swordfishlist  xweb.Mapper `xweb:"/member/swordfish/swordfishlist"`      //剑鱼列表
+	setVisited     xweb.Mapper `xweb:"/member/swordfish/setVisited"`         //已经访问过的列表
+	visitRedirect  xweb.Mapper `xweb:"/visit/redirect"`                      //剑鱼跳转访问请求,后续统计
+	protocol       xweb.Mapper `xweb:"/member/swordfish/protocol"`           //剑鱼协议
+	wxprotocol     xweb.Mapper `xweb:"/member/swordfish/wxprotocol"`         //微信剑鱼协议
+	wxsearch       xweb.Mapper `xweb:"/member/wxswordfish/search"`           //剑鱼微信查询
+	wxsearchlist   xweb.Mapper `xweb:"/member/wxswordfish/searchlist"`       //剑鱼微信查询结果展示
+	transfer       xweb.Mapper `xweb:"/member/wxswordfish/transfer"`         //剑鱼微信查询结果跳转到我的订阅
+	newSordfish    xweb.Mapper `xweb:"/front/newSwordfish.html"`             //剑鱼新首页
+	searchinfolist xweb.Mapper `xweb:"/front/swordfish/searchinfolist.html"` //剑鱼查询
 
 }
 

+ 15 - 0
core/src/qfw/swordfish/swordfishmanage.go

@@ -7,6 +7,8 @@ import (
 	"gopkg.in/mgo.v2/bson"
 	"net/rpc"
 	"qfw/coreconfig"
+	cutil "qfw/coreutil"
+	"qfw/mobile"
 	"qfw/util"
 	"qfw/util/mongodb"
 	"qfw/util/redis"
@@ -14,6 +16,11 @@ import (
 	"time"
 )
 
+//剑鱼新首页
+func (s *SwordFish) NewSordfish() error {
+	return s.Render("/swordfish/newindex.html")
+}
+
 //剑鱼查询结果也跳转到我的订阅
 func (s *SwordFish) Transfer() error {
 	s.DisableHttpCache()
@@ -94,6 +101,8 @@ func (s *SwordFish) Wxprotocol() error {
 
 //剑鱼微信查询页面
 func (s *SwordFish) Wxsearch() error {
+	s.T["signature"] = mobile.GetSignature(s.Action)
+	s.T["shareid"] = cutil.FindMyShareId("topjy", s.Session().Get("s_m_openid").(string))
 	return s.Render("/swordfish/wxsearch.html")
 }
 
@@ -133,6 +142,9 @@ func (s *SwordFish) Wxsearchlist() error {
 			}
 		}
 	}
+	//搜索列表增加分享
+	s.T["signature"] = mobile.GetSignature(s.Action)
+	s.T["shareid"] = cutil.FindMyShareId("topjy", s.Session().Get("s_m_openid").(string))
 	return s.Render("/swordfish/wxsearchlist.html", &s.T)
 }
 
@@ -146,6 +158,7 @@ func (s *SwordFish) Searchinfolist() error {
 	} else if s_type == "2" {
 		s_type = "bid"
 	}
+	s.T["status"] = "Y"
 	s.T["keywords"] = keywords
 	s.SetSession("sf_keywords", keywords)
 	s.T["s_name"] = s_name
@@ -256,6 +269,8 @@ func getSwordFish(lasttime int64, sid string, res []map[string]interface{}, coun
 func (s *SwordFish) VisitRedirect() {
 	sid := s.GetString("id")
 	surl := s.GetString("url")
+	s.T["signature"] = mobile.GetSignature(s.Action)
+	s.T["shareid"] = cutil.FindMyShareId("topjy", s.Session().Get("s_m_openid").(string))
 	if len(sid) > 5 {
 		obj := *mongodb.FindById("bidding", sid, `{"publishtime":1,"_id":0,"detail":1,"title":1}`)
 		if obj != nil && len(obj) == 3 {

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

@@ -2,37 +2,21 @@ package yellowpage
 
 //企业黄页的Action
 import (
-	"fmt"
 	"github.com/go-xweb/xweb"
-	. "gopkg.in/mgo.v2/bson"
-	. "qfw/util/mongodb"
-	"strings"
 )
 
 type Yellowpage struct {
 	*xweb.Action
 	//进入企业黄页
-	wxenterpriseInfo xweb.Mapper `xweb:"/wx/enterprise/(\\w+).html"`
-	//进入企业黄页
 	enterpriseInfo xweb.Mapper `xweb:"/enterprise/(\\w+).html"`
-	//根据企业注册号进入企业黄页
-	enterpriseInfoByRegNO xweb.Mapper `xweb:"/enterpriseInfoByRegNO/(\\w+).html"`
 	//获取关系网数据
 	getRelation xweb.Mapper `xweb:"/member/getRelation"`
 	//获取失信信息
 	getDishonesty xweb.Mapper `xweb:"/front/getDishonesty"`
-	//获取企业的服务列表
-	findServiceByEntId xweb.Mapper `xweb:"/front/findServiceByEntId"`
+	//根据注册证号展示关系网
+	showRelationByRegNo xweb.Mapper `xweb:"/enterprise/relation/(\\w+)"`
 }
 
-func (yp *Yellowpage) EnterpriseInfoByRegNO(regNO string) error {
-	r := FindOne("enterprise", M{"RegNo": regNO})
-	if r == nil || len(*r) == 0 {
-		return yp.Render("/yellowpage/error.html")
-	}
-	id := strings.Split(fmt.Sprintf("%s", (*r)["_id"]), `"`)[1]
-	return yp.Redirect("/enterprise/" + id + ".html")
-}
 func init() {
 	xweb.AddAction(&Yellowpage{})
 }

+ 145 - 221
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -5,14 +5,14 @@ import (
 	"container/list"
 	"encoding/json"
 	"fmt"
-	"github.com/go-xweb/httpsession"
-	_ "github.com/go-xweb/xweb"
+	"github.com/go-xweb/xweb"
 	mgo "gopkg.in/mgo.v2"
 	. "gopkg.in/mgo.v2/bson"
 	"html/template"
 	"log"
 	cf "qfw/coreconfig"
 	"qfw/mobile"
+	tag "qfw/tag"
 	"qfw/util"
 	"qfw/util/credit"
 	elastic "qfw/util/elastic"
@@ -48,7 +48,7 @@ func FormatDate(src *interface{}) string {
 }
 
 func GetEntInfo(id string) map[string]interface{} {
-	res := mongodbutil.FindById("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, 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,"SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1,"staffinfo":1,"RegCapCurName":1}`)
+	res := mongodbutil.FindById("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, 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,"SourceType":1, "Nb_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1,"staffinfo":1,"RegCapCurName":1,"excDirect":1}`)
 	if res != nil && len(*res) > 0 {
 		opl, _ := (*res)["OpLocDistrict"].(string)
 		if len(opl) >= 2 {
@@ -132,206 +132,117 @@ func GetEntInfo(id string) map[string]interface{} {
 				(*res)["s_action"] = "N"
 			}
 		}
-		log.Println(res)
 		return *res
 	}
 	return nil
 }
-func WxGetEntInfo(id string, flag bool) 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, "s_weixin":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}`)
-	if res != nil {
-		submitid := (*res)["s_submitid"]
-		if submitid != nil {
-			ud := FindById("user", submitid.(string), `{"i_comauthenttype":1}`)
-			(*res)["i_comauthenttype"] = (*ud)["i_comauthenttype"]
-		}
-		opl, _ := (*res)["OpLocDistrict"].(string)
-		if len(opl) >= 2 {
-			if v, ok := city_map[opl[:2]]; ok {
-				(*res)["OpLoc"] = v
-			}
-		}
-		syno, _ := (*res)["s_synopsis"].(string)
-		(*res)["s_synopsis"] = template.HTML(syno)
-		ty, _ := (*res)["SourceType"].(string)
-		if ty == "01" {
-			(*res)["gs"] = true
-		} else {
-			(*res)["gs"] = false
-		}
-		OpFrom := (*res)["OpFrom"]
-		if OpFrom != nil {
-			(*res)["OpFrom"] = FormatDate(&OpFrom)
-		}
-		OpTo := (*res)["OpTo"]
-		if OpFrom != nil {
-			(*res)["OpTo"] = FormatDate(&OpTo)
-		}
-		IssBLicDate := (*res)["IssBLicDate"]
-		s_action := (*res)["s_action"]
-		if s_action == nil || s_action == "" {
-			(*res)["s_action"] = "N"
-		}
-		if OpFrom != nil {
-			(*res)["IssBLicDate"] = FormatDate(&IssBLicDate)
-		}
-		EstDate := (*res)["EstDate"]
-		if OpFrom != nil {
-			(*res)["EstDate"] = FormatDate(&EstDate)
-		}
-		//查询企业关系
-		//relation := Find("entrelation", &map[string]interface{}{
-		//	"aid": ObjectIdHex(id),
-		//}, nil, nil, false, -1, -1)
-		EntType, _ := (*res)["EntType"].(string)
-		//处理分公司
-		if EntType != "" {
-			if EntType == "5810" || EntType == "6810" || EntType == "7310" || EntType == "3200" || EntType == "3100" {
-				(*res)["EntType"] = "5810"
-			} else if len(EntType) > 1 {
-				if EntType[:1] == "2" {
-					(*res)["EntType"] = "5810"
-				}
-			}
-		}
-		en, _ := (*res)["EntName"].(string)
-		if en == "" {
-			(*res)["EntName"] = (*res)["LeRep"]
-		}
-		//
-		(*res)["EntTypeLabel"] = (mobile.GetDiffName(EntType))[0]
-		if flag {
-			RegNo, _ := (*res)["RegNo"].(string)
-			relation := makeRelation(RegNo, en)
-			if relation != nil {
-				(*res)["relation"] = relation
-			}
-		}
-
-		(*res)["entid"] = id
-		return *res
-	}
-	return nil
-}
-
-//企业黄查询结果
-func (yp *Yellowpage) WxenterpriseInfo(regNO string) error {
-	r := FindOne("enterprise", M{"RegNo": regNO})
-	if r == nil || len(*r) == 0 {
-		return yp.Render("/yellowpage/error.html")
-	}
-	id := strings.Split(fmt.Sprintf("%s", (*r)["_id"]), `"`)[1]
-	return yp.Redirect("/enterprise/" + id + ".html")
-}
 
 //企业黄查询结果
 func (yp *Yellowpage) EnterpriseInfo(id string) error {
+	pcVisit, _ := yp.GetSession("pcVisit").(bool)
 	id = strings.Split(id, "#")[0]
 	regex, _ := regexp.Compile("(Android|Mobile)")
-	ismobile := regex.FindAllString(yp.Header("User-Agent"), -1)
+	ismobile := len(regex.FindAllString(yp.Header("User-Agent"), -1)) > 0 && !pcVisit
 	key := "enterpriseInfo_"
-	if len(ismobile) > 0 {
+	if ismobile {
 		key = "menterpriseInfo_"
 	}
 	if ret, err := redis.GetBytes("enterprise", key+id); err == nil {
 		return yp.SetBody(*ret)
 	} else {
-		if info := GetEntInfo(id); info != nil {
-			yp.T["res"] = info
-			regNo, _ := info["RegNo"].(string)
-			entName, _ := info["EntName"].(string)
-			relation, relflag := getRelation(regNo, entName)
-			var nodes *[]map[string]interface{}
-			if relflag {
-				if d, err := json.Marshal(relation["nodes"]); err == nil && json.Unmarshal(d, &nodes) == nil && len(*nodes) > 0 {
-					//相关企业
-					var entmids []ObjectId
-					for _, v := range *nodes {
-						if v["type"] == "e" && v["entmid"] != nil && v["entmid"].(string) != "" {
-							entmids = append(entmids, ObjectIdHex(v["entmid"].(string)))
-						}
+		return CommonEntInfo(yp.Action, id, 0, ismobile)
+	}
+}
+func CommonEntInfo(yp *xweb.Action, id string, editFlag int, ismobile bool) error {
+	if info := GetEntInfo(id); info != nil {
+		yp.T["res"] = info
+		regNo, _ := info["RegNo"].(string)
+		entName, _ := info["EntName"].(string)
+		relation, relflag := getRelation(regNo, entName)
+		var nodes *[]map[string]interface{}
+		if relflag {
+			if d, err := json.Marshal(relation["nodes"]); err == nil && json.Unmarshal(d, &nodes) == nil && len(*nodes) > 0 {
+				//相关企业
+				var entmids []ObjectId
+				for _, v := range *nodes {
+					if v["type"] == "e" && v["entmid"] != nil && v["entmid"].(string) != "" {
+						entmids = append(entmids, ObjectIdHex(v["entmid"].(string)))
 					}
-					if len(entmids) > 0 {
-						relevantEnts := mongodbutil.Find("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, M{"_id": M{"$in": entmids}}, 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"])
-								for _, node := range *nodes {
-									if node["entmid"] != nil && node["entmid"].(string) == relevantEnt["_id"] {
-										node["haslink"] = true
-										break
-									}
+				}
+				if len(entmids) > 0 {
+					relevantEnts := mongodbutil.Find("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, M{"_id": M{"$in": entmids}}, 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"])
+							for _, node := range *nodes {
+								if node["entmid"] != nil && node["entmid"].(string) == relevantEnt["_id"] {
+									node["haslink"] = true
+									break
 								}
 							}
-							yp.T["relevantEnts"] = relevantEnts
 						}
-						relation["nodes"] = nodes
-						redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
+						yp.T["relevantEnts"] = relevantEnts
 					}
+					relation["nodes"] = nodes
+					redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
 				}
 			}
-			//相关新闻
-			var ids []ObjectId
-			newsIds := Find("rel_news", `{"s_entid":"`+id+`"}`, nil, `{"s_newsid":1}`, false, -1, -1)
-			if newsIds != nil && len(*newsIds) > 0 {
-				for _, v := range *newsIds {
-					if v["s_newsid"] != nil {
-						newsid, _ := v["s_newsid"].(string)
-						if newsid == "" {
-							continue
-						}
-						ids = append(ids, ObjectIdHex(newsid))
+		}
+		//相关新闻
+		var ids []ObjectId
+		newsIds := Find("rel_news", `{"s_entid":"`+id+`"}`, nil, `{"s_newsid":1}`, false, -1, -1)
+		if newsIds != nil && len(*newsIds) > 0 {
+			for _, v := range *newsIds {
+				if v["s_newsid"] != nil {
+					newsid, _ := v["s_newsid"].(string)
+					if newsid == "" {
+						continue
 					}
+					ids = append(ids, ObjectIdHex(newsid))
 				}
-				if len(ids) > 0 {
-					news := Find("trs_news", M{"_id": M{"$in": ids}}, `{"l_comeintime":-1}`, `{"s_link":1,"s_title":1,"l_comeintime":1}`, false, 0, 8)
-					if news != nil && len(*news) > 0 {
-						yp.T["relevantNews"] = news
-					}
+			}
+			if len(ids) > 0 {
+				news := Find("trs_news", M{"_id": M{"$in": ids}}, `{"l_comeintime":-1}`, `{"s_link":1,"s_title":1,"l_comeintime":1}`, false, 0, 8)
+				if news != nil && len(*news) > 0 {
+					yp.T["relevantNews"] = news
 				}
 			}
-			//失信信息第一页数据
-			yp.T["dishonesty"] = getDishonesty(util.If(info["LegCerNO"] != nil, info["LegCerNO"], "").(string), 1)
-			//服务列表第一页数据
-			yp.T["service"] = findServiceByEntId(id, 1, yp.Session())
-			//关系网数据
-			yp.T["relflag"] = relflag
-			//著作权
-			yp.T["copyright"] = FindOne("enterprise_copyright", `{"EntId":"`+id+`"}`)
-
+		}
+		//失信信息第一页数据
+		yp.T["dishonesty"] = getDishonesty(util.If(info["LegCerNO"] != nil, info["LegCerNO"], "").(string), 1)
+		//关系网数据
+		yp.T["relflag"] = relflag
+		//著作权
+		yp.T["copyright"] = mongodbutil.FindOne("enterprise_copyright", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, `{"EntName":"`+entName+`"}`)
+		//编辑企业名片标识
+		yp.T["editFlag"] = editFlag
+		yp.T["lastService"] = getLastService(id)
+		//过滤企业名
+		if relflag && nodes != nil && len(*nodes) > 0 {
+			processRelation(nodes, relation, regNo, id)
+		}
+		if editFlag > 0 {
+			return yp.Render("/enterprise/detail.html", &yp.T)
+		} else {
+			//服务数量
 			var contentuser []byte
 			var erruser error
-			if len(ismobile) > 0 {
+			if ismobile {
 				contentuser, erruser = yp.Render4Cache("/member/incmobile/detailindex.html", &yp.T)
 			} else {
-				contentuser, erruser = yp.Render4Cache("/yellowpage/enterpriseinfo.html", &yp.T)
+				contentuser, erruser = yp.Render4Cache("/enterprise/detail.html", &yp.T)
 			}
-
 			if erruser == nil {
-				if len(ismobile) > 0 {
+				if ismobile {
 					redis.PutBytes("enterprise", "menterpriseInfo_"+id, &contentuser, 7*ONEDAY)
 				} else {
 					redis.PutBytes("enterprise", "enterpriseInfo_"+id, &contentuser, 7*ONEDAY)
 				}
 			}
-			//过滤企业名
-			if relflag && nodes != nil && len(*nodes) > 0 {
-				go func() {
-					util.Try(func() {
-						if filterEntName(nodes) > 0 {
-							relation["nodes"] = nodes
-							redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
-							redis.Del("enterprise", "enterpriseInfo_"+id)
-						}
-					}, func(e interface{}) {
-						log.Println("过滤企业名出错:", e)
-					})
-				}()
-			}
 			return yp.SetBody(contentuser)
-		} else {
-			return yp.Render("/_error.html")
 		}
+	} else {
+		return yp.Render("/_error.html")
 	}
 }
 
@@ -608,67 +519,24 @@ func getDishonesty(legcerNo string, currentPage int) map[string]interface{} {
 		return ret
 	}
 }
-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": {
+
+//获取该企业的服务数量
+func getLastService(id string) string {
+	query := `{"query": {
 		    "bool": {
-			  "must":[` + tempstrquery + `]` + servicequery + `
+			  "must":[
+				  {"term":{"s_enterpriseid":"` + id + `"}},
+				  {"query_string": {"default_field": "s_isshow","query": "*3*"}}
+				],
+			  "must_not":[{"term":{"i_status":1}}]
 		    }
-		  }}`
-		//需要查到的字段信息
-		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)
+		  },"from":0,"size":1,"sort":[{"l_createdate":"desc"}]}`
+	r := elastic.Get("service", "service", query)
+	if r != nil && len(*r) == 1 {
+		return util.ObjToString((*r)[0]["_id"])
 	}
-	return res
+	return ""
 }
-
 func checkAuth(obj map[string]interface{}) (b bool, err string) {
 	if len(obj) > 0 {
 		//判断有没有预约的情况
@@ -692,6 +560,20 @@ func checkAuth(obj map[string]interface{}) (b bool, err string) {
 	}
 	return true, ""
 }
+func processRelation(nodes *[]map[string]interface{}, relation map[string]interface{}, regNo, id string) {
+	go func() {
+		util.Try(func() {
+			if filterEntName(nodes) > 0 {
+				relation["nodes"] = nodes
+				redis.Put("enterprise", "relation-"+regNo, relation, 7*ONEDAY)
+				redis.Del("enterprise", "enterpriseInfo_"+id)
+			}
+		}, func(e interface{}) {
+			log.Println("过滤企业名出错:", e)
+		})
+	}()
+}
+
 func filterEntName(nodes *[]map[string]interface{}) int {
 	if len(provinces) == 0 {
 		util.ReadConfig("./province.json", &provinces)
@@ -814,3 +696,45 @@ func filterRegion(text string) string {
 	}
 	return text
 }
+
+//根据注册证号展示关系网
+func (yp *Yellowpage) ShowRelationByRegNo(regNo string) error {
+	defer util.Catch()
+	data := tag.Ad("relation-limit", 1)
+	if strings.TrimSpace(regNo) == "" || data == nil || len(data) == 0 || len(data[0]) == 0 || data[0]["o_extend"] == nil {
+		log.Println("关系网接口没有开放!")
+		return yp.Render("/_error.html")
+	}
+	extend := data[0]["o_extend"].(map[string]interface{})
+	if util.ObjToString(extend["flag"]) != "true" {
+		log.Println("关系网接口没有开放!")
+		return yp.Render("/_error.html")
+	}
+	res := mongodbutil.FindOneByField("enterprise", cf.SysConfig.EntMongodbAlias, cf.SysConfig.EntMongodbName, `{"RegNo":"`+regNo+`"}`, `{"EntName":1,"LegCerNO":1,"RegCapCurName":1}`)
+	var flag = -1
+	if res != nil && len(*res) > 0 {
+		id := util.BsonIdToSId((*res)["_id"])
+		entName, _ := (*res)["EntName"].(string)
+		datas, ok := getRelation(regNo, entName)
+		var nodes *[]map[string]interface{}
+		if ok {
+			d, err := json.Marshal(datas["nodes"])
+			if err != nil || json.Unmarshal(d, &nodes) != nil {
+				flag = -2
+			}
+			if ok {
+				flag = 1
+				processRelation(nodes, datas, regNo, id)
+			}
+		}
+		yp.T["RegNo"] = regNo
+		yp.T["EntName"] = entName
+		yp.T["LegCerNO"] = (*res)["LegCerNO"]
+		yp.T["RegCapCurName"] = (*res)["RegCapCurName"]
+		yp.T["relation"] = datas
+	} else {
+		flag = -3
+	}
+	yp.T["relFlag"] = flag
+	return yp.Render("/enterprise/relation.html")
+}

+ 1 - 1
core/src/serviceclassify.json

@@ -59,7 +59,7 @@
                 "name": "认证服务",
                 "children": [
                     {
-                        "code": "010301",
+                        "code": "010401",
                         "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-04-19 16:10:53"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-04-19 16:10:53"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-06-13 10:20:06"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-06-13 10:20:06"}},"marketisstart":true,"marketrate":300}

+ 114 - 228
core/src/web/staticres/css/dev-qfw.css

@@ -73,7 +73,7 @@ a{
 	word-break: break-all;
 }
 .a-content {
-	max-width: 1200px;
+	width: 1200px;
 	margin-left: auto;
 	margin-right: auto;
 	padding: 0px;
@@ -2367,6 +2367,9 @@ style="color:#D03102;margin-right:5px;"
 .b-nav-other>a:hover,.b-nav-active>a{
 	font-weight: bold;
 }
+.b-head{
+	min-width: 1200px;
+}
 .b-head .b-loginbtn{
 	width: 40px;
 	height: 40px;
@@ -2492,7 +2495,7 @@ style="color:#D03102;margin-right:5px;"
 .b-content{
 	padding: 0px;
 	margin: 15px auto;
-	max-width: 1200px;
+	width: 1200px;
 }
 .b-left{
 	background-color: #FFFFFF;
@@ -2562,6 +2565,7 @@ style="color:#D03102;margin-right:5px;"
 	color: #666;
 	z-index: 1;
 	display: none;
+	width: 268px;
 }
 .b-pcshare-content img{
 	width: 19px;
@@ -2639,239 +2643,18 @@ style="color:#D03102;margin-right:5px;"
 /*认证完第一次登录 end*/
 /*分辨率小于1200的时候调整布局,算上滚动条1217*/
 @media (max-width: 1217px) {
-	.b-left{
-		width: 100%;
-	}
-	.b-right{
-		display: none;
-	}
-	.a-index .a-cols>.a-com-ul-block.a-com-last{
-		display: none;
-	}
-	.a-index .a-index-want .a-com-title{
-		padding-left: 10px;
-	}
-	.a-index .a-index-want{
-		height: inherit;
-		padding: 0px !important;
-	}
-	.a-index .a-index-fwxq{
-		display: none;
-	}
-	.a-index .a-index-hd{
-		display: none;
-	}
-	.a-index .a-index-want{
-		border-bottom-width: 1px !important;
-	}
-	.a-index .a-index-want li.a-com-last{
-		padding: 0px;
-	}
-	.a-index .a-index-want li.a-com-last>div{
-		margin: 3px;
-	}
+	
 }
 @media (max-width: 1107px) {
-	.a-index .a-index-want li.a-com-last{
-		text-align: center;
-	}
+	
 }
 @media (max-width: 1023px) {
-	.a-index-head{
-		width: 885px;
-		margin-left: auto;
-		margin-right: auto;
-	}
+	
 }
 /* 小屏幕(手机,小于等于 768px) */
 @media (max-width: 768px) {
-	/****企业名片信息页样式****/
-	.qfw-entinfo-padding41 {
-		padding: 0px 5px;
-	}
-	/********首页*******/
-	.a-header{
-		box-shadow: none;
-		margin-bottom: 0px;
-	}
-	.a-index{
-		padding-left: 0px;	
-		padding-right: 0px;	
-	}
-	.a-index .a-panel{
-		padding: 0px 5px;
-	}
-	.loginModal {
-	  	width: 93% !important;
-	}
-	.a-header .a-com-active {
-  		background-color: transparent;
-	}
-	.a-header table {
-		width: 100%;
-	}
-	.a-header td {
-	  	height: 60px;
-	  	line-height: 60px;
-	}
-	.a-header .a-h-logo{
-		padding-left: 10px;
-		padding-right: 15px;
-	}
-	.a-header .a-h-logo img {
-	  	width: 50px;
-	  	height: 50px;
-	}
-	.a-header .a-h-search {
-  		width: 100%;
-		padding-left: 15px;
-	}
-	.a-header .a-h-search .input-group{
-		height: auto;
-	}
-	.a-header .a-h-search form {
-		height: auto;
-	  	margin-top: 0px;
-	}
-	.a-header .a-h-nav{
-		position: absolute;
-		right: 0px;
-		top: 60px;
-		width: 150px;
-		z-index: 101;
-		padding-right: 0px;
-		line-height: 35px;
-	}
-	.a-header .a-h-nav ul{
-		background: black;
-		float: left;
-		opacity: 0.9;
-		text-align: left;
-		padding-top: 5px;
-		padding-bottom: 5px;
-	}
-	.a-header .a-h-nav .a-dot{
-		position: absolute;
-		right: 10px;
-  		bottom: 0px;
-	}
-	.a-header .a-h-nav ul img{
-		width: 25px;
-		height: 25px;
-		margin-left: 15px;
- 		margin-right: 15px;
-	}
-	.a-header .a-h-nav .a-line {
-	  	background-color: #5E5E5E;
-	}
-	.a-header .a-h-nav a{
-		color: #ffffff;
-	}
-	.a-header .a-h-nav li .a-line{
-		width: 100%;
-	}
-	.a-header .a-h-nav li>span{
-		display: inline-block;
-		position: relative;
-		vertical-align: top;
-		height: inherit;
-		padding-top: 5px;
-	}
-	.a-header .a-h-nav li{
-	  	width: 100%;
-	}
-	.a-header .a-h-nav-btn{
-		position: absolute;
-		right: 5px;
-		width: 30px;
-		height: 30px;
-		top: 50%;
-		margin-top: -15px;
-	}
-	.a-header .a-h-nav-btn>img{
-		width: inherit;
-		height: inherit;
-	}
-	.a-header .a-h-nav-btn>.a-dot{
-		position: absolute;
-		right: 0px;
-		top: 0px;
-	}
-	.m-nickName{
-		width: 85px;
-		text-overflow: ellipsis;
-		overflow: hidden;
-		white-space: nowrap;
-		display: inline-block;
-	}
-	.a-index-head {
-	  	width: 100%;
-	}
-	.a-index-head .a-i-h-middle {
-	  	padding-left: 0px;
-	  	width: 100%;
-	}
-	.a-index-head .a-i-h-right{
-		width: 100%;
-		padding: 20px 0px 0px 0px;
-		height: 100px;
-	}
-	.a-index-head .a-index-want{
-		border-width: 0px !important;
-	}
-	.a-index-head .a-index-want div.a-com-four{
-		width: 80px;
-	}
-	.a-index-head .a-index-want div{
-		width: 60px;
-	}
-	.a-index .a-index-want li.a-com-last {
-	  	text-align: left;
-	}
-	.a-index .a-index-want li.a-com-last>div {
-	  	margin: 0px;
-	}
-	.qfw-bottom{
-		position: relative;
-	}
-	.qfw-bottom-text{
-		position: absolute;
-		top: 50%;
-		margin-top: -26px;
-		height: 52px;
-		width: 100%;
-		display: block !important;
-	}
-	.qfw-bottom-text a {
-	  	margin-left: 5px;
-	  	margin-right: 5px;
-	}
-	.a-index .a-panel .a-com-title font{
-		font-size: 20px;
-	}
-	.a-content .a-c-left{
-		width: 100%;
-	}
-	.a-content .a-c-right{
-		display: none;
-	}
-	/*登录窗口*/
-	.loginModal .modal-header{
-		text-align: center;
-	}
-	.login-logo{
-		margin-left: 0px !important;
-		width: 96.6px !important;
-  		height: 40.8px !important;
-		margin-top: 10px !important;
-	}
-	.loginModal .modal-header{
-		height: auto !important;
-	}
-	.loginModal .otherlogin{
-		display: block !important;
-		padding: 0 !important;
-	}
+	
+	
 }
 .radius{
 	border-radius: 34px;
@@ -2899,4 +2682,107 @@ style="color:#D03102;margin-right:5px;"
 	line-height: 75px;
 	text-align: center;
 	background: #FFF;
+}
+/**********百度地图*********/
+.baiduMap{
+	position: absolute;
+	top: 15%;
+	left: 15%;
+	right: 15%;
+	bottom: 15%;
+	border: 5px solid #dd4814;
+	background-color: rgb(255, 255, 255);
+	z-index: 1002;
+}
+.baiduMapError{
+	position: absolute;
+	top: 50%;
+	left: 50%;
+	font-size: 18px;
+	text-align: center;
+	color: red;
+	width: 240px;
+	line-height: 24px;
+	margin-top: -12px;
+	margin-left: -120px;
+	letter-spacing: 2px;
+}
+.baiduMapArea{
+	position: fixed;
+	top: 0px;
+	left: 0px;
+	right: 0px;
+	bottom: 0px;
+	background: rgba(0, 0, 0, 0.8);
+	z-index: 1001;
+}
+.closeBaiduMap{
+    position: absolute;
+    top: 15%;
+    right: 15.5%;
+    margin-top: 5px;
+    z-index: 1003;
+	font-size: 16px;
+}
+/**********提示框***********/
+.tipAssembly{
+	position: fixed;
+	background-color: rgba(128,128,128,0.6);
+	top: 50%;
+	left: 50%;
+	color: #fff;
+	z-index: 999;
+	border-radius: 5px;
+	text-align: center;
+	padding: 20px 25px;
+}
+
+.maskLayer{
+	position: fixed;
+	left: 0px;
+	right: 0px;
+	top: 0px;
+	bottom: 0px;
+	background-color: rgba(0,0,0,0.5);
+	display: none;
+	z-index: 998;
+}
+.tipTriangle{
+	position: absolute;
+	display: none;
+	z-index: 999;
+}
+.tipTriangle>div{
+	padding: 15px 14px;
+	margin-top: 10px;
+	background-color: rgb(255,255,255);
+}
+.tipTriangle .triangle-up{
+    width: 0;
+    height: 0;
+    display: block;
+	position: absolute;
+	border-bottom: 10px solid rgb(255, 255, 255);
+}
+.tipTriangle .triangle-right{
+	right: 20px;
+	border-left: 12px solid transparent;
+    border-right: 3px solid transparent;
+}
+.tipTriangle .triangle-left{
+	left: 20px;
+	border-right: 12px solid transparent;
+    border-left: 3px solid transparent;
+}
+.ent-status-r,.ent-status-g{
+	color: #ffffff;
+	padding: 2px 10px 2px 5px;
+}
+.ent-status-r{
+	background-image: url("/images/status-r.png");
+	background-size: 100% 100%;
+}
+.ent-status-g{
+	background-image: url("/images/status-g.png");
+	background-size: 100% 100%;
 }

+ 226 - 74
core/src/web/staticres/css/entcommunity.css

@@ -34,6 +34,98 @@ a:focus, a:hover{
 .ttcon ul li:hover{
 	color: #16a086;
 }
+.ent-follow{
+	position: absolute;
+	top: 50%;
+	right: 0px;
+	line-height: 27px;
+	margin-top: -14.5px;
+	color: #56C4B0;
+	cursor: pointer;
+	width: 70px;
+}
+.ent-follow span{
+	margin-right: 5px;
+	font-size: 16px;
+	vertical-align: middle;
+}
+/*********企业列表样式***************/
+.entlist-page .rowFl{
+	position:relative;
+	margin-top: 20px;
+	padding-bottom: 20px;
+}
+.entlist-page .rowFltt{
+	border-bottom:1px solid #ddd;
+}
+.entlist-page .rowsolid-bottom{
+	border-bottom:1px solid #CCCCCC;	
+}
+.entlist-page .rowFltt .qfw-text-more{
+	position:absolute;
+	right:10px;
+	top:2px;
+	font-weight:bold;
+	cursor:pointer;
+	color: #16a086;
+}
+.entlist-page .tt{
+	width:90px;
+	padding-left: 15px;
+}
+.entlist-page .city_china{
+	font-size:12px;
+}
+.entlist-page .city_china select{
+	border-bottom:1px dashed #CCCCCC;
+}
+.entlist-page .less{
+	height:20px;
+	overflow:hidden
+}
+.entlist-page .ttcon{
+	width:85%;
+	vertical-align:top
+}
+.entlist-page .ttcon ul{
+	display:inline-block;
+}
+.entlist-page .ttcon ul li{
+	display:inline-block;
+	margin-right:35px;
+	height:25px;
+	line-height:25px;
+	cursor:pointer;
+	margin-top:-2px;
+}
+.entlist-page .sel{
+	width: 20%;
+	min-width:80px;
+	max-width:180px;
+	height: 35px;
+	font-size: 14px;
+	color: #a0a0a0;
+	background-color: #fff;
+	border: 1px solid #ccc;
+	margin-right: 15px;
+}
+.entlist-page #navs {
+	position:relative
+}
+.entlist-page #navs .renzheng {
+	position:absolute;
+	right:10px;
+	bottom:0px;
+}
+/******列表详细信息*******/
+.entlist-page .borderB .qfw-entcontent-padding{
+	padding:20px 50px 20px 20px;
+	line-height: 25px;
+	position: relative;
+}
+.entlist-page .qfw-entcontent-padding .lineb a{
+	font-size:16px;
+}
 .entlist-page .entlist-allclaify{
 	color: #16a086;
 	font-weight: bold;
@@ -68,18 +160,6 @@ a:focus, a:hover{
 .entlist-page .nav-tabs>.active:hover{
 	background-color: #FFFFFF;
 }
-.ent-status-r,.ent-status-g{
-	color: #ffffff;
-	padding: 2px 10px 2px 5px;
-}
-.ent-status-r{
-	background-image: url("/images/status-r.png");
-	background-size: 100% 100%;
-}
-.ent-status-g{
-	background-image: url("/images/status-g.png");
-	background-size: 100% 100%;
-}
 .entlist-page .qfw-entcontent-padding>img{
 	width: 90px;
 	height: 90px;
@@ -102,6 +182,11 @@ a:focus, a:hover{
 	word-break: break-all;
 	white-space: normal !important;
 }
+.tipTriangle>div>div{
+	margin-top: 10px;
+	color: #a0a0a0;
+	text-align: center;
+}
 .b-scroll-list .b-adver-content{
 	padding: 0px 10px 10px 10px;
 	max-height: 600px;
@@ -256,22 +341,44 @@ a:focus, a:hover{
 /*********企业画像***************/
 .entinfo-page .b-com-head{
 	background-color: #FFFFFF;
+	padding: 30px 30px 10px 30px;
 	position: relative;
-	padding: 30px;
 }
-.entinfo-page .b-com-head>img{
+.entinfo-page .b-com-head>.ent-logo{
 	position: absolute;
-	height: 130px;
-	width: 130px;
 	left: 30px;
 	top: 30px;
 }
+.entinfo-page .b-com-head>.ent-logo>img{
+	height: 130px;
+	width: 130px;
+}
+.entinfo-page .b-com-head>.ent-logo>.ent-uploadLogo{
+	position: absolute;
+	left: 0px;
+	right: 0px;
+	bottom: 0px;
+	line-height: 30px;
+	color: #ffffff;
+	background-color: gray;
+	opacity: 0.5;
+	text-align: center;
+	cursor: pointer;
+}
+.entinfo-page .b-com-head>div{
+	position: relative;
+}
 .entinfo-page .b-com-head>.entinfo-cart{
 	margin-left: 160px;
-	height: 130px;
+	min-height: 130px;
+	position: relative;
+}
+.entinfo-page .b-com-head>.entinfo-cart.entinfo-editcart{
+	height: auto;
 }
 .entinfo-page .b-com-head .b-com-first{
 	line-height: 25px;
+	margin-right: 60px;
 }
 .entinfo-page .b-com-head .b-com-first a{
 	color: #16a086;
@@ -285,6 +392,16 @@ a:focus, a:hover{
 .entinfo-page .b-com-head .b-com-second{
 	height: 29px;
 	line-height: 29px;
+	margin-right: 60px;
+}
+.entinfo-page .b-com-head .b-com-second>span{
+	margin-right: 15px;
+}
+.entinfo-page .b-com-head a{
+	color: inherit;
+}
+.entinfo-page .b-com-head a:hover{
+	color: #415fcf;
 }
 .entinfo-page .b-com-head .b-com-second .glyphicon{
 	color: #FF5A5F;
@@ -305,52 +422,15 @@ a:focus, a:hover{
 	line-height: 25px;
 	color: #A0A0A0;
 }
-.entinfo-page .b-com-head .b-com-last .glyphicon{
+.entinfo-page .b-com-head .glyphicon{
 	font-size: 17px;
 	color: #cccccc;
+	vertical-align: text-bottom;
 	margin-right: 5px;
-	vertical-align: sub;
 }
-.entinfo-page .b-com-head .b-com-last a{
+.entinfo-page .b-com-head .entinfo-lookmap{
 	color: #415fcf;
 }
-.white_content {
-	display: none;
-	position: absolute;
-	top: 25%;
-	left: 25%;
-	width: 55%;
-	height: 55%;
-	padding: 20px;
-	border: 5px solid #dd4814;
-	background-color: white;
-	z-index: 1002;
-	overflow: auto;
-}
-.black_overlay {
-	display: none;
-	position: absolute;
-	top: 0px;
-	left: 0px;
-	right: 0px;
-	bottom: 0px;
-	background-color: black;
-	z-index: 1001;
-	-moz-opacity: 0.8;
-	opacity: .80;
-	filter: alpha(opacity=88);
-}
-.closeshowmap{
- 	display: none; 
-    position: absolute; 
-    top: 25%; 
-    left: 79%; 
-    float:right;
-    margin:5px 5px 0px 0px; 
-    background-color: white; 
-    z-index:1003; 
-    overflow: auto; 	
-}
 .ent-tab{
 	height: 50px;
 	background-color: #F6F8FA;
@@ -391,6 +471,49 @@ a:focus, a:hover{
 	margin-top: 10px;
 	min-height: 500px;
 }
+.entinfo-follow,.b-pcshare{
+	display: inline-block;
+	vertical-align: top;
+	font-size: 14px;
+}
+.entinfo-follow span{
+	margin-right: 3px;
+	font-size: 16px !important;
+}
+.entinfo-follow{
+	margin-top: 10px;
+	display: inline-block;
+	vertical-align: top;
+	color: rgb(160, 160, 160);
+	margin-right: 10px;
+	cursor: pointer;
+}
+.entinfo-follow.ent-followed>span,.entinfo-follow.ent-followed{
+	color: #56C4B0 !important;
+}
+.entinfo-page .servicelink{
+    background-color: #57C4B0 !important;
+	margin-left: 5px;
+	font-size: 14px !important;
+	display: inline-block;
+	border-radius: 50%;
+	width: 17px;
+	height: 17px;
+	position: relative;
+	top: 3px;
+}
+.entinfo-page .servicelink i{
+	position: absolute;
+    color: #fff !important;
+	font-size: 12px !important;
+	left: 6px;
+	top: 1px;
+}
+.ent-exception{
+	padding: 0px 6px;
+	border: 1px solid #FF5A5F;
+	color: #FF5A5F;
+}
 /********************企业画像**********************/
 .entinfo-basicinfo .b-com-content{
 	padding-top: 60px !important;
@@ -442,6 +565,7 @@ a:focus, a:hover{
 	font-size: 14px;
 	font-weight: normal;
 	float: right;
+	margin-left: 5px;
 }
 .entinfo-basicinfo .entinfo-round>div:first-child>div:nth-child(n+1)>span:first-child{
 	width: 80px;
@@ -726,19 +850,6 @@ a:focus, a:hover{
 	margin-top: 20px;
 	width: 200px;
 }
-/*************产品服务******************/
-.ent-yellowpage td img{
-	width: 110px;
-	height: 101px;
-}
-.ent-table td.ent-servicepaging{
-	padding-bottom: 0px !important;
-}
-.ent-serviceintroduction{
-	word-wrap: break-word;
-	word-break: break-all;
-	white-space: normal !important;
-}
 /**************变更信息**********************/
 .ent-alterinfo li{
 	width: 100%;
@@ -956,10 +1067,6 @@ a:focus, a:hover{
 .ent-dishonesty .ent-table tr{
 	border-top: 1px solid #e5e6e9;
 }
-.ent-yellowpage .ent-table tr:nth-child(2n+1){
-	border-top: 1px solid #e5e6e9;
-	font-size: 16px;
-}
 .ent-table .b-com-name{
 	font-weight: bold;
 	word-wrap: break-word;
@@ -1007,4 +1114,49 @@ a:focus, a:hover{
 }
 .entinfo-page .badge.disabled{
 	background-color: #a0a0a0;
+}
+/************编辑***********/
+.b-editEnt-form .form-control{
+	display: inline-block;
+	width: 200px;
+	height: 32px;
+	margin-right: 20px;
+}
+.b-editEnt-form .b-com-last .form-control{
+	margin-right: 5px;
+}
+.b-editEnt-form [name='s_address']{
+	width: 315px;
+}
+.b-editEnt-form .glyphicon{
+	margin-right: 10px !important;
+}
+.b-editEnt-form .glyphicon.dizhi{
+	margin-right: 5px !important;
+}
+.b-editEnt-form>div{
+	margin: 8px 0px;
+}
+.select-control{
+	height: 34px;
+    width: 126px;
+    padding: 6px 12px;
+    font-size: 14px;
+    line-height: 1.42857143;
+	vertical-align: middle;
+    color: #555;
+    background-color: #fff;
+    background-image: none;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
+    -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
+    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+}
+.entinfo-cart .btn-save{
+	position: absolute;
+	right: 0px;
+	top: 0px;
 }

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

@@ -2,7 +2,7 @@
 .qfw-row { margin-left: 0px; margin-right: 0px;}
 #titleactionimgs  img{margin-left:15px;width:18px;height:18px;}
 #titleactionimgs  h3{font-weight: normal;}
-.qfw-p-margintop{margin-top:5px;background-color: #fff;}
+.qfw-p-margintop{margin-top:10px;background-color: #fff;}
 .qfw-row-marginbottom{margin-bottom:10px;}
 span.highlight {
     text-decoration: inherit;
@@ -84,7 +84,7 @@ span.highlight {
 }
 #entinfobg {
 	height:auto;
-	background: url("/images/qmx_ent_bgimg.png") ;
+/*	background: url("/images/qmx_ent_bgimg.png") ;*/
 	filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod='scale')";  
 -moz-background-size:100% 100%;  
     background-size:100% 100%; 

+ 145 - 0
core/src/web/staticres/css/membercenter.css

@@ -0,0 +1,145 @@
+/*******用户中心首页**********/
+.membercenter-index .pushlist .panel-title-out a{
+	color: #a0a0a0;
+}
+.membercenter-index .pushlist .panel-title-out a:hover{
+	color: #ff5a5f;
+}
+.membercenter-index .pushlist .tslist{
+	padding: 5px 20px 5px 10px;
+}
+.membercenter-index .pushlist .tslist .bt-parent{
+	width: 760px;
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+}
+.membercenter-index .pushlist .tslist a:hover{
+	color: inherit;
+}
+.membercenter-index .pushlist .tslist .time-diff{
+	display: inline-block;
+	float: right;
+	color: #a0a0a0;
+	width: 70px;
+	overflow: hidden;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	text-align: right;
+}
+.membercenter-index .pushlist .tslist .keyword{
+	color: #ff5a5f;
+}
+.membercenter-index .pushlist .tslist>.xh{
+	margin-right: 10px;
+	vertical-align: top;
+}
+.membercenter-index .pushlist .tslist>*{
+	display: inline-block;
+}
+.membercenter-index .entCard{
+	margin-top: 20px;
+}
+.membercenter-index .entCard .row>div{
+	padding: 30px 40px !important;
+	cursor: pointer;
+}
+.membercenter-index .entCard img{
+	width: 100px;
+	height: 100px;
+}
+.membercenter-index .entCard b{
+	font-size: 16px;
+}
+.membercenter-index .entCard a{
+	float: right;
+	color: #ff5a5f;
+}
+.membercenter-index .entCard font{
+	margin-right: 3px;
+	color: #ff5a5f;
+	float: right;
+	font-size: 12px;
+	margin-left: 5px;
+	vertical-align: text-bottom;
+}
+.membercenter-index .entCard font>font{
+	margin-left: -2px;
+	vertical-align: baseline;
+}
+.membercenter-index .entCard .releaseDemand{
+	height: 100px;
+}
+.membercenter-index .entCard .releaseDemand img{
+	position: relative;
+	top: -8px;
+}
+.membercenter-index .pushlist .glyphicon.xiaoxi{
+	font-size: 18px;
+}
+.membercenter-index .entCard .glyphicon.qmx-icon-mingpian{
+	color: #fff;
+	font-size: 18px;
+	top: -1px;
+}
+.membercenter-index .entCard .panel-title-out{
+	position: relative;
+}
+.membercenter-index .entCard .panel-title-out>div{
+	width: 20px;
+	height: 16px;
+	background-color: #ff5a5f;
+	position: absolute;
+	top: 2px;
+}
+/******************我关注的企业*********************/
+.membercenter-myfollow li{
+	width: 100%;
+	position: relative;
+	border-bottom: 1px solid #ddd;
+	padding: 30px 5px;
+}
+.membercenter-myfollow li>img{
+	width: 90px;
+    height: 90px;
+    vertical-align: top;
+    position: absolute;
+    top: 50%;
+    margin-top: -45px;
+}
+.membercenter-myfollow li>div{
+	padding-left: 100px;
+}
+.membercenter-myfollow li a{
+	font-size: 16px;
+}
+.membercenter-myfollow .ent-follow {
+    position: absolute;
+    top: 50%;
+    right: 0px;
+    line-height: 27px;
+    margin-top: -14.5px;
+    color: rgb(86, 196, 176);
+    cursor: pointer;
+}
+.membercenter-myfollow a:hover,.membercenter-myfollow a:focus{
+	color: #ff5a5f;
+}
+.membercenter-myfollow .ent-follow span {
+    margin-right: 5px;
+    font-size: 16px;
+    vertical-align: middle;
+}
+.membercenter-myfollow .tipTriangle b{
+	font-size: 16px;
+}
+.membercenter-myfollow .tipTriangle button{
+	width: 80px;
+	margin-top: 15px;
+}
+.membercenter-myfollow .tipTriangle .btn-default{
+	background-color: #DEDEDE;
+	border-color: #DEDEDE;
+	color: #fff;
+	margin-left: 10px;
+}

+ 129 - 2
core/src/web/staticres/css/mobile/incmobile.css

@@ -94,7 +94,7 @@ ul{
 }
 .inclist caption div.left{  
 	float:left;
-	width:75%;
+	width:70%;
 	font-size:16px;
 	font-weight:600;
 	color:#1A1A1A !important;
@@ -654,7 +654,6 @@ span#camera {
 	bottom:20px;
 	width: 100%;
 	text-align:center;
-	height: 40px;
 }
 .footer .container div{
 	display:inline-block;	
@@ -669,4 +668,132 @@ span#camera {
 }
 .footer .container .inc p{
 	font-size:10px;
+}
+/*著作权*/
+.cp_ct,.cp_pt,.cp_wk{
+	margin:20px 0px 0px 15px;
+	font-weight:bold;
+}
+.cp_title{
+	font-size:16px;
+	margin: 20px 0px 10px 15px;
+    font-weight: 600;
+}
+.cp_first{
+	margin: 2px 0px 3px 15px;
+}
+.cp_first  span{
+	color:#999;
+}
+.cp_ctcont,.cp_wkcont,.cp_ptcont{
+	padding: 0px 0px 10px;
+	border-bottom: 1px solid rgb(229, 230, 233);
+}
+.combody #lmore_wk,.combody #lmore_ct,.combody #lmore_pt{
+	width:100%;
+	margin:10px 0px;
+}
+.combody #lmore_wk span,.combody #lmore_ct span,.combody #lmore_pt span{
+	border: 1px solid rgb(22, 160, 134) !important;
+	color: rgb(22, 160, 134) !important;
+}
+.combody .copyright{
+	margin-bottom:20px;
+}
+.ent-layout-down .b-com-title > span {
+	background-color:#fff;
+	color:rgb(22, 160, 134);
+	font-size: 22px
+}
+.comnav .qmx-icon-book{
+	font-size:22px;
+	top: 2px;
+    left: 4px;
+}
+.combody .qmx-icon-save{
+	top: 2px;
+}
+.combody .qmx-icon-save{
+	top: 3px;
+}
+.combody .qmx-icon-xinxi{
+	top: 4px;
+}
+.qmx-icon-book,.qmx-icon-zuopin,.qmx-icon-save,.qmx-icon-xinxi{
+	font-weight:bold;
+}
+/*手机版添加关注企业*/
+.mf_title{
+	height:50px;
+	border-bottom:1px solid #ccc;
+	line-height:50px;
+	padding-left: 20px;
+}
+.weiguanzhu{
+	color: rgb(86, 196, 176);
+	font-size:16px;
+}
+.mf_one{
+	margin: 0px 10px;
+	font-size: 16px;
+	font-weight:600;
+}
+.mf_two{
+	font-family: '宋体 Regular', '宋体';
+	font-size: 12px;
+}
+.mf_content{
+	padding:20px 15px;
+}
+.mf_ent{
+	padding-bottom:15px;
+	font-weight: 600;
+	padding-top: 10px;
+	border-bottom: 1px solid #e5e6e9;
+}
+#mf_add span{
+	color:rgb(86, 196, 176);
+	border:1px solid rgb(86, 196, 176);
+}
+#mf_tishi{
+    margin-top: 30px;
+    color: #999;
+	font-size:12px;
+}
+#mf_add{
+	margin-top:20px;
+}
+.mf_qymc{    
+	width: 80%;
+  		height: 20px;
+	float:left;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+#mf_cancel span{
+	font-size: 20px;
+	color:#FF5A5F;
+}
+#mf_cancel{
+	float:right;
+  		margin-right: 10px;
+}
+.mf_one{
+	
+}
+.mf_save{
+	float:right;
+	color:rgb(86, 196, 176);
+	margin-right: 25px;
+	font-size: 16px;
+}
+#mf_entName{
+	height:100px;
+	width: 90%;
+	margin-top:30px;
+	padding:5px; 
+	border:1px solid #ccc;
+}
+.tipassembly{
+	width: 240px;
 }

+ 99 - 8
core/src/web/staticres/css/qfw.css

@@ -364,16 +364,22 @@ a.new_red:hover, a.new_red:active {
 .member-left, .member-right {
 	vertical-align: top;
 	display: inline-block;
-	width: 942px;
 }
 
 .member-left {
 	width: 200px;
+	min-height: 900px;
+	font-weight: 100;
+	font-size: 14px;
+	color: #666;
+    width: 250px;
+	border: 1px solid #E5E6E9;
+	background-color: #fff;
 }
 
 .member-right {
-	width: 975px;
-	float: right;
+	width: 941px;
+	margin-left: 5px;
 }
 /*==========账号信息设置表单标题样式===========*/
 .member-panel {
@@ -406,11 +412,12 @@ a.new_red:hover, a.new_red:active {
 /*==========会员中心首页区块元素的标题===========*/
 .panel-title-in, .panel-title-out {
 	margin-bottom: 10px;
+	padding-left: 10px;
 }
 
 .panel-title-in i, .panel-title-out i {
 	font-size: 20px;
-	color: rgb(153, 153, 153);
+	color: #ff5a5f;
 	vertical-align: sub;
 	margin-right: 10px;
 }
@@ -424,10 +431,6 @@ a.new_red:hover, a.new_red:active {
 .panel-title-out .pull-right i {
 	font-size: 16px;
 }
-
-.panel-title-out .pull-right {
-	font-size: 12px;
-}
 /*==========点击邀请链接之后跳转到页面的样式===========*/
 .invite-form-title {
 	height: 60px;
@@ -1025,6 +1028,94 @@ span.highlight {
 	content: "\AE";
 }
 
+.weiguanzhu:before{
+	content: "\B0";
+}
+
+.yiguanzhu:before{
+	content: "\AF";
+}
+
+.qmx-icon-jianyu:before{
+	content: "\BB";
+}
+
+.qmx-icon-xuqiu:before{
+	content: "\B1";
+}
+
+.qmx-icon-renzheng:before{
+	content: "\B2";
+}
+
+.qmx-icon-mingpian:before{
+	content: "\B3";
+}
+
+.qmx-icon-fabufuwu:before{
+	content: "\B4";
+}
+
+.qmx-icon-dingdan:before{
+	content: "\B5";
+}
+
+.qmx-icon-toubiao:before{
+	content: "\B6";
+}
+
+.qmx-icon-jifen:before{
+	content: "\B7";
+}
+
+.qmx-icon-guize:before{
+	content: "\B8";
+}
+
+.qmx-icon-xiaoxi:before{
+	content: "\B9";
+}
+
+.qmx-icon-shezhi:before{
+	content: "\BA";
+}
+
+.qmx-icon-shimingrenzheng:before{
+	content: "\BD";
+}
+
+.qmx-icon-anquan:before{
+	content: "\BC";
+}
+
+.qmx-icon-right:before{
+	content: "\BE";
+}
+
+.qmx-icon-xinxi:before{
+	content: "\BF";
+}
+
+.qmx-icon-zuopin:before{
+	content: "\C0";
+}
+
+.qmx-icon-save:before{
+	content: "\C1";
+}
+
+.qmx-icon-book:before{
+	content: "\C2";
+}
+
+.qmx-icon-jingqingqidai:before{
+	content: "\C3";
+}
+
+.qmx-icon-jingqingqidai2:before{
+	content: "\C4";
+}
+
 .icon-small {
 	font-size: 12px;
 }

+ 2 - 7
core/src/web/staticres/css/swordfish.css

@@ -343,10 +343,5 @@ a:focus, a:hover{
     border-color: #37C6DA;
 }
 @media (max-width: 1200px) {
-	.b-left{
-		width: 100%;
-	}
-	.b-right{
-		display: none;
-	}
-}
+	
+}

BIN
core/src/web/staticres/fonts.zip


BIN
core/src/web/staticres/fonts/qimingxing.eot


BIN
core/src/web/staticres/fonts/qimingxing.svg


BIN
core/src/web/staticres/fonts/qimingxing.ttf


BIN
core/src/web/staticres/fonts/qimingxing.woff


BIN
core/src/web/staticres/images/bianjixinxi.png


BIN
core/src/web/staticres/images/bottom_bg_b.png


BIN
core/src/web/staticres/images/buxuqiu.png


BIN
core/src/web/staticres/images/ent_authe.png


BIN
core/src/web/staticres/images/ent_authe_a.png


BIN
core/src/web/staticres/images/fabuxinxi.png


BIN
core/src/web/staticres/images/other_authe.png


BIN
core/src/web/staticres/images/other_authe_a.png


BIN
core/src/web/staticres/images/person_authe.png


BIN
core/src/web/staticres/images/person_authe_a.png


BIN
core/src/web/staticres/images/swordfish/calendar.png


BIN
core/src/web/staticres/images/swordfish/clocks.png


BIN
core/src/web/staticres/images/swordfish/sf_01.png


BIN
core/src/web/staticres/images/swordfish/sf_02.png


BIN
core/src/web/staticres/images/swordfish/sf_03.png


BIN
core/src/web/staticres/images/swordfish/sf_04.png


BIN
core/src/web/staticres/images/swordfish/sf_05.png


BIN
core/src/web/staticres/images/swordfish/sf_06.png


BIN
core/src/web/staticres/images/swordfish/sorry.png


BIN
core/src/web/staticres/images/swordfish/sunlight.png


BIN
core/src/web/staticres/images/u906.png


BIN
core/src/web/staticres/images/u908.png


+ 101 - 0
core/src/web/staticres/js/baiduMap.js

@@ -0,0 +1,101 @@
+function BaiduMap(){
+	var closeMapNodeId = "closeBaiduMap";
+	(function(){
+		var div = document.createElement("div");
+		div.id = BaiduMap.mainNodeId;
+		div.className = BaiduMap.mainNodeId;
+		div.innerHTML = '<a href ="javascript:void(0)"><div id="'+closeMapNodeId+'" class="closeBaiduMap">X</div></a>'
+						+'<div id="baiduMap" class="'+BaiduMap.mapId+'"></div>';
+		document.body.appendChild(div);
+		div.onclick = function(e){
+			if(e.target.id == BaiduMap.mainNodeId || e.target.id == closeMapNodeId){
+				BaiduMap.closeMap();
+			}
+		}
+	})();
+	this.showMap = function(){
+		document.body.className += " overflow-hidden";
+		document.getElementById(BaiduMap.mainNodeId).style.display = 'block';
+	};
+	//地址解析
+	this.analysisAddress = function(province,city,area,address){
+		city = province + city;
+		address = area + address;
+		this.showMap();
+		var script = document.createElement('script');
+	    script.type = 'text/javascript';
+		script.src = "http://api.map.baidu.com/geocoder/v2/?address="+address+"&output=json&ak="+BaiduMap.key+"&callback=BaiduMap.renderOption";
+	    document.body.appendChild(script);
+	};
+	this.sign = function(callback){
+		var map = null;
+		var showInfo = function(e){
+			map.clearOverlays();
+			var point = new BMap.Point(e.point.lng,e.point.lat);
+			BaiduMap.showInfo(map,point,callback);
+			var marker = new BMap.Marker(point);
+			map.addOverlay(marker); //将标记添加到地图中
+		}
+		var myFun = function(result){
+			var point = new BMap.Point(result.center.lng,result.center.lat);
+			map = BaiduMap.initMap(point);
+			BaiduMap.showInfo(map,point,callback);
+			map.addEventListener("click", showInfo)
+		}
+		var myCity = new BMap.LocalCity();
+		myCity.get(myFun);
+	}
+};
+BaiduMap.key = "AFd8b176f363f23e6a23d516f4cfb742";
+BaiduMap.mainNodeId = "baiduMapArea";
+BaiduMap.mapId = "baiduMap";
+BaiduMap.error = function(){
+	document.getElementById(this.mapId).innerHTML = "<span class='baiduMapError'>您地址没有解析到结果!</span>";
+};
+BaiduMap.renderOption = function(response){
+	try{
+		if(response.status != 0){
+			this.error();
+			return;
+		}
+		var location = response.result.location;
+		BaiduMap.initMap(new BMap.Point(location.lng,location.lat));
+	}catch(e){}
+};
+BaiduMap.initMap = function(point){
+	var map = new BMap.Map(this.mapId); //初始化地图  
+	map.enableScrollWheelZoom(true);
+	if(point){
+		map.addOverlay(new BMap.Marker(point)); //将标记添加到地图中
+		map.centerAndZoom(point, 12); //设置中心点坐标和地图级别
+	}
+	return map;
+};
+BaiduMap.closeMap = function(){
+	var reg = new RegExp('(\\s|^)overflow-hidden(\\s|$)');
+    document.body.className = document.body.className.replace(reg, '');
+	document.getElementById(BaiduMap.mainNodeId).style.display = 'none';
+};
+BaiduMap.showInfo = function(map,point,callback){
+	BaiduMap.signCallback = callback;
+	var opts = {
+		width: 100     // 信息窗口宽度
+	}
+	var geoc = new BMap.Geocoder();
+	geoc.getLocation(point, function(rs){
+		var addComp = rs.addressComponents;
+		var province = addComp.province;
+		var city = addComp.city;
+		var district = addComp.district;
+		var street = addComp.street;
+		var streetNumber = addComp.streetNumber;
+		var html = "地址:"+province+city+district+street+streetNumber;
+		html+='<br><a class="btn btn-default pull-right" onclick="BaiduMap.signComplate(\''+province+'\',\''+city+'\',\''+district+'\',\''+street+streetNumber+'\')">使用当前地址</a>';
+		var infoWindow = new BMap.InfoWindow(html,opts);  // 创建信息窗口对象
+		map.openInfoWindow(infoWindow,point); //开启信息窗口  
+	});
+}
+BaiduMap.signComplate = function(province,city,district,address){
+	BaiduMap.closeMap();
+	BaiduMap.signCallback(province,city,district,address);
+}

+ 1 - 0
core/src/web/staticres/js/chart.js

@@ -82,6 +82,7 @@ function loadData(me){
 	data.comparebefore=$("#comparebefore").val()
 	data.compareafter=$("#compareafter").val()
 	data.comparetype=$("#comparetype").val();
+	data.checked=$("#comparecheck").prop('checked')?1:0;
 	$.ajax({
 		url:"/manage/countlist",
 		method:"post",

+ 1 - 1
core/src/web/staticres/js/demand.js

@@ -105,7 +105,7 @@ function getCaptchaImg(){
 
 function rechoose(t){
 		if (!isLogined){
-			loginModalShow(6);
+			loginModalShow("/front/reurl");
 			return;
 		}
 		if(t==0){

+ 29 - 0
core/src/web/staticres/js/entcommunity.js

@@ -346,3 +346,32 @@ function initRelation(){
 		}
 	});
 }
+function follow(me,params){
+	me=$(me);
+	var id=me.attr("data-id");
+	if(id.indexOf("Hex")>-1){
+		id=id.replace("ObjectIdHex(\"","").replace("\")","");
+	}
+	console.log(id);
+	var icon=me.find("i");
+	var text=me.find("span");
+
+	$.get("/member/enterprise/isFollowed?entId="+id,function(r){
+		if (r.status=="n"){
+			$.get("/member/enterprise/follow?entId="+id+"&flag=false",function(rs){
+				TipAssembly.show("已关注");
+				me.find("i").attr("class","glyphicon yiguanzhu");
+				me.find("span").text("已关注");
+				
+			});
+		}else{
+			$.get("/member/enterprise/follow?entId="+id+"&flag=true",function(rs){
+				
+				TipAssembly.show("已取消<br>关注");
+				me.find("i").attr("class","glyphicon weiguanzhu");
+				me.find("span").text("关注");
+			})	;
+		}
+	})
+	  event.stopPropagation();
+}

+ 11 - 2
core/src/web/staticres/js/enterprise.js

@@ -70,7 +70,16 @@ function reloadData(obj,name){
 	$("#searchForm input[name=OpState]").val("");
 	$("#searchForm input[name=c_author]").val("");
 	$("#searchForm input[name="+name+"]").val(val);
-	
+	//
+	var wordsVal = $("#searchForm input[name=words]").val();
+	var cityVal = $("#searchForm input[name=city]").val();
+	var c_authorVal = $("#searchForm input[name=c_author]").val();
+	var OpStateVal = $("#searchForm input[name=OpState]").val();
+	var c_hflVal = $("#searchForm input[name=c_hfl]").val();
+	var c_zbVal = $("#searchForm input[name=c_zb]").val();
+	if(wordsVal=="" && cityVal=="" && c_authorVal=="" && OpStateVal=="" && c_hflVal=="" && c_zbVal==""){
+		$("#searchForm input[name=cityNo]").val("");
+	}
     document.forms['searchForm'].submit();
 }
 
@@ -1388,7 +1397,7 @@ function formclane(){
 }
 //在列表中点击添加服务按钮事件
 function addService(){
-	window.location.href="/member/yellowpage/show/showService/" + id;
+	window.location.href="/member/service/add";
 }
 //取消添加服务按钮事件
 function cancelService(){

+ 212 - 107
core/src/web/staticres/js/entportrait.js

@@ -1,7 +1,6 @@
 var entType = "企业";
 var relationEntity = null;//关系网
 var copyrightEntity = null;//著作权
-var servicePaging = null;//服务列表
 var staffinfoEntity = null;//主要人员
 var dishonestyPaging = null;//失信
 var hasLoadPagingJs = false;//是否已经加载过js
@@ -19,6 +18,11 @@ var computerSoftCopyRightFlag = false;
 //专利
 var patent = null;
 var patentFlag = false;
+var baiduMap = null;
+//根据城市名和地址解析
+var provinceName = "";
+var cityName = "";
+var areaName = "";
 //解析服务列表
 $(function(){
 	staffinfoFlag = typeof(staffinfo) != "undefined" && staffinfo != null && staffinfo.length > 0;
@@ -66,25 +70,133 @@ $(function(){
 		$("#ent-tab-staffinfo").addClass("disabled");
 	}
 	//联系地址
-	if($address){
+	if(editFlag){
+		$("#uploadLogo").click(function(){
+			document.getElementById("upload").click();
+		});
+		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/enterprise/upLoadEntImg",
+					  	data: "field=s_avatar&url="+data.url,
+					 	dataType: "text",
+					  	success: function(result){
+							if (result == "y"){
+								$("#entLogo>img").attr("src",data.url);
+							}else{
+								alert("上传LOGO失败,请重新上传。");
+							}
+						},
+						error: function(){
+							alert("上传LOGO失败,请重新上传。");
+						}
+					});
+				}else{
+					alert(data.msg)
+				}
+		 	}
+		};
+		try{
+			loadJS(cdn+"/js/upload.js",function(){
+				$("#uploadLogo>div").upload(option);
+			});
+		}catch(e){}
+		//编辑的时候输入框失去焦点验证格式
+		$("#editForm").find("input").blur(function(){
+			var thisValue = $.trim(this.value);
+			if(this.name == "s_persion" && thisValue == ""){
+				alert("请输入联系人!");
+				return;
+			}
+			if(thisValue == ""){
+				return;
+			}
+			switch(this.name){
+				case "s_mobile":
+					if(!ValidDatatype.m(thisValue)){
+						alert("手机号格式不正确!");
+					}
+					break;
+				case "s_email":
+					if(!ValidDatatype.e(thisValue)){
+						alert("邮箱格式不正确!");
+					}
+					break;
+				case "s_enturl":
+					if(!ValidDatatype.url(thisValue)){
+						alert("网址格式不正确!");
+					}
+					break;
+			}
+		});
+		$("#editSave").click(function(){
+			var formNode = $("#editForm");
+			var value = formNode.find("[name='s_persion']").val();
+			if(value == ""){
+				alert("请输入联系人!");
+				return;
+			}
+			value = formNode.find("[name='s_mobile']").val();
+			if(value != "" && !ValidDatatype.m(value)){
+				alert("手机号格式不正确!");
+				return;
+			}
+			value = formNode.find("[name='s_email']").val();
+			if(value != "" && !ValidDatatype.e(value)){
+				alert("邮箱格式不正确!");
+				return;
+			}
+			value = formNode.find("[name='s_enturl']").val();
+			if(value != "" && !ValidDatatype.url(value)){
+				alert("网址格式不正确!");
+				return;
+			}
+			$.post("/member/enterprise/save",formNode.serialize(),function(r){
+				if(r.status == "personError"){
+					alert("请输入联系人!");
+				}else if(r.status == "y"){
+					alert("保存成功!");
+					window.location.href = "/member/enterprise/show";
+				}else{
+					alert("保存失败!");
+				}
+			});
+		});
 		loadJS(cdn+"/js/jquery.cxselect.js",function(){
 			$('#city_china').cxSelect({
 				selects: ['province', 'city', 'area'],
 				required:0
 			});
 			$.cxSelect.setVal(province,city,area);
-			var pt=province?($("#provincesel option[value="+province+"]").text()):"";
-			var ct=city?($("#citysel option[value="+city+"]").text()):"";
-			var at=area?($("#areasel option[value="+area+"]").text()):"";
-			//设置地图上显示的位置
-			$("#location").attr("value",as1);
-			$("#cityname").attr("value",pt.trim()+ct.trim()+at.trim());		
-			initMap();
-			$("#city_china").text(pt+ct+at+as1);
 		});
+	}else{
+		if($address){
+			loadJS(cdn+"/js/jquery.cxselect.js",function(){
+				$('#city_china').cxSelect({
+					selects: ['province', 'city', 'area'],
+					required:0
+				});
+				$.cxSelect.setVal(province,city,area);
+				var pt=province?($("#provincesel option[value="+province+"]").text()):"";
+				var ct=city?($("#citysel option[value="+city+"]").text()):"";
+				var at=area?($("#areasel option[value="+area+"]").text()):"";
+				provinceName = pt;
+				cityName = ct;
+				areaName = at;
+				//设置地图上显示的位置
+				$("#city_china").text(pt+ct+at+address);
+			});
+		}
+		pcShare();
 	}
-	//隐藏地图
-	$("#fade").click(closeMap);
 	//分享
 	$(".entinfo-share").click(function(){
 		$(".bdsharebuttonbox").show();
@@ -112,7 +224,7 @@ $(function(){
 			}
 		}
 		if(index == 1){
-			b_afterLogin(isLogined);
+			afterReLoadTop(isLogined);
 		}else if($(this).index() == 2 && staffinfoEntity == null){
 			//加载服务列表
 			staffinfoEntity = new StaffinfoEntity();
@@ -122,39 +234,63 @@ $(function(){
 		}else if($(this).index() == 5 && dishonestyPaging == null){
 			//加载失信列表
 			dishonestyPaging = new DishonestyPaging();
-		}else if($(this).index() == 6 && servicePaging == null){
-			//加载服务列表
-			servicePaging = new ServicePaging();
 		}
 	});
-	pcShare();
-});
-function initMap(){
-	//获取地图的经纬度
-	loadJS("http://api.map.baidu.com/getscript?v=2&ak=AFd8b176f363f23e6a23d516f4cfb742&services=&t=20150522093217",function(){
-		loadJS(cdn+"/js/geocoder.js",function(){
-			doOptions();
+	//关注
+	$("#follow").click(function(){
+		if(!isLogined){
+			loginModalShow();
+			return;
+		}
+		var dataObj = {};
+		dataObj["flag"] = $(this).hasClass("ent-followed");
+		dataObj["entId"] = entId;
+		var thisClass = $(this);
+		$.post("/member/enterprise/follow",dataObj,function(r){
+			if(r.status == "y"){
+				if(dataObj.flag){
+					thisClass.html('<span class="glyphicon weiguanzhu"></span>关注');
+					TipAssembly.show("已取消<br>关注");
+				}else{
+					thisClass.html('<span class="glyphicon yiguanzhu"></span>已关注');
+					TipAssembly.show("已关注");
+				}
+				thisClass.toggleClass("ent-followed");
+			}else if(r.status == "m"){
+				TipAssembly.hide();
+				TipAssembly.triangleShow(thisClass,"left",250,10,0);
+			}else if(r.status == "n"){
+				if(dataObj.flag){
+					TipAssembly.show("取消关注失败!");
+				}else{
+					TipAssembly.show("关注失败!");
+				}
+			}else{
+				if(dataObj.flag){
+					TipAssembly.show("取消关注失败!");
+				}else{
+					TipAssembly.show("关注失败!");
+				}
+			}
 		});
 	});
-}
-//显示地图
-function showMap(){
-	document.getElementById('mapshowdiv').style.display = 'block';
-	document.getElementById('closeshowmap').style.display = 'block';
-	document.getElementById('fade').style.display = 'block';
-	$("html,body").addClass("overflow-hidden");
-}
-//关闭地图
-function closeMap(){
-	document.getElementById('mapshowdiv').style.display = 'none';
-	document.getElementById('closeshowmap').style.display = 'none';
-	document.getElementById('fade').style.display = 'none';
-	$("html,body").removeClass("overflow-hidden");
-}
-function b_afterLogin(flag,result){
+	$("#thinkAgain").click(function(){
+		TipAssembly.triangleHide();
+	});
+	if($("#entinfo-opState").length > 0){
+		$("#entinfo-status").prepend($("#entinfo-opState").clone());
+	}
+});
+function afterReLoadTop(flag,result){
 	//关系网如果没有数据,选项卡不可点
 	if(typeof(result) != "undefined"){
 		identWayFlag = result.identWay == 1;
+		//查询关注状态
+		$.post("/member/enterprise/isFollowed",{entId:entId},function(r){
+			if(r.status == "y"){
+				$("#follow").addClass("ent-followed").html('<span class="glyphicon yiguanzhu"></span>已关注');
+			}
+		});
 	}
 	relationFlag = flag && identWayFlag && !relFlag;
 	if(!$(".ent-tab>li:eq(1)").hasClass("ent-active") && relationFlag){
@@ -384,74 +520,6 @@ function CopyrightEntity(){
 		$("#copyright .ent-findnull").removeClass("hide");
 	}
 }
-//服务列表
-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();
-				return;
-			}
-			$(".serviceList-layout").removeClass("hide");
-			var html = '';
-			for(var i=0;i<r.length;i++){
-				var f_price = r[i].f_price;
-				if(typeof(f_price) == "undefined" || f_price == null || f_price == ""){
-					f_price = 0;
-				}
-				var i_sales = r[i].i_sales;
-				if(typeof(i_sales) == "undefined" || i_sales == null || i_sales == ""){
-					i_sales = 0;
-				}
-				var i_comments = r[i].i_comments;
-				if(typeof(i_comments) == "undefined" || i_comments == null || i_comments == ""){
-					i_comments = 0;
-				}
-				var flag = typeof(r[i].s_isshow) != "undefined" && r[i].s_isshow != null && r[i].s_isshow.indexOf("3")>-1;
-				html += '<tr>'
-						+'<td rowspan="2" width="130"><img src="'+(r[i].s_images==""?"null":(cdn+r[i].s_images))+'" onerror="this.src=\''+cdn+'/images/services/default.png\'"></td>'
-						+'<td class="b-com-name">';
-				if(flag){
-					html += '<a href="/market/detail/'+r[i]._id+'.html">';
-				}
-				html += r[i].s_name;
-				if(flag){
-					html += '</a>';
-				}
-				html += '</td>';
-				if(flag){
-					html += '<td width="150" class="text-center"><font class="b-disabled">报价:</font><font class="text-primary">'+(r[i].s_pricemy==1?"面议":f_price+"元")+'</font></td>'
-						+'<td width="250" class="text-center"><font class="b-disabled">成交:</font><font class="text-primary">'+i_sales+'</font><font class="margin-lr-5 b-disabled">|</font><font class="b-disabled">评价:</font><font class="text-primary">'+i_comments+'</font></td>';
-				}else{
-					html += '<td>&nbsp;</td><td>&nbsp;</td>';
-				}
-				html += '</tr><tr>'
-					+'<td colspan="3"><div class="ent-serviceintroduction">'+r[i].s_introduction+'</div></td>'
-					+'</tr>';
-			}
-			$("#serviceListPaging").parent().prevAll().remove();
-			$("#serviceListPaging").parent().before(html);
-			$(".ent-serviceintroduction").each(function(){
-				var text = $(this).text();
-				if(text.length > 200){
-					text = text.substring(0,150)+"...";
-				}
-				$(this).html(text);
-			});
-		},service);
-		paging.firstPageDatas = null;
-	}
-	if(hasLoadPagingJs){
-		this.initServiceList();
-	}else{
-		var thisClass = this;
-		loadJS(cdn+"/js/paging.js",function(){
-			hasLoadPagingJs = true;
-			thisClass.initServiceList();
-		});
-	}
-}
 //失信信息
 function DishonestyPaging(){
 	this.initDishonesty = function(){
@@ -487,4 +555,41 @@ function DishonestyPaging(){
 			thisClass.initDishonesty();
 		});
 	}
+}
+function showMap(){
+	if(baiduMap == null){
+		loadJS("http://api.map.baidu.com/getscript?v=2.0&ak="+BaiduMap.key,function(){
+			baiduMap = new BaiduMap();
+			if(editFlag){
+				baiduMap.sign(function(province,city,district,address){
+					$("select.province option").each(function(){
+						if(province.startWith($(this).text())){
+							$(this).attr("selected",true);
+							$("select.province").trigger("change");
+							return false;
+						}
+					});
+					$("select.city option").each(function(){
+						if(city == $(this).text()){
+							$(this).attr("selected",true);
+							$("select.city").trigger("change");
+							return false;
+						}
+					});
+					$("select.area option").each(function(){
+						if(district == $(this).text()){
+							$(this).attr("selected",true);
+							$("select.area").trigger("change");
+							return false;
+						}
+					});
+					$("[name='s_address']").val(address);
+				});
+			}else{
+				baiduMap.analysisAddress(provinceName,cityName,areaName,address);
+			}
+		});
+	}else{
+		baiduMap.showMap();
+	}
 }

+ 0 - 84
core/src/web/staticres/js/geocoder.js

@@ -1,84 +0,0 @@
-var SAMPLE_ADVANCED_POST = 'http://api.map.baidu.com/geocoder/v2/?ak=您的密钥&callback=renderOption&output=json';
-
-var advancedOptions = '';
-var address;
-var marker;
-function showOptionsURL(type) {	
-	try{
-	    advancedOptions = SAMPLE_ADVANCED_POST;   
-		address = document.getElementById('location').value; 
-	    var cityname=document.getElementById('cityname').value;
-		advancedOptions+="&address="+address;
-		advancedOptions+="&city="+cityname;
-	}catch(e){}
-};
-
-function renderOption(response) {
-	try{
-		if (response.status ) {
-				var text = "无正确的返回结果:\n";
-				document.getElementById('mapshowdiv').innerHTML = text;
-				return;
-		}
-		var location = response.result.location;
-		//纬度 location.lat
-		//经度 location.lng
-		ptlat =location.lng;
-		ptlng =location.lat;	
-		var map = new BMap.Map("mapshowdiv"); //初始化地图   
-		var opts = {type: BMAP_NAVIGATION_CONTROL_LARGE}; //初始化地图控件  
-		map.addControl(new BMap.NavigationControl(opts)); 
-		//经度                 纬度
-		//var ptlat=113.69884285509,  ptlng=34.791342526551;
-		var point = new BMap.Point(ptlat,ptlng); //初始化地图中心点  
-		marker = new BMap.Marker(point); //初始化地图标记  
-		marker.enableDragging(); //标记开启拖拽  
-		  
-		var gc = new BMap.Geocoder();
-		
-		//添加标记拖拽监听  
-		marker.addEventListener("dragend", function(e){  
-		    //获取地址信息  
-		    gc.getLocation(e.point, function(rs){  
-		        showLocationInfo(e.point, rs);  
-		    });  
-		});  
-		  
-		//添加标记点击监听  
-		marker.addEventListener("click", function(e){  
-		   gc.getLocation(e.point, function(rs){  
-		        showLocationInfo(e.point, rs);  
-		    });  
-		});  
-		map.clearOverlays(); 
-		map.centerAndZoom(point, 12); //设置中心点坐标和地图级别  
-		map.addOverlay(marker); //将标记添加到地图中 
-		map.panBy(280, 200);//中心点偏移多少像素(width,height)为div 宽高的1/2; 
-		}catch(e){}
-}
-
-function doOptions() {
-    var script = document.createElement('script');
-    script.type = 'text/javascript';
-    showOptionsURL('buttonClick');
-    var newURL = advancedOptions.replace('您的密钥','AFd8b176f363f23e6a23d516f4cfb742');
-	script.src = newURL;
-    document.body.appendChild(script);
-};
-
-//显示地址信息窗口  
-function showLocationInfo(pt, rs){  
-    var opts = {  
-      width : 280,     //信息窗口宽度  
-      height: 100,     //信息窗口高度  
-      title : ""  //信息窗口标题  
-    }  
-      
-    var addComp = rs.addressComponents;  
-    var addr = "当前位置:" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "<br />";  
-    //addr += "纬度: " + pt.lat + ", " + "经度:" + pt.lng;  
-    //alert(addr);  
-	
-    var infoWindow = new BMap.InfoWindow(addr, opts);  //创建信息窗口对象  
-    marker.openInfoWindow(infoWindow);  
-}  

+ 43 - 2
core/src/web/staticres/js/qfw.js

@@ -24,6 +24,9 @@ var ValidDatatype = {
 	"e": function(gets,obj,curform,regxp){
 		return !!gets.match("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
 	},
+	"url": function(gets,obj,curform,regxp){
+		return /^(\w+:\/\/)?\w+(\.\w+)+.*$/.test(gets);
+	},
 	"*4": /^[^\s]{4,4}$/,//四位任意字符
 	"n4": /^\d{4,4}$/,	//四位数字
 	"n6": /^\d{6,6}$/,	//六位数字
@@ -301,6 +304,9 @@ function webSiteInit(){
 	}
 	try{
 		var setBottomPadding = function(){
+			if($("#testBottom").length == 0){
+				return;
+			}
 			$("#qfw-bottom").css("padding-top","0px");
 			var testBottom_offsetTop = $("#testBottom").offset().top;
 			var windowHeight = $(window).height();
@@ -333,13 +339,13 @@ function webSiteInit(){
 			}
 		}
 		//设置用户用心左右布局
-		var memberLeft_marginLeft = 0;
+		/*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 - 50);
 			if($(".member-content").children(".clearfix").length == 0){
 				$(".member-content").append('<div class="clearfix"></div>');
 			}
-		}
+		}*/
 	}catch(e){
 		clear_waitTopLoadOver();
 	}
@@ -689,4 +695,39 @@ function getChineseLoc(code,obj,name){
 		}
 		return name;
 	}
+}
+var TipAssembly = {
+	timeout: null,
+	show: function(text,css){
+		if(this.timeout != null){
+			clearTimeout(this.timeout);
+			this.hide();
+			this.timeout = null;
+		}
+		var thisClass = this;
+		this.timeout = setTimeout(function(){
+			thisClass.hide();
+			thisClass.timeout = null;
+		},1000);
+		$("body").append('<div class="tipAssembly" id="tipAssembly">'+text+'</div>');
+		if(typeof(css) != "undefined"){
+			$("#tipAssembly").css(css);
+		}
+		$("#tipAssembly").css({"margin-top":-($("#tipAssembly").outerHeight()/2),"margin-left":-($("#tipAssembly").outerWidth()/2)});
+	},
+	hide: function(){
+		$("#tipAssembly").remove();
+	},
+	triangleShow: function(obj,direction,width,top,left){
+		$("#maskLayer").unbind("click").click(function(e){
+			$(this).hide();
+			$("#tipTriangle").hide();
+		});
+		$("#tipTriangle>span").addClass("triangle-"+direction);
+		$("#tipTriangle").css({width:width,top: obj.offset().top+top,left: obj.offset().left+left}).show();
+		$("#maskLayer,#tipTriangle").show();
+	},
+	triangleHide: function(){
+		$("#maskLayer,#tipTriangle").hide();
+	}
 }

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

@@ -1389,7 +1389,7 @@ function formclane(){
 }
 //在列表中点击添加服务按钮事件
 function addService(){
-	window.location.href="/member/yellowpage/show/showService/" + id;
+	window.location.href="/member/service/add";
 }
 //取消添加服务按钮事件
 function cancelService(){

File diff suppressed because it is too large
+ 45 - 10
core/src/web/templates/_error.html


+ 41 - 65
core/src/web/templates/common/authentication.html

@@ -1,22 +1,16 @@
 <style type="text/css">
 .rzimg{
-	width:80px;
-	height:75px;
+	width: 120px;
+	height: 120px;
 	margin-left:14px;
 }
 .rztable{
 	max-width: 206px;
 	height: 310px;
 	text-align: center;
-	padding-top: 35px;
-	font-weight: bold;
 	cursor: pointer;
-	background-image: url('{{Msg "seo" "cdn"}}/images/u12.png');
 	margin: 20px auto 0px auto;
 }
-.rztable-mouseover{
-	background-image: url('{{Msg "seo" "cdn"}}/images/u12_mouseOver.png');
-}
 .rztable img{
 	margin-bottom: 10px;
 }
@@ -28,8 +22,9 @@
 	margin-left: 61.5px;
 }
 .rztable p {
-	padding:15px 19px;
-	font-weight:normal;
+	display: block;
+	height: 90px;
+	color: #a0a0a0;
 }
 .disablelink {
 	cursor: auto !important;
@@ -37,6 +32,16 @@
 .rztableParent{
 	padding-right: 0px;
 }
+.rztableParent span{
+	font-size: 16px;
+	font-weight: bold;
+	margin-bottom: 10px;
+	display: block;
+}
+.rztableParent button{
+	width:80px;
+	border-radius: 40px;
+}
 .notPassReason{
 	padding-bottom: 10px;
 	padding-left: 10px;
@@ -122,75 +127,46 @@
 	</div>
 {{end}}
 <div class="top-msage" id="topmsage">提示信息:只有进行实名认证的用户才能发布服务!<a onclick="$('#topmsage').hide();">x</a></div>
-<div class="panel panel-default">
-	<div class="panel-body">
-	   	<div class="panel-title-in">
-		    <i class="glyphicon shimingrenzheng"></i><span>实名认证</span>
+<div class="panel-title-out">
+	<i class="glyphicon qmx-icon-shimingrenzheng" style="font-size: 22px;"></i><span>实名认证</span>
+</div>
+<div class="a-line"></div>
+<div class="row margin-b-20">
+	<div class="col-sm-4 rztableParent">
+		<div class="rztable" id="ent_authe" href="/member/comaut/index">
+			<img class="rzimg" src="{{Msg "seo" "cdn"}}/images/ent_authe.png"/>
+			<br><span>企业实名认证</span>
+			<p>企业实名认证是“企明星”针对普通会员推出的免费认证服务,只要您有工商注册号,即可进行认证。</p>
+			<button  class="btn btn-primary">认证</button>
 		</div>
-		<div class="a-line"></div>
-		<div class="row">
-			<div class="col-sm-4 rztableParent">
-				<div class="rztable" id="ent_authe" href="/member/comaut/index">
-					<img class="rzimg" src="{{Msg "seo" "cdn"}}/images/ent_authe.png"/>
-					<br>企业实名认证
-					<p style="padding-bottom:10px;">企业实名认证是“企明星”针对普通会员推出的免费认证服务,只要您有工商注册号,即可进行认证。</p>
-					<button  class="btn btn-primary" style="width:80px;margin-top:-10px;">认证</button>
-				</div>
-			</div>
-			<div class="col-sm-4 rztableParent">
-				<div class="rztable" id="person_authe" href="/member/personauthent/index">
-					<img class="rzimg" src="{{Msg "seo" "cdn"}}/images/person_authe.png"/>
-					<br>个人实名认证
-					<p>个人实名认证是指通过身份证信息的核实,来证明会员身份的真实性,更好的促进交易。</p>
-					<button  class="btn  btn-primary" style="width:80px;margin-top:-10px;">认证</button>
-				</div>
-			</div>
-			<div class="col-sm-4 rztableParent">
-				<div class="rztable" id="other_authe" href="/member/otherauthent/index">
-					<img class="rzimg" src="{{Msg "seo" "cdn"}}/images/other_authe.png"/>
-					<br>机构认证
-					<p>政府、事业单位、各种协会或社会团体等,使用组织机构代码完成认证。</p>
-					<button  class="btn btn-primary" style="width:80px;margin-top:10px;">认证</button>
-				</div>
-			</div>
+	</div>
+	<div class="col-sm-4 rztableParent">
+		<div class="rztable" id="person_authe" href="/member/personauthent/index">
+			<img class="rzimg" src="{{Msg "seo" "cdn"}}/images/person_authe.png"/>
+			<br><span>个人实名认证</span>
+			<p>个人实名认证是指通过身份证信息的核实,来证明会员身份的真实性,更好的促进交易。</p>
+			<button  class="btn  btn-primary">认证</button>
+		</div>
+	</div>
+	<div class="col-sm-4 rztableParent">
+		<div class="rztable" id="other_authe" href="/member/otherauthent/index">
+			<img class="rzimg" src="{{Msg "seo" "cdn"}}/images/other_authe.png"/>
+			<br><span>机构认证</span>
+			<p>政府、事业单位、各种协会或社会团体等,使用组织机构代码完成认证。</p>
+			<button  class="btn btn-primary">认证</button>
 		</div>
 	</div>
 </div>
-
 <script type="text/javascript">
 $(function (){
 		//企业认证 点击事件
 		$("#ent_authe").click(function (){
 			window.location.href = "/member/comaut/index";
 		});
-		//企业认证
-		$("#ent_authe").mouseover(function (){
-			$(this).addClass("rztable-mouseover");
-			$(this).children("img").attr("src","{{Msg "seo" "cdn"}}/images/ent_authe_a.png");
-		}).mouseout(function (){
-			$(this).removeClass("rztable-mouseover");
-			$(this).children("img").attr("src","{{Msg "seo" "cdn"}}/images/ent_authe.png");
-		});
 		//个人认证 点击事件
 		$("#person_authe").click(function (){
 			window.location.href = "/member/personauthent/index";
 		});
-		//个人认证
-		$("#person_authe").mouseover(function (){
-			$(this).addClass("rztable-mouseover");
-			$(this).children("img").attr("src","{{Msg "seo" "cdn"}}/images/person_authe_a.png");
-		}).mouseout(function (){
-			$(this).removeClass("rztable-mouseover");
-			$(this).children("img").attr("src","{{Msg "seo" "cdn"}}/images/person_authe.png");
-		});
-		//其他认证
-		$("#other_authe").mouseover(function (){
-			$(this).addClass("rztable-mouseover");
-			$(this).children("img").attr("src","{{Msg "seo" "cdn"}}/images/other_authe_a.png");
-		}).mouseout(function (){
-			$(this).removeClass("rztable-mouseover");
-			$(this).children("img").attr("src","{{Msg "seo" "cdn"}}/images/other_authe.png");
-		});
 		//其他认证 点击事件
 		$("#other_authe").click(function (){
 			window.location.href = "/member/otherauthent/index";

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

@@ -1,6 +1,6 @@
 {{$userTypeString := printf "%v" (session "userType")}}
 <!-- 底部 -->
-<div class="hidden-xs" id="qfw-bottom">
+<div class="hidden-xs" id="qfw-bottom" style="min-width: 1200px;">
 	<ul class="hidden-xs bottom-bar" id="bottom-bar">
 		<li title="扫码登录"{{if or (session "userType") (eq $userTypeString "0")}} class="invisible"{{end}}><img src="{{Msg "seo" "cdn"}}/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="{{Msg "seo" "cdn"}}/images/bottom-qq.png"></a></li>
@@ -12,7 +12,7 @@
 		<div class="text-center hidden-xs"><img src="{{Msg "seo" "cdn"}}/images/bottom_logo.png"/></div>
 		<div class="qfw-bottom-text text-center">
 			<a href="/front/web_A_help.html">关于我们</a><span>|</span><a href="/front/web_L_help.html">联系我们</a><span>|</span>&nbsp;&nbsp;<span style="color:white">法律声明&nbsp;&nbsp;&nbsp;&nbsp;</span><span>|</span><a href="/front/web_H_help.html">帮助中心</a><span>|</span><a href="/front/web_O_help.html">意见反馈</a>
-			<div style="line-height:25px">©2015-2016&nbsp;拓普丰联&nbsp;版权所有<span>&nbsp;|&nbsp;</span><a target="_blank" href="http://www.miibeian.gov.cn/publish/query/indexFirst.action">京ICP备14030217号-2</a></div>
+			<div style="line-height:25px">©2015-2016&nbsp;拓普丰联&nbsp;版权所有<span>&nbsp;|&nbsp;</span><a href="http://www.miibeian.gov.cn/state/outPortal/loginPortal.action" target="_blank">豫ICP备15016539号-1</a></div>
 		</div>
 	</div>
 </div>

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

@@ -35,47 +35,4 @@ body{
 			<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>
+</div>

+ 6 - 0
core/src/web/templates/common/errorhead.html

@@ -8,6 +8,12 @@ body{
 h5 a{
 	color: #a0a0a0;
 }
+.b-head .head-hideMenu li:hover {
+    color: inherit;
+}
+.b-head .head-hideMenu li:hover>i {
+    color: inherit;
+}
 </style>
 <div class="b-head">
 	{{include "/common/top.html"}}

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

@@ -329,7 +329,7 @@ function afterAutheFirstLogin(result){
 		$("body").append('{{include "/common/ploginmodal.html"}}');
 		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
 		$("#fristAutheLoginModal .com-entName").text(result.entName+"店铺");
-		$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
+		$("#fristAutheLoginModal .com-entCard a").attr("href","/member/enterprise/edit");
 	}else{
 		$("body").append('{{include "/common/ologinmodal.html"}}');
 		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
@@ -347,10 +347,10 @@ function afterAutheFirstLogin(result){
 			//$("#fristAutheLoginModal .com-who").text("完成以下操作,就可以领取红包啦:");
 		}else{
 			$("#fristAutheLoginModal .com-entCard").removeClass("hide");
-			$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
+			$("#fristAutheLoginModal .com-entCard a").attr("href","/member/enterprise/edit");
 		}
 	}
-	$("#fristAutheLoginModal .com-releaseService a").attr("href","/member/yellowpage/show/showService/"+entId);
+	$("#fristAutheLoginModal .com-releaseService a").attr("href","/member/service/add");
 	$("#fristAutheLoginModal").modal('show');
 }
 </script>

+ 0 - 1
core/src/web/templates/common/inc.html

@@ -1,6 +1,5 @@
 <meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
-<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0" user-scalable="no" />
 <meta name="renderer" content="webkit">
 <link href="{{Msg "seo" "cdn"}}/css/bootstrap.min.css" rel="stylesheet">
 <link href="{{Msg "seo" "cdn"}}/css/bootswatch.min.css" rel="stylesheet">

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

@@ -106,9 +106,9 @@ $(function (){
 	//
 	$("[id='releaseService']").click(function(){
 		if(isLogined){
-			window.location.href = "/front/reurl";
+			window.location.href = "/member/service/add";
 		}else{
-			loginModalShow(6);
+			loginModalShow("/front/reurl");
 		}
 	});
 });

+ 37 - 85
core/src/web/templates/common/login.html

@@ -54,26 +54,21 @@
 </style>
 <script src="/js/validform-min.js"></script>
 <script type="text/javascript">
+//登录完之后要跳转的url
+var afterLoginUrl = null;
 //打开登录窗口
-function loginModalShow(lbt){
-	$("#head-navbar").toggleClass("hidden-xs");
-	if(loginBackType == null){
-		if(typeof(lbt) == "undefined" || lbt == null){
-			loginBackType = 0;
-		}else{
-			loginBackType = lbt;
-		}
+function loginModalShow(url){
+	if(typeof(url) != "undefined"){
+		afterLoginUrl = url;
 	}
-	if(lbt>7)loginBackType = lbt;
 	$("#wxPic").attr("src","");
 	$.post("/front/wxlogin/getNum",function(data){
 		if(data&&data.num){		
-			$("#wxPic").attr("src","http://wxs.qimingxing.info/weixin/sso/"+data.num);
+			$("#wxPic").attr("src","/weixin/sso/"+data.num);
 			setTimes(data.num,35)		
 		}
 	},'json');
 	$('#loginModal').modal('show');
- 
 }
 t=''
 function setTimes(num,n){
@@ -86,7 +81,7 @@ function setTimes(num,n){
 			$.post("/front/wxlogin/getLogin/"+num,function(data){
 				try{			
 					if(data&&data.res){
-						if (data.freeze == "2"){
+						if (data.freeze == 2){
 			    				window.location.href="/front/webhelpcontent/55c818d8af537440a700000d.html";
 								return
 							}
@@ -145,33 +140,31 @@ $(function (){
 			$(o.obj).prev().text(msg).show();
 		},
 		callback:function(data){
-			if(data.status == "n"){
-				if (data.info == "s_error"){
-					login_errorProcess($("[name='s_name']"),"用户不存在")
-				}else{
-					login_errorProcess($("[name='s_pwd']"),"密码输入有误")
-				}
-			}else if (data.freeze == "2"){
-			    window.location.href="/front/webhelpcontent/55c818d8af537440a700000d.html";
-			}else if (data.status == "0"){//后台管理员
-				window.location.href="/manage/system";
-			}else{
-				//注册页面登录之后
-				$("#loginStatus").trigger("login");
-				afterLoginSkip(data,true);
-			}
-			//
 			if($("#loginModal [name='rememberMe']").is(':checked')==true){
 				document.cookie="loginName="+$("#loginModal [name='s_name']").val(); 
 			}
 			clearInterval(t);
+			if(data.status == "y"){
+				if(data.freeze == 2){
+				    window.location.href="/front/webhelpcontent/55c818d8af537440a700000d.html";
+				}else if (data.userType == 0){//后台管理员
+					window.location.href="/manage/system";
+				}else{
+					afterLoginSkip(data,true);
+				}
+			}else if (data.status == "s_error"){
+				login_errorProcess($("[name='s_name']"),"用户不存在")
+			}else if (data.status == "p_error"){
+				login_errorProcess($("[name='s_pwd']"),"密码输入有误")
+			}else{
+				window.location.reload();	
+			}
 		}
 	},"loginForm");
 	function login_errorProcess(obj,msg){
 		login_cssctlObj(obj.prev(),3);
 		obj.prev().text(msg).show();
 	}
-	
 	$(".loginFont").click(function(){
 		var v=$(this).attr("v")
 		$("#loginModal .loginFont").removeClass("text-primary");
@@ -179,68 +172,27 @@ $(function (){
 		$("#loginModal .login").hide();	
 		$("#loginModal ."+v).show();	
 	});
-	$("#loginStatus").bind("login",function(){
-		
-	});
 });
 function afterLoginSkip(data,flag){
-	//强制刷新
 	if(compulsoryreRresh){
-		window.location.href = window.location.href;
+		window.location.reload();
 		return;
 	}
 	if(flag){
-		switch(loginBackType){
-			case -1:
-				window.location.href = window.location.href;
-				break;
-			case 1://微官网
-				window.location.href="/member/wsite";
-				break;
-			case 2://员工邀请
-				window.location.href="/member/employeemanage/loginUserJoin";
-				break;
-			case 4://注册
-				window.location.href="/";
-				break;
-			case 5://预约
-				window.location.href="/front/appointlogin";
-				break;
-			case 6://投标
-				window.location.href="/front/reurl";
-				break;
-			case 7://用户中心首页
-				window.location.href = "/member/show/memberindex";
-				break;
-			case 8://录入产品服务信息
-				if(data.code==null || data.code == ""){
-					window.location.href = '/member/show/memberindex';
-				}else{
-					window.location.href = '/member/yellowpage/show/showService/'+data.code;
-				}
-				break;
-			case 9://录入企业信息
-				if(data.code==null || data.code == ""){
-					window.location.href = '/member/show/memberindex';
-				}else{
-					window.location.href = '/member/yellowpage/edit/enterprise/'+data.code;
-				}
-				break;
-			case 10://订阅设置
-				window.location.href = '/member/swordfish/rssset';
-				break;
-			case 11://信息列表
-				window.location.href = '/member/swordfish/infolist';
-				break;
-			default:
-				$('#loginModal').modal('hide');
+		if(afterLoginUrl == -1){//登录完之后回调
+			window.location.reload();
+		}else if(afterLoginUrl == 0){//登录完之后回调
+			try{
+				afterLogin(data);
+			}catch(e){}
+		}else if(afterLoginUrl == null){//登录完之后重新加载头部
+			reLoadTop();
+		}else{//登录完之后跳转到指定页面
+			window.location.href = afterLoginUrl;
 		}
+		$('#loginModal').modal('hide');
 	}
-	try{
-		reLoadTop();
-	}catch(e){
-		b_loadTop();
-	}
+	
 }
 </script>
 <!-- 登录弹出框 -->
@@ -278,12 +230,12 @@ function afterLoginSkip(data,flag){
 			</div>
 			<div class="modal-body f-login" style="text-align:center;padding-top:20;">
 				<div class="row">
-					<div class="login wxlogin hidden-xs col-md-5">
+					<div class="login wxlogin col-xs-5">
 						<div class="text-muted" style="margin-top:5px;font-weight: 700;color:#000;font-size: 14px;">微信扫码登录</div>
 						<img alt="加载中.." style="width:124px;height:127px;margin:20px;" id="wxPic" class="border">
 						<div class="text-muted" style="line-height: 22px;margin-top:5px;font-family: tahoma, arial, 'Hiragino Sans GB', 宋体, sans-serif;;font-size: 12px;color: rgb(160, 160, 160);">使用微信扫描登录<br/>新用户自动注册</div>
 					</div>
-					<div class="login col-md-7" style="border-left:1px solid #F0F0F0;">
+					<div class="login col-xs-7" style="border-left:1px solid #F0F0F0;">
 						<form class="form-horizontal loginForm" method="post" style="width:220px;margin-left: 40px;">
 						  	<div class="text-muted" style="margin-top:5px;font-weight: 700;color:#000;font-size: 14px;">邮箱/手机登录</div>
 							<div class="form-group">

+ 106 - 63
core/src/web/templates/common/memberleft.html

@@ -1,23 +1,7 @@
 <style type="text/css">
-.member-left{
-	font-weight: 100;
-	font-size: 14px;
-	color: #666;
-    width: 250px;
-	border: 1px solid #E5E6E9;
-	background-color: #fff;
-}
 .member_nav_a{
 	color: inherit;
 }
-.member-left .glyphicon{
-	font-size: 20px;
-	vertical-align: sub;
-	width: 30px;
-	text-align: center;
-	margin-right: 5px;
-	color: rgb(153, 153, 153);
-}
 .member-loginName{
 	display: inline-block;
 	max-width: 240px;
@@ -80,16 +64,23 @@
 	font-weight: 700;
 }
 #serviceMerchan:hover,#personal:hover,#vipMenu:hover,#accountSetMenu:hover{
-	background-color:#e4e4e4;
 	color:#0099FA;
 }
-.list-group .list-group-item {
+#serviceMerchan,#personal,#vipMenu,#accountSetMenu{
+	background-color:#F7F6F4;
+	margin-top: 10px;
+	margin-bottom: 10px;
+}
+#personal{
+	margin-top: 0px;
+}
+.member-left .list-group .list-group-item {
 	border: 0px;
     font-size: 14px;
-    color: #666666;
+    color: #666;
 	padding: 10px 0px 10px 70px;
 }
-a.list-group-item:hover{
+.member-left a.list-group-item:hover{
 	background-color:#fff;
 }
 .member-right{
@@ -98,10 +89,48 @@ a.list-group-item:hover{
 	border: 1px solid #E5E6E9;
 }
 .b-round-dot {
-    background-color: rgb(255, 90, 95);
+    background-color: #ff5a5f;
 }
 .index-new-head .head-hidemenu i {
-    color: rgb(255, 90, 95);
+    color: #ff5a5f;
+}
+.member-left .list-group .glyphicon{
+	font-size: 14px;
+	vertical-align: middle;
+	margin-right: 10px;
+	top: -1px;
+}
+.member-left .glyphicon.qmx-icon-jianyu {
+    font-size: 18px;
+	vertical-align: sub;
+}
+.member-left .glyphicon.qmx-icon-xuqiu {
+    font-size: 22px;
+}
+.member-left .glyphicon.bofangjilu {
+    font-size: 16px;
+	top: 0px;
+	opacity: 0.7;
+}
+.member-left .glyphicon.qmx-icon-dingdan {
+    font-size: 16px;
+}
+.member-left .glyphicon.qmx-icon-toubiao {
+    font-size: 16px;
+	margin-right: 8px;
+	top: 0px;
+}
+.member-left .glyphicon.qmx-icon-renzheng {
+    font-size: 16px;
+	top: 0px;
+}
+.member-left .glyphicon.qmx-icon-guize {
+    font-size: 16px;
+}
+.member-left .glyphicon.qmx-icon-mingpian {
+	font-size: 13px;
+	vertical-align: baseline;
+	top: 0px;
 }
 </style>
 {{$identWay := session "identWay"}}
@@ -117,7 +146,20 @@ a.list-group-item:hover{
 					<img class="img-circle" src="{{Msg "seo" "cdn"}}{{$s_avatar}}" onerror="this.className='img-circle defaultHeadImg';this.src='{{Msg "seo" "cdn"}}/images/image_radius_bg.png'">
 				{{end}}
 			</div>
-			<div><span style="line-height:30px;font-size:16px;padding:5px 0px 10px;" class="member-loginName cursor-pointer" onclick="window.location.href = '/member/show/memberindex'">{{session "nickName"}}</span></div>
+			<div><span style="font-size:16px;padding:10px 0px;" class="member-loginName cursor-pointer" onclick="window.location.href = '/member/show/memberindex'">{{session "nickName"}}</span></div>
+			{{if and (eq 1 $identWay) (session "identType")}}
+				<div style="padding-bottom:10px;">
+					<span>{{printf "%v" (index (session "userInfo") "s_enterprisename")}}</span>
+					{{$identType := session "identType"}}
+					{{if eq 1 $identType}}
+						<i class="glyphicon qyrz" style="width:25px;color:red;font-size:16px;margin-right:0px;"></i><span class="font-size-12" style="font-weight:normal;color:#999999;"></span>
+					{{else if eq 2 $identType}}
+						<i class="glyphicon grrz" style="width:25px;color:red;font-size:16px;margin-right:0px;"></i><span  class="font-size-12" style="font-weight:normal;color:#999999;"></span>
+					{{else if eq 3 $identType}}
+						<i class="glyphicon jgrz" style="width:25px;color:red;font-size:16px;margin-right:0px;"></i><span  class="font-size-12" style="font-weight:normal;color:#999999;"></span>
+					{{end}}
+				</div>
+			{{end}}
 			<div>
 			{{if session "credit_qd"}}
 				{{if eq (session "credit_qd") "y"}}
@@ -135,7 +177,7 @@ a.list-group-item:hover{
 	<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-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><i class="glyphicon jinbi" style="width:20px;color:red;font-size:13px;margin-top: -5px;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:50px;float:left;width:1px;background-color:#e5e6e9"></div>
 		<div onclick="window.location.href='/member/accountset/index'" style="float:left;width:125px;">
@@ -172,7 +214,7 @@ a.list-group-item:hover{
 	</div>
 	</a>
 	<div class="list-group-item" id="personal">个人菜单</div>
-	<a class="list-group-item" onclick="window.location.href = '/member/swordfish/rssset'">剑鱼(信息订阅)</a>
+	<a class="list-group-item" onclick="window.location.href = 'http://www.zhaobiao.info'"><i class="glyphicon qmx-icon-jianyu"></i>剑鱼</a>
 	
 </div>
 <!-- vipcreditModal -->
@@ -229,59 +271,47 @@ a.list-group-item:hover{
 </div>
 <script type="text/javascript">
 var role = "{{$s_role}}"=="<nil>"?"":"{{$s_role}}";
-var identWay = "{{$identWay}}";
+var identWay = {{$identWay}};
 var entId = '{{session "entid"}}';
 var isCanEditEnt = entId!="";
 var MemberLeftMenu = {
 	authentHref: "/member/authentication/index",//企业认证页面url
 	init: function (){
-		var editEnterHref = null;
-		if(isCanEditEnt){//可以编辑黄页
-			editEnterHref = "/member/yellowpage/show/enterprise/"+entId;
-		}else{//不可编辑黄页跳转到企业认证页面
-			editEnterHref = this.authentHref;
-		}
 		var html = "";
-
 		if(/^[2]$/.test(role)){//客服组长
 			html += this.accountSetMenu()+this.accountMenu()+this.messageMenu();
 			return;
 		}else if(role == "" || /^[9]$/.test(role)){//最大权限
-			html += this.myAppointment()+this.myDemand()+this.myYellowPageMenu(editEnterHref)+this.serverMenu(editEnterHref)+this.employeemanageMenu();
+			html += this.myDemand()+this.myAppointment()+this.employeemanageMenu()+this.myFollow();
 			if(/^[9]$/.test(role)){
 				html += this.callCenterMenu();
 			}
-			html += this.serviceMerchantMenu()+this.orderManageMenu()+this.bidManageMenu();
+			html += this.serviceMerchantMenu()+this.autheMenu()+this.myYellowPageMenu()+this.serverMenu()+this.orderManageMenu()+this.bidManageMenu();
 			html += this.employeemanageMenu();
 			if(/^[3]$/.test(role)){//客服
 				html += this.callCenterMenu();
 			}
-			html += this.accountSetMenu()+this.accountMenu()+this.messageMenu();
 			html += this.vipMenu()+this.myCredit()+this.creditRule();
+			html += this.accountSetMenu()+this.messageMenu()+this.accountMenu();
 		}else if(isCanEditEnt){
-			html += this.myYellowPageMenu(editEnterHref);
+			html += this.myYellowPageMenu();
 			if(/^[1]$/.test(role)){//黄页编辑者
-				html += this.serverMenu(editEnterHref);
+				html += this.serverMenu();
 			}
 			html += this.accountSetMenu()+this.accountMenu()+this.messageMenu();
 		}
 		$("#member-left-nav").append(html);
-		//$("#serviceMerchan").click(function(){
-		//	$(this).children(".a-com-collapse").toggleClass("glyphicon-menu-up");
-		//	$(".menu-childnode").toggleClass("hide");
-		//});
-		//$("#vipMenu").click(function(){
-		//	$(this).children(".a-com-collapse2").toggleClass("glyphicon-menu-up");
-		//	$(".menu-childnode2").toggleClass("hide");
-		//});
 	},
 	//实名认证菜单
 	autheMenu: function(){
-		return '<a class="list-group-item" onclick="window.location.href=\'/member/authentication/index\'"><i class="glyphicon shimingrenzheng"></i>实名1认证</a>';
+		if(identWay == 1){
+			return '';
+		}
+		return '<a class="list-group-item authemenu" onclick="window.location.href=\'/member/authentication/index\'"><i class="glyphicon qmx-icon-renzheng"></i>用户认证</a>';
 	},
 	//账户设置
 	accountMenu: function(){
-		return '<a class="list-group-item accountmenu" onclick="window.location.href = \'/member/accountset/index\'">账户设置</a>';
+		return '<a class="list-group-item accountmenu" onclick="window.location.href = \'/member/accountset/index\'"><i class="glyphicon qmx-icon-shezhi"></i>账户设置</a>';
 	},
 	//服务商家菜单
 	serviceMerchantMenu: function(){
@@ -293,7 +323,7 @@ var MemberLeftMenu = {
 	},
 	//消息菜单
 	messageMenu: function(){
-		return '<a class="list-group-item" onclick="window.location.href = \'/member/msgcenter\'" id="msgCenter">网站消息</a>'
+		return '<a class="list-group-item" onclick="window.location.href = \'/member/msgcenter\'" id="msgCenter"><i class="glyphicon qmx-icon-xiaoxi"></i>网站消息</a>'
 	},
 	//员工管理菜单
 	employeemanageMenu: function(){
@@ -310,15 +340,24 @@ var MemberLeftMenu = {
 		return '<a onclick="openSChat()" class="list-group-item">客服中心</a>';
 	},
 	//我的黄页菜单
-	myYellowPageMenu: function(href){
-		return '<a onclick="window.location.href=\''+href+'\'" class="list-group-item myyellow">我的黄页</a>';
+	myYellowPageMenu: function(){
+		var href = null;
+		if(isCanEditEnt){//可以编辑黄页
+			href = "/member/enterprise/show";
+		}else{//不可编辑黄页跳转到企业认证页面
+			href = this.authentHref;
+		}
+		return '<a onclick="window.location.href=\''+href+'\'" class="list-group-item myyellow"><i class="glyphicon qmx-icon-mingpian"></i>企业/商家名片</a>';
 	},
 	//产品服务菜单
-	serverMenu: function(href){
-		if(this.authentHref != href){
-			href += '#service';
+	serverMenu: function(){
+		var href = null;
+		if(isCanEditEnt){
+			href = "/member/service/add";
+		}else{//不可编辑黄页跳转到企业认证页面
+			href = this.authentHref;
 		}
-		return '<a onclick="window.location.href=\''+href+'\'" class="list-group-item">产品服务</a>';
+		return '<a onclick="window.location.href=\''+href+'\'" class="list-group-item"><i class="glyphicon qmx-icon-fabufuwu"></i>发布服务</a>';
 	},
 	//微官网菜单
 	microwebsiteMenu: function(){
@@ -326,19 +365,19 @@ var MemberLeftMenu = {
 	},
 	//我预约的服务
 	myAppointment: function(){
-		return '<a onclick="window.location.href=\'/member/myAppointment\'" class="list-group-item myappointment">我预约的服务</a>';
+		return '<a onclick="window.location.href=\'/member/myAppointment\'" class="list-group-item myappointment"><i class="glyphicon bofangjilu"></i>我预约的服务</a>';
 	},
 	//我发布的需求
 	myDemand: function(){
-		return '<a onclick="window.location.href=\'/member/myDemand\'" class="list-group-item mydemand">我发布的需求</a>';
+		return '<a onclick="window.location.href=\'/member/myDemand\'" class="list-group-item mydemand"><i class="glyphicon qmx-icon-xuqiu"></i>我发布的需求</a>';
 	},
 	//订单管理
 	orderManageMenu: function(){
-		return '<a onclick="window.location.href=\'/member/orderManage\'" class="menu-childnode list-group-item ordermanage">订单管理</a>';
+		return '<a onclick="window.location.href=\'/member/orderManage\'" class="menu-childnode list-group-item ordermanage"><i class="glyphicon qmx-icon-dingdan"></i>订单管理</a>';
 	},
 	//需求管理
 	bidManageMenu: function(){
-		return '<a onclick="window.location.href=\'/member/bidManage\'" class="menu-childnode list-group-item bidmanage">投标管理</a>';
+		return '<a onclick="window.location.href=\'/member/bidManage\'" class="menu-childnode list-group-item bidmanage"><i class="glyphicon qmx-icon-toubiao"></i>投标管理</a>';
 	},
 	//vip会有菜单
 	vipMenu: function(){
@@ -346,11 +385,15 @@ var MemberLeftMenu = {
 	},
 	//我的积分
 	myCredit: function(){
-		return '<a onclick="creditModel(1)" class="menu-childnode2 list-group-item mycredit" data-target="#vipcreditModal">我的积分</a>';
+		return '<a onclick="creditModel(1)" class="menu-childnode2 list-group-item mycredit" data-target="#vipcreditModal"><i class="glyphicon qmx-icon-jifen"></i>我的积分</a>';
 	},
 	//积分规则
 	creditRule: function(){
-		return '<a href="/member/credit/creditRule" class="menu-childnode2 list-group-item credit">积分规则</a>';
+		return '<a href="/member/credit/creditRule" class="menu-childnode2 list-group-item credit"><i class="glyphicon qmx-icon-guize"></i>积分规则</a>';
+	},
+	//我关注的企业
+	myFollow: function(){
+		return '<a href="/member/myFollowEnts" class="menu-childnode2 list-group-item myfollow"><i class="glyphicon weiguanzhu"></i>我关注的企业</a>';
 	}
  };
 $(function (){
@@ -372,8 +415,8 @@ function openSChat() {
 function qd(){
 	$.post("/member/credit/inCreditAjx",{"param":"qd"},function(r){
 		if (r.result=="y"){
-					bookinfo(1);
-				}
+			bookinfo(1);
+		}
 		changeStatus();
 	});
 }

+ 263 - 0
core/src/web/templates/common/newsfhead.html

@@ -0,0 +1,263 @@
+<link href="/css/swordfish.css" rel="stylesheet">
+<style>
+
+/*剑鱼首页*/
+.sf_search{
+	background: url('/images/swordfish/sf_02.png') center top no-repeat;
+	width:100%;
+	height:660px;
+	background-size: cover;
+	padding-top: 150px;
+}
+.sf_newscount{
+	background: url('/images/swordfish/sf_03.png') center top no-repeat;
+	width:100%;
+	height:500px;
+	background-size: cover;
+}
+.sf_GTwebsite{
+	background: url('/images/swordfish/sf_04.png') center top no-repeat;
+	width:100%;
+	height:500px;
+	background-size: cover;
+}
+.sf_Epwebsite{
+	background: url('/images/swordfish/sf_05.png') center top no-repeat;
+	width:100%;
+	height:500px;
+	background-size: cover;
+}
+.sf_type{
+	background: url('/images/swordfish/sf_06.png') center top no-repeat;
+	width:100%;
+	min-height:750px;
+	background-size: cover;
+}
+.sf_shm{
+    font-size: 16px;
+    line-height: 32px;
+	padding: 90px 0px 80px 10px;
+	width:100%; 
+	height:465px;
+}
+.sf_shmone{
+	float:left;
+	width:33%;
+}
+.sf_from span:first-child,.sf_lately span:first-child,.sf_today span:first-child{
+	font-size: 16px;
+    font-weight: bold;
+    color: #000;
+}
+.sf_ewm{
+	width:100%;
+	height:260px;
+	background-color:#f0f0f0;
+	padding-top:40px;
+	border:1px solid #E5E6E9;
+}
+.sf_firstewm{
+	width:100%;
+	height:260px;
+	padding-top:40px;
+}
+.sf_ewm img,.sf_firstewm img{
+	width:135px;
+	margin-bottom:20px;
+}
+.sf_ewm span,.sf_firstewm span{
+	font-size: 18px;
+    color: #000;
+}
+.sf_cp{
+	height:100px;
+	width:100%;
+	margin-bottom:100px;
+    line-height: 32px;
+    padding: 20px;
+    background-color: #f0f0f0;
+}
+.sf_cp span{
+	font-size:16px;
+	padding: 20px;
+	cursor:pointer;
+}
+.sf_ybh{
+	font-size: 14px !important;
+    color: #ccc;
+}
+.sf_geduan{
+	width:100%;
+	height:85px;
+	background-color:#fff;
+}
+.sf_collect{
+	color: #fff;
+	position: relative;
+	float:right;    
+	background-color: #24C0D7;
+    padding-top: 100px;
+	font-size: 32px;
+    width: 550px;
+    height: 300px;
+    margin-right: 10px;
+}
+.sf_collect span{
+	text-decoration: underline;
+	font-size: 36px;
+}
+.sf_GTcollect{
+	color: #fff;
+    position: relative;
+    float: left;
+    width: 551px;
+    height: 365px;
+    padding-top: 60px;
+    background-color: #316BAE;
+    margin-left: 10px;
+    font-size: 25px;
+}
+.sf_GTcollect span:first-child,.sf_Epcollect span:first-child{
+	text-decoration: underline;
+	font-size: 36px;
+}
+.sf_GTcollect span:nth-child(4),.sf_Epcollect span:nth-child(4){
+	font-size: 14px;
+    line-height: 24px;
+}
+.sf_Epcollect{
+	color: #fff;
+	position: relative;
+	float:right;    
+	width: 550px;
+    height: 309px;
+    background-color: #9A397C;
+    margin-right: 20px;
+    padding-top: 50px;
+	font-size: 32px;
+}
+.sf_jyzbdy{
+	font-size: 62px;
+    margin-bottom: 30px;
+	letter-spacing: 8px;
+}
+.sf_gxh{
+	font-size: 24px;
+    font-weight: bold;
+    margin-bottom: 40px;
+	letter-spacing: 5px;
+}
+.sf_gxh span{
+	color: #24C0D7;
+}
+.sf_form{
+	width: 30%;
+    margin-left: 31%;
+}
+.sf_form .sousuo{
+    top: 16px;
+    z-index: 99;
+    left: 12px;
+    color: #ccc;
+    font-size: 20px;
+    position: absolute;
+}
+.sf_form .sf_sousuo{
+	position: absolute;
+    display: inline-block;
+    width: 108px;
+    height: 50px;
+    background-color: #24C0D7;
+    color: #fff;
+    font-size: 20px;
+    text-align: center;
+    line-height: 50px;
+    right: -108px;
+	cursor: pointer;
+}
+.b-nav li:hover{
+	border-bottom: 3px solid #24C0D7;
+	/*cursor: pointer;*/
+}
+.b-nav li:first-child:hover{
+	border-bottom: 0px;
+}
+.b-nav-link a{
+	color:#000 !important;
+	font-weight: inherit !important;
+}
+.b-nav > ul {
+    height: 110px !important;
+    /*line-height: 110px !important;*/
+	max-width: 2250px !important;
+	padding-left: 40px;
+    padding-right: 30px;
+}
+.b-nav-main{
+	padding: 0px !important;
+    /*width: 80px !important;*/
+	background-color: #fff;
+	height: 110px;
+	line-height: 110px !important;
+}
+.b-loginStatus{
+	width:121px;
+	line-height: 110px !important;
+}
+.b-nav-logo{
+	padding-top:20px;
+}
+.sf_headjiansuo{
+	margin-right:40px;
+	margin-top: 36px;
+}
+.sf_headjiansuo:hover{
+	border-bottom: 0px !important;
+	/*cursor: pointer;*/
+}
+.sf_headinput{
+	float:left;
+}
+.sf_headinput input{
+	padding-left: 8px;
+	width:320px;
+	height:40px;
+	border-top-left-radius: 5px;
+    border-bottom-left-radius: 5px;
+}
+.sf_headsousuo{
+	float:left; 
+	height:40px; 
+	width:60px; 
+    padding-top: 6px;
+    font-size: 24px;
+    color: #fff;
+	background-color: rgb(55, 198, 218);
+	border-top-right-radius: 5px;
+    border-bottom-right-radius: 5px;
+	cursor:pointer;
+}
+.sf_nothing{
+	padding-top:150px;
+}
+</style>
+<div class="b-head">
+	<div class="b-nav index-new-nva" style="border-top:0px;box-shadow: 0 0 10px #E5E6E9;">
+		<ul>
+			<li class="b-nav-logo"><img src="{{Msg "seo" "cdn"}}/images/swordfish/sf_01.png"></li>
+			<li class="pull-right b-loginStatus hidden" id="b-loginStatus"></li>
+			<li class="pull-right b-nav-link b-nav-main"><a class="sf_zbsq">招标社区</a></li>
+			<li class="pull-right b-nav-link b-nav-main"><a class="sf_zbsq">招标百科</a></li>
+			<li class="pull-right b-nav-link b-nav-main"><a  onclick="subsea()">招标搜索</a></li>
+			<li class="pull-right b-nav-link sf_headjiansuo {{if .T.status}} {{else}} hidden{{end}} ">
+				<div class="sf_headinput" style="float:left;">
+				<input type="text" id="headsearchname" name="headsearchname" value="{{.T.keywords}}"  placeholder="信息检索"/>
+				</div>
+				<div class="text-center sf_headsousuo">
+				<span  class="glyphicon sousuo"></span>
+				</div>
+				<div style="clear:both;"></div>
+			</li>
+		</ul>
+	</div>
+</div>

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

@@ -67,7 +67,7 @@ $(function (){
 		if(isLogined){
 			window.location.href = "/front/reurl";
 		}else{
-			loginModalShow(6);
+			loginModalShow("/front/reurl");
 		}
 	});
 });

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

@@ -65,7 +65,7 @@ $(function (){
 		if(isLogined){
 			window.location.href = "/front/reurl";
 		}else{
-			loginModalShow(6);
+			loginModalShow("/front/reurl");
 		}
 	});
 });

+ 6 - 9
core/src/web/templates/common/swordfishhead.html

@@ -21,7 +21,7 @@ function open_window(link){
 	}
 	window.open("/visit/redirect?url="+escape(link));
 }
-function b_afterLogin(flag,result){
+function afterReLoadTop(flag,result){
 	if(flag){
 		//立即体验
 		$("#experience").click(function(){
@@ -37,18 +37,15 @@ function b_afterLogin(flag,result){
 			window.location.href = "/member/swordfish/infolist";
 		});
 	}else{
-		//立即体验
-		$("#experience").click(function(){
-			loginModalShow();
-		});
-		$("#goToSearch").click(function(){
-			loginModalShow();
+		//立即体验,信息查询
+		$("#experience,#goToSearch").click(function(){
+			loginModalShow("/member/swordfish/searchinfolist");
 		});
 		$("#goToRssset").click(function(){
-			loginModalShow(10);
+			loginModalShow("/member/swordfish/rssset");
 		});
 		$("#goToInfolist").click(function(){
-			loginModalShow(11);
+			loginModalShow("/member/swordfish/infolist");
 		});
 	}
 }

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

@@ -2,7 +2,7 @@
 	<div>
 		<ul class="pull-right">
 			<li><span class="img-circle b-com-first"><i class="glyphicon fuwushichang"></i></span><a href="/market/0/list.html">服务市场</a></li>
-			<li><span class="img-circle b-com-second"><i class="glyphicon jianyu"></i></span><a href="/front/swordfish">剑鱼</a></li>
+			<li><span class="img-circle b-com-second"><i class="glyphicon jianyu"></i></span><a href="http://www.zhaobiao.info">剑鱼</a></li>
 			<li><span class="img-circle b-com-third"><i class="glyphicon qiyeshequ"></i></span><a href="/front/entCommunity.html">企业社区</a></li>
 			<li><span class="img-circle b-com-four"><i class="glyphicon weiguanwang1"></i></span><a href="/front/wsite.html">微官网</a></li>
 			<li><span class="img-circle b-com-five"><i class="glyphicon zhengcefagui"></i></span><a href="/front/content_zcfg_list.html">政策法规</a></li>
@@ -11,7 +11,7 @@
 </div>
 <script type="text/javascript">
 $(function(){
-	b_loadTop();
+	reLoadTop();
 });
 //认证完之后首次登录
 function afterAutheFirstLogin(result){
@@ -21,7 +21,7 @@ function afterAutheFirstLogin(result){
 		$("body").append('{{include "/common/ploginmodal.html"}}');
 		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
 		$("#fristAutheLoginModal .com-entName").text(result.entName+"店铺");
-		$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
+		$("#fristAutheLoginModal .com-entCard a").attr("href","/member/enterprise/edit");
 	}else{
 		$("body").append('{{include "/common/ologinmodal.html"}}');
 		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
@@ -39,14 +39,14 @@ function afterAutheFirstLogin(result){
 			//$("#fristAutheLoginModal .com-who").text("完成以下操作,就可以领取红包啦:");
 		}else{
 			$("#fristAutheLoginModal .com-entCard").removeClass("hide");
-			$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
+			$("#fristAutheLoginModal .com-entCard a").attr("href","/member/enterprise/edit");
 		}
 	}
-	$("#fristAutheLoginModal .com-releaseService a").attr("href","/member/yellowpage/show/showService/"+entId);
+	$("#fristAutheLoginModal .com-releaseService a").attr("href","/member/service/add");
 	$("#fristAutheLoginModal").modal('show');
 }
 //
-function b_loadTop(){
+function reLoadTop(){
 	$.ajax({
 	  	type: "POST",
 	  	url: "/front/getWebSiteTop",
@@ -106,7 +106,7 @@ function b_loadTop(){
 				$("body").append('{{include "/common/login.html"}}');
 			}
 			try{
-				b_afterLogin(isLogined,result);
+				afterReLoadTop(isLogined,result);
 			}catch(e){}
 		},
 		error: function(e){

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

@@ -66,7 +66,7 @@ $(function (){
 		if(isLogined){
 			window.location.href = "/front/reurl";
 		}else{
-			loginModalShow(6);
+			loginModalShow("/front/reurl");
 		}
 	});
 });

+ 74 - 57
core/src/web/templates/yellowpage/enterpriseinfo.html → core/src/web/templates/enterprise/detail.html

@@ -6,6 +6,7 @@
 <meta name="Keywords" content="{{.T.res.EntName}},{{.T.res.EntName}}地址,{{.T.res.EntName}}怎么样"/>
 <meta name="Description" content="{{.T.res.OpScope}}"/>
 <link href="{{Msg "seo" "cdn"}}/css/entcommunity.css" rel="stylesheet">
+<script src="{{Msg "seo" "cdn"}}/js/baiduMap.js"></script>
 <script src="{{Msg "seo" "cdn"}}/js/entportrait.js"></script>
 </head>
 <body class="entinfo-page">
@@ -13,12 +14,22 @@
 <div class="b-content container-fluid">
 	<!--企业名片-->
 	<div class="b-com-head">
-		<img src="{{if .T.res.s_avatar}}{{Msg "seo" "cdn"}}{{.T.res.s_avatar}}{{else}}null{{end}}" onerror="this.src='{{Msg "seo" "cdn"}}/images/ent-logo.png'">
-		<div class="entinfo-cart">
+		<div class="ent-logo" id="entLogo">
+			<img src="{{if .T.res.s_avatar}}{{Msg "seo" "cdn"}}{{.T.res.s_avatar}}{{else}}null{{end}}" onerror="this.src='{{Msg "seo" "cdn"}}/images/ent-logo.png'">
+			{{if eq .T.editFlag 2}}
+			<div id="uploadLogo" class="ent-uploadLogo">
+				上传企业LOGO
+				<div class="hide"></div>
+			</div>
+			{{end}}
+		</div>
+		<div class="entinfo-cart{{if eq .T.editFlag 2}} entinfo-editcart{{end}}">
+			{{if eq .T.editFlag 1}}<button class="btn btn-primary btn-save" onclick="window.location.href='/member/enterprise/edit'">编辑</button>{{end}}
+			{{if eq .T.editFlag 2}}<button id="editSave" class="btn btn-primary btn-save">保存</button>{{end}}
 			<div class="b-com-first">
 				<font class="b-com-title">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</font>
 				{{if .T.res.OpState}}
-				<span class="{{if eq .T.res.OpState "07" "08" "11"}}ent-status-r{{else}}ent-status-g{{end}}">
+				<span id="entinfo-opState" class="{{if eq .T.res.OpState "07" "08" "11"}}ent-status-r{{else}}ent-status-g{{end}}">
 				<script>
 					var OpState = {{.T.res.OpState}};
 					var OpStateName = {{.T.res.OpStateName}};
@@ -41,23 +52,53 @@
 				{{end}}
 			</div>
 			<div class="b-com-second">
-				{{if .T.res.EntName }}
+				{{if .T.res.EntName}}
 					{{if .T.res.s_action}}
 						{{$identaction:=.T.res.s_action}}
 						{{if eq $identaction "01"}}
 						<script>entType="企业"</script>
+						<span>
 							<span class="glyphicon qyrz"></span>
 							已认证企业{{if .T.res.i_comauthenttype}}{{if eq .T.res.i_comauthenttype 2}}<font class="margin-lr-5">-</font><span class="glyphicon mprz"></span>名片认证{{else if eq .T.res.i_comauthenttype 1}}<font class="margin-lr-5">-</font><span class="glyphicon yyzzrz"></span>营业执照认证{{else if eq .T.res.i_comauthenttype 3}}<font class="margin-lr-5">-</font><span class="glyphicon yjrz"></span>年报邮箱认证{{end}}{{else}}<font class="margin-lr-5">-</font><span class="glyphicon yyzzrz"></span>营业执照认证{{end}}
+						</span>
 						{{else if eq $identaction "02"}}
 						<script>entType="商家"</script>
+						<span>
 							<span class="glyphicon grrz"></span>已认证个人
+						</span>
 						{{else if eq $identaction "03"}}
 						<script>entType="机构"</script>
+						<span>
 							<span class="glyphicon jgrz"></span>已认证机构
+						</span>
 						{{end}}
 					{{end}}
 				{{end}}
+				{{if .T.lastService}}<a href="/market/detail/{{.T.lastService}}.html#moreservice">服务信息<div class="servicelink"><i class="glyphicon qmx-icon-right"></i></div></a>{{end}}
 			</div>
+			{{if eq .T.editFlag 2}}
+			<form class="b-editEnt-form" id="editForm">
+				<div>
+					<span class="glyphicon ren2"></span><input type="text" name="s_persion" class="form-control" maxlength="10" value="{{.T.res.s_persion}}">
+					<span class="glyphicon shouji"></span><input type="text" name="s_mobile" class="form-control" maxlength="11" onKeyUp="rePlaceUnDigital(this)" value="{{.T.res.s_mobile}}">
+					<span class="glyphicon qq1"></span><input type="text" name="s_qq" class="form-control" maxlength="30" value="{{.T.res.s_qq}}">
+				</div>
+				<div>
+					<span class="glyphicon youjian2"></span><input type="text" name="s_email" class="form-control" value="{{.T.res.s_email}}">
+					<span class="glyphicon wangzhi1"></span><input type="text" name="s_enturl" class="form-control" value="{{.T.res.s_enturl}}">
+				</div>
+				<div class="b-com-last">
+					<span class="glyphicon dizhi"></span>
+					<span id="city_china">
+						<select class="province cxselect select-control" id="provincesel" name="i_province" data-first-title="全国"></select>								
+						<select class="city cxselect select-control" id="citysel" name="i_city" data-first-title="选择市"></select>
+						<select class="area cxselect select-control" id="areasel" name="i_area" data-first-title="选择县"></select>
+					</span>
+					<input type="text" name="s_address" class="form-control" maxlength="50" value="{{.T.res.s_address}}">
+					<a href="javascript:void(0)" class="font-size-12" onclick="showMap()">添加标记</a>
+				</div>
+			</form>
+			{{else}}
 			<div class="b-com-last">
 				{{if .T.res.s_persion}}<span class="glyphicon ren2"></span>{{.T.res.s_persion}}<span class="margin-r-15"></span>{{end}}
 				{{if or .T.res.s_mobile .T.res.Tel}}<span class="glyphicon shouji"></span>{{if .T.res.s_mobile}}{{.T.res.s_mobile}}{{else if .T.res.Tel}}{{.T.res.Tel}}{{end}}<span class="margin-r-15"></span>{{end}}
@@ -105,11 +146,14 @@
 							{{.T.res.Dom}}
 						{{end}}
 					</span>
-					<input id="location" type="hidden" value="{{if .T.res.Dom}}{{.T.res.Dom}}{{end}}">
-					<input id="cityname" type="hidden" value="">
-					<a href="javascript:void(0)" class="font-size-12" onclick="showMap()">查看详细地图</a>
+					<a href="javascript:void(0)" class="entinfo-lookmap" onclick="showMap()">查看详细地图</a>
 				{{end}}
 			</div>
+			{{end}}
+		</div>
+		{{if ne .T.editFlag 2}}
+		<div class="entinfo-follow" id="follow">
+			<span class="glyphicon weiguanzhu"></span>关注
 		</div>
 		<div class="b-pcshare">
 			<span id="pcShare"><span class="glyphicon fenxiang"></span>分享</span>
@@ -126,6 +170,7 @@
 				</div>
 			</div>
 		</div>
+		{{end}}
 	</div>
 	<!--切换-->
 	<ul class="ent-tab">
@@ -135,7 +180,6 @@
 		<li{{if and (not .T.copyright.WorkCopyRight) (not .T.copyright.SoftWareCopyRight) (not .T.copyright.Patent)}} class="disabled"{{end}}><div class="b-com-border-top"></div>著作权<front class="badge" id="ent-tab-copyright">0</front></li>
 		<li{{if not .T.res.alterInfo}} class="disabled"{{end}}><div class="b-com-border-top"></div>变更信息<front class="badge{{if .T.res.alterInfo}}{{if eq (len .T.res.alterInfo) 0}} disabled{{end}}{{else}} disabled{{end}}">{{if .T.res.alterInfo}}{{len .T.res.alterInfo}}{{else}}0{{end}}</front></li>
 		<li{{if not .T.dishonesty.count}} class="disabled"{{end}}><div class="b-com-border-top"></div>失信信息<front class="badge" id="ent-tab-dishonesty">0</front></li>
-		<li class="{{if and (not .T.service.count) (not .T.res.s_synopsis)}}disabled {{end}}border-r-0"><div class="b-com-border-top"></div>{{if .T.res.s_action}}{{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}}{{else}}企业{{end}}黄页</li>
 	</ul>
 	<div class="ent-tab-content b-left{{if and (not .T.relevantNews) (not .T.relevantEnts)}} b-right-none{{end}}">
 		<!--企业概况-->
@@ -151,18 +195,12 @@
 						<div>
 							<span>
 								<div>
-									{{if .T.res.OpStateName}}
-									<span class="{{if eq .T.res.OpStateName "注销" "吊销"}}ent-status-r{{else}}ent-status-g{{end}}">
-									<script>
-										var OpStateName = {{.T.res.OpStateName}};
-										if(OpStateName.length > 2){
-											OpStateName = OpStateName.substring(0,2);
-										}
-										document.write(OpStateName);
-									</script>
+									<span id="entinfo-status" class="entinfo-status">
+										{{if .T.res.excDirect}}
+										<span class="ent-exception">经营异常</span>
+										{{end}}
 									</span>
 									<br>
-									{{end}}
 									{{if .T.res.EntName}}
 									<script>
 										var entName = {{.T.res.EntName}};
@@ -197,8 +235,11 @@
 						<!--注册资本-->
 						<div class="entinfo-regcap">
 							<div>
-							{{if and .T.res.RegCap .T.res.EntType}}
-								{{if and (ne .T.res.EntType "9600") (ne .T.res.EntType "5810") (ne .T.res.EntType "4540") (ne .T.res.EntType "4533")}}
+							{{if and .T.res.RegCap}}
+								{{if not .T.res.EntType}}
+									<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>万{{if .T.res.RegCapCurName}}{{.T.res.RegCapCurName}}{{else}}元{{end}}</span>
+								{{else if and (ne .T.res.EntType "9600") (ne .T.res.EntType "5810") (ne .T.res.EntType "4540") (ne .T.res.EntType "4533")}}
 									<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>万{{if .T.res.RegCapCurName}}{{.T.res.RegCapCurName}}{{else}}元{{end}}</span>
 								{{else}}
@@ -451,33 +492,6 @@
 				<h4>抱歉,未找到相关数据!</h4>
 			</div>
 		</div>
-		<!--企业黄页-->
-		<div class="hide ent-yellowpage">
-			{{if .T.res.s_synopsis}}
-			<div class="ent-layout-down">
-				<div class="b-com-title">
-					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>{{if .T.res.s_action}}{{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}}{{else}}企业{{end}}介绍
-				</div>
-				<div class="b-com-content">{{.T.res.s_synopsis}}</div>
-			</div>
-			{{end}}
-			<div class="ent-layout-down serviceList-layout hide">
-				<div class="b-com-title">
-					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>产品服务信息
-				</div>
-				<div class="b-com-content padding-b-0">
-					<table class="table ent-table" id="serviceList">
-						<tr>
-							<td colspan="4" class="text-center ent-servicepaging" id="serviceListPaging"></td>
-						</tr>
-					</table>
-				</div>
-			</div>
-			<div class="ent-findnull hide">
-				<img src="{{Msg "seo" "cdn"}}/images/findnull.png" class="b-findnull">
-				<h4>抱歉,未找到相关数据!</h4>
-			</div>
-		</div>
 	</div>
 	{{if or .T.relevantEnts .T.relevantNews}}
 	<div class="b-right">
@@ -527,11 +541,15 @@
 	</div>
 	{{end}}
 </div>
-<!--显示地图信息-->
-<div id="mapshowdiv" class="white_content"></div>
-<a href ="javascript:void(0)" onclick="closeMap();"><div id="closeshowmap" class="closeshowmap">X</div></a>
-<div id="fade" class="black_overlay"></div>
 {{include "/common/bottom.html"}}
+<div class="maskLayer" id="maskLayer"></div>
+<div class="tipTriangle" id="tipTriangle">
+	<span class="triangle-up"></span>
+	<div>
+		剑鱼为给您更好的使用体验目前仅支持关注10家企业,你已成功关注10家企业,如需继续关注,请到“用户中心-我的关注”对已关注的企业进行取消关注后,可关注新的企业。
+		<div><span class="cursor-pointer" id="thinkAgain">再想想</span><span class="margin-lr-15">或</span>管理<button class="btn btn-primary margin-l-5" onclick="window.location.href='/member/myFollowEnts'">我的关注</button></div>
+	</div>
+</div>
 </body>
 <script type="text/javascript">
 var cdn = {{Msg "seo" "cdn"}};
@@ -547,21 +565,20 @@ var dishonesty = {{.T.dishonesty}};
 var gs = {{.T.res.gs}};
 var investor = {{.T.res.investor}};
 var OpScope = {{.T.res.OpScope}};
-var service = {{.T.service}};
 var relFlag = {{.T.relflag}};
 var copyright = {{.T.copyright}};
+var editFlag = {{.T.editFlag}}==2;
+var opLocDistrict = {{.T.res.OpLocDistrict}};
 //联系地址
-//定义默认的郑州经纬度
-var ptlat=113.69884285509,  ptlng=34.791342526551;
 var province = {{.T.res.i_province}};
 var city = {{.T.res.i_city}};
 var area = {{.T.res.i_area}};
-var as1="{{.T.res.s_address}}";
-var $address=false,$listent=false;
+var address = {{.T.res.s_address}};
+var $address=false;
 {{if or .T.res.i_province .T.res.i_city .T.res.i_area .T.res.s_address}}
 	$address = true;
 {{else if .T.res.Dom}}
-	initMap();
+	address = {{.T.res.Dom}};
 {{end}}
 </script>
 </html>

+ 142 - 0
core/src/web/templates/enterprise/relation.html

@@ -0,0 +1,142 @@
+<html>
+<head>
+<title>{{.T.res.EntName}}</title>
+<link href="{{Msg "seo" "cdn"}}/css/qfw.css" rel="stylesheet">
+<script src="{{Msg "seo" "cdn"}}/js/jquery.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/d3.v3.min.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/geometry.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/provinceData.min.js"></script>
+<script src="{{Msg "seo" "cdn"}}/js/relation.js"></script>
+<script type="text/javascript">
+	var regNo = {{.T.RegNo}};
+	var regCapCurName = {{.T.RegCapCurName}};
+	var legcerNo = {{.T.LegCerNO}};
+	var entName = {{.T.EntName}};
+	var relFlag = {{.T.relFlag}};
+	var relation = {{.T.relation}};
+	$(function(){
+		if(relFlag == 1){
+			var relationEntity = new Relation(legcerNo,regNo,regCapCurName,relation,relation.nodes.length>15);
+			relationEntity.init();
+		}else{
+			$("#entrelation-infovis").hide();
+			if(relFlag == -3){
+				$("#findnull h3").text("抱歉,未找到该企业!");
+			}else{
+				$("#findnull h3").text("抱歉,未找到相关数据!");
+			}
+			$("#findnull").show();
+		}
+	});
+</script>
+<style type="text/css">
+	body{
+		padding-top: 0px;
+		font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;
+		color: #4e5051;
+		font-size: 14px;
+		padding: 20px;
+	}
+	.entrelation{
+		position: relative;
+		height: inherit;
+		height: 100%;
+	}
+	.entrelation svg{
+		position: relative;
+		z-index: 1;
+	}
+	.legend-text-bg>div{
+	    position: absolute;
+	    display: inline-block;
+	    border-radius: 4px;
+	    width: 110px;
+		height: 25px;
+	    line-height: 25px;
+	    text-align: center;
+		margin-top: -3px;
+	}
+	.legend-text-bg>span{
+		position: relative;
+	}
+	/*全屏代码*/
+	.entrelation .entrelation-controlls{
+		position: absolute;
+		z-index: 2;
+		right: 0px;
+	}
+	.entrelation .entrelation-controlls-fullscreen{
+		top: 15px;
+		right: 15px;
+	}
+	.entrelation .entrelation-controlls>div{
+		margin-bottom: 10px;
+		margin-left: 10px;
+		width: 35px;
+		height: 35px;
+		box-shadow: 0px 0px 5px #DADADA;
+	}
+	.entrelation .entrelation-controlls>div>span{
+		margin-top: 9px;
+	}
+	.entrelation .entrelation-controlls .entrelation-box{
+		border: 1px solid #e5e6e9;
+		text-align: center;
+		cursor: pointer;
+		vertical-align: top;
+		border-radius: 3px;
+		color: #16a086;
+		
+	}
+	.entrelation .entrelation-controlls .entrelation-box.checked{
+		display: none;
+	}
+	:-moz-full-screen .entrelation,:-webkit-full-screen .entrelation,:-o-full-screen .entrelation,
+	:-ms-full-screen .entrelation,:fullscreen .entrelation,:-ms-fullscreen .entrelation,:full-screen .entrelation{
+	  width: 100%;
+	  height: 100%;
+	  background-color:#fff;
+	}
+	:-moz-full-screen{
+		background: #fff;
+	}
+	:-webkit-full-screen{
+		background: #fff;
+	}
+	:-o-full-screen{
+		background: #fff;
+	}
+	:-ms-full-screen{
+		background: #fff;
+	}
+	:fullscreen{
+		background: #fff;
+	} 
+	:-ms-fullscreen{
+		background: #fff;
+	} 
+	:full-screen{
+		background: #fff;
+	}
+	.findnull{
+		text-align: center;
+		display: none;
+		margin-top: 13%;
+	}
+	.findnull img{
+		width: 200px;
+		height: 180px;
+	}
+</style>
+</head>
+<body class="entinfo-page">
+<!--关系网-->
+<div class="entrelation" id="entrelation">
+	<div id="entrelation-infovis"></div>
+	<div id="findnull" class="findnull">
+		<img src="{{Msg "seo" "cdn"}}/images/findnull.png">
+		<h3></h3>
+	</div>
+</div>
+</body>
+</html>

+ 10 - 12
core/src/web/templates/index.html

@@ -5,17 +5,15 @@
 {{include "/common/inc.html"}}
 <meta name="Keywords" content="{{Msg "seo" "qfw.homepage.key"}}"/>
 <meta name="Description" content="{{Msg "seo" "qfw.homepage.description"}}"/>
-<link href="{{Msg "seo" "cdn"}}/css/index-new.css" rel="stylesheet">
-<script src="{{Msg "seo" "cdn"}}/js/jquery.lazyload.min.js"></script>
-
+{{if .T.flag}}
 <script type="text/javascript">
-$(function(){
-	var wid = document.body.clientWidth;
-	if (wid < 760){
+	if (window.screen.width < 760){
 		window.location.href = "/front/webindexcontent/56f24224af53745027000078.html";
 	} 
-});
 </script>
+{{end}}
+<link href="{{Msg "seo" "cdn"}}/css/index-new.css" rel="stylesheet">
+<script src="{{Msg "seo" "cdn"}}/js/jquery.lazyload.min.js"></script>
 </head>
 <body>
 {{include "/common/indexhead.html"}}
@@ -158,7 +156,7 @@ $(function(){
 			<div id="myCarousel" class="carousel slide" style="height:300px;">  
 			   <!-- 轮播(Carousel)项目 -->
 			   <div class="carousel-inner">
-			         	{{$s:=(Ad "index-center-06" 16)}}
+			         	{{$s:=(Ad "ent-recommend" 16)}}
 			      <div class="item active itemno">
 						<div class="index-qysq">
 						{{range $k,$v := $s}}
@@ -168,9 +166,9 @@ $(function(){
 			    		{{if eq $k 12}}</div><div class="index-qysq">{{end}}
 				
 						<div class="index-new-qysqlist text-center">
-						<a  target="_blank" href="{{$v.s_link}}"{{if ge $k 2}} class="hidden-xs"{{end}}><img{{if $v.s_picalt}} alt="{{$v.s_picalt}}"{{end}}  data-original="{{if $v.s_pic}}{{Msg "seo" "cdn"}}{{$v.s_pic}}{{else}}{{Msg "seo" "cdn"}}/images/u166.png{{end}}" class="lazy"  onerror="this.src='/images/u166.png'"></a>
+						<a  target="_blank" href="/enterprise/{{$v.s_id}}.html" {{if ge $k 2}} class="hidden-xs"{{end}}><img{{if $v.s_picalt}} alt="{{$v.s_picalt}}"{{end}}  data-original="{{if $v.s_pic}}{{Msg "seo" "cdn"}}{{$v.s_pic}}{{else}}{{Msg "seo" "cdn"}}/images/u166.png{{end}}" class="lazy"  onerror="this.src='/images/u166.png'"></a>
 						</br>
-						<a  target="_blank" href="{{$v.s_link}}" class="index-qysq-name font-size-12
+						<a  target="_blank" href="/enterprise/{{$v.s_id}}.html" class="index-qysq-name font-size-12
 ">{{$v.s_remark}}</a>
 						</div>
 						{{end}}
@@ -530,9 +528,9 @@ $(function(){
 	function adjustLayout(){
 		var windowWidth = $(window).width();
 		if(windowWidth>=1007 && windowWidth < 1200){
-			$(".a-i-h-right").css("width",windowWidth-10-200-685+"px");
+			//$(".a-i-h-right").css("width",windowWidth-10-200-685+"px");
 		}else{
-			$(".a-i-h-right").removeAttr("style");
+			//$(".a-i-h-right").removeAttr("style");
 		}
 		//
 		$(".a-xwzx").find("ul li.a-com-title").css("height","auto");

+ 36 - 18
core/src/web/templates/manage/tj.html

@@ -24,7 +24,7 @@
 				color:#ff5a5f;
 			}
 			.counttab{
-				width:310px;
+				width:440px;
 				height:34px;
 				margin:30px 0px 30px 18px;
 				background-color:#F8F8F8;
@@ -162,7 +162,8 @@
 					<div class="counttab">
 						<a href="javascript:void(0);"  onclick="loadData(this)" id="n_total" class="counttabbtn" style="border-right:1px solid #E4E4E4;">新增人数</a>
 						<a href="javascript:void(0);"  onclick="loadData(this)" id="total" class="counttabbtn" style="border-right:1px solid #E4E4E4;">累计人数</a>
-						<a href="javascript:void(0);"  onclick="loadData(this)" id="sfish" class="counttabbtn">剑鱼用户</a>
+						<a href="javascript:void(0);"  onclick="loadData(this)" id="sfish" class="counttabbtn" style="    border-right: 1px solid #E4E4E4;">剑鱼用户</a>
+						<a href="javascript:void(0);"  onclick="loadData(this)" id="nfish" class="counttabbtn">剑鱼用户(活跃)</a>
 					</div>
 				</div>
 				<div class="count_chart">
@@ -187,7 +188,7 @@
 							   </div>
 								  </div>
 								<div class="col-sm-1">
-										<input type="checkbox" type="form-control" id="comparecheck" onclick=onCompareClick(this) />是否对比
+										<input type="checkbox" type="form-control" id="comparecheck" name="comparecheck" onclick=onCompareClick(this) />是否对比
 								</div> 		
 						</div>
 						<div class="col-sm-3 text-center">
@@ -235,36 +236,53 @@
 						 title: "认证个人",
 						field: "personum",
 						callback:function(ct,cd,val,k,m){
-							if (!cd){
-								return "-";
+							var enternum=ct.enternum;
+							var personum=ct.personum;
+							var organnum=ct.organnum;
+							if(!enternum){
+								enternum=0;
 							}
-							 return cd;
+							if(!personum){
+								personum=0;
+							}
+							if(!organnum){
+								organnum=0;
+							}
+							 return enternum+personum+organnum;
 						}
 					},
 					{
-						 title: "认证企业",
-						field: "enternum",
-						callback:function(ct,cd,val,k,m){
-							if (!cd){
-								return "-";
+						 title: "剑鱼订阅(总)",
+						field: "sfish",
+						callback:function(ct,cd,val,k,m){	
+							var sfish=ct.sfish;
+							var snfish=ct.snfish;
+							if(!sfish){
+								sfish=0;
 							}
-							 return cd;
+							if(!snfish){
+								snfish=0;
+							}
+							 return (sfish+snfish)+"人";
 						}
 					},
 					{
-						 title: "认证机构",
-						field: "organnum",
+						 title: "剑鱼订阅(旧)",
+						field: "sfish",
 						callback:function(ct,cd,val,k,m){
-							if (!cd){
+							 if(!cd){
 								return "-";
 							}
-							 return cd;
+							 return cd+"人";
 						}
 					},
 					{
-						 title: "剑鱼订阅",
-						field: "sfish",
+						 title: "剑鱼订阅(新)",
+						field: "snfish",
 						callback:function(ct,cd,val,k,m){	
+							if(!cd){
+								return "-";
+							}
 							 return cd+"人";
 						}
 					},

+ 27 - 8
core/src/web/templates/manage/web_help.html

@@ -280,9 +280,10 @@
 		</div>
 	  
 		<div class="form-group" style="margin-top:35px; ">
-        <label id="col-sm-2" class="col-sm-2 control-label" for="name"><span style="color:#D03102;margin-right:5px;">*</span>问题描述:</label>
+        <label id="col-sm-2" class="col-sm-2 control-label" for="name"><span style="color:#D03102;margin-right:5px;">*</span>反馈内容:</label>
 	    <div class="col-sm-10">
-		<textarea style=" width:100%;padding:10px 8px; height:120px; max-width:740px;"  name="s_remark" class="form-control" id="remark"   placeholder="请在这里输入您的问题描述。" ></textarea>
+		<textarea style=" width:100%;padding:10px 8px; height:120px; max-width:740px;"  name="s_remark" class="form-control" id="remark"   placeholder="" >1.请输入您的宝贵意见
+2.如果有好的信息源,请告诉我们</textarea>
 		</div>
 		</div>
 		
@@ -407,6 +408,24 @@
 </div>
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
+var rm = $("#remark").val();
+$("#remark").css("color","cccccc");
+$("#remark").click(function(){
+	var rm2 = $("#remark").val();
+	if (rm == rm2){
+		$("#remark").val("");
+	}else{
+		$("#remark").css("color","000");
+	}
+});
+$("#remark").blur(function(){
+	var rm3 = $("#remark").val();
+	var rm4;
+	if (rm3 == ""||rm3 == rm){
+		$("#remark").css("color","cccccc");
+		document.getElementById("remark").value = "1.请输入您的宝贵意见\n2.如果有好的信息源,请告诉我们"
+	}
+});
 var tp = {{.T.tp}}
 active(tp)
 $("#tdbtn").click(function(){
@@ -415,7 +434,12 @@ $("#tdbtn").click(function(){
 function reLoadCaptcha(id){
 	document.getElementById(id).src='/tool/captcha?rnd='+Math.random()
 }
-function insertback(){    
+function insertback(){  
+	var str1 = $("#remark").val();
+	if (str1 == '' || rm == str1){
+	alert('请输入您的反馈内容!')
+	return
+	}  
     var str4 = $("#chedkcode").val();
 	if (str4 == ''){
 	alert('验证码不能为空!')
@@ -426,11 +450,6 @@ function insertback(){
 	//alert('问题标题不能为空!')
 	//return
 	//}
-	var str1 = $("#remark").val();
-	if (str1 == ''){
-	alert('问题描述不能为空!')
-	return
-	}
 	
     var Param = $("#insertback").serialize();
     $.ajax({    

+ 1 - 1
core/src/web/templates/manage/webactivitycontent.html

@@ -126,7 +126,7 @@ $(function (){
 		if(isLogined){
 			window.location.href = "/front/reurl";
 		}else{
-			loginModalShow(6);
+			loginModalShow("/front/reurl");
 		}
 	});
 });

+ 51 - 1
core/src/web/templates/manage/webmobindex.html

@@ -1,12 +1,16 @@
 <html>
 <head>
 <title>企明星_移动端首页</title>
+<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0" user-scalable="no" />
 {{include "/common/inc.html"}}
 <script src="{{Msg "seo" "cdn"}}/js/validform-min.js"></script>
 <style type="text/css">
 body{
 	background-color:#f0f0f0;
 	}
+.b-head{
+	min-width: inherit;
+}
 .b-nav {
     border-top-color: rgb(255, 90, 95);
 }
@@ -29,6 +33,33 @@ body{
      width: auto; 
     border-radius: 4px;
 }
+#webbtsm{
+	border-top:1px solid #E5E6E9; 
+	height:88px; 
+	width:100%;
+	background-color:#f0f0f0;
+	line-height:25px;
+}
+#chup{
+	float:left;
+	width:50%;
+	padding-left:80px;
+	margin-top: 10px;
+}
+#diann{
+	float:left;
+	width:50%;
+	padding-right:80px;
+	margin-top: 10px;
+}
+#banquan{
+	border-top:1px solid #E5E6E9; 
+	height:50px; 
+	width:100%;
+	background-color:#f0f0f0;
+	line-height:20px;
+	padding-top: 10px;
+}
 </style>
 </head>
 <body>
@@ -66,7 +97,7 @@ body{
 
 
 </div>
-<div class="row" style="padding:0px; margin-left:auto; margin-right:auto;margin-bottom:20px;">
+<div class="row" style="padding:0px; margin-left:auto; margin-right:auto;">
 		<div id="contentindex">
 			<div class="container-fluid">
 				<div style="margin-top:0px;" class="row-fluid">
@@ -92,6 +123,21 @@ body{
 
 
 </div>
+<div class="text-center" id="webbtsm">
+<div id="chup">
+<img style="height:49px;" src="/images/u906.png"><br/>
+触屏版
+</div>
+<div id="diann">
+<img style="height:49px;" src="/images/u908.png"><br/>
+电脑版
+</div>
+<div style="clear:both;"></div>
+</div>
+<div class="text-center" id="banquan">
+©2015-2016 拓普丰联 版权所有 | 京ICP备14030217号-2
+</div>
+
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
 function currPos(){
@@ -101,6 +147,10 @@ $(function (){
 	$(".backTop").click(function (){
 		$(window).scrollTop(0);
 	});
+	$("#diann").click(function(){
+		//跳转到电脑版
+		window.location.href = "/pcIndex"
+	});
 	$('#loginModal').on('shown.bs.modal', function () {
 		$("#username").focus();
 	});

Some files were not shown because too many files changed in this diff