Pārlūkot izejas kodu

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

wangshan 9 gadi atpakaļ
vecāks
revīzija
cd9837f221

+ 37 - 22
common/src/qfw/util/credit/credit.go

@@ -31,6 +31,7 @@ const (
 	A_WCJY   = "a14" //完成交易
 	A_WCJYPJ = "a15" //完成交易评价
 	A_JYSCTS = "a63" //剑鱼首次推送
+	A_ALL    = "a64" //一次性积分任务完成
 
 	B_QD       = "b1" //签到
 	B_QD_T     = 7    //最高连续签到次数
@@ -76,6 +77,8 @@ func InCreditA(userId, code string, credit_a int) (bool, int, int, error) {
 		err := Rc.InCreadit(&rpc.CreditData{Code: code, Uid: userId, Num: 0, OtherParam: param}, &Replay)
 		if err == nil && Replay > 0 {
 			result, credit_a = UpuserCreditA(code, userId, credit_a)
+		} else {
+			log.Println("调用rpc出错", err)
 		}
 		return result, credit_a, Replay, err
 	}
@@ -102,8 +105,10 @@ func InCreditB(userId, code string, param map[string]interface{}) (bool, int, er
 	}
 	var Replay int
 	err := Rc.InCreadit(&rpc.CreditData{Code: code, Uid: userId, Num: 0, OtherParam: param}, &Replay)
-	if err == nil && Replay > 0 {
+	if err == nil && Replay != 0 {
 		b = true
+	} else {
+		log.Println("调用rpc出错", err)
 	}
 	return b, Replay, err
 }
@@ -156,16 +161,20 @@ func AAllIsHasDo(num int) bool {
 }
 
 //扣积分
-func OutCreditB(userId, code, umid string, score int, param map[string]interface{}) (bool, int) {
+func OutCreditB(userId, code, umid string, score int, param map[string]interface{},
+	xb *xweb.Action) (bool, int) {
 	b := false
 	var Replay int
 	if len(userId) < 5 {
 		return b, Replay
 	}
 	err := Rc.OutCreadit(&rpc.CreditData{Code: code, Uid: userId, Umid: umid, Num: score, OtherParam: param}, &Replay)
-	if err == nil && Replay > 0 {
+	if err == nil && Replay != 0 {
 		b = true
 	}
+	if b {
+		xb.Session().UpdateByCustomField("id", userId, "i_credit", util.IntAll(xb.GetSession("i_credit"))+Replay)
+	}
 	return b, Replay
 }
 
@@ -173,28 +182,34 @@ func OutCreditB(userId, code, umid string, score int, param map[string]interface
 func UpuserCreditSession(userId, code, dtype string, param map[string]interface{}, xb *xweb.Action) bool {
 	b := false
 	score := 0
-	if dtype == "A" {
-		credit_a := util.IntAll(xb.GetSession("credit_a"))
-		b, credit_a, score, _ = InCreditA(userId, code, credit_a)
-		if b {
-			xb.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)
-			xb.Session().UpdateByCustomField("id", userId, "i_credit", util.IntAll(xb.GetSession("i_credit"))+score)
-		} else {
-			log.Println(userId, code, "一次性任务送积分失败")
-		}
-		if AAllIsHasDo(credit_a) {
-			b, _, _, _ := InCreditA(userId, "a64", credit_a)
+	util.Try(func() {
+		if dtype == "A" {
+			credit_a := util.IntAll(xb.GetSession("credit_a"))
+			b, credit_a, score, _ = InCreditA(userId, code, credit_a)
 			if b {
-				log.Println(userId, "完成所有一次性任务")
+				xb.Session().UpdateByCustomField("id", userId, "credit_a", credit_a)
+				xb.Session().UpdateByCustomField("id", userId, "i_credit", util.IntAll(xb.GetSession("i_credit"))+score)
+			} else {
+				log.Println(userId, code, "一次性任务送积分失败")
+			}
+			if AAllIsHasDo(credit_a) {
+				b, _, _, err := InCreditA(userId, A_ALL, credit_a)
+				if b {
+					log.Println(userId, "完成所有一次性任务,送分成功")
+				} else {
+					log.Println(userId, "完成所有一次性任务,送分失败", err)
+				}
 			}
-		}
-	} else {
-		b, score, _ = InCreditB(userId, code, param)
-		if b {
-			xb.Session().UpdateByCustomField("id", userId, "i_credit", util.IntAll(xb.GetSession("i_credit"))+score)
 		} else {
-			log.Println(userId, code, param, "任务送积分失败")
+			b, score, _ = InCreditB(userId, code, param)
+			if b {
+				xb.Session().UpdateByCustomField("id", userId, "i_credit", util.IntAll(xb.GetSession("i_credit"))+score)
+			} else {
+				log.Println(userId, code, param, "任务送积分失败")
+			}
 		}
-	}
+	}, func(e interface{}) {
+		log.Println("更新积分和session出错", e)
+	})
 	return b
 }

+ 22 - 13
core/src/qfw/mobile/wxmenu.go

@@ -139,22 +139,26 @@ func (m *Mobile) SwordfishPay() error {
 						mapPush := map[string]string{}
 						for _, v := range types {
 							util.Try(func() {
-								obj_typei := user["o_msgset"].(map[string]interface{})[v]
 								b_newopen := false
-								if obj_typei == nil {
+								if user["o_msgset"] == 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 {
+									obj_typei := user["o_msgset"].(map[string]interface{})[v]
+									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
+											}
 										}
 									}
 								}
@@ -168,13 +172,14 @@ func (m *Mobile) SwordfishPay() error {
 						}
 						//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 {
+							credit_a := util.IntAll(m.GetSession("credit_a"))
+							b := false
+							if b, _ = credit.OutCreditB(userId.(string), credit.V_JY, util.ObjToString(m.GetSession("s_m_openid")), 0, isPay, m.Action); b {
 								//先扣分,然后更新,然后返回结果
 								res["credit"] = i_credit
 								res["oprstatus"] = true
 								//初次提交积分时
 								//加上剑鱼是否推送过的逻辑判断
-								credit_a := util.IntAll(m.GetSession("credit_a"))
 								if !credit.AIsHasDo(credit.A_JYSCTS, credit_a) {
 									util.Try(func() {
 										//对用户进行推送
@@ -185,7 +190,7 @@ func (m *Mobile) SwordfishPay() error {
 											Mopenid:  m.GetSession("s_m_openid").(string),
 											PushType: mapPush,
 										}
-										go clent.Call("PushInfo.PushMsg", &rpcData, &repl)
+										clent.Call("PushInfo.PushMsg", &rpcData, &repl)
 										if errs == nil {
 											//修改剑鱼占位值
 											credit.CheckSword(userId.(string), credit.A_JYSCTS, credit_a, m.Action)
@@ -195,6 +200,10 @@ func (m *Mobile) SwordfishPay() error {
 									})
 								}
 							}
+							//首次使用剑鱼送积分
+							if b && !credit.AIsHasDo(credit.A_SYJY, credit_a) {
+								credit.UpuserCreditSession(userId.(string), credit.A_SYJY, "A", nil, m.Action)
+							}
 						} else {
 							res["credit"] = i_credit
 						}

+ 1 - 1
core/src/qfw/search/searchService.go

@@ -100,7 +100,7 @@ func (search *Search) FindServiceByEntId() error {
 		    }
 		  }}`
 		//需要查到的字段信息
-		fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status"`
+		fields = `"_id","s_name","s_introduction","s_images","s_enterpriseid","s_isshow","i_status","s_pricemy","i_comments","f_price"`
 		if currentPage == 1 {
 			count = elastic.Count("service", collection, query)
 		}

+ 6 - 7
core/src/qfw/swordfish/swordfish.go

@@ -9,13 +9,12 @@ import (
 
 type SwordFish struct {
 	*xweb.Action
-	swordfish     xweb.Mapper `xweb:"/front/swordfish"`                 //剑鱼
-	rsssetAjaxReq xweb.Mapper `xweb:"/member/swordfish/rssset/ajaxReq"` //订阅消息设置ajax请求
-	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"`                  //剑鱼跳转访问请求,后续统计
+	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"`                 //剑鱼跳转访问请求,后续统计
 }
 
 func init() {

+ 21 - 38
core/src/qfw/swordfish/swordfishmanage.go

@@ -2,8 +2,6 @@ package swordfish
 
 import (
 	"gopkg.in/mgo.v2/bson"
-	"qfw/util"
-	credit "qfw/util/credit"
 	"qfw/util/mongodb"
 	"qfw/util/redis"
 	"time"
@@ -29,44 +27,29 @@ func (s *SwordFish) Swordfish() error {
 //跳转到订阅设置页面
 func (s *SwordFish) RssSet() error {
 	u := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
-	s.T["msgset"] = (*u)["o_msgset"]
-	//判断是否使用过剑鱼
-
-	return s.Render("/swordfish/rssset.html", &s.T)
-}
-func (s *SwordFish) RsssetAjaxReq() error {
-	userId := s.GetSession("userId").(string)
-	var flag = "n"
-	msgset := make(map[string]interface{})
-	//投标公告
-	if tender_flag, _ := s.GetBool("tender_flag"); tender_flag {
-		tender := make(map[string]interface{})
-		tender["a_key"] = s.GetSlice("tender_keys")
-		tender["s_scope"] = s.GetString("tender_scope")
-		msgset["tender"] = tender
-	}
-	//中标公告
-	if bid_flag, _ := s.GetBool("bid_flag"); bid_flag {
-		bid := make(map[string]interface{})
-		bid["a_key"] = s.GetSlice("bid_keys")
-		bid["s_scope"] = s.GetString("bid_scope")
-		msgset["bid"] = bid
-	}
-	//更新数据库
-	msgset["l_modifydate"] = time.Now().Unix()
-	if mongodb.Update("user", `{"_id":"`+userId+`"}`, &map[string]interface{}{"$set": map[string]interface{}{"o_msgset": msgset}}, false, false) {
-		flag = "y"
-	}
-	//首次使用剑鱼送积分
-	if flag == "y" {
-		if credit.AIsHasDo(credit.A_SYJY, util.IntAll(s.GetSession("credit_a"))) {
-			credit.UpuserCreditSession(userId, credit.A_SYJY, "A", nil, s.Action)
+	msgset := (*u)["o_msgset"]
+	if msgset != nil {
+		if set, _ := msgset.(map[string]interface{}); set != nil {
+			if set["tender"] != nil {
+				tender, _ := set["tender"].(map[string]interface{})
+				if tender["l_enddate"] != nil {
+					t := tender["l_enddate"].(int64) - time.Now().Unix()
+					tender["day"] = t / (60 * 60 * 24)
+				}
+			}
+		}
+		if set, _ := msgset.(map[string]interface{}); set != nil {
+			if set["bid"] != nil {
+				bid, _ := set["bid"].(map[string]interface{})
+				if bid["l_enddate"] != nil {
+					t := bid["l_enddate"].(int64) - time.Now().Unix()
+					bid["day"] = t / (60 * 60 * 24)
+				}
+			}
 		}
 	}
-	s.ServeJson(map[string]interface{}{
-		"flag": flag,
-	})
-	return nil
+	s.T["msgset"] = msgset
+	return s.Render("/swordfish/rssset.html", &s.T)
 }
 
 //跳转到用户中心剑鱼信息列表

+ 28 - 10
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -3,6 +3,7 @@ package yellowpage
 //企业黄页的操作类
 import (
 	"container/list"
+	"encoding/json"
 	"fmt"
 	_ "github.com/go-xweb/xweb"
 	mgo "gopkg.in/mgo.v2"
@@ -40,7 +41,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, "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}`)
+	res := FindById("enterprise", id, `{"RegNo":1, "EntName":1, "EntType":1, "EntTypeName":1, "OpLocDistrict":1, "LeRep":1, "LegCerNO":1, "Tel":1, "Dom":1, "OpScope":1, "OpFrom":1, "OpTo":1, "RegCap":1, "EstDate":1, "CompForm":1, "CompFormName":1, "OpState":1, "OpStateName":1, "RegOrgName":1, "IssBLicDate":1, "Timestamp":1, "s_synopsis":1, "SourceType":1, "NB_email":1,"IndustryPhyName":1,"investor":1,"alterInfo":1, "s_enturl, "i_province":1, "i_city":1, "i_area":1,"s_action":1,"s_persion":1,"s_mobile":1,"s_address":1,"s_avatar":1,"s_microwebsite":1,"s_qq":1,"s_submitid":1,"s_email":1}`)
 	if res != nil {
 		id := (*res)["s_submitid"]
 		if id != nil {
@@ -81,10 +82,6 @@ func GetEntInfo(id string) interface{} {
 		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 != "" {
@@ -102,8 +99,27 @@ func GetEntInfo(id string) interface{} {
 		}
 		//
 		(*res)["EntTypeLabel"] = (mobile.GetDiffName(EntType))[0]
-
 		(*res)["entid"] = id
+		//企业变更排序
+		var alterInfo []map[string]interface{}
+		if d, err := json.Marshal((*res)["alterInfo"]); err == nil {
+			json.Unmarshal(d, &alterInfo)
+		}
+		for x, _ := range alterInfo {
+			for y := 0; y < len(alterInfo)-x-1; y++ {
+				dt1, xok := alterInfo[y]["AltDate"].(float64)
+				dt2, yok := alterInfo[y+1]["AltDate"].(float64)
+				if xok && yok && dt1 < dt2 {
+					temp := alterInfo[y]
+					alterInfo[y] = alterInfo[y+1]
+					alterInfo[y+1] = temp
+				}
+			}
+		}
+		for _, v := range alterInfo {
+			log.Println(v["AltAf"])
+		}
+		(*res)["alterInfo"] = alterInfo
 		return *res
 	}
 	return nil
@@ -118,7 +134,7 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 		yp.T["res"] = GetEntInfo(id)
 		contentuser, erruser := yp.Render4Cache("/yellowpage/enterpriseinfo.html", &yp.T)
 		if erruser == nil {
-			redis.PutBytes("enterprise", id, &contentuser, ONEDAY)
+			redis.PutBytes("enterprise", id, &contentuser, 7*ONEDAY)
 		}
 		return yp.SetBody(contentuser)
 	}
@@ -250,10 +266,12 @@ func (yp *Yellowpage) GetRelation() error {
 		if regNo == "" || entName == "" {
 			return nil
 		}
-		relation := makeRelation(regNo, entName)
-		if relation != nil {
-			yp.ServeJson(M{"flag": true, "relation": relation})
+		relation := redis.Get("other", "relation-"+regNo)
+		if relation == nil {
+			relation = makeRelation(regNo, entName)
+			redis.Put("other", "relation-"+regNo, relation, 7*ONEDAY)
 		}
+		yp.ServeJson(M{"flag": true, "relation": relation})
 	} else {
 		yp.ServeJson(M{"flag": false})
 	}

+ 40 - 12
core/src/web/staticres/css/dev-qfw.css

@@ -2175,9 +2175,10 @@ style="color:#D03102;margin-right:5px;"
 .b-nav-logo{
 	padding-right: 40px;
 }
-.b-nav-link{
+.b-nav-main{
 	width: 120px;
 	text-align: center;
+	margin-right: 16px;
 }
 .b-nav-main a{
 	font-size: 18px;
@@ -2189,12 +2190,28 @@ style="color:#D03102;margin-right:5px;"
 	height: 20px;
 	margin-top: 25px;
 	border-left: 1px solid #e5e6e9;
-	border-right: 1px solid #ffffff;
-	float: right;
+	position: absolute;
+	right: 0px;
+	top: 50%;
+	margin-top: -10px;
+}
+.b-nav-other{
+	padding-left: 21px;
+	padding-right: 21px;
+	position: relative;
+}
+.b-nav-other a{
+	color: #4e5051;
 }
 .b-nav-other>a:hover,.b-nav-active>a{
 	font-weight: bold;
 }
+.b-head .b-loginbtn{
+	width: 40px;
+	height: 40px;
+	margin-top: 13px;
+	margin-right: 30px;
+}
 .b-head .headimg{
 	width: 40px;
 	height: 40px;
@@ -2204,7 +2221,7 @@ style="color:#D03102;margin-right:5px;"
 	padding: 0px 15px;
 	position: relative;
 }
-.b-head .b-loginStatus:hover{
+.b-head .b-logined:hover{
 	background-color: #F7F9FB;
 }
 .b-head .b-loginStatus:hover>a{
@@ -2277,12 +2294,17 @@ style="color:#D03102;margin-right:5px;"
 }
 .b-head .b-h-search{
 	padding-top: 14px;
+	padding-left: 17px;
 }
 .b-head .b-h-search .input-group{
 	width: 300px;
 }
 .b-head .b-h-search .form-control{
 	border-radius: 50px !important;
+	color: #a0a0a0;
+	box-shadow: none;
+	border-color: #e5e6e9;
+	padding-left: 21px;
 }
 .b-head .b-h-search form>span i {
     position: absolute;
@@ -2295,15 +2317,15 @@ style="color:#D03102;margin-right:5px;"
 }
 .b-head .b-h-search form>span{
     position: absolute;
-    right: 10px;    
+	right: 10px;
 	border-radius: 50px;
-    top: 50%;
-    z-index: 20;
-    margin-top: -19px;
-	margin-right:-10px;
-    display: inline-block;
-	width:38px;
-	height:38px;
+	top: 50%;
+	z-index: 20;
+	margin-top: -17px;
+	margin-right: -11px;
+	display: inline-block;
+	width: 35px;
+	height: 35px;
 }
 .b-content{
 	padding: 15px 0px 15px 0px;
@@ -2331,6 +2353,12 @@ style="color:#D03102;margin-right:5px;"
 	padding: 10px 10px 10px 20px;
 	font-size: 16px;
 }
+.b-modal .modal-header-jy{
+	background-color: #37C6DA;
+	color: #FFFFFF;
+	padding: 10px 10px 10px 20px;
+	font-size: 16px;
+}
 .b-modal .modal-header .close{
 	opacity: 1;
 	text-shadow: none;

+ 59 - 5
core/src/web/staticres/css/entcommunity.css

@@ -34,9 +34,6 @@ a:focus, a:hover{
 .ttcon ul li:hover{
 	color: #16a086;
 }
-.text-primary{
-	color: #16a086 !important;
-}
 .entlist-page .nav-tabs{
 	background-color: #f7f8fa;
 	margin-top: 20px;
@@ -543,10 +540,67 @@ a:focus, a:hover{
 .ent-service{
 	padding: 0px 20px;
 }
-.ent-service img{
+.ent-service td img{
 	width: 110px;
 	height: 101px;
 }
+/**************变更信息**********************/
+.ent-alterinfo li{
+	width: 100%;
+	display: table;
+}
+.ent-alterinfo li>div{
+	position: relative;
+	display: table-cell;
+	width: 50%;
+	padding-bottom: 20px;
+}
+.ent-alterinfo li:last-of-type>div{
+	padding: 0px;
+}
+.ent-alterinfo ul li:nth-child(odd)>div:first-child{
+	visibility: hidden;
+}
+.ent-alterinfo ul li:nth-child(odd)>div:last-child{
+	border-left: 1px solid #16a086;
+	padding-left: 20px;
+	left: -1px;
+}
+.ent-alterinfo ul li:nth-child(odd) a{
+	left: -6px;
+}
+.ent-alterinfo ul li:nth-child(even) a{
+	right: -6px;
+}
+.ent-alterinfo ul li:nth-child(even)>div:first-child{
+	border-right: 1px solid #16a086;
+	text-align: right;
+	padding-right: 20px;
+}
+.ent-alterinfo ul li:nth-child(even)>div:last-child{
+	visibility: hidden;
+}
+.ent-alterinfo li a{
+	display: block;
+	width: 11px;
+	height: 11px;
+	border-radius: 50%;
+	background-color: #16a086;
+	position: absolute;
+	top: 0px;
+}
+.ent-alterinfo li>div>div{
+	margin-bottom: 10px;
+	margin-top: -5px;
+}
+.ent-alterinfo li>div>div:first-of-type{
+	font-size: 16px;
+	color: #16a086;
+	font-weight: bold;
+}
+.ent-alterinfo li>div>div:last-of-type{
+	color: #A0A0A0;
+}
 /************公用****************/
 .ent-layout-up{
 	padding: 0px 20px;
@@ -596,10 +650,10 @@ a:focus, a:hover{
 }
 .ent-table tr:nth-child(2n+1){
 	border-top: 1px solid #e5e6e9;
+	font-size: 16px;
 }
 .ent-table .b-com-name{
 	font-weight: bold;
-	font-size: 16px;
 	word-wrap: break-word;
 	word-break: normal;
 }

+ 9 - 0
core/src/web/staticres/css/swordfish.css

@@ -88,6 +88,11 @@ a:focus, a:hover{
 	border: 1px solid #F5DC99;
 	text-indent: 2em;
 }
+.swordfish-explain2{
+	background-color: #FCF8E3;
+	padding: 10px 30px;
+	text-indent: 2em;
+}
 .swordfish-explain span{
 	color: #A0A0A0;
 }
@@ -329,6 +334,10 @@ a:focus, a:hover{
 	border-radius: 8px !important;
 	margin-right: 10px;
 }
+.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
+    background-color: #37C6DA;
+    border-color: #37C6DA;
+}
 @media (max-width: 1200px) {
 	.b-left{
 		width: 100%;

+ 11 - 378
core/src/web/staticres/js/entportrait.js

@@ -40,7 +40,7 @@ $(function(){
 		$(".ent-tab-content>div").addClass("hide");
 		$(".ent-tab-content>div:eq("+$(this).index()+")").removeClass("hide");
 		if($(this).index() == 1){
-			initRelation();
+			b_afterLogin();
 		}else if($(this).index() == 5 && serviceList == null){
 			//加载服务列表
 			serviceList = new ServiceList();
@@ -75,7 +75,8 @@ function initRelation(){
 				$("#entrelation-nologin").addClass("hide");
 				$("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
 				$("#entrelation-infovis").hide();
-			}else if(r.flag == true && (typeof(r) == "undefined" || r == null || r == "")){
+			}else if(r.flag == true && (r == null || typeof(r) == "undefined" || typeof(r.links) == "undefined" || r.links.length == 0 || typeof(r.nodes) == "undefined" || r.nodes.length <= 1)){
+				relation = "";
 				$("#entrelation-infovis").hide();
 				$("#entrelation-findnull").removeClass("hide");
 			}else{
@@ -98,12 +99,17 @@ function initRelation(){
 //服务列表
 function ServiceList(){
 	loadJS("/js/paging.js",function(){
-		paging = new Paging("serviceList","/front/findServiceByEntId",{entId:entId},6,function(r){
+		paging = new Paging("serviceListPaging","/front/findServiceByEntId",{entId:entId},6,function(r){
+			if(r.length == 0){
+				$("#serviceList").next(".ent-findnull").removeClass("hide");
+			}
 			var html = '';
 			for(var i=0;i<r.length;i++){
 				html += '<tr>'
-						+'<td rowspan="2" width="120"><img src="/images/services/default.png"></td>'
-						+'<td class="b-com-name">'+r[i].s_name+'</td>'
+						+'<td rowspan="2" width="120"><img src="'+(r[i].s_images==""?"null":r[i].s_images)+'" onerror="this.src=\'/images/services/default.png\'"></td>'
+						+'<td class="b-com-name"><a href="/market/detail/'+r[i]._id+'.html">'+r[i].s_name+'</a></td>'
+						+'<td width="100" class="text-center">报价:<font class="text-primary">'+(r[i].s_pricemy==0?"面议":r[i].f_price+"元")+'</font></td>'
+						+'<td width="100" class="text-center">评价:<font class="text-primary">'+r[i].i_comments+'</font></td>'
 						+'<tr>'
 						+'<td>'+r[i].s_introduction+'</td>'
 						+'</tr>';
@@ -111,377 +117,4 @@ function ServiceList(){
 			$("#serviceList").html(html);
 		});
 	});
-}
-
-
-
-
-
-
-
-
-
-
-
-/*
-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();
-	//所在地信息加载
-	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;
-		}
-	}
-	return ret
-}
-//公式信息是否显示
-if(!$gs){
-	$("#ags").parent().hide();
-	$("#gs").hide();
-}
-*/
-
-
-var perPage=5,currentPage=1
-
-//点击服务标题展示服务信息
-function clickservicename(id,isshow){
-	if(isshow.indexOf("3")>-1){
-		window.location.href="/market/detail/"+id+".html"
-	}else{
-		window.location.href="/market/showservice/"+id+".html"
-	}
-}
-
-
-
-//显示二维码图片
-function viewBarCode(bcpath){
-	if(bcpath){
-		$('#myModal').modal({
-      		keyboard: true
-   		})
-		$("#viewImgs").html("<img style='width:300px;height:300px;' src='"+bcpath+"'/>")
-	}
-}
-
-
-function analyList(rowHtml, rowData) {
-	var t="";
-	if(rowData.i_status==1){
-		t=template_content.replace("<a class='text-primary' value='${_id}' data-id='${s_isEdit}' onclick='removeservice(this)'>下架</a>","");
-	}else{
-		t=template_content.replace("已下架","");
-	}
-	return t.replace(/\$\{(.*?)\}/g,
-	function(a, b, c) {
-		var res = rowData[b]||"";
-		//去掉后台服务列表中的图片
-		var data = res.replace(/<img.*>.*<\/img>/ig,"");   //过滤如<img></img>形式的图片元素
-		res = data.replace(/<img.*\/>/ig, "");   //过滤如<img />形式的元素
-		if (!res&&b=="s_images"){
-			res="/images/services/default.png"
-		}else{
-			res = res.replace(/\n/g,"");
-		}
-		return res;
-	});
-}
-//加载更多
-function loadMore(){
-	$.post('/searchEntSer/'+entId ,{currentPage:currentPage+1,perPage:perPage},function(data){
-		if(data){
-			var res=data["data"]
-			if(!res || res === undefined || res.length == 0) {
-				$("#loadMore").hide();
-				return;
-			}else if(data.totalRows<=(perPage*data.currentPage)){
-				$("#loadMore").hide();
-			}else{
-				$("#loadMore").show();
-			}
-			currentPage=data["currentPage"];
-			var str="";
-			
-			for(var i=0;i<res.length;i++){
-				var temp=res[i];
-				str+=analyList("",temp)
-			}
-			$("#service_list table tbody").append(str);
-		}
-	})
 }

+ 15 - 15
core/src/web/staticres/js/qfw.js

@@ -44,6 +44,21 @@ var ValidDatatype = {
 		return true;
 	}
 }
+Date.prototype.Format = function (fmt) { //author: meizz 
+    var o = {
+        "M+": this.getMonth() + 1, //月份 
+        "d+": this.getDate(), //日 
+        "h+": this.getHours(), //小时 
+        "m+": this.getMinutes(), //分 
+        "s+": this.getSeconds(), //秒 
+        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
+        "S": this.getMilliseconds() //毫秒 
+    };
+    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+    for (var k in o)
+    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+    return fmt;
+}
 //浏览器窗口大小变化重新加载
 window.onresize=webSiteInit;
 serializeObject = function(form) {
@@ -60,21 +75,6 @@ $(function(){
 	if(webSiteInitFlag){
 		webSiteInit();
 	}
-	Date.prototype.Format = function (fmt) { //author: meizz 
-	    var o = {
-	        "M+": this.getMonth() + 1, //月份 
-	        "d+": this.getDate(), //日 
-	        "h+": this.getHours(), //小时 
-	        "m+": this.getMinutes(), //分 
-	        "s+": this.getSeconds(), //秒 
-	        "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
-	        "S": this.getMilliseconds() //毫秒 
-	    };
-	    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
-	    for (var k in o)
-	    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
-	    return fmt;
-	}
 });
 
 function makeData(d,_this,b){

+ 39 - 19
core/src/web/templates/common/memberleft.html

@@ -60,7 +60,15 @@
 	height: 20px;
 	margin-right: 5px;
 }
-
+.txbootleft{
+	float:left;
+	padding-left:5px;
+	
+}
+.txbootright{
+	float:right;
+	padding-right:5px;
+}
 </style>
 {{$identWay := session "identWay"}}
 {{$s_role := printf "%v" (index (session "userInfo") "s_role")}}
@@ -79,7 +87,7 @@
 			<div>
 			{{if session "credit_qd"}}
 				{{if eq (session "credit_qd") "y"}}
-					<button style="width:100px" class="btn" disabled>签到</button>
+					<button style="width:100px" class="btn" disabled>签到</button>
 				{{else}}
 					<button id="credit_qd" style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
 				{{end}}	
@@ -87,28 +95,39 @@
 				<button id="credit_qd" style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
 			{{end}}	
 			</div>
+		</div>
+	</a>
+	<a class="list-group-item" style="padding:10px 2px">
+	<div style="width:198px;height:40px;text-align:center;">
+		<div style="float:left;width:90px;border-right:1px">
+			<div>积分</div>
+			<div><i class="glyphicon jinbi" style="width:25px;color:red;font-size:18px"></i>{{session "i_credit"}}</div>
+		</div>
+		<div style="height:40px;float:left;width:1px;background-color:#DDDDDD"></div>
+		<div style="float:left;width:105px;">
+			<div>认证</div>
 			<div>
-				<i class="glyphicon jinbi" style="color:red"></i>{{session "i_credit"}}
-				{{if session "identType"}}
-					{{$identType := session "identType"}}
-					{{if eq 1 $identType}}
-						{{if eq 1 $identWay}}
-						<i class="glyphicon qyrz" style="color:#FF5A5F;top:4px;"></i>已认证企业
-						{{end}}
-					{{else if eq 2 $identType}}
-						{{if eq 1 $identWay}}
-						<i class="glyphicon grrz" style="color:#FF5A5F;top:4px;"></i>已认证个人
-						{{end}}
-					{{else if eq 3 $identType}}
-						{{if eq 1 $identWay}}
-						<i class="glyphicon jgrz" style="color:#FF5A5F;top:4px;"></i>已认证机构
-						{{end}}
+			{{if session "identType"}}
+				{{$identType := session "identType"}}
+				{{if eq 1 $identType}}
+					{{if eq 1 $identWay}}
+					<i class="glyphicon qyrz" style="width:25px;color:red;font-size:18px;margin-right:0px;"></i>已认证企业
+					{{end}}
+				{{else if eq 2 $identType}}
+					{{if eq 1 $identWay}}
+					<i class="glyphicon grrz" style="width:25px;color:red;font-size:18px;margin-right:0px;"></i>已认证个人
+					{{end}}
+				{{else if eq 3 $identType}}
+					{{if eq 1 $identWay}}
+					<i class="glyphicon jgrz" style="width:25px;color:red;font-size:18px;margin-right:0px;"></i>已认证机构
 					{{end}}
-				{{else}}
-					<i class="glyphicon grrz" style="top:4px;"></i>未认证
 				{{end}}
+			{{else}}
+				<i class="glyphicon grrz" style="width:25px;color:red;font-size:18px;margin-right:0px;"></i>未认证
+			{{end}}
 			</div>
 		</div>
+	</div>
 	</a>
 	<a class="list-group-item" onclick="window.location.href = '/member/accountset/index'"><i class="glyphicon zhanghao"></i>账户设置</a>
 	<a class="list-group-item" onclick="window.location.href = '/member/swordfish/rssset'"><i class="glyphicon iconfontcolor71"></i>剑鱼(信息订阅)</a>
@@ -247,6 +266,7 @@ $(function (){
 		if(r&&r.result=="y"){
 			$("#credit_qd").attr("disabled","disabled");
 			$("#credit_qd").removeClass("btn-primary");
+			$("#credit_qd").html("已签到")
 		}
 	});
 	

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

@@ -77,7 +77,7 @@ function b_loadTop(){
 						+'<li onclick="window.location.href=\'/member/show/memberindex\'"><i class="glyphicon ren1"></i>用户中心</li>'
 						+'<li onclick="window.location.href=\'/front/logout\'" class="border-b-0"><i class="glyphicon tuichu"></i>退出</li>';
 						+'</ul></div>';
-				$("#b-loginStatus").html(html)
+				$("#b-loginStatus").addClass("b-logined").html(html)
 				.mouseover(function(){
 					$("#head-hideMenu").show();
 				}).mouseleave(function(){
@@ -96,7 +96,7 @@ function b_loadTop(){
 				}
 			}else{
 				isLogined = false;
-				var html = '<a onclick="loginModalShow();">登录/注册</a>';
+				var html = '<img class="b-loginbtn cursor-pointer" onclick="loginModalShow();" src="/images/swordfish/headimg.png">';
 				$("#b-loginStatus").html(html);
 				$("#bottom-bar>li").removeClass("invisible");
 				//登录

+ 171 - 15
core/src/web/templates/swordfish/rssset.html

@@ -11,14 +11,14 @@
 	<div class="b-left">
 		<div class="swordfish-page-title">
 			<i class="img-circle glyphicon jianyu"></i>订阅设置
-			<span >继续使用表明你已经同意了<span><a>剑鱼用户服务协议</a>
+			<!--<span >继续使用表明你已经同意了<span><a onclick="$('#yhxyModal').modal('show')">剑鱼用户服务协议</a>-->
 			<span style="float:right;width:190px">
 			<a id="ckys">查看演示&nbsp;&nbsp;</a>
-			<a id="sfbz">收费标准</a>
+			<a id="sfbz" onclick="$('#sfbzModal').modal('show')">收费标准</a>
 			<a id="yjfk">去提意见</a>
 			</span>
 		</div>
-		<div id="swordfish-tishi" class="swordfish-explain">
+		<div class="swordfish-explain">
 			“剑鱼”是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,
 			为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,
 			比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。
@@ -30,7 +30,15 @@
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				招标公告
-				<span id="tender-panel-info">本栏目推送服务期还剩3天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a></span>
+				<span>
+				{{if .T.msgset}}
+					{{if .T.msgset.tender}}
+						{{if .T.msgset.tender.day}}
+						本栏目推送服务期还剩{{.T.msgset.tender.day}}天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a>
+						{{end}}
+					{{end}}
+				{{end}}
+				</span>
 			</div>
 			<div class="swordfish-panel-c">
 				<div>
@@ -56,7 +64,15 @@
 				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
 				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
 				中标公告
-				<span id="bid-panel-info">本栏目推送服务期还剩3天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a></span>
+				<span id="bid-panel-info">
+				{{if .T.msgset}}
+					{{if .T.msgset.bid}}
+						{{if .T.msgset.bid.day}}
+						本栏目推送服务期还剩{{.T.msgset.bid.day}}天。想要服务不间断,请确保积分充足。 <a href="/member/credit/myCredit">去做任务赚积分</a>
+						{{end}}
+					{{end}}
+				{{end}}
+				</span>
 			</div>
 			<div class="swordfish-panel-c">
 				<div>
@@ -234,10 +250,75 @@
 	    </div>
   	</div>
 </div>
+
+<!-- tishiModal -->
+<div class="modal fade b-modal" id="tishiModal" tabindex="-1" role="dialog" aria-labelledby="tishiModalLabel">
+  	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+		  	<div class="modal-header-jy">
+				<span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1"></span>
+				<span class="modal-title" id="vipcreditModalLabel">提示信息</span>
+			</div>
+			<div class="swordfish-explain2">
+				<div id="swordfish-tishi"></div>
+				<div id="btn-tijiao" style="text-align:center;padding:10px 0;"></div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<!-- 用户协议 -->
+<div class="modal fade b-modal" id="yhxyModal" tabindex="-1" role="dialog" aria-labelledby="yhxyModalLabel">
+  	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+		  	<div class="modal-header-jy">
+				<span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1"></span>
+				<span class="modal-title" id="yhxyModalLabel">用户协议</span>
+			</div>
+			<div style="background-color: #FCF8E3;padding:10px;line-height:25px">
+				<div>
+					<p style="margin-left:5px">剑鱼用户协议:</p>
+					<p style="margin-left:15px">
+					 
+					</p>
+				</div>
+				<div style="text-align:center;padding:10px 0;">
+					<button class='btn btn-primary' onclick="$('#yhxyModal').modal('hide')">确定</button>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<!-- 收费标准 -->
+<div class="modal fade b-modal" id="sfbzModal" tabindex="-1" role="dialog" aria-labelledby="sfbzModalLabel">
+  	<div class="modal-dialog" role="document">
+		<div class="modal-content">
+		  	<div class="modal-header-jy">
+				<span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1"></span>
+				<span class="modal-title" id="sfbzModalLabel">用户协议</span>
+			</div>
+			<div style="background-color: #FCF8E3;padding:10px 20px;line-height:25px">
+				<div>
+					<p style="margin-left:5px">剑鱼收费标准:</p>
+					<p style="margin-left:35px">
+					每个栏目、每月1000积分。
+					积分按月扣除,到期后默认自动扣除下月积分,积分不足则停止服务。如果您不希望下月继续服务,可提前将服务关闭。
+					</p>
+				</div>
+				<div style="text-align:center;padding:10px 0;">
+					<button class='btn btn-primary' onclick="$('#sfbzModal').modal('hide')">确定</button>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
 <!-- 底部 -->
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
-
+//Array.prototype.indexOf = function (val) {for (var i = 0; i < this.length; i++) {if (this[i] == val) {return i;}} return -1;};  
+//Array.prototype.removevalue = function (val){var index=this.indexOf(val);if(index > -1){this.splice(index, 1);}}; 
+var oprarr = new Array();
 $(function(){
 	var selectKeyword = function(type,keyword,i_switchstatus){
 		if(keyword == "" || typeof(keyword) == "undefined"){
@@ -306,20 +387,62 @@ $(function(){
 	$("#bid-scope-dialog").find("li .btn").click(function(){
 		afterSelectScope("bid",$(this));
 	});
+	var tender_i_status=0;
+	var bid_i_status=0;
+	var i_credit={{session "i_credit"}}
+	if(typeof(msgset.tender) != "undefined"&&typeof(msgset.tender.i_status) != "undefined"&&msgset.tender.i_status==1){
+		tender_i_status=1;
+	}
+	if(typeof(msgset.bid) != "undefined"&&typeof(msgset.bid.i_status) != "undefined"&&msgset.bid.i_status==1){
+		bid_i_status=1;
+	}
 	$(".swordfish-uncheck").click(function(){
-		$(this).next().show();
+		var type=$(this).parent().parent().attr("id");
+		//如果新增功能扣积分
+		if(type=="tender"&&tender_i_status==0){
+			oprarr.push("types=tender");
+		}
+		if(type=="bid"&&bid_i_status==0){
+			oprarr.push("types=bid");
+		}
+		var typeinfo="";
+		if(type=="tender"){
+			typeinfo="招标公告";
+		}else{
+			typeinfo="中标公告 ";
+		}
+		if(oprarr.length>0){
+			var str1="您选择了<span style='color:red'>"+oprarr.length+"</span>个信息栏目(<span style='color:red'>"+typeinfo+"</span>),确认后系统将每月扣除<span style='color:red'>"+oprarr.length*1000+"</span>积分,您目前的积分余额<span style='color:red'>("+i_credit+")</span>不足,<a href='/member/credit/myCredit' style='color:#37C6DA'>去做任务赚积分</a>";
+			str2="<button class='btn btn-primary' onclick='swordfishpay(1)'>取消</button>";
+			if((i_credit-oprarr.length*1000)>0){				
+				str1="您选择了<span style='color:red'>"+oprarr.length+"</span>个信息栏目(<span style='color:red'>"+typeinfo+"</span>),确认后系统将每月扣除<span style='color:red'>"+oprarr.length*1000+"</span>积分,您目前的积分余额是<span style='color:red'>"+i_credit+"</span>积分,扣除后将剩余<span style='color:red'>"+(i_credit-oprarr.length*1000)+"</span>积分。";
+				str2="<button class='btn btn-primary' onclick='swordfishpay(0)'>提交</button>"
+				+"&nbsp;<button class='btn btn-primary' onclick='swordfishpay(1)'>取消</button>";
+			}
+			$("#swordfish-tishi").html(str1);
+			$("#btn-tijiao").html(str2);
+			$("#tishiModal").modal("show");
+		}
 		$(this).hide();
 		autoChecked($(this).parents(".swordfish-panel").attr("id"),true,1);
 	});
-	var arrinfo=["您选择了?个信息栏目,确认后系统将每月扣除?积分,您目前的积分余额是?积分,扣除后将剩余?积分。",
-				"ss"];
 	$(".swordfish-checked").click(function(){
 		$(this).parents(".swordfish-panel").removeClass("swordfish-panel-a");
 		$(this).prev().show();
 		$(this).hide();
-		$(this).next().css('display','none');
-		//ajaxReq();
+		ajaxReq();
 	});
+	//针对页面异常关闭
+	if(typeof(msgset.tender) != "undefined"&&typeof(msgset.tender.i_switchstatus) != "undefined"&&msgset.tender.i_switchstatus==1){
+		if(tender_i_status==0){
+			$("#tender").children(".swordfish-panel-t").children(".swordfish-uncheck").click();
+		}
+	}
+	if(typeof(msgset.bid) != "undefined"&&typeof(msgset.bid.i_switchstatus) != "undefined"&&msgset.bid.i_switchstatus==1){
+		if(bid_i_status==0){
+			$("#bid").children(".swordfish-panel-t").children(".swordfish-uncheck").click();
+		}
+	}
 });
 function afterSelectScope(type,btn){
 	var text = btn.text();
@@ -362,7 +485,6 @@ function autoChecked(type,flag,i_switchstatus){
 		obj.find(".swordfish-checked").show();
 		obj.find(".swordfish-checked").next().css('display','');
 	}
-	
 	if(obj.find(".swordfish-keywords").children(".swordfish-keyword").length == 0){
 		appendKeyWord(type,"",false);
 	}
@@ -401,17 +523,14 @@ function appendKeyWord(type,value,isFocus){
 		obj.find(".swordfish-keyword").each(function(i){
 			$(this).children("b").children("font").text(i+1);
 		});
-		//autoChecked(type,false,i_switchstatus);
 		ajaxReq();
 	});
 	node.children("[type='text']").blur(function(){
-		//autoChecked(type,false,i_switchstatus);
 		ajaxReq();
 	});
 	if(isFocus){
 		node.children("[type='text']").focus()
 	}
-	//autoChecked(type,false,i_switchstatus);
 }
 function ajaxReq(){
 	var thisClass = this;
@@ -480,6 +599,43 @@ function ajaxReq(){
 		}
 	});
 }
+
+//扣积分
+function swordfishpay(oprtype){
+	$("#tishiModal").modal("hide");
+	$.ajax({
+		dataType:"json",
+		url:"/member/credit/swordfishpay",
+		data:oprarr.join("&")+"&no="+oprtype,
+		type:"POST",
+		async:false,
+		success:function(msg){
+			if(msg){
+				if(msg.flag){
+					//有session
+					if(msg.oprstatus){
+						//扣积分操作成功
+						$("#tishiModal").hide()
+					}else{
+						//扣积分操作无效
+						alert("操作无效,请重新进入页剑鱼页面后操作")
+					}				
+				}else{
+					//无session
+					alert("请重新进入页剑鱼页面后操作")
+				}
+			}			
+		},
+		error:function(x,st,err){
+			alert("请稍后再试"+st)
+		}
+	})
+	window.location.reload()
+}
+//弹窗关闭,取消
+$('#tishiModal').on('hidden.bs.modal', function () {
+  swordfishpay(1);
+})
 </script>
 </body>
 </html>

+ 48 - 6
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -107,7 +107,7 @@
 		<li class="border-r-0">招聘</li>
 	</ul>
 	<div class="ent-tab-content">
-		<div class='hide'>
+		<div>
 			{{if .T.res.gs}}
 			<div class="entinfo-basicinfo ent-layout-up">
 				<div class="b-com-title">
@@ -277,7 +277,7 @@
 				</div>
 				<img src="/images/entcommunity/relation.png">
 			</div>
-			<div id="entrelation-findnull" class="entrelation-findnull hide">
+			<div id="entrelation-findnull" class="ent-findnull hide">
 				<img src="/images/findnull.png" class="b-findnull">
 				<h4>抱歉,未找到相关数据!</h4>
 			</div>
@@ -304,8 +304,46 @@
 				{{end}}
 			</div>
 		</div>
-		<div class="hide">
-		
+		<div class="ent-alterinfo hide">
+			<div class="ent-layout-up">
+				<div class="b-com-title">
+					<span class="glyphicon jianzhu"></span>变更信息
+				</div>
+				<div class="b-com-content">
+				{{if gt (len .T.res.alterInfo) 0}}
+					<ul>
+					{{range $k,$v := .T.res.alterInfo}}
+						<li>
+							<div>
+								<div><script>document.write(new Date(Number({{$v.AltDate}})).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
+								<div>{{$v.AltItemName}}</div>
+								<div>变更前:{{$v.AltBe}}<br>变更后:{{$v.AltAf}}</div>
+								<a></a>
+							</div>
+							<div>
+								<div><script>document.write(new Date(Number({{$v.AltDate}})).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
+								<div>{{$v.AltItemName}}</div>
+								<div>变更前:{{$v.AltBe}}<br>变更后:{{$v.AltAf}}</div>
+								<a></a>
+							</div>
+						</li>
+					{{end}}
+						<li>
+							<div></div>
+							<div>
+								<a></a>
+							</div>
+						</li>
+						<div class="clearfix"></div>
+					</ul>
+				{{else}}
+					<div class="ent-findnull">
+						<img src="/images/findnull.png" class="b-findnull">
+						<h4>抱歉,未找到相关数据!</h4>
+					</div>
+				{{end}}
+				</div>
+			</div>
 		</div>
 		<div class="hide">
 			<div class="ent-findnull">
@@ -313,12 +351,16 @@
 				<h4>抱歉,未找到相关数据!</h4>
 			</div>
 		</div>
-		<div class="ent-service">
+		<div class="hide ent-service">
 			<table class="table ent-table" id="serviceList">
 				<tr>
-					<td colspan="5" class="text-center" id="myAppointmentPaging"></td>
+					<td colspan="4" class="text-center" id="serviceListPaging"></td>
 				</tr>
 			</table>
+			<div class="ent-findnull hide">
+				<img src="/images/findnull.png" class="b-findnull">
+				<h4>抱歉,未找到相关数据!</h4>
+			</div>
 		</div>
 		<div class="hide">
 			<div class="ent-findnull">

+ 1 - 1
credit/src/qfw/creditrpc/creditrpc.go

@@ -281,7 +281,7 @@ func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
 			creditDoc["i_givestatus"] = 0
 		}
 		if creditlog.Save(creditDoc) {
-			*replay = 1
+			*replay = creditDoc["i_score"].(int)
 			//发送微信通知扣积分成功
 			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)