Explorar o código

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

zhangjinkun@topnet.net.cn %!s(int64=9) %!d(string=hai) anos
pai
achega
14908fd50b
Modificáronse 34 ficheiros con 1474 adicións e 672 borrados
  1. 2 2
      common/src/qfw/util/credit/credit.go
  2. 1 0
      core/src/qfw/member/membermanager.go
  3. 78 56
      core/src/qfw/mobile/wxmenu.go
  4. 4 4
      core/src/qfw/redpackage/redpackage_test.go
  5. 2 2
      core/src/qfw/yellowpage/yellowpagemanager.go
  6. 1 28
      core/src/timetask.json
  7. 11 1
      core/src/web/staticres/css/dev-qfw.css
  8. 470 7
      core/src/web/staticres/css/entcommunity.css
  9. 0 3
      core/src/web/staticres/css/enterprise.css
  10. 4 0
      core/src/web/staticres/css/qfw.css
  11. BIN=BIN
      core/src/web/staticres/fonts.zip
  12. BIN=BIN
      core/src/web/staticres/fonts/qimingxing.eot
  13. BIN=BIN
      core/src/web/staticres/fonts/qimingxing.svg
  14. BIN=BIN
      core/src/web/staticres/fonts/qimingxing.ttf
  15. BIN=BIN
      core/src/web/staticres/fonts/qimingxing.woff
  16. BIN=BIN
      core/src/web/staticres/images/entcommunity/chenglirizi.png
  17. BIN=BIN
      core/src/web/staticres/images/entcommunity/dengjijiguan.png
  18. BIN=BIN
      core/src/web/staticres/images/entcommunity/dizhi.png
  19. BIN=BIN
      core/src/web/staticres/images/entcommunity/faren.png
  20. BIN=BIN
      core/src/web/staticres/images/entcommunity/gongsileixing.png
  21. BIN=BIN
      core/src/web/staticres/images/entcommunity/ren.png
  22. BIN=BIN
      core/src/web/staticres/images/entcommunity/rens.png
  23. BIN=BIN
      core/src/web/staticres/images/entcommunity/shijian.png
  24. BIN=BIN
      core/src/web/staticres/images/entcommunity/zhuceziben.png
  25. BIN=BIN
      core/src/web/staticres/images/entcommunity/ziranren.png
  26. 513 526
      core/src/web/staticres/js/entportrait.js
  27. 55 13
      core/src/web/staticres/wxswordfish/main.js
  28. 2 0
      core/src/web/templates/common/enthead.html
  29. 3 0
      core/src/web/templates/common/login.html
  30. 2 2
      core/src/web/templates/member/showenterprise.html
  31. 2 2
      core/src/web/templates/search/enterpriseList.html
  32. 293 2
      core/src/web/templates/yellowpage/enterpriseinfo.html
  33. 4 18
      credit/src/main.go
  34. 27 6
      credit/src/qfw/creditrpc/creditrpc.go

+ 2 - 2
common/src/qfw/util/credit/credit.go

@@ -140,13 +140,13 @@ func AAllIsHasDo(num int) bool {
 }
 
 //扣积分
-func OutCreditB(userId, code string, score int, param map[string]interface{}) (bool, int) {
+func OutCreditB(userId, code, umid string, score int, param map[string]interface{}) (bool, int) {
 	b := false
 	var Replay int
 	if len(userId) < 5 {
 		return b, Replay
 	}
-	err := Rc.OutCreadit(&rpc.CreditData{Code: code, Uid: userId, Num: score, OtherParam: param}, &Replay)
+	err := Rc.OutCreadit(&rpc.CreditData{Code: code, Uid: userId, Umid: umid, Num: score, OtherParam: param}, &Replay)
 	if err == nil && Replay > 0 {
 		b = true
 	}

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

@@ -1124,6 +1124,7 @@ func UpdateSession(action *xweb.Action, r map[string]interface{}) {
 			setSessMap["nickName"] = r["s_nickname"]
 		}
 		setSessMap["userId"] = r["_id"]
+		setSessMap["s_m_openid"] = r["s_m_openid"]
 		setSessMap["userType"] = IntAllDef(r["i_type"], 2)
 		setSessMap["userInfo"] = &r
 		setSessMap["userName"] = r["s_name"]

+ 78 - 56
core/src/qfw/mobile/wxmenu.go

@@ -47,31 +47,38 @@ func (m *Mobile) Wxrssset() error {
 	if m.Session().Get("userId") != nil {
 		m.T["signature"] = GetSignature(m.Url())
 		userInfo := mongodb.FindById("user", m.GetSession("userId").(string), nil)
-		if i_m_guide := (*userInfo)["i_m_guide"]; util.IntAll(i_m_guide) == 0 {
-			mongodb.Update("user", `{"_id":"`+m.GetSession("userId").(string)+`"}`, map[string]interface{}{
-				"$set": map[string]interface{}{
-					"i_m_guide": 1,
-				},
-			}, false, false)
-			return m.Redirect("/swordfish/guide")
-		}
-		for _, v := range (*userInfo)["o_msgset"].(map[string]interface{}) {
-			if vobj, ok := v.(map[string]interface{}); ok {
-				if vobj["l_enddate"] != nil && vobj["i_status"] != nil {
-					if util.IntAll(vobj["i_status"]) == 1 {
-						sub := vobj["l_enddate"].(int64) - time.Now().Unix()
-						if sub >= 0 {
-							if sub%86400 == 0 {
-								vobj["days"] = sub / 86400
-							} else {
-								vobj["days"] = sub/86400 + 1
+		if *userInfo != nil {
+			if i_m_guide := (*userInfo)["i_m_guide"]; util.IntAll(i_m_guide) == 0 {
+				mongodb.Update("user", `{"_id":"`+m.GetSession("userId").(string)+`"}`, map[string]interface{}{
+					"$set": map[string]interface{}{
+						"i_m_guide": 1,
+					},
+				}, false, false)
+				return m.Redirect("/swordfish/guide")
+			}
+			if (*userInfo)["o_msgset"] != nil {
+				for _, v := range (*userInfo)["o_msgset"].(map[string]interface{}) {
+					if vobj, ok := v.(map[string]interface{}); ok {
+						if vobj["l_enddate"] != nil && vobj["i_status"] != nil {
+							if util.IntAll(vobj["i_status"]) == 1 {
+								sub := vobj["l_enddate"].(int64) - time.Now().Unix()
+								if sub >= 0 {
+									if sub%86400 == 0 {
+										vobj["days"] = sub / 86400
+									} else {
+										vobj["days"] = sub/86400 + 1
+									}
+								} else {
+									vobj["days"] = 0
+								}
 							}
 						}
 					}
 				}
 			}
+			m.T["msgset"] = (*userInfo)["o_msgset"]
 		}
-		m.T["msgset"] = (*userInfo)["o_msgset"]
+
 		return m.Render("/swordfish/wxrssset.html", &m.T)
 	} else {
 		return m.Render("_err.html")
@@ -117,55 +124,70 @@ func (m *Mobile) SwordfishPay() error {
 		types := m.GetSlice("types")
 		res["flag"] = true
 		if len(types) > 0 {
-			//获取积分
-			user := getMsgSetById(userId.(string))
-			if user == nil {
-				res["flag"] = false
-			} else {
-				i_credit := util.IntAll(user["i_credit"])
-				if i_credit > 0 {
-					isPay := map[string]interface{}{}
-					for _, v := range types {
-						util.Try(func() {
-							obj_typei := user["o_msgset"].(map[string]interface{})[v]
-							b_newopen := false
-							if obj_typei == nil {
-								b_newopen = true
-							} else {
-								obj_type := obj_typei.(map[string]interface{})
-								st := obj_type["i_status"]
-								objt := obj_type["l_enddate"]
-								if st == nil || objt == nil {
+			no, _ := m.GetInteger("no")
+			if no == 0 {
+				//获取积分
+				user := getMsgSetById(userId.(string))
+				if user == nil {
+					res["flag"] = false
+				} else {
+					i_credit := util.IntAll(user["i_credit"])
+					if i_credit > 0 {
+						isPay := map[string]interface{}{}
+						for _, v := range types {
+							util.Try(func() {
+								obj_typei := user["o_msgset"].(map[string]interface{})[v]
+								b_newopen := false
+								if obj_typei == nil {
 									b_newopen = true
 								} else {
-									//判断是否开启
-									i_st := st.(int)
-									l_objt := objt.(int64)
-									if !(i_st == 1 && l_objt > util.GetDayStartSecond(0)) {
+									obj_type := obj_typei.(map[string]interface{})
+									st := obj_type["i_status"]
+									objt := obj_type["l_enddate"]
+									if st == nil || objt == nil {
 										b_newopen = true
+									} else {
+										//判断是否开启
+										i_st := st.(int)
+										l_objt := objt.(int64)
+										if !(i_st == 1 && l_objt > util.GetDayStartSecond(0)) {
+											b_newopen = true
+										}
 									}
 								}
+								if b_newopen { //进行扣费操作
+									isPay[v] = v
+								}
+							}, func(e interface{}) {
+								log.Println(e)
+							})
+						}
+						//i_credit -= len(isPay) * 1000
+						if i_credit >= 0 {
+							if b, _ := credit.OutCreditB(userId.(string), credit.V_JY, util.ObjToString(m.GetSession("s_m_openid")), 0, isPay); b {
+								//先扣分,然后更新,然后返回结果
+								res["credit"] = i_credit
+								res["oprstatus"] = true
 							}
-							if b_newopen { //进行扣费操作
-								isPay[v] = v
-							}
-						}, func(e interface{}) {
-							log.Println(e)
-						})
-					}
-					i_credit -= len(isPay) * 1000
-					if i_credit >= 0 {
-						if b, _ := credit.OutCreditB(userId.(string), credit.V_JY, -len(isPay)*1000, isPay); b {
-							//先扣分,然后更新,然后返回结果
+						} else {
 							res["credit"] = i_credit
-							res["oprstatus"] = true
 						}
+
 					} else {
 						res["credit"] = i_credit
 					}
+				}
 
-				} else {
-					res["credit"] = i_credit
+			} else if no == 1 {
+				//取消操作
+				set := map[string]interface{}{}
+				for _, v := range types {
+					set["o_msgset."+v+".i_switchstatus"] = 0
+				}
+				if mongodb.Update("user", `{"_id":"`+userId.(string)+`"}`, &map[string]interface{}{
+					"$set": set,
+				}, false, false) {
+					res["oprstatus"] = true
 				}
 			}
 		}

+ 4 - 4
core/src/qfw/redpackage/redpackage_test.go

@@ -81,16 +81,16 @@ func Test_reissue(t *testing.T) {
 	util.ReadConfig("../../redpackage.json", &coreconfig.RedPackage)
 	amount := GetAmount() * 100
 	billno := time.Now().Unix()
+	amount = 500
 	fmt.Println("billno=", billno, ",amount=", amount)
-	//amount = 400
 	bm := qrpc.BonusMsg{Mchbillno: fmt.Sprint(billno),
 		Sendname: coreconfig.RedPackage.Weixin["sendname"].(string),
 		//Reopenid:    "",
 		Totalamount: amount,
 		Totalnum:    1,
-		Wishing:     coreconfig.RedPackage.Weixin["wishing"].(string),
-		Actname:     coreconfig.RedPackage.Weixin["actname"].(string),
-		Remark:      coreconfig.RedPackage.Weixin["remark"].(string),
+		Wishing:     "企明星幸运有奖",
+		Actname:     "企明星幸运有奖",
+		Remark:      "企明星幸运有奖",
 	}
 	coreutil.PayBonus(&bm)
 }

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

@@ -40,7 +40,7 @@ func FormatDate(src *interface{}) string {
 }
 
 func GetEntInfo(id string) interface{} {
-	res := FindById("enterprise", id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1, "s_synopsis":1, "SourceType":1, "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}`)
+	res := FindById("enterprise", id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1, "s_synopsis":1, "SourceType":1, "NB_email":1,"IndustryPhyName":1,"investor":1, "s_enturl, "i_province":1, "i_city":1, "i_area":1,"s_action":1,"s_persion":1,"s_mobile":1,"s_address":1,"s_avatar":1,"s_microwebsite":1,"s_qq":1,"s_submitid":1,"s_email":1}`)
 	if res != nil {
 		id := (*res)["s_submitid"]
 		if id != nil {
@@ -112,7 +112,7 @@ func GetEntInfo(id string) interface{} {
 //企业黄查询结果
 func (yp *Yellowpage) EnterpriseInfo(id string) error {
 	id = strings.Split(id, "#")[0]
-	if ret, err := redis.GetBytes("enterprise", id); err == nil {
+	if ret, err := redis.GetBytes("enterprise", id); err == nil && false {
 		return yp.SetBody(*ret)
 	} else {
 		yp.T["res"] = GetEntInfo(id)

+ 1 - 28
core/src/timetask.json

@@ -1,28 +1 @@
-{
-    "comment": {
-        "c_rate": 720,
-        "commentrate": 900
-    },
-    "market": {
-        "demand": {
-            "attr": [
-                "i_hits",
-                "i_bids",
-                "i_status"
-            ],
-            "timepoint": "2016-01-15 18:45:30"
-        },
-        "service": {
-            "attr": [
-                "i_hits",
-                "i_sales",
-                "i_comments",
-                "i_score",
-                "i_appcounts"
-            ],
-            "timepoint": "2016-01-15 18:45:30"
-        }
-    },
-    "marketisstart": true,
-    "marketrate": 300
-}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-16 15:02:30"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-16 15:02:30"}},"marketisstart":true,"marketrate":300}

+ 11 - 1
core/src/web/staticres/css/dev-qfw.css

@@ -212,6 +212,11 @@ a{
 	margin-bottom: 5px !important;
 }
 
+.margin-lr-5 {
+	margin-left: 5px !important;
+	margin-right: 5px !important;
+}
+
 .margin-l-10 {
 	margin-left: 10px !important;
 }
@@ -236,6 +241,10 @@ a{
 	margin-left: 15px !important;
 }
 
+.margin-r-15 {
+	margin-right: 15px !important;
+}
+
 .margin-lr-15 {
 	margin-left: 15px !important;
 	margin-right: 15px !important;
@@ -1111,7 +1120,7 @@ a{
 	padding:30px 0 25px 60px;	
 	width: 100%;
 }
-.pull-left{
+.a-servicedetail .pull-left{
 	margin-top:-10px;
 }
 .a-servicedetail .preview {
@@ -2218,6 +2227,7 @@ style="color:#D03102;margin-right:5px;"
 	width: 120px;
 	left: 50%;
 	margin-left: -60px;
+	z-index: 1;
 }
 .b-head .head-hideMenu ul{
 	background-color: #F7F9FB;

+ 470 - 7
core/src/web/staticres/css/entcommunity.css

@@ -67,17 +67,15 @@ a:focus, a:hover{
 .entlist-page .nav-tabs>.active:hover{
 	background-color: #FFFFFF;
 }
-.entlist-status-r,.entlist-status-g{
+.ent-status-r,.ent-status-g{
 	color: #ffffff;
-	display: inline-block;
-	padding-left: 2px;
-	padding-right: 10px;
+	padding: 2px 10px 2px 5px;
 }
-.entlist-status-r{
+.ent-status-r{
 	background-image: url("/images/status-r.png");
 	background-size: 100% 100%;
 }
-.entlist-status-g{
+.ent-status-g{
 	background-image: url("/images/status-g.png");
 	background-size: 100% 100%;
 }
@@ -92,4 +90,469 @@ a:focus, a:hover{
 .entlist-page .qfw-entcontent-padding>div{
 	display: inline-block;
 	padding-left: 100px;
-}
+}
+/*********企业画像***************/
+.entinfo-page .b-com-head{
+	background-color: #FFFFFF;
+	position: relative;
+	padding: 30px;
+}
+.entinfo-page .b-com-head>img{
+	position: absolute;
+	height: 130px;
+	width: 130px;
+	left: 30px;
+	top: 30px;
+}
+.entinfo-page .b-com-head>.entinfo-cart{
+	margin-left: 160px;
+	height: 130px;
+}
+.entinfo-page .b-com-head .b-com-first{
+	line-height: 25px;
+}
+.entinfo-page .b-com-head .b-com-first>.b-microwebsite,.entinfo-page .b-com-head .b-com-first a{
+	color: #16a086;
+}
+.entinfo-page .b-com-head .b-com-first>.b-microwebsite{
+	margin-left: 10px;
+}
+.entinfo-page .b-com-head .b-com-title{
+	font-size: 18px;
+	font-weight: bold;
+	margin-right: 5px;
+}
+.entinfo-page .b-com-head .b-com-second{
+	line-height: 29px;
+}
+.entinfo-page .b-com-head .b-com-second .glyphicon{
+	color: #FF5A5F;
+	vertical-align: sub;
+	margin-right: 10px;
+}
+.entinfo-page .b-com-head .b-com-second .qyrz{
+	margin-right: 2px;
+	vertical-align: baseline;
+}
+.entinfo-page .b-com-head .b-com-second .grrz,.entinfo-page .b-com-head .b-com-second .jgrz{
+	margin-right: 5px;
+}
+.entinfo-page .b-com-head .b-com-second .yyzzrz{
+	font-size: 16px;
+}
+.entinfo-page .b-com-head .b-com-last{
+	line-height: 25px;
+	color: #A0A0A0;
+}
+.entinfo-page .b-com-head .b-com-last .glyphicon{
+	font-size: 18px;
+	color: #cccccc;
+	margin-right: 5px;
+	vertical-align: sub;
+}
+.entinfo-page .b-com-head .b-com-last a{
+	color: blue;
+	margin-left: 10px;
+}
+.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; 	
+}
+.entinfo-share{
+	margin-top: 10px;
+	font-size: 16px;
+	color: #A0A0A0;
+	width: 60px;
+	cursor: pointer;
+}
+.entinfo-tab{
+	height: 50px;
+	background-color: #F6F8FA;
+	padding-left: 20px;
+}
+.entinfo-tab li{
+	padding: 0px 20px;
+	border-top-width: 3px;
+	height: 47px;
+	line-height: 47px;
+	border-top: 3px solid #F6F8FA;
+	cursor: pointer;
+	border-right: 1px solid #FFFFFF;
+	font-weight: bold;
+}
+.entinfo-tab .entinfo-active{
+	border-top-color: #16a086;
+	background-color: #FFFFFF;
+	color: #16a086;
+	border-right-width: 0px
+}
+.entinfo-tab-content{
+	margin-top: 10px;
+	background-color: #FFFFFF;
+	padding-top: 20px;
+}
+/********************企业画像**********************/
+.entinfo-basicinfo{
+	padding: 0px 20px;
+}
+.entinfo-basicinfo .b-com-title{
+	font-size: 18px;
+	padding-left: 5px;
+	border-bottom: 1px solid #DFE0E2;
+	padding-bottom: 10px;
+}
+.entinfo-basicinfo .b-com-title span{
+	color: #16a086;
+	margin-right: 5px;
+}
+.entinfo-basicinfo .b-com-title font{
+	font-size: 14px;
+	margin-left: 5px;
+}
+.entinfo-basicinfo .b-com-content{
+	padding: 90px 0px;
+}
+.entinfo-basicinfo .entinfo-round{
+	border: 1px solid #DFE0E2;
+	width: 350px;
+	height: 350px;
+	border-radius: 50%;
+	margin: auto;
+	position: relative;
+}
+.entinfo-basicinfo .entinfo-round>div{
+	position: absolute;
+}
+.entinfo-basicinfo .entinfo-round>div:first-child{
+	top: 130px;
+	left: 15px;
+	width: 320px;
+	padding-left: 50px;
+}
+.entinfo-basicinfo .entinfo-round>div:first-child>span{
+	position: relative;
+	display: block;
+	width: 320px;
+	margin-bottom: 10px;
+	margin-left: -50px;
+	text-align: center;
+}
+.entinfo-basicinfo .entinfo-round>div:first-child>span>div:first-child{
+	font-size: 18px;
+	font-weight: bold;
+	color: #16a086;
+	text-overflow: ellipsis;
+	overflow: hidden;
+	white-space: nowrap;
+	max-width: 320px;
+	display: inline-block;
+	position: relative;
+}
+.entinfo-basicinfo .entinfo-round>div:first-child>span span{
+	padding-top: 1px;
+	padding-bottom: 1px;
+	font-size: 14px;
+	font-weight: normal;
+	float: right;
+}
+.entinfo-basicinfo .entinfo-round>div:first-child>div:nth-child(n+1)>span:first-child{
+	width: 70px;
+	text-align: center;
+	vertical-align: super;
+	margin-right: 10px;
+}
+.entinfo-basicinfo .entinfo-round>div:first-child>div:nth-child(n+1)>span:last-child{
+	width: 175px;
+}
+.entinfo-basicinfo .entinfo-round>div>div>span:first-child{
+	background-color: #AEE7D6;
+	padding: 5px 10px;
+	border-radius: 5px;
+	color: #16a086;
+	display: inline-block;
+	margin-bottom: 5px;
+}
+.entinfo-basicinfo .entinfo-round>div>div>span:nth-child(2){
+	text-overflow: ellipsis;
+	overflow: hidden;
+	white-space: nowrap;
+	width: 350px;
+	display: inline-block;
+}
+.entinfo-basicinfo .entinfo-round>a{
+	width: 8px;
+	height: 8px;
+	border-radius: 50%;
+	background-color: #DFE0E2;
+	position: absolute;
+}
+.entinfo-basicinfo .entinfo-round>div>div{
+	margin: 0px 5px;
+}
+.entinfo-basicinfo .entinfo-round>div>img{
+	position: absolute;
+	top: 0px;
+	right: -45px;
+}
+/*成立日期*/
+.entinfo-basicinfo .entinfo-estdate{
+	right: 340px;
+	top: -5px;
+	text-align: right;
+}
+.entinfo-basicinfo .entinfo-estdate>img{
+	width: 30px;
+	height: 67px;
+	margin-top: -20px;
+	right: -35px !important;
+}
+.entinfo-basicinfo .entinfo-estdate-round{
+	top: 40px;
+	left: 53px;
+}
+/*注册资本*/
+.entinfo-basicinfo .entinfo-regcap{
+	right: 405px;
+	top: 107px;
+	text-align: right;
+}
+.entinfo-basicinfo .entinfo-regcap>img{
+	width: 40px;
+	height: 40px;
+}
+.entinfo-basicinfo .entinfo-regcap-round{
+	top: 120px;
+	left: 2px;
+}
+/*公司类型*/
+.entinfo-basicinfo .entinfo-enttype{
+	right: 395px;
+	top: 222px;
+	text-align: right;
+}
+.entinfo-basicinfo .entinfo-enttype>img{
+	width: 40px;
+	height: 48px;
+}
+.entinfo-basicinfo .entinfo-enttype-round{
+	top: 240px;
+	left: 10px;
+}
+/*法定代表人*/
+.entinfo-basicinfo .entinfo-lerep{
+	right: 325px;
+	top: 320px;
+	text-align: right;
+}
+.entinfo-basicinfo .entinfo-lerep>img{
+	width: 40px;
+	height: 42.5px;
+}
+.entinfo-basicinfo .entinfo-lerep-round{
+	top: 315px;
+	left: 73px;
+}
+/*公司规模*/
+.entinfo-basicinfo .entinfo-entscale{
+	left: 310px;
+	top: 330px;
+}
+.entinfo-basicinfo .entinfo-entscale>img{
+	width: 40px;
+	height: 33px;
+	left: -45px;
+}
+.entinfo-basicinfo .entinfo-entscale-round{
+	top: 330px;
+	right: 100px;
+}
+/*登记机关*/
+.entinfo-basicinfo .entinfo-regorgname{
+	left: 400px;
+	top: 225px
+}
+.entinfo-basicinfo .entinfo-regorgname>img{
+	width: 40px;
+	height: 51px;
+	left: -45px;
+}
+.entinfo-basicinfo .entinfo-regorgname-round{
+	top: 240px;
+	right: 10px;
+}
+/*地址*/
+.entinfo-basicinfo .entinfo-dom{
+	top: 85px;
+	left: 380px;
+}
+.entinfo-basicinfo .entinfo-dom>img{
+	width: 30px;
+	height: 40px;
+	left: -35px;
+}
+.entinfo-basicinfo .entinfo-dom-round{
+	top: 120px;
+	right: 3px;
+}
+/*营业期限*/
+.entinfo-basicinfo .entinfo-operperiod{
+	left: 300px;
+	top: -28px;
+}
+.entinfo-basicinfo .entinfo-operperiod>img{
+	width: 40px;
+	height: 40px;
+	left: -45px;
+}
+.entinfo-basicinfo .entinfo-operperiod-round{
+	top: 10px;
+	right: 100px;
+}
+/*股东信息*/
+.entinfo-shareholderinfo>div{
+	margin-bottom: 30px;
+}
+.entinfo-shareholderinfo>div{
+	font-size: 16px;
+	color: #16a086;
+}
+.entinfo-shareholderinfo>div>span{
+	background-color: #AEE7D6;
+	font-size: 14px;
+	margin-right: 10px;
+	display: inline-block;
+	line-height: 25px;
+	text-align: center;
+	width: 25px;
+	height: 25px;
+	color: #FFFFFF;
+}
+.entinfo-shareholderinfo ul{
+	padding-left: 50px;
+	padding-bottom: 60px;
+}
+.entinfo-shareholderinfo li{
+	margin-right: 40px;
+	margin-bottom: 20px;
+	text-align: center;
+}
+.entinfo-shareholderinfo img{
+	width: 80px;
+	height: 80px;
+	border: 2px solid #16a086;
+	border-radius: 50%;
+	margin-bottom: 10px;
+}
+.entinfo-shareholderinfo li>span{
+	display: block;
+	width: 100px;
+	word-wrap: break-word; 
+	word-break: normal;
+}
+.entinfo-shareholderinfo li>span:last-child{
+	color: #A0A0A0;
+}
+/********************关系网**********************/
+.entrelation{
+	
+}
+.entrelation-legend{
+	float:left;
+	height:500px;
+}
+.legend-text-bg>div{
+    position: absolute;
+    display: inline-block;
+    border-radius: 5px;
+    width: 80px;
+	height: 25px;
+    line-height: 25px;
+    text-align: center;
+	margin-top: -3px;
+	z-index: -1;
+}
+.legend-text-bg>span{
+	position: relative;
+}
+/*全屏代码*/
+.entrelation-infovis .entrelation-controlls{
+	position: absolute;
+	margin-top: 10px;
+}
+.entrelation-infovis .entrelation-controlls .entrelation-item{
+	border-radius: 2px;
+	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
+	cursor: pointer;
+	margin-bottom: 8px;
+	float:left;
+}
+.entrelation-infovis .entrelation-controlls .entrelation-box{
+	padding:10px;
+	float:left;
+}
+.entrelation-infovis .entrelation-controlls .entrelation-box div{
+	background: url(/images/view_icons.png) no-repeat;
+	width: 16px;
+	height: 16px;
+	opacity: 0.6;
+}
+:-moz-full-screen .entrelation-infovis,:-webkit-full-screen .entrelation-infovis,:-o-full-screen .entrelation-infovis,
+:-ms-full-screen .entrelation-infovis,:fullscreen .entrelation-infovis,:-ms-fullscreen .entrelation-infovis,:full-screen .entrelation-infovis{
+  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; 
+}

+ 0 - 3
core/src/web/staticres/css/enterprise.css

@@ -71,9 +71,6 @@ span.highlight {
 /******列表详细信息*******/
 .borderB .qfw-entcontent-padding{padding:20px 20px;line-height: 25px;position: relative;}
 .qfw-entcontent-padding .lineb a{font-size:16px;}
-.borderB .qfw-entcontent-padding div span{padding-right: 0px;}
-.qfw-entcontent-padding div span{padding-right: 30px;display: inline-block;}
-
 /*========================企业名片信息页样式========================*/
 @media (max-width: 768px) {
 	body{

+ 4 - 0
core/src/web/staticres/css/qfw.css

@@ -949,6 +949,10 @@ span.highlight {
 	content: "\5E";
 }
 
+.jianzhu:before{
+	content: "\5F";
+}
+
 .icon-small {
 	font-size: 12px;
 }

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


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


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


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


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


BIN=BIN
core/src/web/staticres/images/entcommunity/chenglirizi.png


BIN=BIN
core/src/web/staticres/images/entcommunity/dengjijiguan.png


BIN=BIN
core/src/web/staticres/images/entcommunity/dizhi.png


BIN=BIN
core/src/web/staticres/images/entcommunity/faren.png


BIN=BIN
core/src/web/staticres/images/entcommunity/gongsileixing.png


BIN=BIN
core/src/web/staticres/images/entcommunity/ren.png


BIN=BIN
core/src/web/staticres/images/entcommunity/rens.png


BIN=BIN
core/src/web/staticres/images/entcommunity/shijian.png


BIN=BIN
core/src/web/staticres/images/entcommunity/zhuceziben.png


BIN=BIN
core/src/web/staticres/images/entcommunity/ziranren.png


+ 513 - 526
core/src/web/staticres/js/entportrait.js

@@ -1,322 +1,67 @@
-
-var c_hfl=[["全部","0"],["农、林、牧、渔业","A"],["采矿业","B"],["制造业","C"],["住宿和餐饮业","H"],["信息传输、软件和信息技术服务业","I"],["金融业","J"],["房地产业","K"],["租赁和商务服务业","L"],["科学研究和技术服务业","M"],["水利、环境和公共设施管理业","N"],["居民服务、修理和其他服务业","O"],["教育","P"],["卫生和社会工作","Q"],["文化、体育和娱乐业","R"],["公共管理、社会保障和社会组织","S"],["电力、热力、燃气及水生产和供应业","D"],["建筑业","E"],["批发和零售业","F"],["交通运输、仓储和邮政业","G"]]
-var c_zb=[["全部","0"],["10W以下","0-10"],["10w-100w","10-100"],["100w-1000w","100-1000"],["1000万-1亿","1000-10000"],["1亿以上","10000"]]
-var c_qfl=[["全部","0"],["股份有限公司分公司(上市、外商投资企业投资)","2211"],["普通合伙企业","4531"],["农民专业合作经济组织","9100"],["个体工商户","9600"],["有限责任公司(自然人投资或控股)","1130"]]
-	
-//点击关闭微信版企明星
-function colseWeixin(){document.getElementById('weixintu').style.visibility = 'hidden';}
-
-$(function(){
-	//点击回车执行搜索
-	$(document).keydown(function(event){
-	    if(event.keyCode == 13){
-	        $("#c_words").click()
-	    }
-	});
-});
-
-function getCityN(code){
-	if(code){
-		var n=code.substring(0,2)
-		for(var i=0;i<citySim.length;i++){
-			if (citySim[i].k==n) {
-				return citySim[i].n;
-			}
-		}
-	}
-	return "";	
-}
-
-
-function reloadData(obj,name){
-
-	name=name||obj.attr("name")
-	var val=(obj.attr("value")||obj.val());
-	
-	if (val==0) val=""
-	if(name=="city"&&!val){
-		var pids=obj.attr("id")
-		if(pids=="c_area"){
-			var v=obj.prev("select").val()
-			if(!v){
-				v=obj.prev("select").prev("select").val()
-			}
-			if(v){
-				val=v
-			}
-			
-		}else if(pids=="c_city"){
-			var v=obj.prev("select").val()
-			if(v){
-				val=v
-			}
-		}
-		
-	}else if(name=="c_author"){
-		if(!obj.prop("checked")){
-			val="";
-		}
-	}
-	//调整value 值
-	if(val==10){
-		val = "10-100"
-	}else if(val ==100){
-		val = "100-1000"
-	}else if(val ==1000){
-		val = "1000-10000"
-	}
-	//搜索表单提交
-	$("#searchForm input[name="+name+"]").val(val);
-    document.forms['searchForm'].submit();
-}
-
-function setLocation(entsel,serviceloc){
-	//所在地处理
-	var le  =  entsel.length
-	var sel1 = "";
-	var sel2 = "";
-	var sel3 = "";
-	if (le == 2) {
-	 sel1 = entsel.substring(0,2);
-	 sel2 = 0;
-	 sel3 = 0;
-	}else if (le == 4){
-	 sel1 = entsel.substring(0,2);
-	 sel2 = entsel.substring(0,4);
-	 sel3 = 0;
-	}else{	
-	 sel1 = entsel.substring(0,2);
-	 sel2 = entsel.substring(0,4);
-	 sel3 = entsel.substring(0,6);
-	}
-	$.cxSelect.setVal(sel1,sel2,sel3);
-	if(serviceloc){	
-		//添加编辑服务中的省
-		$("#servicecity_china .province option").each(function(){
-			if(sel1 == $(this).val()){					
-				$(this).attr("selected","selected");
-			}
-		});
-		//添加编辑服务中的市
-		$("#servicecity_china .city option").each(function(){
-			if(sel2 == $(this).val()){					
-				$(this).attr("selected","selected");
-			}
-		});
-		//添加编辑服务中的县
-		$("#servicecity_china .area option").each(function(){
-			if(sel3 == $(this).val()){					
-				$(this).attr("selected","selected");
-			}
-		});
-	}
-}	
-cityMouse="";
-$(function(){
-	
-	////推荐企业
-	loadImg(1);
-	//行业类别  注册资本 加载
-	makeFl();
-	//所在地信息加载
+var entType = "企业";
+with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
+//解析服务列表
+$(function(){	
+	//重绘关系网
+	try{		
+	//	redraw();	
+	}catch(e){}
+	//联系地址
 	if($chiancity){
-		$('#city_china').cxSelect({
-			selects: ['province', 'city', 'area'],
-			required:0,
-			somep:true,
-			someps:[41,45]
-		});
-		setLocation(entsel)
-	}
-	
-	
-	//处理点击重新加载
-	$("div[id^=c_] li,li[id^=c_],input[id^=c_]").click(function(){
-		
-		if(this.id=="c_words"){
-			reloadData($("#header-searchInputs"))	
-		}else{
-			reloadData($(this))	
-		}	
-	})
-	
-	$("select[id^=c_]").click(function(){
-		cityMouse=this.id
-	}).change(function(){
-		if(this.id==cityMouse){
-			reloadData($(this),"city")			
-		}
-	})	
-
-	//处理选择样式
-	$("div[id^=c_] li").click(function(){
-		$("li",$(this).closest("div")).removeClass("text-primary");
-		$(this).addClass("text-primary");
-	})
-	//搜索关键字
-	var words=""
-	
-	if(btempwords){
-		words=btempwords
-		$("#header-searchInput").val(words);
-	}
-	
-	
-})
-function makeFl(){
-	//行业类别
-	$(["c_hfl"]).each(function(i,ad){
-		var str="<ul>";
-		var tmp=eval(ad)
-		for(var i=0;i<tmp.length;i++){
-		    var val = chf1;
-			if (val !=""){
-			if (val == tmp[i][1]){
-			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' class='text-primary'>"+tmp[i][0]+"</li>"
-			var j ="J"
-			if (val > j || val == "D" || val == "E" || val == "F" || val == "G"  ){
-			$("#c_hfl").next().find("small").text("收起<")
-			$("#c_hfl").removeClass("less")
-			
-			}
-			}else{
-			str+="<li name='"+ad+"' value='"+tmp[i][1]+"'>"+tmp[i][0]+"</li>"
-			}
-			}else{
-			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' "+(i==0?"class='text-primary'":"")+">"+tmp[i][0]+"</li>"
-			}
-			
-		}
-		str+="</ul>"
-		$("#"+ad).html(str)
-	})
-	//注册资本
-	$(["c_zb"]).each(function(i,ad){
-		var str="<ul>";
-		var tmp=eval(ad)
-		for(var i=0;i<tmp.length;i++){
-		    var val = czb;
-			if (val !=""){
-			if (val == tmp[i][1]){
-			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' class='text-primary'>"+tmp[i][0]+"</li>"
-			}else{
-			str+="<li name='"+ad+"' value='"+tmp[i][1]+"'>"+tmp[i][0]+"</li>"
-			}
-			}else{
-			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' "+(i==0?"class='text-primary'":"")+">"+tmp[i][0]+"</li>"
-			}
-			
-		}
-		str+="</ul>"
-		$("#"+ad).html(str)
-	})
-}
-function less(obj){
-	pred=$(obj).prev()
-	obj=$(obj).find("small")
-	var text=obj.text()
-	if(text=="更多>"){
-		obj.text("收起<")
-		pred.removeClass("less")
-	}else{
-		obj.text("更多>")
-		pred.addClass("less")
-	}
-	
-}
-//推荐企业
-function loadImg(n){
-	var str=""
-	for(var i=0;i<n;i++){
-		str+="<img src='/images/right_ad.png'>"
-	}
-	$("#tjqy").html(str)
-}
-
-function GetDiffName(i)  {
-	ret=["法定代表人"]
-	//ret=["法定代表人","住所","成立日期"]
-	switch (i) {
-		case  "9600":
-		{
-			ret[0] = "经营者"
-			//ret[1] = "经营场所"
-			//ret[2] = "注册日期"
-			break;
-		}
-		case "4500":
-		case "6800":
-		case "6810":
-		case "6820":
-		case "7100":
-		case "7110":
-		case "7120":
-		case "7130":
-		case "7190":
-		case "9200":
-		case "6840":
-		case "2100":
-		case "2110":
-		case "2120":
-		case "2121":
-		case "2122":
-		case "2123":
-		case "2130":
-		case "2140":
-		case "2150":
-		case "2151":
-		case "2152":
-		case "2190":
-		case "2200":
-		case "2210":
-		case "2211":
-		case "2212":
-		case "2213":
-		case "2219":
-		case "2220":
-		case "2221":
-		case "2222":
-		case "2223":
-		case "2229":
-		case "4000":
-		case "4300":
-		case "4310":
-		case "4320":
-		case "4330":
-		case "4340":
-		case "4550":
-		case "4551":
-		case "4552":
-		case "4553":
-		case "4560":
-		case "5800":
-		case "5810":
-		case "5820":{
-			ret[0] = "负责人"
-			//ret[1] = "营业场所"
-			//ret[2] = "成立日期"
-			break;
-		}
+		setcxSelect();	
+		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());		
+		//获取地图的经纬度
+		doOptions();
+		$("#city_china").text(pt+ct+at+as1);
+	}else{	
+		setcxSelect();
 	}
-	return ret
+	//隐藏地图
+	$("#fade").click(closeMap);
+	//分享
+	$(".entinfo-share").click(function(){
+		$(".bdsharebuttonbox").show();
+	});
+	//切换
+	$(".entinfo-tab>li").click(function(){
+		$(".entinfo-tab>li").removeClass("entinfo-active");
+		$(this).addClass("entinfo-active");
+		$(".entinfo-tab-content>div").addClass("hide");
+		$(".entinfo-tab-content>div:eq("+$(this).index()+")").removeClass("hide");
+	});
+	//加载服务列表
+	initServiceList();
+});
+//显示地图
+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");
 }
-//公式信息是否显示
-if(!$gs){
-	$("#ags").parent().hide();
-	$("#gs").hide();
+//关闭地图
+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");
 }
-
-//关系网的设置		
-if($relationlen>0 ){
-  //try{
-	var zoomlevel=1;
-	var w = parseInt($("#gx").css("width").replace("px","")) - 80;
-	$("#infovis").css("width",w+"px");
-	var h = $("#infovis").height();
-	if($(".controlls").length>0){
-		$(".controlls").css({left:$("#gx").width()-$(".controlls").width()-30});
+//关系网初始化
+function Relation(data){
+	this.zoomlevel = 1;
+	//关系网的设置
+	$("#entrelation-fullscreen").bind("click",initFullScreen);
+	var w = parseInt($("#entrelation").css("width").replace("px","")) - 80;
+	$("#entrelation-infovis").css("width",w+"px");
+	var h = $("#entrelation-infovis").height();
+	if($(".entrelation-controlls").length>0){
+		$(".entrelation-controlls").css({left:$("#entrelation").width()-$(".entrelation-controlls").width()-30});
 	}
-	
 	//查找逻辑
 	var index=-1;
 	var reg = new RegExp(/(有限公司|有限责任公司|股份有限公司|总公司|分公司|公司|事务所|合伙企业)$|\(.*\)|\(.*\)/g);
@@ -542,64 +287,59 @@ if($relationlen>0 ){
 			}
 		}
 	}
-//屏蔽鼠标右点击事件
-if(document.getElementById("infovis")){
-	document.getElementById("infovis").oncontextmenu=function(){return false;};
-}
-
-$("#op_fullscreen").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));	
- //处理全屏
- function launchFullScreen(element) {
-	
-  if(element){
-  	if (element.requestFullscreen) {
-      element.requestFullscreen();
-    } else if (element.msRequestFullscreen) {
-      element.msRequestFullscreen();
-    } else if (element.mozRequestFullScreen) {
-      element.mozRequestFullScreen();
-    } else if (element.webkitRequestFullscreen) {
-		// 对 Chrome 特殊处理,
-        // 参数 Element.ALLOW_KEYBOARD_INPUT 使全屏状态中可以键盘输入。
-        if ( window.navigator.userAgent.toUpperCase().indexOf( 'CHROME' ) >= 0 ) {
-              element.webkitRequestFullScreen( Element.ALLOW_KEYBOARD_INPUT );
-        }else {
-			// Safari 浏览器中,如果方法内有参数,则 Fullscreen 功能不可用。
-           element.webkitRequestFullScreen();
-        }
-    }
-  }
-   
-}
-function cancelFullScreen() {
-	h = $("#infovis").height();  
-	$("#op_fullscreen").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));	
-	//force.linkDistance(120).charge(-200).size([w,h]).resume();
-	$("#infovis").css({width:w,height:h});
-	//设置svg标签的宽度与高度
-	d3.select("svg").attr("width", w).attr("height", h);
-	$(".controlls").css({left:$("#gx").width()-$(".controlls").width()-30});
-    if(document.exitFullscreen) {
-      document.exitFullscreen();
-    } else if (document.msExitFullscreen) {
-      document.msExitFullscreen();
-    } else if (document.mozCancelFullScreen) {
-      document.mozCancelFullScreen();
-    } else if (document.webkitExitFullscreen) {
-      document.webkitExitFullscreen();
-    }
-} 
-
-$(document).on('webkitfullscreenchange mozfullscreenchange msfullscreenchange fullscreenchange', function(){
-    if (!document.fullscreenElement &&    // alternative standard method
-    !document.mozFullScreenElement && 
-    !document.webkitFullscreenElement && 
-    !document.msFullscreenElement ) {
-	//退出
-	cancelFullScreen();
- }});
- 
-   var infovisdiv = document.getElementById("infovis");
+	//屏蔽鼠标右点击事件
+	if(document.getElementById("entrelation-infovis")){
+		document.getElementById("entrelation-infovis").oncontextmenu=function(){return false;};
+	}
+	$("#entrelation-fullscreen").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));	
+ 	//处理全屏
+ 	function launchFullScreen(element) {
+	  	if(element){
+		  	if (element.requestFullscreen) {
+		      element.requestFullscreen();
+		    } else if (element.msRequestFullscreen) {
+		      element.msRequestFullscreen();
+		    } else if (element.mozRequestFullScreen) {
+		      element.mozRequestFullScreen();
+		    } else if (element.webkitRequestFullscreen) {
+				// 对 Chrome 特殊处理,
+		        // 参数 Element.ALLOW_KEYBOARD_INPUT 使全屏状态中可以键盘输入。
+		        if ( window.navigator.userAgent.toUpperCase().indexOf( 'CHROME' ) >= 0 ) {
+		              element.webkitRequestFullScreen( Element.ALLOW_KEYBOARD_INPUT );
+		        }else {
+					// Safari 浏览器中,如果方法内有参数,则 Fullscreen 功能不可用。
+		           element.webkitRequestFullScreen();
+		        }
+		    }
+	  	}
+	}
+	function cancelFullScreen() {
+		h = $("#entrelation-infovis").height();  
+		$("#entrelation-fullscreen").attr("title","进入全屏视图"+((!!window.ActiveXObject || "ActiveXObject" in window)?"":" (F11)"));	
+		//force.linkDistance(120).charge(-200).size([w,h]).resume();
+		$("#entrelation-infovis").css({width:w,height:h});
+		//设置svg标签的宽度与高度
+		d3.select("svg").attr("width", w).attr("height", h);
+		$(".entrelation-controlls").css({left:$("#entrelation").width()-$(".entrelation-controlls").width()-30});
+	    if(document.exitFullscreen) {
+	      document.exitFullscreen();
+	    } else if (document.msExitFullscreen) {
+	      document.msExitFullscreen();
+	    } else if (document.mozCancelFullScreen) {
+	      document.mozCancelFullScreen();
+	    } else if (document.webkitExitFullscreen) {
+	      document.webkitExitFullscreen();
+	    }
+	}
+	$(document).on('webkitfullscreenchange mozfullscreenchange msfullscreenchange fullscreenchange', function(){
+	    if (!document.fullscreenElement &&    // alternative standard method
+	    !document.mozFullScreenElement && 
+	    !document.webkitFullscreenElement && 
+	    !document.msFullscreenElement ) {
+		//退出
+		cancelFullScreen();
+	});
+   	var infovisdiv = document.getElementById("entrelation-infovis");
 	document.onkeydown=function(event){
         var e = event || window.event || arguments.callee.caller.arguments[0];
         if(e && e.keyCode==122){
@@ -615,22 +355,16 @@ $(document).on('webkitfullscreenchange mozfullscreenchange msfullscreenchange fu
 			cancelFullScreen();
 		}
     };  
-	try{
-		$("#op_fullscreen").bind("click",initFullScreen);
-	}catch(e){}
-    
-	
-	
 	function initFullScreen(){
 		var fullscreenElement =
         document.fullscreenElement ||
         document.mozFullScreenElement ||
         document.webkitFullscreenElement ||
 		document.msFullscreenElement;
-	    $(".ico_fullscreen").toggleClass("exit");
+	    $(".entrelation-fullscreen").toggleClass("exit");
 		if(!fullscreenElement || fullscreenElement==null){
 			redrawflag = true;
-			$("#op_fullscreen").attr("title","退出全屏视图 (F11)");
+			$("#entrelation-fullscreen").attr("title","退出全屏视图 (F11)");
 			launchFullScreen(infovisdiv);
 			var timeout = 100;
 			if(!!window.ActiveXObject || "ActiveXObject" in window){
@@ -644,9 +378,9 @@ $(document).on('webkitfullscreenchange mozfullscreenchange msfullscreenchange fu
 					//if(w>1200){
 						//w= 1200
 					//}
-					$("#infovis").css({width:w,height:h});
+					$("#entrelation-infovis").css({width:w,height:h});
 					d3.select("svg").attr("width", w).attr("height", h);
-					$(".controlls").css({left:w-$(".controlls").width() - 70});
+					$(".entrelation-controlls").css({left:w-$(".entrelation-controlls").width() - 70});
 					force.linkDistance(h).charge(-700).size([w,h]).resume();
 				}
 				
@@ -655,67 +389,64 @@ $(document).on('webkitfullscreenchange mozfullscreenchange msfullscreenchange fu
 			cancelFullScreen();
 		}
 	}
-//计算点之间的距离
-var chargeArray = [[0,10],[10,20],[20,30],[30,40],[40,50],[50,60],[60,70],[70,80],[80,90],[90,100],[100,110]];
-var chargeVal = -1600;
-var nodeCount = data.nodes.length;
-for(var i in chargeArray){
-	if(nodeCount >= chargeArray[i][0] && nodeCount < chargeArray[i][1]){
-		chargeVal += i*100;
-		break;
-	}else if(i == chargeArray.length){
-		chargeVal += i*100;
+	//计算点之间的距离
+	var chargeArray = [[0,10],[10,20],[20,30],[30,40],[40,50],[50,60],[60,70],[70,80],[80,90],[90,100],[100,110]];
+	var chargeVal = -1600;
+	var nodeCount = data.nodes.length;
+	for(var i in chargeArray){
+		if(nodeCount >= chargeArray[i][0] && nodeCount < chargeArray[i][1]){
+			chargeVal += i*100;
+			break;
+		}else if(i == chargeArray.length){
+			chargeVal += i*100;
+		}
 	}
-}
-var tick=function (e) {
-		
+	var tick=function (e) {
 		lines.attr("d", function(d) {
-				var sy   = d.source.y,
-					x    = d.target.x,
-		            y    = d.target.y;
-				if(sy > y){
-					sy -= 12;
-				}else{
-					sy += 5;
-				}
-				var line = new geo.LineSegment(d.source.x, sy, x, y);
-				for (var e in d.target.edge) {
-		            var ix = line.intersect(d.target.edge[e].offset(x, y));
-		            if (ix.in1 && ix.in2) {
-		                x = ix.x;
-		                y = ix.y;
-		                break;
-		            }
-		        }
-		        var dx = x - d.source.x,
-			        dy = y - sy,
-			        dr = Math.sqrt(dx * dx + dy * dy),
-			        theta = Math.atan2(dy, dx) + Math.PI / 7.85,
-			        d90 = Math.PI / 2,
-			        dtxs = x - Math.cos(theta),
-			        dtys = y - Math.sin(theta);
-			    return "M" + d.source.x + "," + sy + "A" + dr + "," + dr + " 0 0 1," + x + "," + y + "A" + dr + "," + dr + " 0 0 0," + d.source.x + "," + sy + "M" + dtxs + "," + dtys +  "l" + (3.5 * Math.cos(d90 - theta) - 10 * Math.cos(theta)) + "," + (-3.5 * Math.sin(d90 - theta) - 10 * Math.sin(theta)) + "L" + (dtxs - 3.5 * Math.cos(d90 - theta) - 10 * Math.cos(theta)) + "," + (dtys + 3.5 * Math.sin(d90 - theta) - 10 * Math.sin(theta)) + "z";
-		  });	
+			var sy   = d.source.y,
+				x    = d.target.x,
+	            y    = d.target.y;
+			if(sy > y){
+				sy -= 12;
+			}else{
+				sy += 5;
+			}
+			var line = new geo.LineSegment(d.source.x, sy, x, y);
+			for (var e in d.target.edge) {
+	            var ix = line.intersect(d.target.edge[e].offset(x, y));
+	            if (ix.in1 && ix.in2) {
+	                x = ix.x;
+	                y = ix.y;
+	                break;
+	            }
+	        }
+	        var dx = x - d.source.x,
+		        dy = y - sy,
+		        dr = Math.sqrt(dx * dx + dy * dy),
+		        theta = Math.atan2(dy, dx) + Math.PI / 7.85,
+		        d90 = Math.PI / 2,
+		        dtxs = x - Math.cos(theta),
+		        dtys = y - Math.sin(theta);
+		    return "M" + d.source.x + "," + sy + "A" + dr + "," + dr + " 0 0 1," + x + "," + y + "A" + dr + "," + dr + " 0 0 0," + d.source.x + "," + sy + "M" + dtxs + "," + dtys +  "l" + (3.5 * Math.cos(d90 - theta) - 10 * Math.cos(theta)) + "," + (-3.5 * Math.sin(d90 - theta) - 10 * Math.sin(theta)) + "L" + (dtxs - 3.5 * Math.cos(d90 - theta) - 10 * Math.cos(theta)) + "," + (dtys + 3.5 * Math.sin(d90 - theta) - 10 * Math.sin(theta)) + "z";
+		});	
 		nodes.attr("transform", function(d) {
 			return "translate(" + d.x + "," + d.y + ")scale(" + zoomlevel+ ")";
 		});
 	}
-var force = d3.layout.force()
-    .nodes(data.nodes)
-    .links(data.links)
-    .size([w, h])
-    .linkDistance(function(p){
-		return Math.floor(Math.random()*60)+90;
-	})
-	.chargeDistance(600)
-    .charge(chargeVal)
-	.linkStrength(1)
-	.on('tick',tick);
-  
-	
-var dragstatus = false,
+	var force = d3.layout.force()
+	    .nodes(data.nodes)
+	    .links(data.links)
+	    .size([w, h])
+	    .linkDistance(function(p){
+			return Math.floor(Math.random()*60)+90;
+		})
+		.chargeDistance(600)
+	    .charge(chargeVal)
+		.linkStrength(1)
+		.on('tick',tick);
+	var dragstatus = false,
 	mouseoverstatus = false;
-var drag = force.drag()
+	var drag = force.drag()
 		.on("dragstart",function(d,i){
 			d.fixed = true;    //拖拽开始后设定被拖拽对象为固定
 			d3.event.sourceEvent.stopPropagation(); // Prevent panning
@@ -729,17 +460,14 @@ var drag = force.drag()
 			setTimeout(function(){
 				dragstatus = false;
 			},500)
-		});	
-		function zoomed() {
-			svg.attr("transform", 
-				"translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
-		}
+		});
+	function zoomed() {
+		svg.attr("transform", 
+			"translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
+	}
 	//处理缩放
 	var zoom = d3.behavior.zoom().scaleExtent([0.4, 10]).on("zoom", zoomed);
-	
-	
-	
-	var svg = d3.select("#infovis").append("svg:svg")
+	var svg = d3.select("#entrelation-infovis").append("svg:svg")
 	    .attr("width", w)
 	    .attr("height", h)
 		.call(zoom)
@@ -768,7 +496,6 @@ var drag = force.drag()
 				d3.select(this).append("title").text("投资金额:"+invacconam+"万元");
 			}
 		});
-	
 	var nodes = svg.append("svg:g")
 	    .selectAll(".node")
 	    .data(force.nodes())
@@ -786,7 +513,6 @@ var drag = force.drag()
 			d3.event.preventDefault();
 			removeNode(this);
 		});
-		
 	nodes.append("rect")
 		.attr("rx", 5)
 	    .attr("ry", 5)
@@ -808,8 +534,6 @@ var drag = force.drag()
 			}
 			return "1";
 		});
-	
-	
 	nodes.each(function (d,i){
 		if(d.type == "ce" || d.type == "e"){
 			var title = "";
@@ -901,7 +625,6 @@ var drag = force.drag()
 	    });
 	    force.start();
 	},10);
-
 	function highlightObject(obj,flag){
 		if(mouseoverstatus){
 			return;
@@ -934,7 +657,6 @@ var drag = force.drag()
 				});
 			}
 		});
-		
 	}
 	function removeNode(obj){
 		if(d3.event.which != 3){
@@ -977,98 +699,363 @@ var drag = force.drag()
 				removeAloneNode(toNodeName);
 			}
 		});
-		d3.selectAll("rect").each(function (){
-			if(name == this.__data__.name){
-				d3.select(this).remove();
+		d3.selectAll("rect").each(function (){
+			if(name == this.__data__.name){
+				d3.select(this).remove();
+			}
+		});
+		d3.selectAll("text").each(function (){
+			if(name == this.__data__.name){
+				d3.select(this).remove();
+			}
+		});
+	}
+	var diagonal = d3.svg.diagonal().projection(function(d) { return [d.y, d.x]; });
+	/////////////重绘画布///////////////////
+	var redrawflag=false;
+	//重绘
+	function redraw(){
+		if(force!=undefined){
+			var w = parseInt($("#entrelation").css("width").replace("px","")) - 80;
+			var h = parseInt($("#entrelation").css("height").replace("px",""))-10;
+			d3.select("svg").attr("width", w).attr("height", h);
+			force.size([w,h]).resume();
+			$("#entrelation-infovis").css({width:w,height:h});
+			//
+			redrawflag=false;
+		}
+	}
+	$(window).resize(function(){
+		if(!redrawflag){
+		    //1秒后重绘
+			redrawflag=true;
+			setTimeout(redraw,1000);
+		}
+		firstresize=false;
+	});
+	///////////////////////关系网实例////////////////////////////
+	var htmls="<div style='position:absolute;' class='legend'>";
+	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #ff9800;'></div><span style='margin-left: 20px;'>本企业</span></div>";
+	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #cddc39;opacity:0.5;'></div><span style='margin-left: 12px;'>其他企业</span></div>";
+	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #2196f3;'></div><span style='margin-left: 25px;'>个人</span></div>";
+	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;margin-bottom: 10px;'><div style='background-color: #cecece;'></div><span style='margin-left: 5px;'>注吊销企业</span></div>";
+	htmls= htmls+ "<div><span style='font-size: 20px;font-weight: bold;color: #cecece;'>→</span><span style=''>投资关系(股东→企业)</span></div>";
+	htmls= htmls+ "<div><span style='font-size: 20px;font-weight: bold;color: #cd93d7;'>→</span><span style=''>法定代表人</span></div>";
+	htmls= htmls+ "<div style='margin:10px 0px;' class='hidden-sm hidden-xs'><span class='text-muted'>提示:点击鼠标右键可以删除不想看的节点。</span></div>";
+	htmls= htmls+"</div>"
+	$("#entrelation-legend").html(htmls);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+function getCityN(code){
+	if(code){
+		var n=code.substring(0,2)
+		for(var i=0;i<citySim.length;i++){
+			if (citySim[i].k==n) {
+				return citySim[i].n;
+			}
+		}
+	}
+	return "";	
+}
+
+
+function reloadData(obj,name){
+	name=name||obj.attr("name")
+	var val=(obj.attr("value")||obj.val());
+	
+	if (val==0) val=""
+	if(name=="city"&&!val){
+		var pids=obj.attr("id")
+		if(pids=="c_area"){
+			var v=obj.prev("select").val()
+			if(!v){
+				v=obj.prev("select").prev("select").val()
+			}
+			if(v){
+				val=v
+			}
+			
+		}else if(pids=="c_city"){
+			var v=obj.prev("select").val()
+			if(v){
+				val=v
+			}
+		}
+		
+	}else if(name=="c_author"){
+		if(!obj.prop("checked")){
+			val="";
+		}
+	}
+	//调整value 值
+	if(val==10){
+		val = "10-100"
+	}else if(val ==100){
+		val = "100-1000"
+	}else if(val ==1000){
+		val = "1000-10000"
+	}
+	//搜索表单提交
+	$("#searchForm input[name="+name+"]").val(val);
+    document.forms['searchForm'].submit();
+}
+
+function setLocation(entsel,serviceloc){
+	//所在地处理
+	var le  =  entsel.length
+	var sel1 = "";
+	var sel2 = "";
+	var sel3 = "";
+	if (le == 2) {
+	 sel1 = entsel.substring(0,2);
+	 sel2 = 0;
+	 sel3 = 0;
+	}else if (le == 4){
+	 sel1 = entsel.substring(0,2);
+	 sel2 = entsel.substring(0,4);
+	 sel3 = 0;
+	}else{	
+	 sel1 = entsel.substring(0,2);
+	 sel2 = entsel.substring(0,4);
+	 sel3 = entsel.substring(0,6);
+	}
+	$.cxSelect.setVal(sel1,sel2,sel3);
+	if(serviceloc){	
+		//添加编辑服务中的省
+		$("#servicecity_china .province option").each(function(){
+			if(sel1 == $(this).val()){					
+				$(this).attr("selected","selected");
+			}
+		});
+		//添加编辑服务中的市
+		$("#servicecity_china .city option").each(function(){
+			if(sel2 == $(this).val()){					
+				$(this).attr("selected","selected");
 			}
 		});
-		d3.selectAll("text").each(function (){
-			if(name == this.__data__.name){
-				d3.select(this).remove();
+		//添加编辑服务中的县
+		$("#servicecity_china .area option").each(function(){
+			if(sel3 == $(this).val()){					
+				$(this).attr("selected","selected");
 			}
 		});
 	}
-	var diagonal = d3.svg.diagonal()
-	.projection(function(d) { return [d.y, d.x]; });
+}	
+cityMouse="";
+$(function(){
 	
+	////推荐企业
+	loadImg(1);
+	//行业类别  注册资本 加载
+	makeFl();
+	//所在地信息加载
+	if($chiancity){
+		$('#city_china').cxSelect({
+			selects: ['province', 'city', 'area'],
+			required:0,
+			somep:true,
+			someps:[41,45]
+		});
+		setLocation(entsel)
+	}
 	
 	
+	//处理点击重新加载
+	$("div[id^=c_] li,li[id^=c_],input[id^=c_]").click(function(){
+		
+		if(this.id=="c_words"){
+			reloadData($("#header-searchInputs"))	
+		}else{
+			reloadData($(this))	
+		}	
+	})
 	
-	/////////////重绘画布///////////////////
-	var redrawflag=false;
-	//重绘
-	function redraw(){
-		if(force!=undefined){
-			var w = parseInt($("#gx").css("width").replace("px","")) - 80;
-			var h = parseInt($("#gx").css("height").replace("px",""))-10;
-			d3.select("svg").attr("width", w).attr("height", h);
-			force.size([w,h]).resume();
-			$("#infovis").css({width:w,height:h});
-			//
-			redrawflag=false;
+	$("select[id^=c_]").click(function(){
+		cityMouse=this.id
+	}).change(function(){
+		if(this.id==cityMouse){
+			reloadData($(this),"city")			
 		}
-		
+	})	
+
+	//处理选择样式
+	$("div[id^=c_] li").click(function(){
+		$("li",$(this).closest("div")).removeClass("text-primary");
+		$(this).addClass("text-primary");
+	})
+	//搜索关键字
+	var words=""
+	
+	if(btempwords){
+		words=btempwords
+		$("#header-searchInput").val(words);
 	}
-	$(window).resize(function(){
-		if(!redrawflag){
-		    //1秒后重绘
-			redrawflag=true;
-			setTimeout(redraw,1000);
+	
+	
+})
+function makeFl(){
+	//行业类别
+	$(["c_hfl"]).each(function(i,ad){
+		var str="<ul>";
+		var tmp=eval(ad)
+		for(var i=0;i<tmp.length;i++){
+		    var val = chf1;
+			if (val !=""){
+			if (val == tmp[i][1]){
+			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' class='text-primary'>"+tmp[i][0]+"</li>"
+			var j ="J"
+			if (val > j || val == "D" || val == "E" || val == "F" || val == "G"  ){
+			$("#c_hfl").next().find("small").text("收起<")
+			$("#c_hfl").removeClass("less")
+			
+			}
+			}else{
+			str+="<li name='"+ad+"' value='"+tmp[i][1]+"'>"+tmp[i][0]+"</li>"
+			}
+			}else{
+			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' "+(i==0?"class='text-primary'":"")+">"+tmp[i][0]+"</li>"
+			}
+			
 		}
-		firstresize=false;
-	});
-	///////////////////////关系网实例////////////////////////////
-	var htmls="<div style='position:absolute;' class='legend'>";
-	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #ff9800;'></div><span style='margin-left: 20px;'>本企业</span></div>";
-	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #cddc39;opacity:0.5;'></div><span style='margin-left: 12px;'>其他企业</span></div>";
-	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;'><div style='background-color: #2196f3;'></div><span style='margin-left: 25px;'>个人</span></div>";
-	htmls= htmls+ "<div class='legend-text-bg' style='margin-top: 10px;margin-bottom: 10px;'><div style='background-color: #cecece;'></div><span style='margin-left: 5px;'>注吊销企业</span></div>";
-	htmls= htmls+ "<div><span style='font-size: 20px;font-weight: bold;color: #cecece;'>→</span><span style=''>投资关系(股东→企业)</span></div>";
-	htmls= htmls+ "<div><span style='font-size: 20px;font-weight: bold;color: #cd93d7;'>→</span><span style=''>法定代表人</span></div>";
-	htmls= htmls+ "<div style='margin:10px 0px;' class='hidden-sm hidden-xs'><span class='text-muted'>提示:点击鼠标右键可以删除不想看的节点。</span></div>";
-	htmls= htmls+"</div>"
-	$("#gxw_bs").html(htmls);
+		str+="</ul>"
+		$("#"+ad).html(str)
+	})
+	//注册资本
+	$(["c_zb"]).each(function(i,ad){
+		var str="<ul>";
+		var tmp=eval(ad)
+		for(var i=0;i<tmp.length;i++){
+		    var val = czb;
+			if (val !=""){
+			if (val == tmp[i][1]){
+			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' class='text-primary'>"+tmp[i][0]+"</li>"
+			}else{
+			str+="<li name='"+ad+"' value='"+tmp[i][1]+"'>"+tmp[i][0]+"</li>"
+			}
+			}else{
+			str+="<li name='"+ad+"' value='"+tmp[i][1]+"' "+(i==0?"class='text-primary'":"")+">"+tmp[i][0]+"</li>"
+			}
+			
+		}
+		str+="</ul>"
+		$("#"+ad).html(str)
+	})
+}
+function less(obj){
+	pred=$(obj).prev()
+	obj=$(obj).find("small")
+	var text=obj.text()
+	if(text=="更多>"){
+		obj.text("收起<")
+		pred.removeClass("less")
+	}else{
+		obj.text("更多>")
+		pred.addClass("less")
+	}
+	
+}
+//推荐企业
+function loadImg(n){
+	var str=""
+	for(var i=0;i<n;i++){
+		str+="<img src='/images/right_ad.png'>"
+	}
+	$("#tjqy").html(str)
+}
 
-//}catch(e){alert(e)}
-}else{
-	//当关系网不存在的时候设置隐藏
-	$("#agx").parent().hide();
-	$("#gx").hide();
+function GetDiffName(i)  {
+	ret=["法定代表人"]
+	//ret=["法定代表人","住所","成立日期"]
+	switch (i) {
+		case  "9600":
+		{
+			ret[0] = "经营者"
+			//ret[1] = "经营场所"
+			//ret[2] = "注册日期"
+			break;
+		}
+		case "4500":
+		case "6800":
+		case "6810":
+		case "6820":
+		case "7100":
+		case "7110":
+		case "7120":
+		case "7130":
+		case "7190":
+		case "9200":
+		case "6840":
+		case "2100":
+		case "2110":
+		case "2120":
+		case "2121":
+		case "2122":
+		case "2123":
+		case "2130":
+		case "2140":
+		case "2150":
+		case "2151":
+		case "2152":
+		case "2190":
+		case "2200":
+		case "2210":
+		case "2211":
+		case "2212":
+		case "2213":
+		case "2219":
+		case "2220":
+		case "2221":
+		case "2222":
+		case "2223":
+		case "2229":
+		case "4000":
+		case "4300":
+		case "4310":
+		case "4320":
+		case "4330":
+		case "4340":
+		case "4550":
+		case "4551":
+		case "4552":
+		case "4553":
+		case "4560":
+		case "5800":
+		case "5810":
+		case "5820":{
+			ret[0] = "负责人"
+			//ret[1] = "营业场所"
+			//ret[2] = "成立日期"
+			break;
+		}
+	}
+	return ret
+}
+//公式信息是否显示
+if(!$gs){
+	$("#ags").parent().hide();
+	$("#gs").hide();
 }
+*/
+
 
 var perPage=5,currentPage=1
-//解析服务列表
-$(function(){	
-	//重绘关系网
-	try{		
-		redraw();	
-	}catch(e){}
-	try{
-		if(isLogined){
-			//initFullScreen();
-		}
-		
-	}catch(e){}
 
-	//联系地址
-	if($chiancity){
-		setcxSelect();	
-		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());		
-		
-		//获取地图的经纬度
-		doOptions();
-		$("#city_china").text(pt+ct+at+as1);
-	}else{	
-		setcxSelect();
-	}
-	//加载服务列表
-	initServiceList();
-});
 //点击服务标题展示服务信息
 function clickservicename(id,isshow){
 	if(isshow.indexOf("3")>-1){

+ 55 - 13
core/src/web/staticres/wxswordfish/main.js

@@ -151,12 +151,13 @@ function getCredit(){
 }
 var snopshot=[];
 function showAlls(){
+	
 	var n=0,str=[],sel=[];
 	for(var i in snopshot){
 		if(snopshot[i]){
 			n++;
 			str.push((i=="tender")?"招标公告":"中标公告")
-			sel.push("types="+i)
+			sel.push("types="+i)	
 		}
 	}
 	if(n>0){
@@ -204,6 +205,36 @@ function showAlls(){
 				$("html,body").addClass("overflow-hidden");
 			})
 		}
+		$("#credit_no").unbind("click").bind("click",function(e){
+			$.ajax({
+					dataType:"json",
+					url:"/member/credit/swordfishpay",
+					data:sel.join("&")+"&no=1",
+					type:"POST",
+					async:false,
+					success:function(msg){
+						if(msg){
+							if(msg.flag){
+								//有session
+								if(msg.oprstatus){
+									//取消操作成功
+									$(".visible").hide()
+								}else{
+									//取消操作无效
+									alert("操作无效,请重新进入页剑鱼页面后操作")
+								}				
+							}else{
+								//无session
+								alert("请重新进入页剑鱼页面后操作")
+							}
+						}			
+					},
+					error:function(x,st,err){
+						alert("请稍后再试"+st)
+					}
+				})
+				window.location.reload()
+		})
 		$("#txt_tip").text(contents+strs)
 		$(".visible").show()
 	}else{
@@ -217,20 +248,25 @@ function showSnopshot(module,type,on){
 	//alert(getCredit())
 	if(type==0){//初始化
 		//是开启状态
-		if (!eval("msgset."+module+".i_status")){
-			snopshot[module]=true
-			showAlls()
-		}else{
-			//显示天数
+		//显示天数
+		try{
 			var days=eval("msgset."+module+".days")	
-			var tiptxt="本栏目推送服务期还剩<d style='color:red'>"+days+"</d>天"
-			if(winWidth<341){
-				tiptxt="服务期还剩<d style='color:red'>"+days+"</d>天"
+			if(days){
+				var tiptxt="本栏目推送服务期还剩<d style='color:red'>"+days+"</d>天"
+				if(winWidth<341){
+					tiptxt="服务期还剩<d style='color:red'>"+days+"</d>天"
+				}
+			}
+		}catch(e){}
+		if(on){
+			if (!eval("msgset."+module+".i_status")){
+				snopshot[module]=true
+				showAlls()
 			}
 			$("#"+module+" .show-days").html(tiptxt)
+		}else{
+			$("#"+module+" .show-days").html(tiptxt).hide()
 		}
-		
-		
 	}else if(type==1){//提交修改时
 		if(on){
 			if(module=="tender"){
@@ -275,8 +311,10 @@ function commonAjaxReq(object,module){
 	if($("#"+module+"-on-off").hasClass("open")){
 		//开服务要校验
 		showSnopshot(module,1,1)
+		$("#"+module+" .show-days").show()
 	}else{
 		showSnopshot(module,1,0)
+		$("#"+module+" .show-days").hide()
 	}
 	var keysString = "",scopeString = "";
 	var thisClass = this;
@@ -415,7 +453,9 @@ $(function(){
 		if(msgset.tender.i_switchstatus){
 			turnOn($("#tender-on-off"));
 			//判断要不要还原提示
-			showSnopshot("tender",0)
+			showSnopshot("tender",0,1)
+		}else{
+			showSnopshot("tender",0,0)			
 		}
 	}
 	if(typeof(msgset.bid) != "undefined"){
@@ -424,7 +464,9 @@ $(function(){
 		if(msgset.bid.i_switchstatus){
 			turnOn($("#bid-on-off"));
 			//判断要不要还原提示
-			showSnopshot("bid",0)
+			showSnopshot("bid",0,1)
+		}else{
+			showSnopshot("bid",0,0)
 		}
 	}
 	//开关

+ 2 - 0
core/src/web/templates/common/enthead.html

@@ -13,11 +13,13 @@
 					<form method="post" id="searchForm" action="/search/enterprise/ent.html">
 						<span id="searchFormBtn"><i class="glyphicon sousuo"></i></span>
 				        <input type="text" name="words" class="form-control" id="header-searchInput" placeholder="找企业" value="{{if .T.querymap}}{{index .T.querymap "query"}}{{end}}">
+						{{if .T.querymap}}
 						<input type="hidden" name="city" id="city" value="{{index .T.querymap "city"}}">
 						<input type="hidden" name="cityNo" id="cityNo" value="{{index .T.querymap "cityNo"}}">
 						<input type="hidden" name="c_author" id="hauthor" value="{{index .T.querymap "c_author"}}">
 						<input type="hidden" name="c_hfl" id="hfl" value="{{index .T.querymap "c_hfl"}}">
 						<input type="hidden" name="c_zb" id="zb" value="{{index .T.querymap "c_zb"}}">
+						{{end}}
 					</form>
 	       		</div><!-- /input-group -->
 			</li>

+ 3 - 0
core/src/web/templates/common/login.html

@@ -11,6 +11,9 @@
 	width: 520px;
 	height: 440px;
 }
+.loginModal a,.loginModal .text-primary{
+	color: #ff5a5f !important;
+}
 .loginForm{
 	text-align:left;
 }

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

@@ -506,7 +506,7 @@ var entsel={{.T.opLocDistrict}},btempwords,chf1,czb;
 //公式信息的变量
 var $gs = {{.T.entinfo.gs}};
 //关系网上的变量
-var  $relationlen = {{len .T.entinfo.relation.links}};
+var  $relationlen = "";
 //服务模板
 var role = "{{$s_role}}"=="<nil>"?"":"{{$s_role}}";
 var isCanEdit = role==""||/^[1]$/.test(role)||/^[9]$/.test(role);
@@ -523,7 +523,7 @@ if(isCanEdit){
 }
 template_content+="</div></td><tr>"
 //关系网数据
-data= {{.T.entinfo.relation}};
+data= "";
 //注册号
 var regno="{{.T.entinfo.RegNo}}";
 var dphone=serentinfoid=serviceid="";

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

@@ -61,7 +61,7 @@
 										{{end}}
 									</b></a>
 									{{if index $v "OpStateName"}}
-									<div class="{{if eq (index $v "OpStateName") "注销" "吊销"}}entlist-status-r{{else}}entlist-status-g{{end}}">
+									<span class="{{if eq (index $v "OpStateName") "注销" "吊销"}}ent-status-r{{else}}ent-status-g{{end}}">
 									<script>
 										var OpStateName = {{index $v "OpStateName"}};
 										if(OpStateName.length > 2){
@@ -69,7 +69,7 @@
 										}
 										document.write(OpStateName);
 									</script>
-									</div>
+									</span>
 									{{end}}
 									{{ if index $v "s_action"}}
 										{{ if eq (index $v "s_action") "01"}}

+ 293 - 2
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -9,9 +9,300 @@
 <script src="/js/geocoder.js"></script>
 <script type="text/javascript" src="http://api.map.baidu.com/getscript?v=2&ak=AFd8b176f363f23e6a23d516f4cfb742&services=&t=20150522093217"></script>  
 <script src="/js/jquery.cxselect.js"></script>
-<script src="/js/entportrait.js"></script>
 </head>
-<body>
+<body class="entinfo-page">
 {{include "/common/enthead.html"}}
+<div class="b-content container-fluid">
+	<!--企业名片-->
+	<div class="b-com-head">
+		<img src="/images/ent-logo.png">
+		<div class="entinfo-cart">
+			<div class="b-com-first">
+				<font class="b-com-title">{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}</font>
+				{{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>
+				{{end}}
+				{{if .T.res.s_microwebsite}}<span class="b-microwebsite"><i class="glyphicon weiguanwang"></i><a href="/ent/wsite/preview/{{.T.res.entid}}">微官网</a></span>{{end}}
+			</div>
+			<div class="b-com-second">
+				{{if .T.res.EntName }}
+					{{if .T.res.s_action}}
+						{{$identaction:=.T.res.s_action}}
+						{{if eq $identaction "01"}}
+						<script>entType="企业"</script>
+							<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}}{{end}}
+						{{else if eq $identaction "02"}}
+						<script>entType="商家"</script>
+							<span class="glyphicon grrz"></span>已认证个人
+						{{else if eq $identaction "03"}}
+						<script>entType="机构"</script>
+							<span class="glyphicon jgrz"></span>已认证机构
+						{{end}}
+					{{end}}
+				{{end}}
+			</div>
+			<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 .T.res.s_mobile}}<span class="glyphicon shouji"></span>{{.T.res.s_mobile}}<span class="margin-r-15"></span>{{end}}
+				{{if .T.res.s_qq}}<span class="glyphicon qq1"></span>{{.T.res.s_qq}}{{end}}
+				<br>
+				{{if .T.res.s_email}}
+					<span class="glyphicon youjian2"></span>{{.T.res.s_email}}<span class="margin-r-15"></span>
+				{{else if .T.res.NB_email}}
+					<span class="glyphicon youjian2"></span>{{.T.res.NB_email}}<span class="margin-r-15"></span>
+				{{end}}
+				{{if .T.res.s_enturl}}<span class="glyphicon wangzhi1"></span>{{.T.res.s_enturl}}{{end}}
+				<br>
+				{{if or .T.res.i_province .T.res.i_city .T.res.i_area .T.res.s_address}}
+					<span class="glyphicon dizhi"></span>
+					<span id="city_china">
+						<select class="province cxselect select" id="provincesel" name="province" data-first-title="全国"></select>								
+						<select class="city cxselect select" id="citysel" name="city" data-first-title="选择市"></select>
+						<select class="area cxselect select" id="areasel" name="area" data-first-title="选择县"></select>
+						<input id="location" type="hidden">
+						<input id="cityname" type="hidden">
+					</span>
+					{{if .T.res.s_address}}
+					<a href="javascript:void(0)" onclick="showMap()">查看详细地图</a>
+					{{end}}
+				{{end}}
+			</div>
+		</div>
+		<div class="entinfo-share">
+			<span class="glyphicon fenxiang"></span>分享
+			<div class="bdsharebuttonbox"><a href="#" id="bds_weixin" data-cmd="weixin" title="分享到微信">微信扫码</a><a href="#" id="bds_tsina" data-cmd="tsina" title="分享到新浪微博">新浪微博"</a><a href="#" id="bds_tqq" data-cmd="tqq" title="分享到腾讯微博">腾讯微博</a><a href="#" id="bds_qzone" data-cmd="qzone" title="分享到QQ空间">QQ空间</a><a href="#" id="bds_douban" data-cmd="douban" title="分享到豆瓣网">豆瓣</a></div>
+		</div>
+	</div>
+	<!--切换-->
+	<ul class="entinfo-tab">
+		<li class="entinfo-active">企业画像</li>
+		<li>关系网</li>
+		<li>公司简介</li>
+		<li>变更信息</li>
+		<li>失信信息</li>
+		<li>产品服务信息</li>
+		<li class="border-r-0">招聘</li>
+	</ul>
+	<div class="entinfo-tab-content hide">
+		<div>
+			{{if .T.res.gs}}
+			<div class="entinfo-basicinfo">
+				<div class="b-com-title">
+					<span class="glyphicon jianzhu"></span>基本信息
+					<font>(来源:<a href="http://gsxt.saic.gov.cn/" rel="nofollow" style="text-decoration: underline;color: #0099FF;">全国企业信用信息公示系统</a>)</font>
+				</div>
+				<div class="b-com-content">
+					<div class="entinfo-round">
+						<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>
+									<br>
+									{{end}}
+									{{if .T.res.EntName}}{{.T.res.EntName}}{{end}}
+								</div>
+							</span>
+							<div><span>注册号</span><span>{{if .T.res.RegNo}}{{.T.res.RegNo}}{{end}}</span></div>
+							<div><span>行业</span><span>{{if .T.res.IndustryPhyName}}{{.T.res.IndustryPhyName}}{{end}}</span></div>
+						</div>
+						<!--成立日期-->
+						{{if .T.res.EstDate}}
+						<div class="entinfo-estdate">
+							<div>
+								<span>成立日期</span>
+								<span>{{.T.res.EstDate}}</span>
+							</div>
+							<img src="/images/entcommunity/chenglirizi.png">
+						</div>
+						<a class="entinfo-estdate-round"></a>
+						{{end}}
+						<!--注册资本-->
+						{{if .T.res.RegCap}}
+							{{if and (ne .T.res.EntType "9600") (ne .T.res.EntType "5810")}}
+							 <div class="entinfo-regcap">
+								<div>
+									<span>注册资本</span>
+									<span><script>var d1={{.T.res.RegCap}};d1=d1?d1:0; var lenD1=(d1+"").length ;if(lenD1>4&&(d1+"").indexOf(".")>-1&&(lenD1-(d1+"").indexOf("."))>4){document.write(d1.toFixed(4))}else{document.write(d1)}</script>万元</span>
+								</div>
+								<img src="/images/entcommunity/zhuceziben.png">
+							</div>
+							<a class="entinfo-regcap-round"></a>
+						    {{end}}
+						{{end}}
+						<!--公司类型-->
+						{{if .T.res.EntTypeName}}
+						  	<div class="entinfo-enttype">
+								<div>
+									<span>公司类型</span>
+									<span>{{.T.res.EntTypeName}}</span>
+								</div>
+								<img src="/images/entcommunity/gongsileixing.png">
+							</div>
+							<a class="entinfo-enttype-round"></a>
+						{{end}}
+						<!--法定代表人-->
+						{{if .T.res.LeRep}}
+						  	<div class="entinfo-lerep">
+								<div>
+									<span>{{.T.res.EntTypeLabel}}</span>
+									<span>{{.T.res.LeRep}}</span>
+								</div>
+								<img src="/images/entcommunity/ren.png">
+							</div>
+							<a class="entinfo-lerep-round"></a>
+						{{end}}
+						<!--公司规模-->
+					  	<div class="entinfo-entscale">
+							<img src="/images/entcommunity/rens.png">
+							<div>
+								<span>公司规模</span>
+								<span></span>
+							</div>
+						</div>
+						<a class="entinfo-entscale-round"></a>
+						<!--登记机关-->
+						{{if .T.res.RegOrgName}}
+						  	<div class="entinfo-regorgname">
+								<img src="/images/entcommunity/dengjijiguan.png">
+								<div>
+									<span>登记机关</span>
+									<span>{{.T.res.RegOrgName}}</span>
+								</div>
+							</div>
+							<a class="entinfo-regorgname-round"></a>
+						{{end}}
+						<!--地址-->
+						{{if .T.res.Dom}}
+						  	<div class="entinfo-dom">
+								<img src="/images/entcommunity/dizhi.png">
+								<div>
+									<span>地址</span>
+									<span>{{.T.res.Dom}}</span>
+								</div>
+							</div>
+							<a class="entinfo-dom-round"></a>
+						{{end}}
+						<!--营业期限-->
+						{{if .T.res.OpFrom}}
+						<div class="entinfo-operperiod">
+							<img src="/images/entcommunity/shijian.png">
+							<div>
+								<span>营业期限</span>
+								<span>自{{.T.res.OpFrom}}{{if .T.res.OpTo}}至{{.T.res.OpTo}}{{end}}</span>
+							</div>
+						</div>
+						<a class="entinfo-operperiod-round"></a>
+						{{end}}
+					</div>
+				</div>
+			</div>
+			<div class="entinfo-shareholderinfo">
+				<div>
+					<span><span class="bootstrap-glyphicon glyphicon-menu-right"></span></span>股东信息
+				</div>
+				{{if .T.res.investor}}
+				<ul>
+					{{range $k,$v := .T.res.investor}}
+					{{if $v.InvType}}
+					<li>
+						{{if eq $v.InvType "20" "21" "22"}}
+						<img src="/images/entcommunity/ziranren.png">
+						{{else}}
+						<img src="/images/entcommunity/faren.png">
+						{{end}}
+						<span><b>{{$v.InvTypeName}}</b></span>
+						<span>{{$v.Inv}}</span>
+					</li>
+					{{end}}
+					{{end}}
+					<div class="clearfix"></div>
+				</ul>
+				{{end}}
+			</div>
+			{{end}}
+		</div>
+		<div class="entrelation" id="entrelation">
+			<div id="entrelation-legend" class="entrelation-legend"></div>
+			<div class="entrelation-infovis">			
+				 <div class="entrelation-controlls hidden-sm hidden-xs">
+					<div class="entrelation-item">
+						<div id="entrelation-fullscreen" class="entrelation-box" title_pos="left"><div class="entrelation-fullscreen"></div></div>
+					</div>
+				</div>
+			</div>
+		</div>
+		<div class="hide"></div>
+		<div class="hide"></div>
+		<div class="hide"></div>
+		<div class="hide"></div>
+	</div>
+</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"}}
 </body>
+<script type="text/javascript">
+
+
+var entsel="",btempwords,chf1,czb;
+
+//企业信息ID
+ var id = {{.T.res._id}}
+//公式信息的变量
+var $gs = {{.T.res.gs}};
+//关系网上的变量
+var  $relationlen = "";
+
+//服务模板
+var template_content = "<tr><td><div class='row service_row'> "
++"<div class='col-sm-1'><div style='width:120px; height:120px; background-color:#eee;'><img class='hidden-xs' src='${s_images}' style='width:120px;height:120px'></div></div>"
++" <div class='col-sm-9'>"
++"<div class='linebser service_des'><div class='servicename text-primary'><a class='text-primary' target='_blank' onclick='clickservicename(\"${_id}\",\"${s_isshow}\")'>${s_name}</a></div><div class='text-muted'>${s_introduction}</div></div>"
++"</div></td><tr>"
+//关系网数据
+data= "";
+//注册号
+var regno="{{.T.res.RegNo}}";
+
+var legcerno = "{{.T.res.LegCerNO}}";
+var lerep="{{.T.res.LeRep}}";
+//联系地址
+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 $chiancity= false,$listent=false;
+{{if or .T.res.i_province .T.res.i_city .T.res.i_area .T.res.s_address}}
+	$chiancity= true;
+{{end}}
+
+var $resdata = {{.T.res.data}};
+var $entid = {{.T.res._id}};
+//定义默认的郑州经纬度
+var ptlat=113.69884285509,  ptlng=34.791342526551;
+var $res = {{.T.res}};
+</script>
+<script src="/js/entportrait.js"></script>
+<script src="/js/qfwtable.js"></script>
+
 </html>

+ 4 - 18
credit/src/main.go

@@ -16,9 +16,7 @@ import (
 	"qfw/timewheel"
 	"qfw/util"
 	"qfw/util/mongodb"
-	"qfw/util/msg"
 	"qfw/util/redis"
-	qrpc "qfw/util/rpc"
 	"runtime"
 	"strconv"
 	"strings"
@@ -62,6 +60,7 @@ func init() {
 	swordfish_close = creditrpc.Message["swordfish_close"]
 	swordfish_payTitle = creditrpc.Message["swordfish_payTitle"]
 	swordfish_pay = creditrpc.Message["swordfish_pay"]
+	creditrpc.Hour = swordfish_subHour
 
 	creditlog.Smtp = SysConfig["smtp"].(map[string]interface{})
 
@@ -182,7 +181,7 @@ func TimerSwordFish() {
 							//提示
 							for _, v := range swordfish_tipBeforeDays {
 								if int64(v) == sub64 {
-									SendMsgWebAndWx(swordfish_dueTitle, fmt.Sprintf(swordfish_due, v), tmp["s_uid"].(string), tmp["s_umid"].(string))
+									creditrpc.SendMsgWebAndWx(swordfish_dueTitle, fmt.Sprintf(swordfish_due, v), tmp["s_uid"].(string), tmp["s_umid"].(string))
 								}
 							}
 						}
@@ -231,14 +230,14 @@ func doSubCredit(userId, umid, typeName, code string, next *time.Time) {
 
 						if creditlog.Save(creditDoc) {
 							//发送微信通知扣积分成功
-							SendMsgWebAndWx(swordfish_payTitle, fmt.Sprintf(swordfish_pay, -codeNum, restNum, util.FormatDate(&newDate, util.Date_Full_Layout)), userId, umid)
+							creditrpc.SendMsgWebAndWx(swordfish_payTitle, fmt.Sprintf(swordfish_pay, -codeNum, restNum, util.FormatDate(&newDate, util.Date_Full_Layout)), userId, umid)
 						}
 
 					} else { //暂停操作
 						//更新操作
 						if mongodb.Update("user", `{"_id":"`+userId+`"}`, `{"$set":{"o_msgset.`+typeName+`.i_status":0}}`, false, false) {
 							//暂停通知,因积分不够
-							SendMsgWebAndWx(swordfish_closeTitle, swordfish_close, userId, umid)
+							creditrpc.SendMsgWebAndWx(swordfish_closeTitle, swordfish_close, userId, umid)
 						}
 
 					}
@@ -250,16 +249,3 @@ func doSubCredit(userId, umid, typeName, code string, next *time.Time) {
 
 	}
 }
-
-//发送微信和站内信通知
-func SendMsgWebAndWx(title, content, userId, umid string) {
-	m := &msg.Msg{
-		Msgtype:   1,
-		Title:     title,
-		Content:   content,
-		ReceiveId: userId,
-	}
-	go m.SaveMsg()
-	go creditrpc.SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: umid, Title: title, Detail: "管理员", Remark: content})
-
-}

+ 27 - 6
credit/src/qfw/creditrpc/creditrpc.go

@@ -8,6 +8,7 @@ import (
 	"qfw/creditlog"
 	"qfw/util"
 	"qfw/util/mongodb"
+	"qfw/util/msg"
 	"qfw/util/redis"
 	qrpc "qfw/util/rpc"
 	"runtime"
@@ -21,6 +22,7 @@ type CreditRpc struct{}
 var Message map[string]string
 var Score map[string]int
 var Rpcserver string
+var Hour int
 
 //用户访问redis加锁
 var SN = 100
@@ -254,15 +256,15 @@ func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
 			"s_operation": Message["txt_"+param.Code],
 			"i_type":      0,
 			"l_date":      now.Unix(),
-			"i_score":     param.Num,
-			"i_scorenow":  i_scorenow,
 		}
 		if param.OtherParam != nil && param.OtherParam["i_way"] != nil {
 			creditDoc["i_way"] = param.OtherParam["i_way"]
 		}
+		var newDate time.Time
 		switch first {
 		case "A":
-			creditDoc["l_enddate"] = now.AddDate(0, 1, 0).Unix()
+			newDate = GetTimeByNow(now, Hour).AddDate(0, 1, 1)
+			creditDoc["l_enddate"] = newDate.Unix()
 			creditDoc["i_valid"] = 1
 			if param.OtherParam != nil {
 				str := []string{}
@@ -270,22 +272,36 @@ func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
 					str = append(str, k)
 				}
 				creditDoc["s_type"] = strings.Join(str, ",")
+				creditDoc["i_score"] = Score[param.Code] * len(str)
+				creditDoc["i_scorenow"] = i_scorenow + Score[param.Code]*len(str)
 			}
 		case "B":
+			creditDoc["i_score"] = param.Num
+			creditDoc["i_scorenow"] = i_scorenow + param.Num
 			creditDoc["i_givestatus"] = 0
 		}
 		if creditlog.Save(creditDoc) {
 			*replay = 1
 			//发送微信通知扣积分成功
-			go SendWeixin(param.Num, param.Umid, "")
+			if first == "A" {
+				go SendMsgWebAndWx(Message["swordfish_payTitle"], fmt.Sprintf(Message["swordfish_pay"], creditDoc["i_score"], creditDoc["i_scorenow"], util.FormatDate(&newDate, util.Date_Full_Layout)), param.Uid, param.Umid)
+			}
 		}
 	}
 	lock.Unlock()
 	return nil
 }
 
-//发送微信积分变动通知
-func SendWeixin(num int, uid, info string) {
+//发送微信和站内信通知
+func SendMsgWebAndWx(title, content, userId, umid string) {
+	m := &msg.Msg{
+		Msgtype:   1,
+		Title:     title,
+		Content:   content,
+		ReceiveId: userId,
+	}
+	go m.SaveMsg()
+	go SendManagerNotifyMsg(&qrpc.NotifyMsg{Openid: umid, Title: title, Detail: "管理员", Remark: content})
 
 }
 
@@ -320,3 +336,8 @@ func GetSubSecond(n int) int {
 	tom := time.Date(now.Year(), now.Month(), now.Day()+n, 0, 0, 0, 0, time.Local)
 	return int(tom.Unix() - now.Unix())
 }
+
+func GetTimeByNow(now time.Time, nhour int) time.Time {
+	tom := time.Date(now.Year(), now.Month(), now.Day(), nhour, 0, 0, 0, time.Local)
+	return tom
+}