Forráskód Böngészése

Merge branch 'release_1.3_20160104'

liumiaomiao 9 éve
szülő
commit
b8ff5c089a
68 módosított fájl, 1690 hozzáadás és 1972 törlés
  1. 2 1
      .gitignore
  2. 2 2
      common/src/qfw/util/elastic/elasticutil_test.go
  3. 3 0
      common/src/qfw/util/mongodb/mongodbutil.go
  4. 6 2
      common/src/qfw/util/redis/redisutil.go
  5. 4 0
      core/src/qfw/front/index.go
  6. 3 1
      core/src/qfw/front/wxpush.go
  7. 1 0
      core/src/qfw/member/member.go
  8. 77 4
      core/src/qfw/member/membermanager.go
  9. 0 1
      core/src/qfw/member/message/message.go
  10. 0 96
      core/src/qfw/member/message/messagedetail.go
  11. 8 0
      core/src/qfw/member/message/swordfish.go
  12. 1 0
      core/src/qfw/mobile/mobile.go
  13. 13 1
      core/src/qfw/mobile/wxmenu.go
  14. 2 1
      core/src/qfw/search/searchService.go
  15. 7 1
      core/src/qfw/swordfish/swordfish.go
  16. 0 23
      core/src/qfw/swordfish/swordfishService.go
  17. 141 0
      core/src/qfw/swordfish/swordfishmanage.go
  18. 21 9
      core/src/qfw/yellowpage/yellowpagemanager.go
  19. 1 1
      core/src/timetask.json
  20. 15 11
      core/src/web/staticres/css/dev-qfw.css
  21. 12 0
      core/src/web/staticres/css/qfw.css
  22. 182 34
      core/src/web/staticres/css/swordfish.css
  23. BIN
      core/src/web/staticres/fonts/qimingxing.eot
  24. 3 0
      core/src/web/staticres/fonts/qimingxing.svg
  25. BIN
      core/src/web/staticres/fonts/qimingxing.ttf
  26. BIN
      core/src/web/staticres/fonts/qimingxing.woff
  27. BIN
      core/src/web/staticres/images/swordfish/guide-1.png
  28. BIN
      core/src/web/staticres/images/swordfish/guide-3.png
  29. BIN
      core/src/web/staticres/images/swordfish/guide-4.png
  30. BIN
      core/src/web/staticres/images/swordfish/guide-5.png
  31. 30 6
      core/src/web/staticres/js/qfw.js
  32. 0 14
      core/src/web/staticres/microwebsite/swiper/swiper.min.js
  33. 0 0
      core/src/web/staticres/swiper/maps/swiper.jquery.min.js.map
  34. 0 0
      core/src/web/staticres/swiper/maps/swiper.min.js.map
  35. 0 0
      core/src/web/staticres/swiper/swiper.min.css
  36. 14 0
      core/src/web/staticres/swiper/swiper.min.js
  37. BIN
      core/src/web/staticres/wxrssset/images/up.png
  38. 20 13
      core/src/web/staticres/wxrssset/main.js
  39. 172 9
      core/src/web/staticres/wxrssset/style.css
  40. 1 1
      core/src/web/templates/active/promotion_201512.html
  41. 1 1
      core/src/web/templates/active/promotion_201512_e.html
  42. 2 33
      core/src/web/templates/common/head.html
  43. 60 85
      core/src/web/templates/common/login.html
  44. 1 1
      core/src/web/templates/common/memberleft.html
  45. 109 18
      core/src/web/templates/common/swordfishhead.html
  46. 59 1
      core/src/web/templates/member/accountset/bindmail.html
  47. 0 294
      core/src/web/templates/member/message/rssset20151230.html
  48. 0 122
      core/src/web/templates/member/message/swordfish.html
  49. 0 400
      core/src/web/templates/member/message/wxrssset - 副本.html
  50. 0 405
      core/src/web/templates/member/message/wxrssset20151224.html
  51. 2 2
      core/src/web/templates/microwebsite/blue/index.html
  52. 2 2
      core/src/web/templates/microwebsite/colorful/index.html
  53. 2 2
      core/src/web/templates/microwebsite/geenleaf/index.html
  54. 2 2
      core/src/web/templates/microwebsite/universe/index.html
  55. 87 0
      core/src/web/templates/swordfish/index.html
  56. 35 45
      core/src/web/templates/swordfish/infolist.html
  57. 76 80
      core/src/web/templates/swordfish/rssset.html
  58. 0 53
      core/src/web/templates/swordfish/swordfish.html
  59. 79 0
      core/src/web/templates/swordfish/wxindex.html
  60. 1 1
      core/src/web/templates/swordfish/wxrssset.html
  61. 18 17
      core/src/web/templates/wxpush/index.html
  62. 17 12
      push/src/qfw/push/bid/bidpushjob.go
  63. 17 13
      push/src/qfw/push/tender/tenderpushjob.go
  64. 0 4
      weixin/src/config.json
  65. 11 35
      weixin/src/qfw/weixin/menu.go
  66. 21 0
      weixin/src/qfw/weixin/rpc/jssdk.go
  67. 4 52
      weixin/src/qfw/weixin/rpc/rpc.go
  68. 343 61
      weixin/src/qfw/weixin/weixinsdk.go

+ 2 - 1
.gitignore

@@ -4,4 +4,5 @@
 */staticres/upload
 */src/src
 *.data
-*/timetask.json
+*/timetask.json
+core/src/timetask.json

+ 2 - 2
common/src/qfw/util/elastic/elasticutil_test.go

@@ -180,6 +180,6 @@ func Test_first(t *testing.T) {
 
 func Test_date(t *testing.T) {
 	//"1448267541"
-	time.Now()
-	log.Println(time.Now().Unix())
+	s := time.Now().UnixNano()
+	log.Println(s, time.Now().Unix(), fmt.Sprintf("%d", s)[4:12], 999999/60/60)
 }

+ 3 - 0
common/src/qfw/util/mongodb/mongodbutil.go

@@ -188,6 +188,7 @@ func SaveBulk(c string, doc ...map[string]interface{}) bool {
 	b := true
 	if sess != nil {
 		defer func() {
+			b = false
 			if r := recover(); r != nil {
 				log.Println("[E]", r)
 				for skip := 1; ; skip++ {
@@ -210,6 +211,8 @@ func SaveBulk(c string, doc ...map[string]interface{}) bool {
 			log.Println("BulkError", err)
 			b = false
 		}
+	} else {
+		b = false
 	}
 	return b
 }

+ 6 - 2
common/src/qfw/util/redis/redisutil.go

@@ -16,12 +16,16 @@ var RedisPool map[string]*redigo.Pool
 
 //初始化redis 1为多个连接池,2为共用一个连接池
 func InitRedis(addrs string) {
+	InitRedisBySize(addrs, 1000, 500, 240)
+}
+
+func InitRedisBySize(addrs string, maxSize, maxIdle, timeout int) {
 	RedisPool = map[string]*redigo.Pool{}
 	addr := strings.Split(addrs, ",")
 	for _, v := range addr {
 		saddr := strings.Split(v, "=")
-		RedisPool[saddr[0]] = &redigo.Pool{MaxActive: 1000, MaxIdle: 800,
-			IdleTimeout: 240 * time.Second, Dial: func() (redigo.Conn, error) {
+		RedisPool[saddr[0]] = &redigo.Pool{MaxActive: maxSize, MaxIdle: maxIdle,
+			IdleTimeout: time.Duration(timeout) * time.Second, Dial: func() (redigo.Conn, error) {
 				c, err := redigo.Dial("tcp", saddr[1])
 				if err != nil {
 					return nil, err

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

@@ -83,6 +83,10 @@ func (i *Index) GetWebSiteTop() error {
 		if userId := i.GetSession("userId"); userId != nil {
 			result["msgCount"] = msg.GetMsgCount(userId.(string))
 		}
+		userInfo := i.GetSession("userInfo").(*map[string]interface{})
+		if avatar := (*userInfo)["s_avatar"]; avatar != nil {
+			result["avatar"] = avatar.(string)
+		}
 		if audittype := i.GetSession("audittype"); audittype != nil && audittype == "y" {
 			i.DelSession("audittype")
 			result["auditType"] = audittype.(string)

+ 3 - 1
core/src/qfw/front/wxpush.go

@@ -16,10 +16,12 @@ type Wxpush struct {
 
 //推送列表
 func (w *Wxpush) WxpushList(s_m_openid string, _id string, msgid string) error {
+	/**
 	go func() {
 		mongodb.Update("message", `{"_id":"`+msgid+`"}`, `{"$set":{"i_status":1}}`, false, false)
 	}()
-	w.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1}`)
+	**/
+	w.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1,"s_type":1}`)
 	w.T["_id"] = _id
 	return w.Render("/wxpush/index.html", &w.T)
 }

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

@@ -33,6 +33,7 @@ type Member struct {
 	delLog             xweb.Mapper `xweb:"/mermber/delLog"`                    //删除日志
 	sendYearIdentCode  xweb.Mapper `xweb:"/front/sendYearIdentCode"`           //发送认证年报邮箱验证码
 	checkYearIdentCode xweb.Mapper `xweb:"/front/checkYearIdentCode"`          //验证输入的验证码
+	checkConMail       xweb.Mapper `xweb:"/member/accountset/checkConMail"`    //验证输入的邮箱是否是没认证的企业邮箱
 	//weixinCallBack     xweb.Mapper `xweb:"/weixinCallBack"`                    //微信授权后的回调地址
 	//qqCallBack         xweb.Mapper `xweb:"/qqCallBack"`                        //QQ授权后的回调地址
 }

+ 77 - 4
core/src/qfw/member/membermanager.go

@@ -79,13 +79,15 @@ func (m *Member) PromotionPage(v string) error {
 
 //自动审核通过
 func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
-	ent := FindById("enterprise", entid, `{"RegNo":1,"EntName":1,"s_action":1}`)
+	ent := FindById("enterprise", entid, `{"RegNo":1,"EntName":1,"s_action":1,"Nb_email":1}`)
 	if ent != nil {
 		s_action := ObjToString((*ent)["s_action"])
 		if len(s_action) == 2 { //已经认证过
 			return
 		}
+		fmt.Println("222222222222222222222", s_action)
 		entName := ObjToString((*ent)["EntName"])
+		email := ObjToString((*ent)["Nb_email"])
 		t := time.Now().Local().Unix()
 		doc := &map[string]interface{}{
 			"i_identificationway": 1,
@@ -96,11 +98,13 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
 			"s_submitname":           uname,
 			"s_submitid":             uid,
 			"s_enterprisename":       entName,
+			"s_enterpriseid":         entid,
 			"i_identificationstatus": 1,
 			"i_identificationtype":   1,
 			"s_piccard":              "",
 			"s_pic":                  "",
 			"l_submitdate":           t,
+			"s_mail":                 email,
 			"i_comauthenttype":       3,
 			"l_auditdate":            t,
 			"s_promotion":            promotion_id,
@@ -114,6 +118,7 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
 			data1["freezeremark"] = ""
 			data1["s_enterprisename"] = entName
 			data1["s_enterpriseid"] = entid
+			data1["i_comauthenttype"] = 3
 			data1["i_identificationway"] = 1 //user表默认=0,审核通过标志=1,审核不通过标志=-1,审核中标志=2
 			data1["i_identificationtype"] = 1
 			data1["s_role"] = "9" //权限设为企业管理员
@@ -142,7 +147,7 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
 					})
 				}, func(e interface{}) {})
 
-				Update("enterprise", `{"_id":"`+entid+`"}`, `{'$set':{'s_action':'01','s_avatar':'`+s_avatar+`'}}`, false, false)
+				Update("enterprise", `{"_id":"`+entid+`"}`, `{'$set':{'s_action':'01','s_avatar':'`+s_avatar+`','s_submitid':'`+uid+`'}}`, false, false)
 				elastic.UpdateEntDoc(entid)
 				redis.Del("enterprise", "enterpriseInfo_"+entid, "enterpriseInfo_user_"+entid)
 			}()
@@ -784,11 +789,45 @@ func (m *Member) Setpwd() error {
 	}
 }
 
+//
+
+//验证输入的邮箱是否是没认证的企业邮箱
+func (m *Member) CheckConMail() error {
+	//userId := m.GetSession("userId").(string)
+	var smail = m.GetString("checkmail")
+	var EntName = ""
+	var ac = ""
+	var id = ""
+	var uname = ""
+	var s_avatar = ""
+	pk := "1"
+	r := *FindOne("enterprise", M{"Nb_email": smail})
+	if len(r) > 0 {
+		ac = ObjToString(r["s_action"])
+		if ac == "" {
+			EntName = r["EntName"].(string)
+			uname = m.GetSession("loginName").(string)
+			s_avatar = ObjToString(r["s_avatar"])
+			pk = "2"
+			id = strings.Split(fmt.Sprintf("%s", r["_id"]), `"`)[1]
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"pk":       pk,
+		"EntName":  EntName,
+		"id":       id,
+		"uname":    uname,
+		"s_avatar": s_avatar,
+	})
+	return nil
+
+}
+
 //绑定邮箱
 func (m *Member) Bindmail() error {
 	if m.Is("POST") {
 		var status string = "y"
-		var result, encryMail, isSetPwd string
+		var result, encryMail, isSetPwd, contype string
 		var count int
 		flag, _ := m.GetInt("flag")
 		mail := m.GetString("mail")
@@ -815,6 +854,16 @@ func (m *Member) Bindmail() error {
 			}
 		case 2: //校验验证码
 			if m.GetString("identCode") == m.GetSession("identCodeValue") {
+				//
+				contype = m.GetString("i_automatic")
+				entid := m.GetString("entid")
+				entname := m.GetString("entname")
+				avatar := m.GetString("avatar")
+				uname := m.GetString("uname")
+				usid := m.GetSession("userId").(string)
+				t := time.Now().Unix()
+				proid := fmt.Sprintf("%s", t)
+				//
 				m.DelSession("identCodeValue")
 				updateMap := make(M)
 				updateMap["s_email"] = mail
@@ -824,6 +873,30 @@ func (m *Member) Bindmail() error {
 				}
 				bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": updateMap}, false, false)
 				if bol {
+					//邮箱绑定认证
+					if contype == "1" {
+						r := *FindById("enterprise", entid, nil)
+						ac := ObjToString(r["s_action"])
+						if len(r) > 0 && ac == "" {
+							autoAuth(usid, uname, avatar, entid, proid)
+							//发系统消息
+							msg := &msg.Msg{
+								Msgtype:   1,
+								Title:     "年报邮箱绑定认证",
+								Content:   "您好,恭喜您的邮箱绑定并同时认证已经通过!",
+								ReceiveId: usid,
+							}
+							msg.SaveMsg()
+							//更改需求名称
+							Update("demand", M{"s_userid": usid}, M{"$set": M{"s_enterprisename": entname, "s_enterpriseid": entid, "i_identtype": 1}}, false, true)
+							demands := *Find("demand", M{"s_userid": usid}, nil, nil, false, -1, -1)
+							if demands != nil && len(demands) > 0 {
+								Try(func() {
+									elastic.UpdateNewDoc("demand", "demand", MapArrToObjArr(demands)...)
+								}, func(e interface{}) {})
+							}
+						}
+					}
 					UpdateCookieSession(m.Action, m.GetSession("loginType").(string), false, *FindById("user", m.GetSession("userId").(string), nil))
 					result = "y"
 				} else {
@@ -833,7 +906,7 @@ func (m *Member) Bindmail() error {
 				status = "identCode_error" //验证码错误
 			}
 		}
-		return m.Write(`{"flag":` + strconv.Itoa(int(flag+1)) + `,"status":"` + status + `","result":"` + result + `","encryMail":"` + encryMail + `","isSetPwd":"` + isSetPwd + `","count":` + strconv.Itoa(count) + `}`)
+		return m.Write(`{"flag":` + strconv.Itoa(int(flag+1)) + `,"status":"` + status + `","result":"` + result + `","encryMail":"` + encryMail + `","isSetPwd":"` + isSetPwd + `","contype":"` + contype + `","count":` + strconv.Itoa(count) + `}`)
 	} else {
 		return returnFront(m, "bindmail")
 	}

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

@@ -10,5 +10,4 @@ import (
 
 func init() {
 	xweb.AddAction(&message{})
-	xweb.AddAction(&swordfish{})
 }

+ 0 - 96
core/src/qfw/member/message/messagedetail.go

@@ -14,118 +14,22 @@ import (
 	"qfw/util"
 	"qfw/util/mongodb"
 	"qfw/util/msg"
-	"runtime"
 	"strings"
 	"time"
 )
 
 type message struct {
 	*xweb.Action
-	//memberIndexMsg xweb.Mapper `xweb:"/member/memberindexmsg"` //会员中心首页
 	msgCenter      xweb.Mapper `xweb:"/member/msgcenter"`      //消息中心
 	getMsgList     xweb.Mapper `xweb:"/member/getmsglist"`     //ajax获取消息列表
 	msgSet         xweb.Mapper `xweb:"/member/msgset"`         //消息设置
 	getMsgById     xweb.Mapper `xweb:"/member/getmsgbyid"`     //获取消息内容
 	msgDel         xweb.Mapper `xweb:"/member/msgdel"`         //删除消息
 	msgFlag        xweb.Mapper `xweb:"/member/msgflag"`        //标记消息
-	swordfish      xweb.Mapper `xweb:"/member/swordfish"`      //剑鱼
-	ajaxReq        xweb.Mapper `xweb:"/member/rssset/ajaxReq"` //订阅消息设置
-	rssSet         xweb.Mapper `xweb:"/member/rssset"`         //订阅消息设置
-	infolist       xweb.Mapper `xweb:"/member/infolist"`       //剑鱼
 	getCahtContent xweb.Mapper `xweb:"/member/getchatcontent"` //获取聊天内部数组内容
 	goCahtContent  xweb.Mapper `xweb:"/member/gochatcontent"`  //已登陆客户发送离线消息
 }
 
-//跳转到用户中心剑鱼首页
-func (m *message) Swordfish() error {
-	r := mongodb.Find("wxpush", `{"s_uid":"`+m.GetSession("userId").(string)+`"}`, `{"l_date":-1}`, `{"s_content":1,"a_publishtime":1,"a_visitedindex":1}`, false, 0, 1)
-	if r != nil && len(*r) == 1 {
-		(*r)[0]["_id"] = strings.Split(fmt.Sprintf("%s", (*r)[0]["_id"]), `"`)[1]
-		m.T["data"] = (*r)[0]
-	}
-	return m.Render("/member/message/swordfish.html", &m.T)
-}
-
-//跳转到订阅设置页面
-func (m *message) RssSet() error {
-	defer func() {
-		if r := recover(); r != nil {
-			log.Println("[E]", r)
-			for skip := 0; ; skip++ {
-				_, file, line, ok := runtime.Caller(skip)
-				if !ok {
-					break
-				}
-				go log.Printf("%v,%v\n", file, line)
-			}
-		}
-	}()
-	userId := m.Session().Get("userId")
-	if userId != nil {
-		u := mongodb.FindById("user", userId.(string), `{"o_msgset":1}`)
-		m.T["msgset"] = (*u)["o_msgset"]
-	}
-	//u := m.Session().Get("userInfo")
-	//userInfo := u.(*map[string]interface{})
-	/*entid := m.GetSession("entid")
-	if entid != nil {
-		local := mongodb.FindById("enterprise", entid.(string), `{"_id":0,"OpLocDistrict":1,"i_province":1}`)
-		if local != nil {
-			localids := (*local)["OpLocDistrict"]
-			i_province := (*local)["i_province"]
-			if localids != nil {
-				localid := localids.(string)
-				localid = localid[:2]
-				m.T["scode"] = localid
-				m.T["sname"] = consts.SRcode[localid]
-			} else if i_province != nil {
-				area := fmt.Sprintf("%d", i_province)
-				if len(area) > 1 {
-					area = area[:2]
-					m.T["scode"] = area
-					m.T["sname"] = consts.SRcode[area]
-				}
-			}
-		}
-
-	}*/
-	return m.Render("/member/message/rssset.html", &m.T)
-}
-func (m *message) AjaxReq() error {
-	var flag = "n"
-	msgset := make(map[string]interface{})
-	//投标公告
-	if tender_flag, _ := m.GetBool("tender_flag"); tender_flag {
-		tender := make(map[string]interface{})
-		tender["a_key"] = m.GetSlice("tender_keys")
-		tender["s_scope"] = m.GetString("tender_scope")
-		msgset["tender"] = tender
-	}
-	//中标公告
-	if bid_flag, _ := m.GetBool("bid_flag"); bid_flag {
-		bid := make(map[string]interface{})
-		bid["a_key"] = m.GetSlice("bid_keys")
-		bid["s_scope"] = m.GetString("bid_scope")
-		msgset["bid"] = bid
-	}
-	//更新数据库
-	msgset["l_modifydate"] = time.Now().Unix()
-	if mongodb.Update("user", `{"_id":"`+m.GetSession("userId").(string)+`"}`, &map[string]interface{}{"$set": map[string]interface{}{"o_msgset": msgset}}, false, false) {
-		flag = "y"
-	}
-	m.ServeJson(map[string]interface{}{
-		"flag": flag,
-	})
-	return nil
-}
-
-//跳转到用户中心剑鱼信息列表
-func (m *message) Infolist() error {
-	ms := mongodb.FindById("user", m.GetSession("userId").(string), `{"o_msgset:1"}`)
-	m.T["msgset"] = ms
-	return m.Render("/member/message/infolist.html", &m.T)
-}
-
 //删除消息
 func (m *message) MsgDel() error {
 	ids := m.GetString("ids")

+ 8 - 0
core/src/qfw/member/message/swordfish.go

@@ -17,6 +17,14 @@ type swordfish struct {
 	*xweb.Action
 	swordfishlist xweb.Mapper `xweb:"/member/message/swordfishlist"` //剑鱼列表
 	setVisited    xweb.Mapper `xweb:"/member/message/setVisited"`    //已经访问过的列表
+	visitRedirect xweb.Mapper `xweb:"/visit/redirect"`               //剑鱼跳转访问请求,后续统计
+}
+
+func (s *swordfish) VisitRedirect() {
+	surl := s.GetString("url")
+	if surl != "" {
+		s.Redirect(surl)
+	}
 }
 
 func (s *swordfish) SetVisited() {

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

@@ -10,6 +10,7 @@ type Mobile struct {
 	search     xweb.Mapper `xweb:"/ent/(.*)/search"`
 	detail     xweb.Mapper `xweb:"/ent/(.*)/detail/(.*)/(.*)"`
 	pageerror  xweb.Mapper `xweb:"/ent/(.*)/505"`
+	guide      xweb.Mapper `xweb:"/swordfish/guide"`
 	wxrssset   xweb.Mapper `xweb:"/swordfish/page"`
 	msgSet     xweb.Mapper `xweb:"/swordfish/msgpushsetting/msgset"`
 	ajaxReq    xweb.Mapper `xweb:"/swordfish/ajaxReq"`

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

@@ -18,6 +18,10 @@ func init() {
 	se = util.SimpleEncrypt{Key: "topnet"}
 }
 
+func (m *Mobile) Guide() error {
+	return m.Render("/swordfish/wxindex.html")
+}
+
 func (m *Mobile) Wxrssset() error {
 	defer func() {
 		if r := recover(); r != nil {
@@ -33,6 +37,14 @@ func (m *Mobile) Wxrssset() error {
 	}()
 	if m.Session().Get("userId") != nil {
 		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")
+		}
 		m.T["msgset"] = (*userInfo)["o_msgset"]
 		entid := util.ObjToString((*userInfo)["s_enterpriseid"])
 		if entid != "" {
@@ -52,7 +64,7 @@ func (m *Mobile) Wxrssset() error {
 			}
 		}
 		//m.T["mid"] = openid
-		return m.Render("/member/message/wxrssset.html", &m.T)
+		return m.Render("/swordfish/wxrssset.html", &m.T)
 	} else {
 		return m.Render("_err.html")
 	}

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

@@ -338,7 +338,8 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 	          "match": {
 	            "enterprise.EntName": {
 	              "query":"` + keyword + `",
-	              "operator": "and"
+	              "operator": "and",
+				  "boost":2
 	            }
 	          }
 	        },

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

@@ -9,7 +9,13 @@ import (
 
 type SwordFish struct {
 	*xweb.Action
-	showSwordFish xweb.Mapper `xweb:"/show/swordfish/fish"` //剑鱼展示页
+	swordfish     xweb.Mapper `xweb:"/front/swordfish"`                 //剑鱼
+	ajaxReq       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"`                  //剑鱼跳转访问请求,后续统计
 }
 
 func init() {

+ 0 - 23
core/src/qfw/swordfish/swordfishService.go

@@ -1,23 +0,0 @@
-package swordfish
-
-import (
-	"net/http"
-	util "qfw/util"
-)
-
-//企业列表
-func (sf *SwordFish) ShowSwordFish() error {
-	//必须是登录之后的已认证用户才可以进入企业社区
-	if sf.GetSession("userId") != nil {
-		utype := util.IntAll(sf.GetSession("userType"))
-		if utype == 0 {
-			return sf.Redirect("/manage/system", http.StatusFound)
-		} else {
-			return sf.Redirect("/member/swordfish", http.StatusFound)
-		}
-	} else {
-		//必须是注册登录之后的用户才可以进入剑鱼页面
-		return sf.Render("/swordfish/swordfish.html")
-	}
-
-}

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

@@ -0,0 +1,141 @@
+package swordfish
+
+import (
+	"gopkg.in/mgo.v2/bson"
+	"qfw/util/mongodb"
+	"qfw/util/redis"
+	"time"
+)
+
+//跳转到用户中心剑鱼首页
+func (s *SwordFish) Swordfish() error {
+	if ret := redis.Get("other", "swordfish"); ret != nil {
+		return s.SetBody([]byte(ret.(string)))
+	} else {
+		now := time.Now()
+		unix := time.Date(now.Year(), now.Month(), now.Day(), now.Hour()-2, now.Minute(), now.Second(), now.Nanosecond(), time.Local).Unix()
+		r := mongodb.Find("bidding", bson.M{"comeintime": bson.M{"$lte": unix}}, `{"comeintime":-1}`, `{"title":1,"href":1,"publishtime":1}`, false, 0, 5)
+		if r != nil {
+			s.T["data"] = r
+		}
+		content, _ := s.Render4Cache("/swordfish/index.html", &s.T)
+		redis.Put("other", "swordfish", string(content), 30*60*1000) //缓存半个小时
+		return s.SetBody(content)
+	}
+}
+
+//跳转到订阅设置页面
+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) AjaxReq() error {
+	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":"`+s.GetSession("userId").(string)+`"}`, &map[string]interface{}{"$set": map[string]interface{}{"o_msgset": msgset}}, false, false) {
+		flag = "y"
+	}
+	s.ServeJson(map[string]interface{}{
+		"flag": flag,
+	})
+	return nil
+}
+
+//跳转到用户中心剑鱼信息列表
+func (s *SwordFish) Infolist() error {
+	ms := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset:1"}`)
+	s.T["msgset"] = ms
+	return s.Render("/swordfish/infolist.html", &s.T)
+}
+func (s *SwordFish) SetVisited() {
+	sid := s.GetSession("userId").(string)
+	index, _ := s.GetInt("index")
+	_id := s.GetString("_id")
+	if sid != "" {
+		mongodb.Update("wxpush", `{"_id":"`+_id+`"}`, map[string]interface{}{
+			"$push": map[string]interface{}{"a_visitedindex": index},
+		}, false, false)
+	}
+}
+
+//取个人的剑鱼列表,返回时间和数组,数组中的每条是一个大数据包含多条,编号要重新编号,每条数据有count值
+func (s *SwordFish) Swordfishlist() error {
+	lasttime, _ := s.GetInt("lasttime")
+	sid := s.GetSession("userId").(string) //"56177ce036b82b0f04000001"
+	res := map[string]interface{}{}
+	res["success"] = false
+	if lasttime > 0 {
+		if lasttime == 1 {
+			lasttime = time.Now().Local().Unix()
+		}
+		thistime, list := getSwordFish(lasttime, sid, nil, 0)
+		if list != nil && len(*list) > 0 {
+			res["success"] = true
+			res["data"] = &list
+			res["thistime"] = thistime
+		}
+	}
+	s.ServeJson(&res)
+	return nil
+}
+
+//内部调用方法,取剑鱼消息列表,数量小于20继续取数
+func getSwordFish(lasttime int64, sid string, res []map[string]interface{}, count int) (thistime int64, list *[]map[string]interface{}) {
+	thistime = lasttime
+	if res == nil {
+		res = make([]map[string]interface{}, 0)
+	}
+	list = &res
+	tmps := mongodb.Find("wxpush", &map[string]interface{}{
+		"s_uid": sid,
+		"a_publishtime": map[string]interface{}{
+			"$exists": true,
+		},
+		"l_date": map[string]interface{}{
+			"$lt": lasttime,
+		},
+	}, `{"l_date":-1}`, nil, false, 0, 1)
+	if (*tmps) != nil && len(*tmps) == 1 && (*tmps)[0] != nil {
+		tmp := (*tmps)[0]
+		at := tmp["a_publishtime"]
+		if at != nil {
+			ats := at.(map[string]interface{})
+			thistime = tmp["l_date"].(int64)
+			count += len(ats)
+			tmp["count"] = len(ats)
+			res = append(res, tmp)
+			list = &res
+			if count >= 1 {
+				return
+			}
+		} else {
+			return
+		}
+	} else {
+		return
+	}
+	return getSwordFish(thistime, sid, res, count)
+}
+func (s *SwordFish) VisitRedirect() {
+	surl := s.GetString("url")
+	if surl != "" {
+		s.Redirect(surl)
+	}
+}

+ 21 - 9
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -181,7 +181,7 @@ func selectById(id string) *map[string]interface{} {
 
 //查找指定id的企业关系,并加入到结果集中,
 //递归查找关系
-func findRelation(certype, cerno, rtype string, level int, ls *list.List, sess *mgo.Session, querycache *list.List) {
+func findRelation(certype, cerno, name, rtype string, level int, ls *list.List, sess *mgo.Session, querycache *list.List) {
 	if level >= cf.SysConfig.Entrelation.Level {
 		return
 	}
@@ -198,32 +198,44 @@ func findRelation(certype, cerno, rtype string, level int, ls *list.List, sess *
 			invtype, _ := (*data)["invtype"].(string)
 			invcertype, _ := (*data)["invcertype"].(string)
 			invcerno, _ := (*data)["invcerno"].(string)
+			var invname string
+			if (*data)["invname"] != nil {
+				invname = (*data)["invname"].(string)
+			}
 			storeNode(data, ls, true, level)
-			findRelation(invcertype, invcerno, invtype, level+1, ls, sess, querycache)
+			findRelation(invcertype, invcerno, invname, invtype, level+1, ls, sess, querycache)
 		}
 		//查找我投资的公司
-		querykey2 := "invtype:e,invcerno:" + cerno
+		querykey2 := "invtype:e,invcerno:" + cerno + ",invname:" + name
 		if isContainInQueryCache(querykey2, querycache) {
 			return
 		}
-		iter = sess.DB("qfw").C("entrelation").Find(M{"invtype": "e", "invcerno": cerno}).Limit(cf.SysConfig.Entrelation.Limit).Iter()
+		iter = sess.DB("qfw").C("entrelation").Find(M{"invtype": "e", "invcerno": cerno, "invname": name}).Limit(cf.SysConfig.Entrelation.Limit).Iter()
 		for iter.Next(data) {
 			entregno, _ := (*data)["entregno"].(string)
 			storeNode(data, ls, false, level)
-			findRelation("", entregno, "e", level+1, ls, sess, querycache)
+			var entname string
+			if (*data)["entname"] != nil {
+				entname = (*data)["entname"].(string)
+			}
+			findRelation("", entregno, entname, "e", level+1, ls, sess, querycache)
 		}
 	} else {
 		//找出我投资的公司
-		querykey := "invcertype:" + certype + ",invcerno:" + cerno
+		querykey := "invcertype:" + certype + ",invcerno:" + cerno + ",invname:" + name
 		if isContainInQueryCache(querykey, querycache) {
 			return
 		}
-		iter := sess.DB("qfw").C("entrelation").Find(M{"invcertype": certype, "invcerno": cerno}).Limit(cf.SysConfig.Entrelation.Limit).Iter()
+		iter := sess.DB("qfw").C("entrelation").Find(M{"invcertype": certype, "invcerno": cerno, "invname": name}).Limit(cf.SysConfig.Entrelation.Limit).Iter()
 		data := new(map[string]interface{})
 		for iter.Next(data) {
 			entregno, _ := (*data)["entregno"].(string)
+			var entname string
+			if (*data)["entname"] != nil {
+				entname = (*data)["entname"].(string)
+			}
 			storeNode(data, ls, false, level)
-			findRelation("", entregno, "e", level+1, ls, sess, querycache)
+			findRelation("", entregno, entname, "e", level+1, ls, sess, querycache)
 		}
 	}
 }
@@ -283,7 +295,7 @@ func makeRelation(mnregno, mnname string) interface{} {
 
 	ls := list.New()
 	querycache := list.New()
-	findRelation("", mnregno, "e", 0, ls, sess, querycache)
+	findRelation("", mnregno, mnname, "e", 0, ls, sess, querycache)
 
 	node := map[string]interface{}{}
 	//加主节点

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":10,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2015-12-31 18:51:13"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2015-12-31 18:51:13"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":10,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-05 17:12:57"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-05 17:12:57"}},"marketisstart":true,"marketrate":300}

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

@@ -439,12 +439,16 @@ a{
 	color: #dd4814;
 }
 
-.a-header .a-loginStatus{
+.a-header .loginStatus{
 	width: 15%;
 	font-size: 14px;
 }
 
-.a-header .a-loginStatus>a {
+.loginStatus{
+	position: relative;
+}
+
+.loginStatus>a {
 	text-overflow: ellipsis;
 	overflow: hidden;
 	white-space: nowrap;
@@ -453,50 +457,50 @@ a{
 	margin-left: 5px;
 }
 
-.a-loginStatus .badge {
+.loginStatus .badge {
 	background-color: #dd4814;
 	margin-left: 10px;
 	font-weight: normal;
 }
 
-.a-header .a-loginStatus>.badge {
+.loginStatus>.badge {
 	position: absolute;
   	right: 15px;
   	top: 15px;
 }
 
-.a-header .a-loginStatus li {
+.loginStatus li {
 	width: 100%;
 }
 
-.a-header .a-loginStatus .popover-content {
+.loginStatus .popover-content {
 	padding: 0px;
 }
 
-.a-header .a-loginStatus li a {
+.loginStatus li a {
 	display: block;
 	padding: 5px 20px;
 	color: #333;
 	white-space: nowrap;
 }
 
-.a-header .a-loginStatus .popover {
+.loginStatus .popover {
 	padding: 0px;
 }
 
-.a-header .a-loginStatus li a:hover {
+.loginStatus li a:hover {
 	background-color: #dd4814;
 	text-decoration: none;
 	color: #fff;
 }
 
-.a-header .a-loginStatus .dropdown-menu {
+.loginStatus .dropdown-menu {
 	min-width: 100px;
 	left: -90px;
 	top: 15px;
 }
 
-.a-header .a-loginStatus .dropdown-menu>li>a {
+.loginStatus .dropdown-menu>li>a {
 	padding-right: 10px;
 	padding-left: 10px;
 }

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

@@ -873,6 +873,18 @@ span.highlight {
 	content: "\61";
 }
 
+.tuichu:before {
+	content: "\2A";
+}
+
+.youjian1:before {
+	content: "\2C";
+}
+
+.ren1:before {
+	content: "\2B";
+}
+
 .icon-small {
 	font-size: 12px;
 }

+ 182 - 34
core/src/web/staticres/css/swordfish.css

@@ -3,24 +3,108 @@ body{
 	background-color: #F0F0F0;
 }
 .logo{
-	width: 161px;
-	height: 68px;
+	width: 156px;
+	height: 66px;
 }
 a:focus, a:hover{
 	color: #37C6DA !important;
 }
+.round-dot{
+	background-color: #37C6DA;
+	width: 6px;
+	height: 6px;
+	border-radius: 50%;
+	position: absolute;
+	display: block;
+	top: 0px;
+}
 /********剑鱼********/
 .swordfish-head{
 	box-shadow: 0px 2px 2px #F4F4F4;
 }
+.swordfish-head .swordfish-loginStatus{
+	padding: 0px 15px;
+	position: relative;
+}
+.swordfish-head .swordfish-loginStatus:hover{
+	background-color: #F7F9FB;
+}
+.swordfish-head .swordfish-loginStatus:hover>a{
+	color: inherit !important;
+}
+.swordfish-head .swordfish-loginStatus>span{
+	position: relative;
+	display: inline-block;
+}
+.swordfish-head .swordfish-loginStatus>span .round-dot{
+	right: 5px;
+	width: 8px;
+	height: 8px;
+}
+.swordfish-head .swordfish-loginStatus>a{
+	display: inline-block;
+	position: relative;
+}
+.swordfish-head .head-hideMenu{
+	display: none;
+	position: absolute;
+	width: 120px;
+	left: 50%;
+	margin-left: -60px;
+}
+.swordfish-head .head-hideMenu ul{
+	background-color: #F7F9FB;
+	box-shadow: 0 5px 10px rgba(0,0,0,.2);
+	margin-top: 1px;
+	float: left;
+}
+.swordfish-head .head-hideMenu li{
+	width: 100%;
+	border-bottom: 1px solid #EDEEEF;
+	line-height: 40px;
+	padding-left: 20px;
+	cursor: pointer;
+}
+.swordfish-head .head-hideMenu li .round-dot{
+	right: -6px;
+}
+.swordfish-head .head-hideMenu li>span{
+	position: relative;
+}
+.swordfish-head .head-hideMenu i{
+	color: #37C6DA;
+	margin-right: 5px;
+}
+.swordfish-head .head-hideMenu i.youjian{
+	font-size: 12px;
+}
+.swordfish-head .head-hideMenu i.ren1{
+	margin-left: 2px;
+}
+.swordfish-head .head-hideMenu i.ren1,.swordfish-head .head-hideMenu i.tuichu{
+	font-size: 16px;
+	margin-right: 15px !important;
+}
+.swordfish-head .head-hideMenu li:hover{
+	background-color: #37C6DA;
+	color: #fff;
+}
+.swordfish-head .head-hideMenu li:hover>i{
+	color: #fff;
+}
+.swordfish-head .head-hideMenu li:hover .round-dot{
+	background-color: #FFFFFF;
+}
 .swordfish-head a{
 	text-decoration: none;
 }
 .swordfish-top{
-	height: 30px;
-	line-height: 30px;
+	height: 25px;
+	line-height: 25px;
 	padding-right: 50px;
 	background-color: #464645;
+	font-size: 12px;
+	font-family: "SimSun";
 }
 .swordfish-top>div,.swordfish-content{
 	max-width: 1200px;
@@ -29,39 +113,58 @@ a:focus, a:hover{
 .swordfish-top li{
 	padding-left: 20px;
 }
+.swordfish-top li:hover>a{
+	color: #37C6DA !important;
+}
+.swordfish-top li:hover>i{
+	background-color: #37C6DA !important;
+}
 .swordfish-top a{
 	color: #A0A0A0;
 }
-.swordfish-top i{
-	font-size: 12px;
-	display: inline-block;
-	background-color: #A0A0A0;
-	width: 20px;
-	height: 20px;
+.swordfish-top li>span{
 	margin-right: 5px;
+	background-color: #A0A0A0;
 	text-align: center;
-	padding-top: 4px;
+	padding: 3px 9px;
+	position: relative;
+}
+.swordfish-top i{
+	position: absolute;
+	left: 0px;
 }
 .swordfish-top i.fuwushichang{
-	padding-top: 5px;
-	padding-right: 5px;
+	left: 3px;
+	top: 3px;
+}
+.swordfish-top i.qiyeshequ{
+	left: 4.5px;
+	top: 2px;
 }
 .swordfish-top i.jianyu{
-	padding-left: 2px;
+	font-size: 16px;
+	left: 3px;
+	top: 1px;
+}
+.swordfish-top i.weiguanwang1{
+	left: 4px;
+	top: 1px;
+	font-size: 14px
 }
 .swordfish-top i.zhengcefagui{
-	padding-top: 5px;
+	left: 4.5px;
+	top: 2px;
 }
 .swordfish-i-a{
 	background-color: #37C6DA !important;
 }
 .swordfish-nva{
-	border-top: 5px solid #37C6DA;
+	border-top: 3px solid #37C6DA;
 	background-color: #FFFFFF;
 }
 .swordfish-nva>ul{
-	height: 70px;
-	line-height: 70px;
+	height: 66px;
+	line-height: 66px;
 	max-width: 1200px;
 	margin: auto;
 }
@@ -71,7 +174,6 @@ a:focus, a:hover{
 .swordfish-nva-c{
 	width: 100px;
 	text-align: center;
-	font-size: 16px;
 }
 .swordfish-nva-s{
 	width: 1px;
@@ -80,33 +182,44 @@ a:focus, a:hover{
 	border-left: 1px solid #e5e6e9;
 	border-right: 1px solid #ffffff;
 	float: right;
-	margin-right: -2px;
 }
-.swordfish-nva-active{
+.swordfish-nva-main{
 	background-color: #37C6DA;
 }
-.swordfish-nva-active a{
+.swordfish-nva-main a{
+	font-size: 18px;
 	color: #FFFFFF !important;
+	font-weight: bold;
+}
+.swordfish-nva-rssset,.swordfish-nva-infolist{
+	font-family: "SimSun";
 }
-.swordfish-nva-active .swordfish-nva-s{
-	height: 0px;
+.swordfish-nva-rssset a:hover,.swordfish-nva-infolist a:hover,.swordfish-nva-active a{
+	font-weight: bold;
+	color: #37C6DA !important;
 }
 .swordfish-head .headimg{
-	margin-right: 10px;
 	width: 40px;
 	height: 40px;
+	margin-right: 5px;
 }
 .swordfish-content{
 	padding: 15px 0px 15px 0px;
 }
-.swordfish-left>.swordfish-left-c{
+.swordfish-left{
 	background-color: #FFFFFF;
-	padding: 10px;
-	min-height:670px;
+	padding: 15px;
+	width: 940px;
+	display: inline-block;
+	vertical-align: top;
 }
 .swordfish-right{
 	padding-right: 0px;
 	background-color: #FFFFFF;
+	width: 250px;
+	display: inline-block;
+	vertical-align: top;
+	float: right;
 }
 .swordfish-page-title{
 	padding-bottom: 10px;
@@ -134,7 +247,7 @@ a:focus, a:hover{
 .swordfish-rssset .btn>span{
 	margin-right: 5px;
 }
-.swordfish-rssset .swordfish-left-c>div{
+.swordfish-rssset .swordfish-left>div{
 	margin-bottom: 15px;
 }
 .swordfish-qrcode{
@@ -149,6 +262,7 @@ a:focus, a:hover{
 	background-color: #FCF8E3;
 	padding: 10px 30px;
 	border: 1px solid #F5DC99;
+	text-indent: 2em;
 }
 .swordfish-explain span{
 	color: #A0A0A0;
@@ -164,8 +278,7 @@ a:focus, a:hover{
 }
 .swordfish-panel-t{
 	padding: 10px;
-	font-size: 18px;
-	font-weight: bold;
+	font-size: 20px;
 	color: #37C6DA;
 	background-color: #F6F8FA;
 }
@@ -186,7 +299,7 @@ a:focus, a:hover{
 	padding: 0px 15px;
 }
 .swordfish-panel-c>div{
-	padding: 15px 0px;
+	padding: 15px 0px 15px 20px;
 	border-bottom: 1px solid #ddd;
 }
 .swordfish-panel-c-t{
@@ -207,9 +320,11 @@ a:focus, a:hover{
 	cursor: pointer;
 }
 .swordfish-panel-c-t>div>span{
-	font-size: 14px;
+	font-family: "SimSun";
+	font-size: 12px;
 	color: #A0A0A0;
 	margin-left: 10px;
+	font-weight: normal;
 }
 .swordfish-panel-c-t i{
 	font-size: 14px;
@@ -231,6 +346,15 @@ a:focus, a:hover{
 	width: 400px;
 	display: inline-block;
 	margin: 0px 10px;
+	border-radius: 0px;
+	border-color: #e5e6e9;
+	box-shadow: none;
+	font-family: "SimSun";
+}
+.swordfish-keywords lable{
+	display: inline-block;
+	width: 70px;
+	font-family: "SimSun";
 }
 .swordfish-keywords img{
 	width: 20px;
@@ -238,7 +362,13 @@ a:focus, a:hover{
 	cursor: pointer;
 }
 .swordfish-keywords button{
-	margin-left: 75px;
+	margin-left: 80px;
+	padding-top: 6px;
+	padding-bottom: 6px;
+}
+.swordfish-scope button{
+	padding-top: 2px;
+	padding-bottom: 2px;
 }
 .swordfish-scope-dialog li{
 	width: 100%;
@@ -263,6 +393,10 @@ a:focus, a:hover{
 	padding-left: 20px;
 	padding-top: 20px;
 }
+.swordfish-scope{
+	cursor: pointer;
+	display: inline-block;
+}
 .swordfish-panel-c-c .btn{
 	margin-right: 20px;
 	margin-bottom: 20px;
@@ -360,4 +494,18 @@ a:focus, a:hover{
 }
 .swordfish-visited{
 	color: #999;
+}
+.swordfish-index .carousel-indicators li{
+	width: 8px !important;
+	height: 8px !important;
+	border-radius: 8px !important;
+	margin-right: 10px;
+}
+@media (max-width: 1200px) {
+	.swordfish-left{
+		width: 100%;
+	}
+	.swordfish-right{
+		display: none;
+	}
 }

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


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 3 - 0
core/src/web/staticres/fonts/qimingxing.svg


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


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


BIN
core/src/web/staticres/images/swordfish/guide-1.png


BIN
core/src/web/staticres/images/swordfish/guide-3.png


BIN
core/src/web/staticres/images/swordfish/guide-4.png


BIN
core/src/web/staticres/images/swordfish/guide-5.png


+ 30 - 6
core/src/web/staticres/js/qfw.js

@@ -486,11 +486,35 @@ function advertAjaxRqe(position){
 		});
 	}
 }
-//
-function open_window(link){
-	if(!/^http/.test(link)){
-		link="http://"+link
+//认证完之后首次登录
+function afterAutheFirstLogin(result){
+	var identType = result.identType;
+	var entId = result.entId;
+	if(identType == 2){//个人认证
+		$("body").append('{{include "/common/ploginmodal.html"}}');
+		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
+		$("#fristAutheLoginModal .com-entName").text(result.entName+"店铺");
+		$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
+	}else{
+		$("body").append('{{include "/common/ologinmodal.html"}}');
+		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
+		$("#fristAutheLoginModal .com-entName").text(result.entName);
+		var comAuthentType = result.comAuthentType;
+		//企业认证标识:1:营业执照;2:企业名片;3:企业邮箱
+		var comAuthentText = comAuthentType==1?"营业执照认证":comAuthentType==2?"名片认证":comAuthentType==3?"邮箱认证":"";
+		var flag = comAuthentText!="";
+		$("#fristAutheLoginModal .com-identTypeText").html(",恭喜您完成"+(identType==1?"企业":identType==3?"机构":"")+"认证"+(flag?"-":"")+comAuthentText);
+		$("#fristAutheLoginModal .com-identTypeImg").append('<i class="glyphicon '+(identType==1?"qy":identType==3?"jg":"")+'rz"></i><font class="text-muted">已认证'+(identType==1?"企业":identType==3?"机构":"")+'</font>');
+		if(flag){
+			$("#fristAutheLoginModal .com-identTypeImg").append('<i class="glyphicon margin-r-5 '+(comAuthentType==1?"margin-r-10 yyzz":comAuthentType==2?"mp":comAuthentType==3?"yj":"")+'rz"></i><font class="text-muted">'+comAuthentText+'</font>');
+		}
+		if(hasNewActive){
+			$("#fristAutheLoginModal .com-who").text("完成以下操作,就可以领取红包啦:");
+		}else{
+			$("#fristAutheLoginModal .com-entCard").removeClass("hide");
+			$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
+		}
 	}
-    var arg = '\u003cscript\u003elocation.replace("'+link+'")\u003c/script\u003e';
-    window.open('javascript:window.name;', arg);
+	$("#fristAutheLoginModal .com-releaseService a").attr("href","/member/yellowpage/show/showService/"+entId);
+	$("#fristAutheLoginModal").modal('show');
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 14
core/src/web/staticres/microwebsite/swiper/swiper.min.js


+ 0 - 0
core/src/web/staticres/microwebsite/swiper/maps/swiper.jquery.min.js.map → core/src/web/staticres/swiper/maps/swiper.jquery.min.js.map


+ 0 - 0
core/src/web/staticres/microwebsite/swiper/maps/swiper.min.js.map → core/src/web/staticres/swiper/maps/swiper.min.js.map


+ 0 - 0
core/src/web/staticres/microwebsite/swiper/swiper.min.css → core/src/web/staticres/swiper/swiper.min.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 14 - 0
core/src/web/staticres/swiper/swiper.min.js


BIN
core/src/web/staticres/wxrssset/images/up.png


+ 20 - 13
core/src/web/staticres/wxrssset/main.js

@@ -43,14 +43,16 @@ function KeyWordDialog(type,clickLi){
 	this.show = function(){
 		dialogObj.show();
 		$("html,body").addClass("overflow-hidden");
+		$(window).resize(function(){
+		  	KeyWordDialog.SetContentHeight(dialogObj);
+		});
 	};
 	this.hide = function(){
 		dialogObj.hide();
 		$("html,body").removeClass("overflow-hidden");
+		$(window).unbind("resize");
 	};
-	var contentObj = dialogObj.find(".dialog-content");
-	var padding = parseInt(contentObj.css('padding-top'))+parseInt(contentObj.css('padding-bottom'))
-	contentObj.css("max-height",document.body.clientHeight-dialogObj.find(".dialog-head").height()-padding-40);
+	KeyWordDialog.SetContentHeight(dialogObj);
 	dialogObj.find(".addKeyWord").click(function(){
 		KeyWordDialog.AppendNode(dialogObj);
 	});
@@ -61,6 +63,11 @@ function KeyWordDialog(type,clickLi){
 		KeyWordDialog.AppendNode(dialogObj);
 	}
 }
+KeyWordDialog.SetContentHeight = function(dialogObj){
+	var contentObj = dialogObj.find(".dialog-content");
+	var padding = parseInt(contentObj.css('padding-top'))+parseInt(contentObj.css('padding-bottom'))
+	contentObj.css("max-height",document.body.clientHeight-dialogObj.find(".dialog-head").height()-padding-40);
+}
 KeyWordDialog.AppendNode = function(dialogObj,value){
 	var getHtml = function(index,value){
 		return '<div class="keyWordGroup">'
@@ -71,7 +78,6 @@ KeyWordDialog.AppendNode = function(dialogObj,value){
 	}
 	var count = dialogObj.find(".keyWordGroup").length;
 	if(count >= 5){
-		dialogObj.find(".addKeyWord").attr("disabled",true);
 		return;
 	}
 	var obj = $(getHtml(count+1,value));
@@ -83,6 +89,12 @@ KeyWordDialog.AppendNode = function(dialogObj,value){
 			$(this).children("lable").children("font").text(i+1);
 		});
 	});
+	if(typeof(value) == "undefined" || value == ""){
+		obj.find("[type='text']").focus();
+	}
+	if(count == 4){
+		dialogObj.find(".addKeyWord").attr("disabled",true);
+	}
 }
 //信息范围
 function ScopeDialog(type,clickLi){
@@ -284,14 +296,8 @@ $(function(){
 		}
 		$("#"+type+"-content li:first").append('<div class="com-last">'+keys.join(";")+'</div>');
 	}
-	var setScope = function(type,scope,n){
+	var setScope = function(type,scope){
 		var dialogObj = $("#"+type+"-scope");
-		if(n){
-			if(scope!="A"){
-				dialogObj.find("ul:first li:first .btn").removeClass("active");
-			}
-		}
-		
 		if(typeof(scope) == "undefined" || scope == ""){
 			return;
 		}
@@ -299,6 +305,7 @@ $(function(){
 			dialogObj.find("ul:first li:first .btn").addClass("active");
 			scope = "全国";
 		}else{
+			dialogObj.find("ul:first li:first .btn").removeClass("active");
 			var scopeArray = scope.split(",");
 			for(var i=0;i<scopeArray.length;i++){
 				dialogObj.find(".btn").each(function(){
@@ -315,12 +322,12 @@ $(function(){
 			.append($("#tender-scope").clone().removeAttr("id").attr("id","bid-scope"));
 	if(typeof(msgset.tender) != "undefined"){
 		setKeyWord("tender",msgset.tender.a_key);
-		setScope("tender",msgset.tender.s_scope,1);
+		setScope("tender",msgset.tender.s_scope);
 		turnOn($("#tender-on-off"));
 	}
 	if(typeof(msgset.bid) != "undefined"){
 		setKeyWord("bid",msgset.bid.a_key);
-		setScope("bid",msgset.bid.s_scope,1);
+		setScope("bid",msgset.bid.s_scope);
 		turnOn($("#bid-on-off"));
 	}
 	//开关

+ 172 - 9
core/src/web/staticres/wxrssset/style.css

@@ -9,7 +9,7 @@ ul{
 	margin: 0px;
 }
 img{
-	vertical-align: middle;
+	vertical-align: sub;
 }
 .overflow-hidden{
 	overflow: hidden;
@@ -68,16 +68,10 @@ img{
 	position: relative;
 	font-size: 16px;
 }
-.operation>.parent-node:first-child>img{
-	margin-right: 2.5px;
-	margin-left: 12.5px;
-	width: 20px;
-	height: 19.5px;
-}
 .operation>.parent-node>img{
 	margin-left: 10px;
-	width: 25px;
-	height: 25px;
+	width: 20px;
+	height: 20px;
 }
 .operation>.parent-node>span img{
 	position: absolute;
@@ -285,4 +279,173 @@ img{
 	color: #ccc;
 	text-align: right;
 	padding-right: 5px;
+}
+/**引导页**/
+.swiper-pagination{
+	top: 80px !important;
+}
+.swiper-pagination-bullet{
+	margin-bottom: 15px !important;
+}
+.swiper-slide{
+	text-align: center;
+	z-index: -1;
+	background: #ffffff;
+	position: absolute !important;
+}
+.swiper-slide-active{
+	z-index: 2;
+}
+.slide-active{
+	z-index: 0;
+}
+.slide-down{
+	z-index: 2;
+	/* Firefox: */
+	-moz-animation-name:slidedown;
+	-moz-animation-duration:0.5s;
+	-moz-animation-timing-function:ease-in;
+	-moz-animation-iteration-count:1;
+	-moz-animation-play-state:running;
+	/* Safari and Chrome: */
+	-webkit-animation-name:slidedown;
+	-webkit-animation-duration:0.5s;
+	-webkit-animation-timing-function:ease-in;
+	-webkit-animation-iteration-count:1;
+	-webkit-animation-play-state:running;
+	/* Opera: */
+	-o-animation-name:slidedown;
+	-o-animation-duration:0.5s;
+	-o-animation-timing-function:ease-in;
+	-o-animation-iteration-count:1;
+	-o-animation-play-state:running;
+}
+@-webkit-keyframes slidedown {
+	0%{
+		top: -100%;
+	}
+	100% {
+		top: 0px;
+	}
+}
+.slide-up{
+	z-index: 2;
+	/* Firefox: */
+	-moz-animation-name:slideup;
+	-moz-animation-duration:0.5s;
+	-moz-animation-timing-function:ease-in;
+	-moz-animation-iteration-count:1;
+	-moz-animation-play-state:running;
+	/* Safari and Chrome: */
+	-webkit-animation-name:slideup;
+	-webkit-animation-duration:0.5s;
+	-webkit-animation-timing-function:ease-in;
+	-webkit-animation-iteration-count:1;
+	-webkit-animation-play-state:running;
+	/* Opera: */
+	-o-animation-name:slideup;
+	-o-animation-duration:0.5s;
+	-o-animation-timing-function:ease-in;
+	-o-animation-iteration-count:1;
+	-o-animation-play-state:running;
+}
+
+@-webkit-keyframes slideup {
+	0%{
+		top: 100%;
+	}
+	100% {
+		top: 0px;
+	}
+}
+.swiper-slide img{
+	position: relative;
+	top: 50%;
+	margin-top: -302px;
+}
+.swiper-pagination-bullet-active{
+	background-color: #37C6DA;
+}
+.guide-bottom{
+	position: absolute;
+	bottom: 10px;
+	text-align: center;
+	width: 100%;
+	z-index: 99999;
+}
+.guide-bottom img{
+	width: 25px;
+	height: 15px;
+	position: absolute;
+	left: 50%;
+	margin-left: -12.5px;
+	animation-name:start;
+	animation-duration:2s;
+	animation-timing-function:ease-in-out;
+	animation-iteration-count:infinite;
+	animation-play-state:running;
+	/* Firefox: */
+	-moz-animation-name:start;
+	-moz-animation-duration:2s;
+	-moz-animation-timing-function:ease-in-out;
+	-moz-animation-iteration-count:infinite;
+	-moz-animation-play-state:running;
+	/* Safari and Chrome: */
+	-webkit-animation-name:start;
+	-webkit-animation-duration:2s;
+	-webkit-animation-timing-function:ease-in-out;
+	-webkit-animation-iteration-count:infinite;
+	-webkit-animation-play-state:running;
+	/* Opera: */
+	-o-animation-name:start;
+	-o-animation-duration:2s;
+	-o-animation-timing-function:ease-in-out;
+	-o-animation-iteration-count:infinite;
+	-o-animation-play-state:running;
+}
+
+@-webkit-keyframes start {
+	0%{
+		opacity:0;
+		bottom: 0px;
+	}
+	60% {
+		opacity:1;
+	}
+	100% {
+		opacity:0;
+		bottom: 25px;
+	}
+}
+@-moz-keyframes start {
+	0%{
+		opacity:0;
+		bottom: 0px;
+	}
+	60% {
+		opacity:1;
+	}
+	100% {
+		opacity:0;
+		bottom: 25px;
+	}
+}
+@keyframes start {
+		0% {
+		opacity:0;
+		bottom: 0px;
+	}
+	60% {
+		opacity:1;
+	}
+	100% {
+		opacity:0;
+		bottom: 25px;
+	}
+}
+.guide-bottom span{
+	float: right;
+	display: block;
+	color: #D7D7D7;
+	margin-right: 10px;
 }

+ 1 - 1
core/src/web/templates/active/promotion_201512.html

@@ -401,7 +401,7 @@ function setTimes(num,n){
 						<ul id="s_con" style="font-size:13px;">
 							<li></li>
 							<li>
-								●“剑鱼”向企业推送富有价值的信息情报等,去体验&nbsp;&nbsp;<a target="_blank" href="/show/swordfish/fish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
+								●“剑鱼”向企业推送富有价值的信息情报等,去体验&nbsp;&nbsp;<a target="_blank" href="/front/swordfish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
 							</li>
 						</ul>
 					</div>

+ 1 - 1
core/src/web/templates/active/promotion_201512_e.html

@@ -400,7 +400,7 @@ function setTimes(num,n){
 							<ul id="s_con" style="font-size:13px;">
 								<li></li>
 								<li>
-									●“剑鱼”向企业推送富有价值的信息情报等,去体验&nbsp;&nbsp;<a target="_blank" href="/show/swordfish/fish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
+									●“剑鱼”向企业推送富有价值的信息情报等,去体验&nbsp;&nbsp;<a target="_blank" href="/front/swordfish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
 								</li>
 							</ul>
 						</div>

+ 2 - 33
core/src/web/templates/common/head.html

@@ -11,7 +11,7 @@
 			<td class="a-h-nav hidden-xs" id="head-navbar">
 		       	<ul class="text-center" id="head-navbar-ul">
 			        <li><img src="/images/nav-fwsc.png" class="visible-xs-inline"><a href="/market/0/list.html">服务市场</a></li>
-					<li class="hidden-xs"><img src="/images/nav-jy.png" class="visible-xs-inline"><a href="/show/swordfish/fish">剑鱼</a></li>
+					<li class="hidden-xs"><img src="/images/nav-jy.png" class="visible-xs-inline"><a href="/front/swordfish">剑鱼</a></li>
 		            <li><img src="/images/nav-qysq.png" class="visible-xs-inline"><a href="/search/enterprise/ent.html">企业社区</a></li>
 		            <li><img src="/images/nav-zcfg.png" class="visible-xs-inline"><a href="/front/content_zcfg_list.html">政策法规</a></li>
 		            <li><img src="/images/nav-xwzx.png" class="visible-xs-inline"><a href="/front/content_qykb_list.html">新闻资讯</a></li>
@@ -49,7 +49,7 @@
 					<img src="/images/nav-btn.png" class="visible-xs-inline" id="nvaBtn">
 				</div>
 			</td>
-			<td id="loginStatus" class="a-loginStatus text-center hidden-xs">
+			<td id="loginStatus" class="loginStatus text-center hidden-xs">
 			</td>
 		</tr>
 	</table>
@@ -324,37 +324,6 @@ function setNavbarActive(index,type){
 	$("#head-navbar-ul li:first").removeClass("a-com-active");
 	$("#head-navbar-ul li:eq("+index+")").addClass("a-com-active");
 }
-function afterAutheFirstLogin(result){
-	var identType = result.identType;
-	var entId = result.entId;
-	if(identType == 2){//个人认证
-		$("body").append('{{include "/common/ploginmodal.html"}}');
-		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
-		$("#fristAutheLoginModal .com-entName").text(result.entName+"店铺");
-		$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
-	}else{
-		$("body").append('{{include "/common/ologinmodal.html"}}');
-		$("#fristAutheLoginModal .com-nickName").text(result.nickName);
-		$("#fristAutheLoginModal .com-entName").text(result.entName);
-		var comAuthentType = result.comAuthentType;
-		//企业认证标识:1:营业执照;2:企业名片;3:企业邮箱
-		var comAuthentText = comAuthentType==1?"营业执照认证":comAuthentType==2?"名片认证":comAuthentType==3?"邮箱认证":"";
-		var flag = comAuthentText!="";
-		$("#fristAutheLoginModal .com-identTypeText").html(",恭喜您完成"+(identType==1?"企业":identType==3?"机构":"")+"认证"+(flag?"-":"")+comAuthentText);
-		$("#fristAutheLoginModal .com-identTypeImg").append('<i class="glyphicon '+(identType==1?"qy":identType==3?"jg":"")+'rz"></i><font class="text-muted">已认证'+(identType==1?"企业":identType==3?"机构":"")+'</font>');
-		if(flag){
-			$("#fristAutheLoginModal .com-identTypeImg").append('<i class="glyphicon margin-r-5 '+(comAuthentType==1?"margin-r-10 yyzz":comAuthentType==2?"mp":comAuthentType==3?"yj":"")+'rz"></i><font class="text-muted">'+comAuthentText+'</font>');
-		}
-		if(hasNewActive){
-			$("#fristAutheLoginModal .com-who").text("完成以下操作,就可以领取红包啦:");
-		}else{
-			$("#fristAutheLoginModal .com-entCard").removeClass("hide");
-			$("#fristAutheLoginModal .com-entCard a").attr("href","/member/yellowpage/edit/enterprise/"+entId);
-		}
-	}
-	$("#fristAutheLoginModal .com-releaseService a").attr("href","/member/yellowpage/show/showService/"+entId);
-	$("#fristAutheLoginModal").modal('show');
-}
 </script>
 <script type='text/javascript'>
 window.BWEUM||(BWEUM={});BWEUM.info = {"stand":true,"agentType":"browser","agent":"bi-collector.oneapm.com/static/js/bw-send-411.4.5.js","beaconUrl":"bi-collector.oneapm.com/beacon","licenseKey":"3Nvir~rAqyZ2Ra7i","applicationID":2274815};</script><script type="text/javascript" src="//bi-collector.oneapm.com/static/js/bw-loader-411.4.5.js">

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

@@ -140,46 +140,12 @@ function setTimes(num,n){
 							}
 						//登陆成功
 						clearInterval(t);
-						switch(loginBackType){
-							case 1://微官网
-								window.location.href="/member/wsite";
-								break;
-							case 2://员工邀请
-								window.location.href="/member/employeemanage/loginUserJoin";
-								break;
-							case 4://注册
-								window.location.href="/";
-								break;
-							case 5://预约
-								window.location.href="/front/appointlogin";
-								break;
-							case 6://投标
-								window.location.href="/front/reurl";
-								break;
-							case 7://用户中心首页
-								window.location.href = "/member/show/memberindex";	
-								break;
-							case 8://录入产品服务信息
-								if(data.code==null){
-									window.location.href = '/member/show/memberindex';
-								}else{
-									window.location.href = '/member/yellowpage/show/showService/'+data.code;
-								}
-								break;
-							case 9://录入企业信息
-								if(data.code==null){
-									window.location.href = '/member/show/memberindex';
-								}else{
-									window.location.href = '/member/yellowpage/edit/enterprise/'+data.code;
-								}
-								break;
-							default:
-								window.location.href = window.location.href;	
-						}
+						compulsoryreRresh = true;
+						afterLoginSkip();
 						$("img.login-logo").css("marginLeft",180);
 						$("div.modal-content").animate({
-					    width:'550px'
-					  });
+						    width:'550px'
+						});
 						if (data.flag==1 && data.auth==1){
 							$(".f-login").hide();
 							$(".f-logintip").show();
@@ -252,50 +218,7 @@ $(function (){
 			}else{
 				//注册页面登录之后
 				$("#loginStatus").trigger("login");
-				switch(loginBackType){
-					case -1:
-						window.location.href = window.location.href;
-						break;
-					case 1://微官网
-						window.location.href="/member/wsite";
-						break;
-					case 2://员工邀请
-						window.location.href="/member/employeemanage/loginUserJoin";
-						break;
-					case 4://注册
-						window.location.href="/";
-						break;
-					case 5://预约
-						window.location.href="/front/appointlogin";
-						break;
-					case 6://投标
-						window.location.href="/front/reurl";
-						break;
-					case 7://用户中心首页
-						window.location.href = "/member/show/memberindex";
-						break;
-					case 8://录入产品服务信息
-								if(data.code==null){
-									window.location.href = '/member/show/memberindex';
-								}else{
-									window.location.href = '/member/yellowpage/show/showService/'+data.code;
-								}
-								break;
-							case 9://录入企业信息
-								if(data.code==null){
-									window.location.href = '/member/show/memberindex';
-								}else{
-									window.location.href = '/member/yellowpage/edit/enterprise/'+data.code;
-								}
-								break;
-					default:
-						if(compulsoryreRresh){
-							window.location.href = window.location.href;
-						}else{
-							$('#loginModal').modal('hide');
-							reLoadTop();
-						}
-				}
+				afterLoginSkip();
 			}
 			//
 			if($("#loginModal [name='rememberMe']").is(':checked')==true){
@@ -320,6 +243,58 @@ $(function (){
 		
 	});
 });
+function afterLoginSkip(){
+	switch(loginBackType){
+		case -1:
+			window.location.href = window.location.href;
+			break;
+		case 1://微官网
+			window.location.href="/member/wsite";
+			break;
+		case 2://员工邀请
+			window.location.href="/member/employeemanage/loginUserJoin";
+			break;
+		case 4://注册
+			window.location.href="/";
+			break;
+		case 5://预约
+			window.location.href="/front/appointlogin";
+			break;
+		case 6://投标
+			window.location.href="/front/reurl";
+			break;
+		case 7://用户中心首页
+			window.location.href = "/member/show/memberindex";
+			break;
+		case 8://录入产品服务信息
+			if(data.code==null){
+				window.location.href = '/member/show/memberindex';
+			}else{
+				window.location.href = '/member/yellowpage/show/showService/'+data.code;
+			}
+			break;
+		case 9://录入企业信息
+			if(data.code==null){
+				window.location.href = '/member/show/memberindex';
+			}else{
+				window.location.href = '/member/yellowpage/edit/enterprise/'+data.code;
+			}
+			break;
+		case 10://订阅设置
+			window.location.href = '/member/swordfish/rssset';
+			break;
+		case 11://信息列表
+			window.location.href = '/member/swordfish/infolist';
+			break;
+		default:
+			if(compulsoryreRresh){
+				window.location.href = window.location.href;
+			}else{
+				$('#loginModal').modal('hide');
+				reLoadTop();
+			}
+	}
+}
 </script>
 <!-- 登录弹出框 -->
 <div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="loginModal" aria-hidden="true">
@@ -340,7 +315,7 @@ $(function (){
 						<div class="u-tipsok">
 								<h3>
 									<div class="f-username" style="float:left;"></div>
-									<div style="float:left;">恭喜你注册成功!<div>
+									<div style="float:left;">恭喜你注册成功!</div>
 								</h3>
 							</div>
 						</div>
@@ -351,7 +326,7 @@ $(function (){
 									●&nbsp;&nbsp;验证企业身份<a href="/member/accountset/index" class="btn btn-primary" style="width:82px;margin-left:5px;">认证</a>
 								</li>
 								<li>
-									●“剑鱼”向企业推送富有价值的信息情报等,去体验<a href="/show/swordfish/fish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
+									●“剑鱼”向企业推送富有价值的信息情报等,去体验<a href="/front/swordfish" class="btn btn-primary" style="width:82px;margin-left:13px;">剑鱼</a>
 								</li>
 							</ul>
 						</div>
@@ -364,7 +339,7 @@ $(function (){
 							<div class="u-tipsok">
 								<h3 style="line-height: 40px;margin: -25px 0 0 50px	;">
 									<div class="f-username"><span></span><img style="margin-left:15px;" src="/images/ent_authe_a.png" height="22"></div>
-									<div style="float:left;margin: -10px 0 30px 0; color:#000;">恭喜你注册成功!<div>
+									<div style="float:left;margin: -10px 0 30px 0; color:#000;">恭喜你注册成功!</div>
 								</h3>
 							</div>
 						</div>

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

@@ -94,7 +94,7 @@
 		</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'"><i class="glyphicon iconfontcolor71"></i>剑鱼(信息订阅)</a>
+	<a class="list-group-item" onclick="window.location.href = '/member/swordfish/rssset'"><i class="glyphicon iconfontcolor71"></i>剑鱼(信息订阅)</a>
 	<a class="list-group-item" onclick="window.location.href = '/member/msgcenter'" id="msgCenter"><i class="glyphicon xiaoxi"></i>消息中心</a>
 </div>
 <script type="text/javascript">

+ 109 - 18
core/src/web/templates/common/swordfishhead.html

@@ -3,29 +3,120 @@
 	<div class="swordfish-top">
 		<div>
 			<ul class="pull-right">
-				<li><i class="img-circle glyphicon fuwushichang"></i><a href="/market/0/list.html">服务市场</a></li>
-				<li><i class="img-circle glyphicon jianyu swordfish-i-a"></i><a href="/show/swordfish/fish">剑鱼</a></li>
-				<li><i class="img-circle glyphicon qiyeshequ"></i><a href="/search/enterprise/ent.html">企业社区</a></li>
-				<li><i class="img-circle glyphicon weiguanwang1"></i><a href="/front/wsite.html">微官网</a></li>
-				<li><i class="img-circle glyphicon zhengcefagui"></i><a href="/front/content_zcfg_list.html">政策法规</a></li>
+				<li><span class="img-circle"><i class="glyphicon fuwushichang"></i></span><a href="/market/0/list.html">服务市场</a></li>
+				<li><span class="img-circle swordfish-i-a"><i class="glyphicon jianyu"></i></span><a href="/front/swordfish">剑鱼</a></li>
+				<li><span class="img-circle"><i class="glyphicon qiyeshequ"></i></span><a href="/search/enterprise/ent.html">企业社区</a></li>
+				<li><span class="img-circle"><i class="glyphicon weiguanwang1"></i></span><a href="/front/wsite.html">微官网</a></li>
+				<li><span class="img-circle"><i class="glyphicon zhengcefagui"></i></span><a href="/front/content_zcfg_list.html">政策法规</a></li>
 			</ul>
 		</div>
 	</div>
 	<div class="swordfish-nva">
 		<ul>
 			<li class="swordfish-nva-l"><a href="/"><img src="/images/logo.png" class="logo"></a></li>
-			<li class="swordfish-nva-c"><a href="/member/swordfish">剑鱼</a><a class="swordfish-nva-s"></a></li>
-			<li class="swordfish-nva-c"><a href="/member/rssset">订阅设置</a><a class="swordfish-nva-s"></a></li>
-			<li class="swordfish-nva-c"><a href="/member/infolist">信息列表</a></li>
-			<li class="pull-right">
-				{{$s_avatar := printf "%v" (index (session "userInfo") "s_avatar")}}
-				{{if session "headImg"}}
-					<img class="img-circle headimg" src="{{$s_avatar}}" onerror="this.src='{{session "headImg"}}'">
-				{{else}}
-					<img class="img-circle headimg" src="{{$s_avatar}}" onerror="this.src='/images/swordfish/headimg.png'">
-				{{end}}
-				<a onclick="window.location.href = '/member/show/memberindex'">{{session "nickName"}}</a>
-			</li>
+			<li class="swordfish-nva-c swordfish-nva-main"><a href="/front/swordfish">剑鱼</a></li>
+			<li class="swordfish-nva-c swordfish-nva-rssset"><a id="goToRssset">订阅设置</a><a class="swordfish-nva-s"></a></li>
+			<li class="swordfish-nva-c swordfish-nva-infolist"><a id="goToInfolist">推送记录</a></li>
+			<li class="pull-right swordfish-loginStatus" id="swordfish-loginStatus"></li>
 		</ul>
 	</div>
-</div>
+</div>
+<script type="text/javascript">
+function open_window(link){
+	if(!/^http/.test(link)){
+		link="http://"+link
+	}
+	window.open("/visit/redirect?url="+escape(link));
+}
+function reLoadTop(){
+	$.ajax({
+	  	type: "POST",
+	  	url: "/front/getWebSiteTop",
+	 	dataType: "json",
+		async: false,
+	  	success: function(result){
+			topLoadOver = true;
+			if(result.status == "y"){
+				isLogined = true;
+				var msgCount = result.msgCount;
+				var hasMsgCount = msgCount > 0;
+				msgCount = msgCount>999?'...':msgCount;
+				var avatar = null;
+				if(avatar != ""){
+					avatar = result.avatar;
+				}
+				var html = '<span><img class="img-circle headimg" src="'+avatar+'" onerror="this.src=\'/images/swordfish/headimg.png\'">';
+				if(hasMsgCount){
+					html += '<a class="round-dot"></a>';
+				}
+				html += '</span><a href="/member/show/memberindex">'+result.nickName+'</a>';
+				html += '<div id="head-hideMenu" class="head-hideMenu"><ul>'
+					    	+'<li onclick="window.location.href=\'/member/msgcenter\'"><i class="glyphicon youjian"></i><span>消息中心';
+				if(hasMsgCount){
+					html += '<a class="round-dot"></a>';
+				}
+				html += '</span></li>'
+						+'<li onclick="window.location.href=\'/member/show/memberindex\'"><i class="glyphicon ren1">&nbsp;</i>用户中心</li>'
+						+'<li onclick="window.location.href=\'/front/logout\'" class="border-b-0"><i class="glyphicon tuichu">&nbsp;</i>退出</li>';
+						+'</ul></div>';
+				$("#swordfish-loginStatus").html(html)
+				.mouseover(function(){
+					$("#head-hideMenu").show();
+				}).mouseleave(function(){
+					$("#head-hideMenu").hide();
+				});
+				$("#head-hideMenu").mouseover(function(){
+					$(this).show();
+				}).mouseleave(function(){
+					$(this).hide();
+				});
+				//立即体验
+				$("#experience").click(function(){
+					window.location.href = "/member/swordfish/rssset";
+				});
+				$("#goToRssset").click(function(){
+					window.location.href = "/member/swordfish/rssset";
+				});
+				$("#goToInfolist").click(function(){
+					window.location.href = "/member/swordfish/infolist";
+				});
+				//处理公用底部扫码登录按钮
+				$("#bottom-bar>li:first").addClass("invisible");
+				//处理认证完之后第一次登录弹出提示框
+				if(result.auditType == "y"){
+					afterAutheFirstLogin(result);
+				}
+			}else{
+				isLogined = false;
+				var html = '<a onclick="loginModalShow();">登录/注册</a>';
+				$("#swordfish-loginStatus").html(html);
+				//立即体验
+				$("#experience").click(function(){
+					loginModalShow();
+				});
+				$("#goToRssset").click(function(){
+					loginModalShow(10);
+				});
+				$("#goToInfolist").click(function(){
+					loginModalShow(11);
+				});
+				$("#bottom-bar>li").removeClass("invisible");
+				//登录
+				$("body").append('{{include "/common/login.html"}}');
+			}
+		},
+		error: function(e){
+			topLoadOver = true;
+		}
+	});
+}
+function swordfishLayoutInit(){
+	if(document.body.scrollHeight <= document.body.clientHeight){
+		$(".swordfish-left").height(document.body.clientHeight-$(".swordfish-head").height() - $("#qfw-bottom").height());
+		webSiteInit();
+	}
+}
+$(function(){
+	reLoadTop();
+});
+</script>

+ 59 - 1
core/src/web/templates/member/accountset/bindmail.html

@@ -38,10 +38,31 @@
 				<div class="form-group">
 					<label class="col-md-1 control-label">邮箱</label>
 					<div class="col-md-4">
-				      <input type="text" name="mail" class="form-control" onkeyup="rePlaceSpace(this)" datatype="e" nullmsg="请输入你的邮箱" errormsg="邮箱格式错误" ajaxurl="/front/ajaxReq?oprType=checkMail">
+				      <input type="text" name="mail" class="form-control" onkeyup="rePlaceSpace(this)" onblur="ocheckMail()" id="ocheckmail" datatype="e" nullmsg="请输入你的邮箱" errormsg="邮箱格式错误" ajaxurl="/front/ajaxReq?oprType=checkMail">
 					</div>
 					<div class="col-md-7"><span class="Validform_checktip">请输入你的邮箱</span></div>
 				</div>
+				<div class="form-group hide" id="tishi1">
+					<label class="col-md-1 control-label"></label>
+					<div class="col-md-8">
+				      <span id="tishinr">“您绑定的是xxx公司在工商年报时登记的邮箱,您是否需要系统自动帮您完成企业实名认证,而无需上传营业执照?”</span>
+					</div>
+					<div class="col-md-3"></div>
+				</div>
+				<div class="form-group hide" id="tishi2">
+					<label class="col-md-2 control-label"></label>
+					<div class="col-md-1">
+				       <label>
+			              <input type="radio" name="i_automatic" value="1" id="i_automaticone"> 是
+			           </label>
+					</div>
+					<div class="col-md-1">
+					   <label>
+			              <input type="radio" name="i_automatic"  checked="checked" value="0" id="i_automatictwo"> 否
+			           </label>
+					</div>
+					<div class="col-md-7"><span class="Validform_checktip"></span></div>
+				</div>
 				<div class="form-group">
 					<label class="col-md-1 control-label">验证码</label>
 				    <div class="input-group col-md-4 checkCodeId">
@@ -63,6 +84,10 @@
 				</form>
 				<form class="form-horizontal accountForm hidden" id="step_2">
 				<input type="hidden" name="flag" value="2">
+				<input type="hidden" name="i_automatic" id="autotype" value="">
+				<input type="hidden" name="entid" id="entid" value="">
+				<input type="hidden" name="avatar" id="avatar" value="">
+				<input type="hidden" name="uname" id="uname" value="">
 				<input type="hidden" name="mail">
 				<div class="form-group">
 				    <label class="col-md-1 control-label" style="padding-top: 0px;">邮箱</label>
@@ -110,6 +135,33 @@
 <!-- 底部 -->
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
+function ocheckMail(){
+	var checkmail = $("#ocheckmail").val();
+	$.post('/member/accountset/checkConMail',{checkmail:checkmail},function(data){
+		if (data.pk == "2")	{
+			$("#tishi1").removeClass("hide");
+			$("#tishi2").removeClass("hide");
+			$("#tishinr").html('您绑定的是企业 “'+data.EntName+'” 在工商年报时登记的邮箱,您是否需要系统自动帮您完成企业实名认证,而无需上传营业执照?');
+			var entid = data.id;
+			$("#entid").val(entid);
+			$("#uname").val(data.uname);
+			$("#avatar").val(data.s_avatar);
+		}
+		
+	})
+	
+	$("#i_automaticone").click(function (){
+		if($(this).is(":checked")){
+			if(checkmail!=""&&checkmail.length>0){
+				var st = $("input[name='i_automatic']:checked").val();
+				if (st == 1){	
+					$("#autotype").val("1");
+				}
+			}
+			
+		}
+	});
+}
 function currPos(){
    return [["用户中心","/member/show/memberindex"]]
 }
@@ -140,8 +192,14 @@ $(function(){
 					$("#step_3").removeClass("hidden");
 					if(data.result == "y"){
 						$("#bindmailSuccess").removeClass("hidden");
+						if(data.contype == 1){
+							$("#bindmailSuccess").append('<span>且年报邮箱已成功认证!</span>');
+						}
 					}else if(data.result == "n"){
 						$("#bindmailFail").removeClass("hidden");
+						if(data.contype == 0){
+							$("#bindmailFail").append('<span>且年报邮箱认证失败!</span>');
+						}
 					}
 				}
 			}else if(data.status == "mail_error"){

+ 0 - 294
core/src/web/templates/member/message/rssset20151230.html

@@ -1,294 +0,0 @@
-<html>
-<head>
-<title>消息订阅</title>
-{{include "/common/inc.html"}}
-</head>
-<body>
-{{$identType := session "identType"}}
-<!-- 头部 -->
-{{include "/common/head.html"}}
-<!-- 中间 -->
-<style>
-.member-right .fontb{
-	margin:30px 0 5px 0;
-}
-.inputkey,.checkbox{
-	margin-left:30px;
-	margin-right:30px;
-}
-.module{
-	cursor:pointer;
-	margin-top:20px;
-	padding:25px;
-	background-color:#F8F8F8;
-	border:1px solid #CECECE;
-}
-
-.mactive{
-	background-color:#FFFFCC;
-	border:2px solid #EBA675
-}
-
-.tips{
-	display:inline-block;
-	margin-left:2em;
-	font-weight:normal;
-}
-
-</style>
-<div class="a-content member-content">
-	<div class="member-left">
-		{{include "/common/memberleft.html"}}
-	</div>
-	<div class="member-right">
-		<div class="panel-title-out">
-			<i class="glyphicon iconfontcolor71"></i><span>剑鱼(信息订阅)</span>
-			<span class="text-muted" style="font-size:12px;font-weight:normal;display:inline-block;margin-left:20px;">信息类型太少?没有我想要的?<a style="color:blue" href="/front/web_feedbacklist.html" target="_blank">去提意见!</a></span>
-		</div>		
-		<div class="panel-body a-border-t-only" id="setContent">
-		
-			<div class="remark" style="background-color:#FCF8E3;padding:10px;line-height:30px;color:#A87C22">
-				<div><span style="font-size:16px;font-weight:bold">“剑鱼”</span>是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。</div>
-				<div> 您在输入了想要订阅的信息主题以后,网上一旦发布这些主题的信息,剑鱼就会第一时间将信息推送给您。</div>
-			</div>
-		
-			<div class="module tender mactive" >
-				<div class="fontb" style="margin-top:0;font-size:20px;"><input name="moduleCheck" value="tender" type="checkbox"/>&nbsp;招标公告</div>
-				<div class="inputkey">
-					  <div class="fontb">订阅主题<span class="text-muted tips">示例:综合布线 机房装修 空调 视频会议 3D+打印机</span></div>
-					  <div class="form-group"><input class="form-control " name="a_key" placeholder="示例:综合布线 机房装修 空调 视频会议 3D+打印机"  type="text" value=""></div>
-					  <div><span class="text-muted">说明:最多输入5个订阅主题,每个主题之间用空格分开。每个主题可以包含一个或多个关键词,关键词之间用“+”号连接。</span></div>
-				</div>
-				
-				<div class="checkbox">
-						<div class="fontb">接收范围</div>
-				        <label style="padding-left:0">
-				          <input type="radio" name="tender_s_scope" checked value="A"> 全国信息
-				        </label>   
-						{{if .T.sname }}
-						<label>
-				          <input type="radio" name="tender_s_scope" value="{{.T.sname}}"> 本省信息({{.T.sname}})
-				        </label>
-						{{end}}
-			    </div>
-				<div class="checkbox">
-					  <div class="fontb">接收方式</div>
-				          <label>
-				            <input type="checkbox" name="a_mode" value="3"> 微信提醒
-				          </label>   
-						  <label>
-				            <input type="checkbox" name="a_mode" value="2"> 邮件通知
-				          </label> 
-						  <label>
-				           <input type="checkbox" checked disabled > 消息中心
-				          </label>   
-			      </div>
-			</div>
-			
-			
-			<div class="module bid">
-				<div class="fontb" style="margin-top:0;font-size:20px;"><input name="moduleCheck" value="bid" type="checkbox"/>&nbsp;中标公告</div>
-				<div class="inputkey">
-					  <div class="fontb">订阅主题<span class="text-muted tips">示例:综合布线 机房装修 空调 视频会议 3D+打印机</span></div>
-					  <div class="form-group"><input class="form-control " name="a_key" placeholder="示例 :政府+采购+计算机 工程 建筑 安全"  type="text" value=""></div>
-					<div><span class="text-muted">说明:最多输入5个订阅主题,每个主题之间用空格分开。每个主题可以包含一个或多个关键词,关键词之间用“+”号连接。</span></div>
-				</div>
-				
-				<div class="checkbox">
-						<div class="fontb">接收范围</div>
-				        <label style="padding-left:0">
-				          <input type="radio" name="bid_s_scope" checked value="A"> 全国信息
-				        </label>   
-						{{if .T.sname }}
-						<label>
-				          <input type="radio" name="bid_s_scope" value="{{.T.sname}}"> 本省信息({{.T.sname}})
-				        </label>
-						{{end}}
-			        </div>
-					<div class="checkbox">
-					  <div class="fontb">接收方式</div>
-				          <label>
-				            <input type="checkbox" name="a_mode" value="3"> 微信提醒
-				          </label>   
-						  <label>
-				            <input type="checkbox" name="a_mode" value="2"> 邮件通知
-				          </label> 
-						  <label>
-				           <input type="checkbox" checked disabled > 消息中心
-				          </label>   
-			        </div>
-			</div>
-			
-			
-			<div class="bid" disabled style="margin-top:20px;padding:25px;background-color:#F8F8F8;border:1px solid #CECECE">
-				<div class="fontb" style="margin-top:0;font-size:20px;">企业情报</div>
-				<div class="text-muted" style="margin-left:30px;">竞争对手的情报,公司大事件,行业风险预警等等。。。</div>
-				<div class="text-muted" style="margin-left:30px;height:200px;line-height:200px;font-size:25px;">开发中,敬请期待!</div>
-			</div>
-				
-		</div>
-	</div>
-</div>
-<!-- 底部 -->
-{{include "/common/bottom.html"}}
-<script type="text/javascript">
-try{
-	identType=identType||""
-	if((role == "" || /^[9]$/.test(role)) && (identType == "-1" || identType == "0")){
-		$(".member-right").prepend('{{include "/common/authentication.html"}}');
-	}else{
-		if(!(role == "" || /^[9]$/.test(role) || (/^[1]$/.test(role) && identType == "1"))){
-			$("#myYellowpage").remove();
-			$("#message").addClass("col-md-12").removeClass("col-md-6");
-		}
-	}
-}catch(e){
-	
-}
-
-var msgset={{.T.msgset}}
-$(function(){	
-	$(".module").click(function(){
-		if(!$(this).hasClass("mactive")){
-			$(".module").removeClass("mactive")	
-			$(this).addClass("mactive")	
-		}
-	})
-	
-	$(".module input[name=moduleCheck]").click(function(){		
-		var check=$(this).prop("checked")
-		if(check){			
-			$(this).closest(".module").find("input[name=a_key]").removeAttr("disabled")
-		}else{
-			$(this).closest(".module").find("input[name=a_key]").attr("disabled","disabled")
-		}
-	})
-	
-	for(var i in msgset){
-		try{
-			var m=$("."+i)
-			$("input[name=moduleCheck][value='"+i+"']").prop("checked",true)
-			var key=msgset[i].a_key
-			var scope=msgset[i].s_scope
-			var a_mode=msgset[i].a_mode
-			if(key) $("input[name='a_key']",m).val(key.join(" "))
-			$("input[name$='s_scope'][value='"+scope+"']",m).prop("checked",true)
-			$(a_mode).each(function(i,ad){
-				$("input[name='a_mode'][value='"+ad+"']",m).prop("checked",true)
-			})
-		}catch(e){
-			
-		}
-	}
-	
-	setTimeout(function(){
-		webSiteInit()
-	},"10")
-	
-	$("input[name='moduleCheck'],input[name$='scope'],input[name='a_mode']").click(function(){
-		save()
-	})
-	/**
-	var t='';
-	$("input[name='a_key']").keyup(function (){
-	 	clearTimeout(t);
-	 	t = setTimeout("save()",100);
-	});
-	**/
-	var last;
-	$("input[name='a_key']").keyup(function(event){
-		last = event.timeStamp;
-		setTimeout(function(){
-			if(last-event.timeStamp==0){
-				save()
-			}
-		},650);
-	});
-	//初始设置
-	$(".module input[name=moduleCheck]").each(function(i,ad){		
-		var check=$(this).prop("checked")
-		if(check){			
-			$(this).closest(".module").find("input[name=a_key]").removeAttr("disabled")
-		}else{
-			$(this).closest(".module").find("input[name=a_key]").attr("disabled","disabled")
-		}
-	})
-})
-function save(){
-	var modules=$(".module input[name='moduleCheck']:checked")
-	var obj
-	modules.each(function(i,ad){
-		var moduleval=$(ad).val();
-		var m=$("."+moduleval)
-		var key=$("input[name='a_key']",m).val()
-		var keys=key.trim().split(/\s+/)
-		if(!key.trim()){
-			//alert("选中的关键词为空。")
-			return false
-		}else{
-			if(keys.length>5){
-				alert("关键词不能超过5个。")			
-				return false
-			}else if(key.trim()==""){
-			
-			}else{
-				for(var k=0;k<keys.length;k++){
-					if(keys[k].length>100){
-						alert("关键词长度不能大于100");
-						return false
-						break;
-					}
-				}
-				if(!obj) obj={}
-				if(!obj[moduleval]) obj[moduleval]={}	
-				obj[moduleval].a_key=keys;
-				obj[moduleval].s_scope=$("input[name$='s_scope']:checked",m).val()
-				var am=[]
-				$("input[name='a_mode']:checked",m).each(function(n,nm){
-					am.push($(nm).val())
-				})
-				obj[moduleval].a_mode=am
-			}
-		}
-	})
-	if(!obj){
-		//alert("选择订阅模块后,填写值无效,请检查.")
-		obj="";
-	}
-	
-	$.post("/member/msgset",{data:jsonToString(obj)},function(data){
-		//alert(data.msg)
-	},'json')
-	
-	/**
-	$.post("/member/msgset?"+$(obj).closest("form").serialize(),function(data){
-		$("#msgset").popover("hide")
-		alert(data.msg)
-	},'json')	
-	**/
-}
-
-jsonToString = function(o,f) {
-	var r = [];
-	if (typeof o == "string")
-		return "\"" + o.replace(/([\'\"\\])/g, "\\$1").replace(/(\n)/g, "\\n").replace(/(\r)/g, "\\r").replace(/(\t)/g, "\\t") + "\"";
-	if (typeof o == "object") {
-		if (!o.sort) {
-			for ( var i in o)
-				r.push((f?i:("\""+i + "\"")) +":"+ jsonToString(o[i]));
-			if (!!document.all && !/^\n?function\s*toString\(\)\s*\{\n?\s*\[native code\]\n?\s*\}\n?\s*$/.test(o.toString)) {
-				r.push("toString:" + o.toString.toString());
-			}
-			r = "{" + r.join() + "}";
-		} else {
-			for (var i = 0; i < o.length; i++)
-				r.push(jsonToString(o[i]));
-			r = "[" + r.join() + "]";
-		}
-		return r;
-	}
-	return o?o.toString():"";
-};
-</script>
-</body>
-</html>

+ 0 - 122
core/src/web/templates/member/message/swordfish.html

@@ -1,122 +0,0 @@
-<html>
-<head>
-<title>剑鱼</title>
-{{include "/common/inc.html"}}
-</head>
-<body>
-<!-- 头部 -->
-{{include "/common/swordfishhead.html"}}
-<!-- 中间 -->
-<div class="swordfish-content container-fluid swordfish-index">
-	<div class="swordfish-left col-xs-9">
-		<div class="swordfish-left-c">
-			<div id="swordfish-guide" class="swordfish-guide carousel slide" data-ride="carousel">
-			    <div class="swordfish-guide-left">
-					<i class="bootstrap-glyphicon glyphicon glyphicon-menu-left" href="#swordfish-guide" data-slide="prev"></i>
-				</div>
-				<!-- Wrapper for slides -->
-			  	<div class="carousel-inner" role="listbox">
-				    <div class="item active">
-				      	<img src="/images/swordfish/guide-1.png">
-				     	<div class="carousel-caption"></div>
-				    </div>
-				    <div class="item">
-				      	<img src="/images/swordfish/guide-2.png">
-				      	<div class="carousel-caption"></div>
-				    </div>
-					<div class="item">
-				      	<img src="/images/swordfish/guide-3.png">
-				     	<div class="carousel-caption"></div>
-				    </div>
-				    <div class="item">
-				      	<img src="/images/swordfish/guide-4.png">
-				      	<div class="carousel-caption"></div>
-				    </div>
-					<div class="item">
-				      	<img src="/images/swordfish/guide-5.png">
-				     	<div class="carousel-caption"></div>
-				    </div>
-			  	</div>
-				<div class="swordfish-guide-right">
-					<i class="bootstrap-glyphicon glyphicon glyphicon-menu-right" href="#swordfish-guide" data-slide="next"></i>
-				</div>
-				<span class="swordfish-guide-bottom">
-					<a class="btn" role="button" href="/member/rssset">立即体验</a>
-					<ol class="carousel-indicators">
-					    <li data-target="#swordfish-guide" data-slide-to="0" class="active"></li>
-					    <li data-target="#swordfish-guide" data-slide-to="1"></li>
-						<li data-target="#swordfish-guide" data-slide-to="2"></li>
-					    <li data-target="#swordfish-guide" data-slide-to="3"></li>
-						<li data-target="#swordfish-guide" data-slide-to="4"></li>
-				  	</ol>
-				</span>
-			</div>
-		</div>
-	</div>
-	<div class="swordfish-right col-xs-3">
-		<div class="swordfish-right-title">
-			剑鱼最新消息
-		</div>
-		<div id="list"></div>
-	</div>
-</div>
-<!-- 底部 -->
-{{include "/common/bottom.html"}}
-<script type="text/javascript">
-$(function(){
-	$('#swordfish-guide').carousel({
-	  interval: 3000
-	});
-	//
-	var data = {{.T.data}};
-	if(data != ""){
-		var publishtime = data.a_publishtime;
-		var visitedindex = data.a_visitedindex;
-		$("#list").html(data.s_content);
-		$("#list>div").each(function(i){
-			if(i > 9){
-				$(this).remove();
-				return true;
-			}
-			if(i == 0){
-				$(this).remove();
-			}else{
-				//已访问过的灰色
-				if(typeof(visitedindex) != "undefined"){
-					var xh = $(this).children(".xh").text();
-					xh = xh.replace(".","");
-					for(var i=0;i<visitedindex.length;i++){
-						if(xh == visitedindex[i]){
-							$(this).find("a.bt").addClass("swordfish-visited");
-						}
-					}
-				}
-				$(this).children(".xh").remove();
-				if(typeof(publishtime) != "undefined" && typeof(publishtime[i+1]) != "undefined"){
-					var time = new Date(Number(publishtime[i+1]+"000")).Format("yyyy-MM-dd hh:mm:ss")
-					$(this).prepend('<div class="time"><img src="/images/swordfish/circle.png">'+time+'</div>');
-				}
-				var bt = $(this).children(".bt");
-				var href = bt.attr("href");
-				if (href.indexOf("java") == -1){							
-					bt.attr("s",href).attr("href","javascript:void(0);");
-				}
-				bt.click(function(){
-					if(!$(this).hasClass("swordfish-visited")){
-						$(this).addClass("swordfish-visited");
-						$.post("/wxpush/bid/ajaxReq",{_id:data._id,index:$(this).parent().index()+1});
-					}
-					open_window($(this).attr("s"));
-					return false;
-				});
-			}
-		});
-	}else{
-		$(".swordfish-index").find(".swordfish-left").removeClass("col-xs-9");
-		$(".swordfish-index").find(".swordfish-right").remove();
-	}
-	$(".swordfish-nva>ul>li:eq(1)").addClass("swordfish-nva-active");
-});
-</script>
-</body>
-</html>

+ 0 - 400
core/src/web/templates/member/message/wxrssset - 副本.html

@@ -1,400 +0,0 @@
-<html>
-<head>
-<title>企明星-信息订阅</title>
-<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
-<meta name="viewport" content="width=device-width,initial-scale=1.0">
-<meta name="renderer" content="webkit">
-<script src="/js/jquery.js"></script>
-</head>
-<style>
-body {
-	padding-top: 0px;
-	font-family: "微软雅黑 Regular", "微软雅黑";
-	color: #666;
-}
-.head{
-	padding:.5em;
-	font-size:1em;
-	color:#999999;
-}
-.ban{
-	width:100%;
-	background-color:#e9e9e9;
-	height:2em;
-	line-height:2em;
-	font-size:1.2em;
-}
-.minBan{
-	background-color:#FB8C00;
-	width:.5em;
-	height:2em;
-	display:inline-block
-}
-
-.arrow1,.arrow2{
-display:inline-block;
-position: relative;
-float:right;
-right:.8em;
-margin-top:0.3em;
-cursor:pointer;
-}
-.arrow2{
-	margin-top:0.5em;
-	right:1.8em;
-}
-.arrow1:after, .arrow1:before {
-  border: 15px solid transparent;
-  border-left: 15px solid #e9e9e9;
-  width: 0;
-  height: 0;
-  position: absolute;
-  top: 0;
-  right: -20px;
-  content: ' '
-}
- 
-.arrow1:before {
-  border-left-color: #999999;
-  right: -23px;
-}
-.arrow2:after, .arrow2:before {
-  border: 15px solid transparent;
-  border-top: 15px solid #e9e9e9;
-  width: 0;
-  height: 0;
-  position: absolute;
-  top: 0;
-  top: 0px;
-  content: ' '
-}
- 
-.arrow2:before {
-  border-top-color: #999999;
-  top: 3px;
-}
-.form-control {
-  display: block;
-  width: 100%;
-  height: 38px;
-  padding: 8px 12px;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #333333;
-  background-color: #ffffff;
-  background-image: none;
-  border: 1px solid #cccccc;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-  -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-  -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-  transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
-.lg-input{
-  height: 5em;
-  padding: .5em;
-  font-size: .9em;
-  line-height: 1.3333333em;
-  border-radius: 0.3em;
-}
-
-.title{
-	font-size:1em;
-	margin:0.5em 0;
-}
-.con{
-	padding:0 1em;
-}
-.scope{
-	text-align:justify
-}
-.radio{
-	display:inline-block;
-	height:2em;
-	line-height:2em;
-	padding-left:2em;
-	font-size:1em;
-	width:5em;
-	margin-right:5%;
-	cursor:pointer;
-}
-.select{
-	background:url(/images/wx/btn_rou_h.png) no-repeat;
-	background-size:1.85em;
-}
-.noselect{
-	background:url(/images/wx/btn_rou_n.png) no-repeat;
-	background-size:1.85em;
-}
-.select2{
-	background:url(/images/wx/btn_squ_h.png) no-repeat;
-	background-size:1.85em;
-}
-.noselect2{
-	background:url(/images/wx/btn_squ_n.png) no-repeat;
-	background-size:1.85em;
-}
-.bantitle{
-	height:2em;
-	display:inline-block;
-}
-.hide{
-	display:none;
-}
-.module{
-	margin-bottom:0.2em;
-}
-.moduleCheck{
-	margin:0 0.1em;
-}
-.minBan2{
-	background-color:#FAA57B;
-}
-.tips{
-	font-size:0.8em;
-	margin-left:1em;
-}
-</style>
-<body>
-<div class="body">
-	<div class="head">
-	<div><span style="font-size:1.2em;color:#222222">“剑鱼”</span>是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。</div>
-	</div>
-	
-	<div class="module tender" value="tender">
-		<div class="ban"><div class="minBan minBan2">&nbsp;</div><span value="tender" class="moduleCheck noselect2" style="display:inline-block;width:35px;background-size: 1.5em;background-position:.1em">&nbsp;</span><div class="bantitle">招标公告</div><div  class="arrow arrow1"></div></div>
-		<div class="con hide">
-			<div class="title">关键词</div>
-			<div class="tips text-muted">示例:政府+采购+计算机 办公+工程 安全</div>
-			<div class="tips text-muted">说明:最多输入5个订阅主题,每个主题之间用空格分开。每个主题可以包含一个或多个关键词,关键词之间用“+”号连接。</div>
-			<div><textarea placeholder="示例:政府+采购+计算机 办公+工程 安全" class="form-control lg-input" ></textarea></div>
-			<div class="title">信息范围</div>
-			<div class="scope">
-				<span class="radio select" value="A">全国</span>
-				{{if .T.sname }}
-				<span class="radio noselect" value="{{.T.sname}}">本省{{.T.sname}}</span>
-				{{end}}
-			</div>
-			<div class="title">接收方式</div>
-			<div class="way">
-				<span value="3" class="radio noselect2">微信提醒</span>
-				<span value="2" class="radio noselect2">邮箱提醒</span>
-			</div>
-		</div>
-	</div>
-	
-	<div class="module bid" value="bid">
-		<div class="ban"><div class="minBan minBan2">&nbsp;</div><span value="bid" class="moduleCheck noselect2" style="display:inline-block;width:35px;background-size: 1.5em;background-position:.1em">&nbsp;</span><div class="bantitle">中标公告</div><div  class="arrow arrow1"></div></div>
-		<div class="con hide">
-			<div class="title">关键词</div>
-			<div class="tips text-muted">示例:政府+采购+计算机 办公+工程 安全</div>
-			<div class="tips text-muted">说明:最多输入5个订阅主题,每个主题之间用空格分开。每个主题可以包含一个或多个关键词,关键词之间用“+”号连接。</div>
-			<div><textarea placeholder="示例:政府+采购+计算机 办公+工程 安全" class="form-control lg-input" ></textarea></div>
-			<div class="title">信息范围</div>
-			
-			<div class="scope">
-				<span class="radio select" value="A">全国</span>
-				{{if .T.sname }}
-				<span class="radio noselect" value="{{.T.sname}}">本省{{.T.sname}}</span>
-				{{end}}
-			</div>
-			<div class="title">接收方式</div>
-			<div class="way">
-				<span value="3" class="radio noselect2">微信提醒</span>
-				<span value="2" class="radio noselect2">邮箱提醒</span>
-			</div>
-		</div>
-	</div>
-	
-	<div class="module other" disabled>
-		<div class="ban"><div class="minBan" style="background-color:#999999">&nbsp;</div><div class="bantitle" style="padding-left:2em;">企业情报</div><div style="" class="arrow arrow1"></div></div>
-		<div class="con hide">
-			<div class="title">企业情报</div>
-			<div class="text-muted" style="margin-left:1.2em;">竞争对手的情报,公司大事件,行业风险预警等等。。。</div>
-			<div class="text-muted" style="margin-left:2em;height:2em;line-height:2em;font-size:1.5em;">开发中,敬请期待!</div>
-		</div>
-	</div>
-
-</div>
-<script>
-var msgset={{.T.msgset}}
-function save(){
-	var modules=$(".module span.moduleCheck")
-	var obj
-	modules.each(function(i,ad){
-		if ($(ad).hasClass("select2")){	
-			var moduleval=$(ad).attr("value");
-			var m=$("."+moduleval)
-			var key=$("textarea",m).val()
-			var keys=key.trim().split(/\s+/)
-			if(keys.length>5){
-				alert("关键词不能超过5个。")			
-				return;
-			}else if(key.trim()==""){
-				
-			}else{
-				for(var k=0;k<keys.length;k++){
-					if(keys[k].length>100){
-						alert("关键词长度不能大于100");
-						return false
-						break;
-					}
-				}
-				if(!obj) obj={}
-				if(!obj[moduleval]) obj[moduleval]={}	
-				obj[moduleval].a_key=keys;
-				obj[moduleval].s_scope=$(".scope span.select",m).attr("value")
-				var am=[]
-				$(".way span.select2",m).each(function(n,nm){
-					am.push($(nm).attr("value"))
-				})
-				obj[moduleval].a_mode=am		
-			}
-		}	
-	})
-	if(!obj){
-		obj="";
-	}
-	$.post("/swordfish/msgpushsetting/msgset",{data:jsonToString(obj),mid:"{{.T.mid}}"})	
-}
-
-function sp(t){
-	if(!t.hasClass("select")){
-		var spans=t.closest("div").find("span")
-		spans.removeClass("select");
-		spans.addClass("noselect");
-		t.removeClass("noselect").addClass("select");
-	}
-}
-function way(t){
-	if(!t.hasClass("select2")){
-		t.removeClass("noselect2").addClass("select2");
-		t.prev("div").removeClass("minBan2");			
-		ban(t.closest(".ban"),"zk")
-	}else{
-		t.removeClass("select2").addClass("noselect2");
-		t.prev("div").addClass("minBan2");
-		ban(t.closest(".ban"),"zd")		
-	}
-}
-
-function ban(t,flag){
-		var arrow=t.find(".arrow");
-		if(!arrow.hasClass("arrow2")){
-			if(flag=="zd"){
-				
-			}else{
-				arrow.removeClass("arrow1").addClass("arrow2")
-				t.closest(".module").find(".con").show();				
-			}
-		}else{
-			if(flag=="zk"){
-				
-			}else{
-				arrow.removeClass("arrow2").addClass("arrow1")
-				t.closest(".module").find(".con").hide();			
-			}
-		}
-}
-
-
-$(function(){
-	$("span.moduleCheck").click(function(e){
-		way($(this))
-		e.stopPropagation();
-	})
-	
-	$(".scope span").click(function(){
-		sp($(this))
-	})
-	
-	$(".way span").click(function(){
-		way($(this))
-	})
-	
-	$(".ban").click(function(){
-		ban($(this))
-	})
-	
-	setTimeout(function(){	
-			for(var i in msgset){
-			try{
-				var m=$("."+i)
-				//$("input[name=moduleCheck][value='"+i+"']").prop("checked",true)
-				//$("span.moduleCheck",m).click();//removeClass("noselect2").addClass("select2");
-				way($("span.moduleCheck",m))
-				var key=msgset[i].a_key
-				$("textarea",m).val(key.join(" "))
-				var scope=msgset[i].s_scope
-				var a_mode=msgset[i].a_mode
-				var sp1=$(".scope span[value='"+scope+"']",m)
-				if(!sp1.hasClass("select")){		
-					sp(sp1)
-				}
-				$(".way span",m).each(function(n,ws){
-					$(a_mode).each(function(i,ad){
-						if($(ws).attr("value")==ad){
-							way($(ws))	
-						}
-					})
-				})
-			}catch(e){
-				
-			}
-		}
-	},10)
-	
-	if(!msgset){
-		$(".way span[value=3]").click()
-	}else if(!msgset.bid){
-		$(".bid .way span[value=3]").click()
-	}else if(!msgset.tender){
-		$(".tender .way span[value=3]").click()
-	}
-	
-	$("span.moduleCheck,div.scope span,div.way span").click(function(){
-		save()
-	})
-	
-	$("textarea").blur(function(){
-		save()
-	})
-	
-	var last;
-	$("textarea").keyup(function(event){
-		last = event.timeStamp;
-		setTimeout(function(){
-			if(last-event.timeStamp==0){
-				save()
-			}
-		},650);
-	});
-	
-})
-
-jsonToString = function(o,f) {
-	var r = [];
-	if (typeof o == "string")
-		return "\"" + o.replace(/([\'\"\\])/g, "\\$1").replace(/(\n)/g, "\\n").replace(/(\r)/g, "\\r").replace(/(\t)/g, "\\t") + "\"";
-	if (typeof o == "object") {
-		if (!o.sort) {
-			for ( var i in o)
-				r.push((f?i:("\""+i + "\"")) +":"+ jsonToString(o[i]));
-			if (!!document.all && !/^\n?function\s*toString\(\)\s*\{\n?\s*\[native code\]\n?\s*\}\n?\s*$/.test(o.toString)) {
-				r.push("toString:" + o.toString.toString());
-			}
-			r = "{" + r.join() + "}";
-		} else {
-			for (var i = 0; i < o.length; i++)
-				r.push(jsonToString(o[i]));
-			r = "[" + r.join() + "]";
-		}
-		return r;
-	}
-	return o?o.toString():"";
-};
-
-</script>
-</body>
-</html>

+ 0 - 405
core/src/web/templates/member/message/wxrssset20151224.html

@@ -1,405 +0,0 @@
-<html>
-<head>
-<title>企明星-信息订阅</title>
-<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
-<meta name="viewport" content="width=device-width,initial-scale=1.0">
-<meta name="renderer" content="webkit">
-<script src="/js/jquery.js"></script>
-</head>
-<style>
-body {
-	font-family: "微软雅黑 Regular", "微软雅黑";
-	color: #666;
-	margin:0;
-	padding:0;
-	background-color:#F9F9F9;
-}
-.form-control {
-  display: block;
-  width: 96%;
-  height: 38px;
-  padding: 8px 12px;
-  font-size: 14px;
-  line-height: 1.42857143;
-  color: #333333;
-  background-color: #ffffff;
-  background-image: none;
-  border: 1px solid #cccccc;
-  border-radius: 4px;
-  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-  -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-  -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-  transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-}
-.lg-input{
-  height: 6em;
-  padding: .5em;
-  font-size: .9em;
-  line-height: 1.3333333em;
-  border-radius: 0.3em;
-}
-.hide{
-	display:none;
-}
-.head{
-	padding:1em;
-
-}
-.ban{
-	height:2.4em;
-	line-height:2.4em;
-	background-color:white;
-	margin-bottom:2px;
-	text-indent:1em;
-	width:100%;
-}
-.bantitle{
-	display:inline-block;
-}
-.slider,.sliderN{
-	display:inline-block;
-	position: relative;
-	float:right;
-	right:.8em;
-	top:.2em;
-	width:3.5em;
-	cursor:pointer;
-}
-.slider1{
-	background:url(/images/wx/on.gif) no-repeat;
-	background-size:3.2em;
-}
-.slider2{
-	background:url(/images/wx/off.png) no-repeat;
-	background-size:3.2em;
-}
-.way{
-	margin-top:0.8em;
-}
-.t{
-	height:2.4em;
-	line-height:2.4em;
-	border-bottom:2px solid #EEEEEE;
-	width:100%;
-	text-indent:1.5em;
-	background-color:#F3F3F3;
-}
-.title{
-	display:inline-block;	
-}
-.n{
-	display:inline-block;
-	min-width:100px;
-	white-space:nowrap;  
-	color:#999999;
-}
-.arrow{
-	display:inline-block;
-	position: relative;
-	float:right;
-	right:.2em;
-	top:.3em;
-	width:3.5em;
-	background:url(/images/wx/d.png) no-repeat;
-	background-size:1.8em;
-	cursor:pointer;
-}
-.top{
-	position:absolute;
-	height:160%;
-	z-index:1000;
-	top:0;
-	width:100%;
-	background-color:#000;
-}
-.infoWay{
-	position:fixed;
-	
-	z-index:1005;
-	width:100%;
-	background-color:white;
-	height:15em;
-	bottom:0;
-}
-.infoT{
-	height:2.2em;
-	line-height:2.2em;
-	background-color:#E2E2E2;
-	text-indent:1em;
-}
-.sel,.content{
-	margin-top:2em;
-}
-.content .text-muted{
-	text-indent:.5em;
-	line-height:2em;
-}
-.sb{
-	width:100%;
-	height:2.2em;
-	line-height:2.2em;
-	border-top:2px solid #F3F3F3;
-	text-align:center;
-	color:#C1C1C1;
-	cursor:pointer;
-}
-.check{
-	color:#333333;
-}
-.bot{
-	text-align:center;
-	position:absolute;
-	width:100%;
-	color:#E15F5E;
-	top:85%;
-	cursor:pointer;
-}
-</style>
-<body>
-<div class="body">
-	<div class="head" >
-	<div><span style="font-size:1.2em;color:#222222">“剑鱼”</span>-借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。</div>
-	</div>
-	<div class="module tender" value="tender">
-		<div class="ban" value="tender"><div class="bantitle">招标公告</div><div class="slider slider2">&nbsp;</div></div>
-		<div class="con hide">
-			<div class="t"><div class="title">订阅主题:</div><input type="hidden" value=""/><div class="n zt"></div><div class="arrow" flag="dy">&nbsp;</div></div>
-			<div class="t"><div class="title">信息范围:</div><div class="n fw">全国</div><div class="arrow" flag="xx">&nbsp;</div></div>
-		</div>
-	</div>
-	
-	<div class="module bid" value="bid">
-		<div class="ban" value="bid"><div class="bantitle">中标公告</div><div class="slider slider2">&nbsp;</div></div>
-		<div class="con hide">
-			<div class="t"><div class="title">订阅主题:</div><input type="hidden" value=""/><div class="n zt"></div><div class="arrow" flag="dy">&nbsp;</div></div>
-			<div class="t"><div class="title">信息范围:</div><div class="n fw">全国</div><div class="arrow" flag="xx">&nbsp;</div></div>
-		</div>
-	</div>
-	
-	<div class="module other" disabled>
-		<div class="ban" onClick="alert('企业情报开发中,敬请期待。')"><div class="bantitle">企业情报</div><div class="sliderN slider2">&nbsp;</div></div>
-	</div>
-	
-	<div class="way" style="border-top:2px solid #F3F3F3;">
-		<div class="ban" value="a_weixin" v="3"><div class="bantitle">微信提醒</div><div class="slider slider2">&nbsp;</div></div>
-		<div class="ban" value="a_mail" v="2"><div class="bantitle">邮件提醒</div><div class="slider slider2">&nbsp;</div></div>
-	</div>
-
-	<div class="ban" style="background-color:#F9F9F9;"><div class="bantitle" style="cursor:pointer" onClick="window.location.href='/mobile/advise'">意见反馈</div></div>
-	
-</div>
-<div class="top hide"></div>
-<div class="infoWay hide xx">
-		<div class="infoT">信息范围</div>
-		<div class="sel">
-			<div class="sb check">全国</div>
-			{{if .T.sname }}
-				<div class="sb" value="{{.T.sname}}">本省({{.T.sname}})</div>
-			{{end}}
-		</div>
-		<div class="bot" onClick="surexx()">确定</div>
-</div>
-<div class="infoWay hide dy">
-		<div class="infoT">订阅主题</div>
-		<div class="content">
-		<div class="text-muted">示例:综合布线 视频会议 3D+打印机</div>
-		<textarea  placeholder='说明:最多输入5个订阅主题,每个主题之间用空格分开,每个订阅主题可以包含一个或多个关键字,关键字之间用“+”号连接。' class="form-control lg-input" ></textarea>
-		</div>
-		<div class="bot" onClick="suredy()">确定</div>
-</div>
-<script>
-var msgset={{.T.msgset}}
-
-function save(){
-	var obj,mode=[]
-	$("div.way .slider1").each(function(i,ad){
-		mode.push($(ad).closest("div.ban").attr("v"))
-	})
-	$("div.module .slider1").each(function(i,ad){
-		var ban=$(ad).closest(".ban")
-		var moduleval=ban.attr("value")
-		var con=ban.next(".con")
-		var key=con.find("input").val()
-		var keys=key.trim().replace(/\r\n/g,"").split(/\s+/)
-		if(keys.length>5){
-			alert("关键词不能超过5个。")			
-			return false;
-		}else if(key.trim()==""){
-			
-		}else{
-			for(var k=0;k<keys.length;k++){
-				if(keys[k].length>100){
-					alert("关键词长度不能大于100");
-					return false
-					break;
-				}
-			}
-			if(!obj) obj={}
-			if(!obj[moduleval]) obj[moduleval]={}	
-			obj[moduleval].a_key=keys;
-			var scope=con.find("div.fw").text();
-			if(scope=="全国"){
-				scope="A"
-			}else{
-				scope=scope.replace(/本省\((.*)\)/g,"$1")
-			}
-			obj[moduleval].s_scope=scope
-			obj[moduleval].a_mode=mode		
-		}
-	})
-	if(!obj){
-		obj="";
-	}
-	$.post("/swordfish/msgpushsetting/msgset",{data:jsonToString(obj),mid:"{{.T.mid}}"})
-}
-var wordw=20;
-function resizeCon(){
-	var winw=$(window).width();
-	var tw=100;
-	if (winw>300){
-		tw=winw-200;
-	}
-	var tl=tw/20;
-	$(".zt").each(function(i,ad){
-		var v=$(ad).prev("input").val();
-		if(v){
-			$(ad).text(v.length>tl?(v.substring(0,tl)+".."):v)
-		}else{
-			$(ad).text("")
-		}
-	})
-}
-
-var sthis="";
-$(function(){
-	$(".top").css({'opacity':'0.5'});
-	resizeCon();
-	window.onresize=resizeCon
-	$(".t").click(function(){
-		sthis=$(this).closest(".module").attr("value")
-		$(".top").show();
-		var sshow=$(this).find(".arrow").attr("flag");
-		$("."+sshow).show();
-		if(sshow=="dy"){
-			$("textarea").val($(this).find("input").val())
-		}else if(sshow=="xx"){
-			$(".sel .sb").removeClass("check")
-			$(".sel .sb:contains("+$(this).find(".fw").text()+")").addClass("check")
-		}
-	})
-	$(".sb").click(function(){
-		$(this).closest(".sel").find(".sb").removeClass("check");
-		$(this).addClass("check");
-	})
-	
-	$(".slider").click(function(){
-		var val=$(this).closest(".ban").attr("value")
-		var bcheck=false;
-		if($(this).hasClass("slider1")){
-			$(this).removeClass("slider1").addClass("slider2")
-		}else{
-			$(this).removeClass("slider2").addClass("slider1")		
-			bcheck=true;
-		}
-		if(val.indexOf("a_")>-1){
-			//weixin/mail
-		}else{
-			//tender/bid
-			if(bcheck){
-				$(".module[value="+val+"] .con").show()
-			}else{
-				$(".module[value="+val+"] .con").hide()				
-			}
-		}
-	})
-		
-	setTimeout(function(){	
-		for(var i in msgset){
-			try{
-				var m=$("."+i)
-				//$("input[name=moduleCheck][value='"+i+"']").prop("checked",true)
-				//$("span.moduleCheck",m).click();//removeClass("noselect2").addClass("select2");
-				$(".slider",m).click();
-				var key=msgset[i].a_key
-				$("input",m).val(key.join(" "))
-				var scope=msgset[i].s_scope
-				if(scope=="A"){
-					$(".fw",m).text("全国")
-				}else if(scope.length>1){
-					$(".fw",m).text("本省("+scope+")")					
-				}
-				var a_mode=msgset[i].a_mode
-				$(".way .ban").each(function(n,ws){
-					$(a_mode).each(function(i,ad){
-						if($(ws).attr("v")==ad){
-							if(!$(ws).find(".slider").hasClass("slider1")){
-								$(ws).find(".slider").click();
-							}
-						}
-					})
-				})
-			}catch(e){
-				
-			}
-			resizeCon();
-		}
-	},8)
-	
-	setTimeout(function(){	
-		$(".slider").click(function(){
-			save()
-		})
-	},10)
-})
-function surexx(){
-	$(".xx").hide();
-	$(".top").hide();
-	$(".module[value="+sthis+"] .fw").text($(".sel .check").text());
-	$(".sel .sb").removeClass("check")
-	save();
-}
-function suredy(){
-	var keys=$("textarea").val().trim().replace(/\r\n/g,"").split(/\s+/)
-	if(keys.length>5){
-			alert("关键词不能超过5个。")			
-			return false;
-	}
-	for(var k=0;k<keys.length;k++){
-		if(keys[k].length>100){
-			alert("关键词长度不能大于100");
-			return false
-			break;
-		}
-	}
-	$(".dy").hide();
-	$(".top").hide();
-	$(".module[value="+sthis+"] input").val($("textarea").val())
-	$("textarea").val("")
-	resizeCon();
-	save();
-}
-jsonToString = function(o,f) {
-	var r = [];
-	if (typeof o == "string")
-		return "\"" + o.replace(/([\'\"\\])/g, "\\$1").replace(/(\n)/g, "\\n").replace(/(\r)/g, "\\r").replace(/(\t)/g, "\\t") + "\"";
-	if (typeof o == "object") {
-		if (!o.sort) {
-			for ( var i in o)
-				r.push((f?i:("\""+i + "\"")) +":"+ jsonToString(o[i]));
-			if (!!document.all && !/^\n?function\s*toString\(\)\s*\{\n?\s*\[native code\]\n?\s*\}\n?\s*$/.test(o.toString)) {
-				r.push("toString:" + o.toString.toString());
-			}
-			r = "{" + r.join() + "}";
-		} else {
-			for (var i = 0; i < o.length; i++)
-				r.push(jsonToString(o[i]));
-			r = "[" + r.join() + "]";
-		}
-		return r;
-	}
-	return o?o.toString():"";
-};
-</script>
-</body>
-</html>

+ 2 - 2
core/src/web/templates/microwebsite/blue/index.html

@@ -4,11 +4,11 @@
 <meta content="telephone=no" name="format-detection">
 <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 <title>{{.T.EntName}}</title>
-<link rel="stylesheet" href="/microwebsite/swiper/swiper.min.css">
+<link rel="stylesheet" href="/swiper/swiper.min.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/style.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/blue.css">
 <script type="text/javascript" src="/js/jquery.js"></script>
-<script type="text/javascript" src="/microwebsite/swiper/swiper.min.js"></script>
+<script type="text/javascript" src="/swiper/swiper.min.js"></script>
 <script type="text/javascript" src="/microwebsite/mobile/js/index.js"></script>
 <script type="text/javascript">
 $(function(){

+ 2 - 2
core/src/web/templates/microwebsite/colorful/index.html

@@ -4,11 +4,11 @@
 <meta content="telephone=no" name="format-detection">
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
 <title>{{.T.EntName}}</title>
-<link rel="stylesheet" href="/microwebsite/swiper/swiper.min.css">
+<link rel="stylesheet" href="/swiper/swiper.min.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/style.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/colorful.css">
 <script type="text/javascript" src="/js/jquery.js"></script>
-<script type="text/javascript" src="/microwebsite/swiper/swiper.min.js"></script>
+<script type="text/javascript" src="/swiper/swiper.min.js"></script>
 <script type="text/javascript" src="/microwebsite/mobile/js/index.js"></script>
 </head>
 <body class="content-bg">

+ 2 - 2
core/src/web/templates/microwebsite/geenleaf/index.html

@@ -4,11 +4,11 @@
 <meta content="telephone=no" name="format-detection">
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
 <title>{{.T.EntName}}</title>
-<link rel="stylesheet" href="/microwebsite/swiper/swiper.min.css">
+<link rel="stylesheet" href="/swiper/swiper.min.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/style.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/geenleaf.css">
 <script type="text/javascript" src="/js/jquery.js"></script>
-<script type="text/javascript" src="/microwebsite/swiper/swiper.min.js"></script>
+<script type="text/javascript" src="/swiper/swiper.min.js"></script>
 <script type="text/javascript" src="/microwebsite/mobile/js/index.js"></script>
 </head>
 <body class="content-bg">

+ 2 - 2
core/src/web/templates/microwebsite/universe/index.html

@@ -4,11 +4,11 @@
 <meta content="telephone=no" name="format-detection">
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
 <title>{{.T.EntName}}</title>
-<link rel="stylesheet" href="/microwebsite/swiper/swiper.min.css">
+<link rel="stylesheet" href="/swiper/swiper.min.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/style.css">
 <link rel="stylesheet" href="/microwebsite/mobile/css/universe.css">
 <script type="text/javascript" src="/js/jquery.js"></script>
-<script type="text/javascript" src="/microwebsite/swiper/swiper.min.js"></script>
+<script type="text/javascript" src="/swiper/swiper.min.js"></script>
 <script type="text/javascript" src="/microwebsite/mobile/js/index.js"></script>
 </head>
 <body class="content-bg">

+ 87 - 0
core/src/web/templates/swordfish/index.html

@@ -0,0 +1,87 @@
+<html>
+<head>
+<title>剑鱼</title>
+{{include "/common/inc.html"}}
+</head>
+<body>
+<!-- 头部 -->
+{{include "/common/swordfishhead.html"}}
+<!-- 中间 -->
+<div class="swordfish-content container-fluid swordfish-index">
+	<div class="swordfish-left">
+		<div id="swordfish-guide" class="swordfish-guide carousel slide" data-ride="carousel">
+		    <div class="swordfish-guide-left">
+				<i class="bootstrap-glyphicon glyphicon glyphicon-menu-left" href="#swordfish-guide" data-slide="prev"></i>
+			</div>
+			<!-- Wrapper for slides -->
+		  	<div class="carousel-inner" role="listbox">
+			    <div class="item active">
+			      	<img src="/images/swordfish/guide-1.png">
+			     	<div class="carousel-caption"></div>
+			    </div>
+			    <div class="item">
+			      	<img src="/images/swordfish/guide-2.png">
+			      	<div class="carousel-caption"></div>
+			    </div>
+				<div class="item">
+			      	<img src="/images/swordfish/guide-3.png">
+			     	<div class="carousel-caption"></div>
+			    </div>
+			    <div class="item">
+			      	<img src="/images/swordfish/guide-4.png">
+			      	<div class="carousel-caption"></div>
+			    </div>
+				<div class="item">
+			      	<img src="/images/swordfish/guide-5.png">
+			     	<div class="carousel-caption"></div>
+			    </div>
+		  	</div>
+			<div class="swordfish-guide-right">
+				<i class="bootstrap-glyphicon glyphicon glyphicon-menu-right" href="#swordfish-guide" data-slide="next"></i>
+			</div>
+			<span class="swordfish-guide-bottom">
+				<a class="btn" role="button" id="experience">立即体验</a>
+				<ol class="carousel-indicators">
+				    <li data-target="#swordfish-guide" data-slide-to="0" class="active"></li>
+				    <li data-target="#swordfish-guide" data-slide-to="1"></li>
+					<li data-target="#swordfish-guide" data-slide-to="2"></li>
+				    <li data-target="#swordfish-guide" data-slide-to="3"></li>
+					<li data-target="#swordfish-guide" data-slide-to="4"></li>
+			  	</ol>
+			</span>
+		</div>
+	</div>
+	<div class="swordfish-right">
+		<div class="swordfish-right-title">
+			剑鱼最新消息
+		</div>
+		<div id="list"></div>
+	</div>
+</div>
+<!-- 底部 -->
+{{include "/common/bottom.html"}}
+<script type="text/javascript">
+$(function(){
+	swordfishLayoutInit();
+	$('#swordfish-guide').carousel({
+	  	interval: 8000
+	});
+	//
+	var data = {{.T.data}};
+	if(data && data != "" && data.length > 0){
+		var html = '';
+		for(var i=0;i<data.length;i++){
+			html += '<div class="tslist"><div class="time"><img src="/images/swordfish/circle.png">'
+					+new Date(Number(data[i].publishtime+"000")).Format("yyyy-MM-dd hh:mm:ss")
+					+'</div><a class="bt" target="_blank" href="javascript:void(0);" onclick="open_window(\''+data[i].href+'\')">'
+					+data[i].title+'</a></div>';
+		}
+		$("#list").html(html);
+	}else{
+		$(".swordfish-index").find(".swordfish-left").removeClass("col-xs-9");
+		$(".swordfish-index").find(".swordfish-right").remove();
+	}
+});
+</script>
+</body>
+</html>

+ 35 - 45
core/src/web/templates/member/message/infolist.html → core/src/web/templates/swordfish/infolist.html

@@ -11,7 +11,7 @@ $(function(){
 	//
 	$.ajax({    
 		type:'post',        
-		url:'/member/message/swordfishlist',    
+		url:'/member/swordfish/swordfishlist',    
 		data:{lasttime:lasttime},    
 		cache:false,    
         dataType:'json',
@@ -19,12 +19,12 @@ $(function(){
 			if (data.success == false){
 					$("#more").hide();
 					$("#forkw").hide();
-					$("#conlist").html('<div id="kong" onClick="javascript:window.location.href=\'/member/rssset\'" class="text-center">你还没有设置关键字!请设置关键字!</div>');
+					$("#conlist").html('<div id="kong" onClick="javascript:window.location.href=\'/member/swordfish/rssset\'" class="text-center">没找到和你的关键词匹配的信息,去修改关键词!</div>');
 					return;
 			}
 			var res=data.data;
 			lasttime=data.thistime;
-			$.post('/member/message/swordfishlist',{lasttime:lasttime},function(data){
+			$.post('/member/swordfish/swordfishlist',{lasttime:lasttime},function(data){
 				if(data.success == false) {
 					$("#more").hide()
 					return;
@@ -45,21 +45,19 @@ $(function(){
 				a_interest={{.T.msgset.o_msgset.tender.a_key}};
 			}
 			$("#conlist").append('<div id="ycwords">'+str+'</div>');
-			
 			if(s_words.length!=0){
-				for(var i=0;i<s_words.length;i++){
-					$("#okeywords").append(s_words[i]+" ");
-				}
+				$("#okeywords").append(s_words.join(" ; ").replace(/\+/gm," "));
 			}else{
 				$("#zhaob").addClass("hide");
 			}
 			if(a_interest.length!=0){
-				for(var i=0;i<a_interest.length;i++){
-					$("#ointerest").append(a_interest[i]+" ");
-				}	
+				$("#ointerest").append(a_interest.join(" ; ").replace(/\+/gm," "));
 			}else{
 				$("#zhongb").addClass("hide");
 			}
+			if(s_words.length!=0 && a_interest.length!=0){
+				$("#zhongb").append(",");
+			}
 			
 			//信息条总数
 			le=$(".tslist").length;
@@ -114,17 +112,15 @@ $(function(){
 						var leave2=leave1%(3600*1000);//计算小时数后剩余的毫秒数
 						var minutes=Math.floor(leave2/(60*1000));
 						//计算相差秒数
-						var leave3=leave2%(60*1000);//计算分钟数后剩余的毫秒数
-						var seconds=Math.round(leave3/1000);
-						var timeDiff = null;
+						/*var leave3=leave2%(60*1000);//计算分钟数后剩余的毫秒数
+						var seconds=Math.round(leave3/1000);*/
+						var timeDiff = "1分钟";
 						if(days > 0){
 							timeDiff = days+"天";
 						}else if(hours > 0){
 							timeDiff = hours+"小时";
 						}else if(minutes > 0){
 							timeDiff = minutes+"分钟";
-						}else{
-							timeDiff = seconds+"秒";
 						}
 						return '<span class="time-diff">'+timeDiff+'前</span>';
 					}
@@ -158,14 +154,14 @@ function setVisitedIndex(obj){
 	f_id=obj.attr("f_id");
 	var index = obj.parent().attr("id")
 	obj.addClass("visited");
-	$.post("/member/message/setVisited",{_id:f_id,index:index});
+	$.post("/member/swordfish/setVisited",{_id:f_id,index:index});
 }
 //加载更多
 function loadMore(){
 		var vi="";
-		$.post('/member/message/swordfishlist',{lasttime:lasttime},function(data){
+		$.post('/member/swordfish/swordfishlist',{lasttime:lasttime},function(data){
 			lasttime=data.thistime;
-			$.post('/member/message/swordfishlist',{lasttime:lasttime},function(data){
+			$.post('/member/swordfish/swordfishlist',{lasttime:lasttime},function(data){
 				if(data.success == false) {
 					$("#more").hide()
 					return;
@@ -241,17 +237,15 @@ function loadMore(){
 							var leave2=leave1%(3600*1000);//计算小时数后剩余的毫秒数
 							var minutes=Math.floor(leave2/(60*1000));
 							//计算相差秒数
-							var leave3=leave2%(60*1000);//计算分钟数后剩余的毫秒数
-							var seconds=Math.round(leave3/1000);
-							var timeDiff = null;
+							/*var leave3=leave2%(60*1000);//计算分钟数后剩余的毫秒数
+							var seconds=Math.round(leave3/1000);*/
+							var timeDiff = "1分钟";;
 							if(days > 0){
 								timeDiff = days+"天";
 							}else if(hours > 0){
 								timeDiff = hours+"小时";
 							}else if(minutes > 0){
 								timeDiff = minutes+"分钟";
-							}else{
-								timeDiff = seconds+"秒";
 							}
 							return '<span class="time-diff">'+timeDiff+'前</span>';
 						}
@@ -285,10 +279,10 @@ function loadMore(){
 <style type="text/css">
 #kong{margin-top:220px; font-size:18px;cursor:hand}
 .visited{
-	color: #999;
+	color: #a0a0a0;
 }
 .time-diff{
-	color: #999;
+	color: #a0a0a0;
 	font-size: 14px;
 	display: inline-block;
 	width: 40px;
@@ -301,7 +295,7 @@ function loadMore(){
 .tim{padding:21px 0px;}
 .row{margin-left:10px;margin-right:10px;}
 #ycwords>div:first-child{display:none;}
-#forkw{padding:30px 0px 30px 50px;}
+#forkw{margin-top: 15px;padding:10px 0px 10px 50px;background-color: #F7F8FA;color: #a0a0a0;}
 .xh{width: 10%;color:#35C5DA;font-size:15px;font-weight:bold;margin:0px 20px;float:left;display: inline-block; width:18px;text-align:right;}
 .tslist{border-bottom:1px solid #ccc;width:100%; padding:15px 0px;}
 #timestamp{color:#ccc;}
@@ -318,29 +312,25 @@ function loadMore(){
 {{include "/common/swordfishhead.html"}}
 <!-- 中间 -->
 <div class="swordfish-content container-fluid">
-	<div class="swordfish-left col-xs-9">
-		<div class="swordfish-left-c">
-			<div class="swordfish-page-title">
-			<i class="img-circle glyphicon jianyu"></i>信息列表
-			</div>
-			
-			<!-- 关键词提示start -->
-			<div id="forkw" >根据你设置的关键词<span id="zhongb"> 招标公告(<span style="color:#FF5A5F;"  id="ointerest"></span>)</span><span id="zhaob"> 中标公告(<span style="color:#FF5A5F;"  id="okeywords"></span>)</span> 为你推送以下信息:</div>
-			<!-- 关键词提示end -->
-			<!-- 列表start -->
-			<div class="row"><div  class="col-sm-12" id="conlist"></div></div>
-			<!-- 列表end -->
-			<div id="more">
+	<div class="swordfish-left">
+		<div class="swordfish-page-title">
+			<i class="img-circle glyphicon jianyu"></i>推送记录
+		</div>
+		<!-- 关键词提示start -->
+		<div id="forkw" >根据你设置的<span id="zhongb">招标公告关键词(<span id="ointerest" style="color:#FF5A5F;"></span>)</span><span id="zhaob">中标公告关键词(<span id="okeywords" style="color:#FF5A5F;"></span>)</span>为你推送以下信息:</div>
+		<!-- 关键词提示end -->
+		<!-- 列表start -->
+		<div class="row"><div  class="col-sm-12" id="conlist"></div></div>
+		<!-- 列表end -->
+		<div id="more">
 			<div class="row">
-		    <div class="col-sm-12 btn btn-link text-center" onClick="loadMore()">
-	         点击加载更多
+			    <div class="col-sm-12 btn btn-link text-center" onClick="loadMore()">
+		        点击加载更多
+				</div>
 			</div>
-			</div>
-			</div>
-			
 		</div>
 	</div>
-	<div class="swordfish-right col-xs-3 swordfish-qrcode text-center">
+	<div class="swordfish-right swordfish-qrcode text-center">
 		<img src="/images/swordfish/qrcode.png">
 		<br>关注微信公众号:企明星
 	</div>

+ 76 - 80
core/src/web/templates/member/message/rssset.html → core/src/web/templates/swordfish/rssset.html

@@ -8,78 +8,76 @@
 {{include "/common/swordfishhead.html"}}
 <!-- 中间 -->
 <div class="swordfish-content container-fluid swordfish-rssset">
-	<div class="swordfish-left col-xs-9">
-		<div class="swordfish-left-c">
-			<div class="swordfish-page-title">
-				<i class="img-circle glyphicon jianyu"></i>订阅设置
-			</div>
-			<div class="swordfish-explain">
-				“剑鱼”是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,
-				为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,
-				比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。
-				您在输入了想要订阅的信息主题以后,网上一旦发布这些主题的信息,剑鱼就会第一时间将信息推送给您。
-				<br><span class="pull-right">信息类型太少?没有找到想要的?<a id="yjfk">去提意见</a></span>
-				<div class="clearfix"></div>
+	<div class="swordfish-left">
+		<div class="swordfish-page-title">
+			<i class="img-circle glyphicon jianyu"></i>订阅设置
+		</div>
+		<div class="swordfish-explain">
+			“剑鱼”是企明星的特色产品,它借助内置的互联网搜索引擎、大数据平台和自然语言分析系统,
+			为企业从互联网上自动抓取、分析、筛选并推送富有价值的信息情报,
+			比如本企业或其他企业的失信行为信息、受到行政处罚的信息、招标公告、中标公告等等。
+			您在输入了想要订阅的信息主题以后,网上一旦发布这些主题的信息,剑鱼就会第一时间将信息推送给您。
+			<br><span class="pull-right">信息类型太少?没有找到想要的?<a id="yjfk">去提意见</a></span>
+			<div class="clearfix"></div>
+		</div>
+		<div class="swordfish-panel" id="tender">
+			<div class="swordfish-panel-t">
+				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
+				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
+				招标公告
 			</div>
-			<div class="swordfish-panel" id="tender">
-				<div class="swordfish-panel-t">
-					<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
-					<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
-					招标公告
+			<div class="swordfish-panel-c">
+				<div>
+					<div class="swordfish-panel-c-t">
+						<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
+					</div>
+					<div class="swordfish-panel-c-c swordfish-keywords" id="tender-keywords">
+						<button class="btn" id="tender-addkeyword"><span>+</span>添加关键词</button>
+					</div>
 				</div>
-				<div class="swordfish-panel-c">
-					<div>
-						<div class="swordfish-panel-c-t">
-							<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
-						</div>
-						<div class="swordfish-panel-c-c swordfish-keywords" id="tender-keywords">
-							<button class="btn" id="tender-addkeyword"><span>+</span>添加关键词</button>
-						</div>
+				<div class="border-b-0">
+					<div class="swordfish-panel-c-t">
+						<span></span><div data-toggle="modal" data-target="#tender-scope-dialog">信息范围<i class="bootstrap-glyphicon glyphicon glyphicon-menu-down"></i></div>
 					</div>
-					<div class="border-b-0">
-						<div class="swordfish-panel-c-t">
-							<span></span><div data-toggle="modal" data-target="#tender-scope-dialog">信息范围<i class="bootstrap-glyphicon glyphicon glyphicon-menu-down"></i></div>
-						</div>
-						<div class="swordfish-panel-c-c swordfish-scope">
-						
-						</div>
+					<div class="swordfish-panel-c-c swordfish-scope" data-toggle="modal" data-target="#tender-scope-dialog">
+					
 					</div>
 				</div>
 			</div>
-			<div class="swordfish-panel" id="bid">
-				<div class="swordfish-panel-t">
-					<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
-					<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
-					中标公告
+		</div>
+		<div class="swordfish-panel" id="bid">
+			<div class="swordfish-panel-t">
+				<img class="swordfish-uncheck" src="/images/swordfish/checkbox.png">
+				<img class="swordfish-checked" src="/images/swordfish/checkbox-a.png">
+				中标公告
+			</div>
+			<div class="swordfish-panel-c">
+				<div>
+					<div class="swordfish-panel-c-t">
+						<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
+					</div>
+					<div class="swordfish-panel-c-c swordfish-keywords" id="bid-keywords">
+						<button class="btn swordfish-addkeyword" id="bid-addkeyword"><span>+</span>添加关键词</button>
+					</div>
 				</div>
-				<div class="swordfish-panel-c">
-					<div>
-						<div class="swordfish-panel-c-t">
-							<span></span><div>订阅关键词<span>最多订阅5组关键词</span></div>
-						</div>
-						<div class="swordfish-panel-c-c swordfish-keywords" id="bid-keywords">
-							<button class="btn swordfish-addkeyword" id="bid-addkeyword"><span>+</span>添加关键词</button>
-						</div>
+				<div class="border-b-0">
+					<div class="swordfish-panel-c-t">
+						<span></span><div data-toggle="modal" data-target="#bid-scope-dialog">信息范围<i class="bootstrap-glyphicon glyphicon glyphicon-menu-down"></i></div>
 					</div>
-					<div class="border-b-0">
-						<div class="swordfish-panel-c-t">
-							<span></span><div data-toggle="modal" data-target="#bid-scope-dialog">信息范围<i class="bootstrap-glyphicon glyphicon glyphicon-menu-down"></i></div>
-						</div>
-						<div class="swordfish-panel-c-c swordfish-scope">
-							
-						</div>
+					<div class="swordfish-panel-c-c swordfish-scope" data-toggle="modal" data-target="#bid-scope-dialog">
+						
 					</div>
 				</div>
 			</div>
-			<div class="swordfish-panel swordfish-intelligence">
-				<div class="swordfish-panel-t">
-					企业情报<span>竞争对手情报,公司大事件,行业风险预警等......</span>
-				</div>
-				<div class="swordfish-panel-c">开发中,敬请期待!</div>
+		</div>
+		<div class="swordfish-panel swordfish-intelligence">
+			<div class="swordfish-panel-t">
+				企业情报<span>竞争对手情报,公司大事件,行业风险预警等......</span>
 			</div>
+			<div class="swordfish-panel-c">开发中,敬请期待!</div>
 		</div>
 	</div>
-	<div class="swordfish-right col-xs-3 swordfish-qrcode text-center">
+	<div class="swordfish-right swordfish-qrcode text-center">
 		<img src="/images/swordfish/qrcode.png">
 		<br>关注微信公众号:企明星
 	</div>
@@ -233,12 +231,13 @@
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
 $(function(){
-	var selectKeyword = function(type,keyword,n){
+	var selectKeyword = function(type,keyword){
 		if(keyword == "" || typeof(keyword) == "undefined"){
+			autoChecked(type,false);
 			return;
 		}
 		for(var i=0;i<keyword.length;i++){
-			appendKeyWord(type,keyword[i].replace(/\+/g," "),n);
+			appendKeyWord(type,keyword[i].replace(/\+/g," "),false);
 		}
 	}
 	var selectScope = function(type,scope){
@@ -265,14 +264,12 @@ $(function(){
 	var msgset = {{.T.msgset}};
 	if(msgset != ""){
 		if(typeof(msgset.tender) != "undefined"){
-			selectKeyword("tender",msgset.tender.a_key,1);
 			selectScope("tender",msgset.tender.s_scope);
-			autoChecked("tender",false,msgset.tender.s_scope,1);
+			selectKeyword("tender",msgset.tender.a_key);
 		}
 		if(typeof(msgset.bid) != "undefined"){
-			selectKeyword("bid",msgset.bid.a_key,1);
 			selectScope("bid",msgset.bid.s_scope);
-			autoChecked("bid",false,msgset.bid.s_scope,1);
+			selectKeyword("bid",msgset.bid.a_key);
 		}
 	}
 	$(".swordfish-nva>ul>li:eq(2)").addClass("swordfish-nva-active");
@@ -282,10 +279,10 @@ $(function(){
 	});
 	//
 	$("#tender-addkeyword").click(function(){
-		appendKeyWord("tender");
+		appendKeyWord("tender","",true);
 	});
 	$("#bid-addkeyword").click(function(){
-		appendKeyWord("bid");
+		appendKeyWord("bid","",true);
 	});
 	//
 	$("#tender-scope-dialog").find("li .btn").click(function(){
@@ -332,15 +329,9 @@ function afterSelectScope(type,btn){
 	autoChecked(type,true);
 	ajaxReq();
 }
-function autoChecked(type,flag,msg,n){
-
+function autoChecked(type,flag){
 	var obj = $("#"+type);
-	if(n==1){
-		if(msg.length=0){
-			obj.find(".swordfish-scope").html('<button class="btn swordfish-btn-a swordfish-country">全国</button>');
-			$("#"+type+"-scope-dialog li:first .btn").addClass("swordfish-btn-a");
-		}
-	}else if(obj.find(".swordfish-scope").children(".btn").length == 0){
+	if(obj.find(".swordfish-scope").children(".btn").length == 0){
 		obj.find(".swordfish-scope").html('<button class="btn swordfish-btn-a swordfish-country">全国</button>');
 		$("#"+type+"-scope-dialog li:first .btn").addClass("swordfish-btn-a");
 	}
@@ -351,16 +342,16 @@ function autoChecked(type,flag,msg,n){
 	obj.find(".swordfish-uncheck").hide();
 	obj.find(".swordfish-checked").show();
 	if(obj.find(".swordfish-keywords").children(".swordfish-keyword").length == 0){
-		appendKeyWord(type,"");
+		appendKeyWord(type,"",false);
 	}
 	if(flag){
 		ajaxReq();
 	}
 }
-function appendKeyWord(type,value,n){
+function appendKeyWord(type,value,isFocus){
 	this.getHtml = function(index,value){
 		return '<div class="swordfish-keyword">'
-					+'<b>关键词<font>'+index+'</font>:</b>'
+					+'<lable>关键词<font>'+index+'</font>:</lable>'
 					+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100">'
 					+'<img src="/images/swordfish/delete.png">'
 				+'</div>';
@@ -368,9 +359,11 @@ function appendKeyWord(type,value,n){
 	var obj = $("#"+type+"-keywords");
 	var count = obj.children(".swordfish-keyword").length;
 	if(count >= 5){
-		$("#"+type+"-addkeyword").attr("disabled",true);
 		return;
 	}
+	if(count == 4){
+		$("#"+type+"-addkeyword").attr("disabled",true);
+	}
 	var node = $(getHtml(count+1,value));
 	obj.children("button").before(node);
 	node.children("img").click(function(){
@@ -386,7 +379,10 @@ function appendKeyWord(type,value,n){
 		autoChecked(type,false);
 		ajaxReq();
 	});
-	autoChecked(type,false,"",n);
+	if(isFocus){
+		node.children("[type='text']").focus()
+	}
+	autoChecked(type,false);
 }
 function ajaxReq(){
 	var thisClass = this;
@@ -433,7 +429,7 @@ function ajaxReq(){
 	/*****************************************/
 	$.ajax({
 		type: "POST",
-		url: "/member/rssset/ajaxReq",
+		url: "/member/swordfish/rssset/ajaxReq",
 		data: dataObj,
 		dataType: "json",
 		traditional: true,

+ 0 - 53
core/src/web/templates/swordfish/swordfish.html

@@ -1,53 +0,0 @@
-<html>
-<head>
-<title>剑鱼_企明星</title>
-{{include "/common/inc.html"}}
-</head>
-<body>
-{{include "/common/head.html"}}
-<div class="a-content text-center a-entcommunity">
-<img class="carousel-inner img-responsive img-rounded invisible center-block" src="/images/qfw-fish.png">
-<div class="margin-b-20">
-{{if session "userId"}}
-<script>
-var utype= {{session "userType"}}
-if(utype==0){
-	window.location.href='/manage/system';
-}else{
-	window.location.href='/member/swordfish';
-}
-</script>
-{{else}}
-<a href="javascript:void(0)" class="btn btn-primary fishdl">扫码登录</a><br>
-<span class="text-muted">扫码登录即可免费体验</span>
-{{end}}
-</div>	
-</div>
-{{include "/common/bottom.html"}}
-<script>
-loginBackType = -1;
-webSiteInitFlag = false;
-$(function(){
-	setNavbarActive(1);
-	setTimeout(function(){
-		var h = $(".a-entcommunity>div").offset().top + $(".a-entcommunity>div").height() - document.body.clientHeight;
-		if(h > 0){
-			$(".a-entcommunity>img").css({width:($(".a-entcommunity>img").height()-h)/$(".a-entcommunity>img").height()*$(".a-entcommunity>img").width(),height:$(".a-entcommunity>img").height()-h})
-									.removeClass("invisible");
-			webSiteInitFlag = true;
-			webSiteInit();
-		}else{
-			$(".a-entcommunity>img").removeClass("invisible");
-		}
-	},100);
-	$(".a-entcommunity .a-com-login,.fishdl").click(function(){
-		loginModalShow();
-	});
-});
-
-function publicCallBack(){
-	window.location.href="/member/swordfish";
-}
-</script>
-</body>
-</html>

+ 79 - 0
core/src/web/templates/swordfish/wxindex.html

@@ -0,0 +1,79 @@
+<html>
+<head>
+<title>剑鱼</title>
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+<link href="/wxrssset/style.css" rel="stylesheet">
+<link href="/swiper/swiper.min.css" rel="stylesheet">
+<script src="/js/jquery.js"></script>
+<script src="/swiper/swiper.min.js"></script>
+</head>
+<body>
+<div class="swiper-container">
+    <div class="swiper-wrapper">
+        <div class="swiper-slide">
+				<img id="guide-firstImg" src="/images/swordfish/guide-1.png">
+		</div>
+       	<div class="swiper-slide">
+				<img src="/images/swordfish/guide-2.png">
+		</div>
+       	<div class="swiper-slide">
+				<img src="/images/swordfish/guide-3.png">
+		</div>
+		<div class="swiper-slide">
+				<img src="/images/swordfish/guide-4.png">
+		</div>
+		<div class="swiper-slide">
+				<img src="/images/swordfish/guide-5.png">
+		</div>
+    </div>
+    <!-- 如果需要分页器 -->
+   	<div class="swiper-pagination"></div>
+	<div class="guide-bottom">
+		<img src="/wxrssset/images/up.png">
+		<span onclick="window.location.href='/swordfish/page'">跳过引导>></span>
+	</div>
+</div>
+<script type="text/javascript">
+$(function(){
+	var currentIndex = 0;
+	var mySwiper = new Swiper('.swiper-container', {
+        pagination: '.swiper-pagination',
+        paginationClickable: true,
+        direction: 'vertical',
+		touchMoveStopPropagation: false,
+		virtualTranslate: true,
+		onSlideChangeStart: function(swiper){
+			var prevSlide = $(swiper.slides[swiper.previousIndex]);
+			prevSlide.addClass("slide-active");
+			var activeSlide = $(swiper.slides[swiper.activeIndex]);
+			if(currentIndex > swiper.activeIndex){
+				activeSlide.addClass("slide-down");
+			}else if(currentIndex < swiper.activeIndex){
+				activeSlide.addClass("slide-up");
+			}
+			currentIndex = swiper.activeIndex;
+			activeSlide.one("webkitAnimationEnd",function(){
+				$(this).removeClass("slide-up").removeClass("slide-down");
+				prevSlide.removeClass("slide-active");
+			});
+		},
+		onSliderMove: function(swiper, event){
+			if(swiper.isEnd && (swiper.touches.currentX - swiper.touches.startX) > 20) {
+				window.location.href = "/swordfish/page";
+			}
+		}
+    });
+	var imgHeight = 604;
+	var imgWidth = 813;
+	var width = document.body.clientWidth;
+	var height = document.body.clientHeight;
+	if(imgWidth > width){
+		var h = width / imgWidth * imgHeight;
+		$(".swiper-slide img").css({width: width,height: h,marginTop: -(h / 2)});
+	}else if(imgHeight > height){
+		$(".swiper-slide img").css({width: height / imgHeight * imgWidth,height: height,marginTop: -(height / 2)});
+	}
+});
+</script>
+</body>
+</html>

+ 1 - 1
core/src/web/templates/member/message/wxrssset.html → core/src/web/templates/swordfish/wxrssset.html

@@ -2,7 +2,7 @@
 <head>
 <title>企明星-信息订阅</title>
 <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
-<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0" user-scalable="no" />
+<meta name="viewport" content="width=device-width, initial-scale=1">
 <meta name="renderer" content="webkit">
 <link href="/wxrssset/style.css" rel="stylesheet">
 <script src="/js/jquery.js"></script>

+ 18 - 17
core/src/web/templates/wxpush/index.html

@@ -5,10 +5,16 @@
 <script src="/js/jquery.js"></script>
 <script>
 $(function(){
-	$("body").html({{.T.data.s_content}});
 	var s_words = {{.T.data.s_words}};
 	var a_visitedindex = {{.T.data.a_visitedindex}};
+	var s_type = {{.T.data.s_type}};
 	var a_publishtime = {{.T.data.a_publishtime}};
+	$("body").html({{.T.data.s_content}});
+	if(typeof(s_words) != "undefined" && s_words.length > 0){
+		$("body>div:first").html('根据你设置的'+(s_type=="tender"?"招标公告":s_type=="bid"?"中标公告":"")+'关键词(<font class="keyword">'+s_words.join(" ; ").replace(/\+/gm," ")+'</font>)为你推送以下信息:');
+	}else{
+		$("body>div:first").remove();
+	}
 	$(".tslist").each(function(i){
 		$(this).children(".xh").text(function(i,v){
 			return v.replace(".","")
@@ -52,17 +58,15 @@ $(function(){
 					var leave2=leave1%(3600*1000);//计算小时数后剩余的毫秒数
 					var minutes=Math.floor(leave2/(60*1000));
 					//计算相差秒数
-					var leave3=leave2%(60*1000);//计算分钟数后剩余的毫秒数
-					var seconds=Math.round(leave3/1000);
-					var timeDiff = null;
+					/*var leave3=leave2%(60*1000);//计算分钟数后剩余的毫秒数
+					var seconds=Math.round(leave3/1000);*/
+					var timeDiff = "1分钟";
 					if(days > 0){
 						timeDiff = days+"天";
 					}else if(hours > 0){
 						timeDiff = hours+"小时";
 					}else if(minutes > 0){
 						timeDiff = minutes+"分钟";
-					}else{
-						timeDiff = seconds+"秒";
 					}
 					return '<div class="time-diff">'+timeDiff+'前</div>';
 				}
@@ -97,11 +101,8 @@ function redirect(link){
 	if(!/^http/.test(link)){
 		link="http://"+link
 	}
-    var arg ='\u003cscript\u003etop.location.replace("'+link+'")\u003c/script\u003e';
-    var iframe = document.createElement('iframe');
-    iframe.src='javascript:window.name;';
-    iframe.name=arg;
-    document.body.appendChild(iframe);
+	window.location.href="/visit/redirect?url="+escape(link)
+
 }
 function setVisitedIndex(obj){
 	if(obj.hasClass("visited")){
@@ -122,16 +123,15 @@ body{
 body>div:first-child{
 	background-color: #F8F8F8;
 	padding: 10px;
-	color: #999;
+	color: #a0a0a0;
 	font-size: 14px;
 }
 .xh{
 	color: #24C0D7;
-	padding-right: 10px;
-	display: table-cell;
+	position: absolute;
 }
 .tslist>div{
-	display: table-cell;
+	padding-left: 20px;
 }
 a{
 	text-decoration: none;
@@ -143,12 +143,13 @@ a{
 .tslist{
 	padding: 10px;
 	border-bottom: 1px solid #ddd;
+	position: relative;
 }
 .visited{
-	color: #999;
+	color: #a0a0a0;
 }
 .time-diff{
-	color: #999;
+	color: #a0a0a0;
 	font-size: 14px;
 	margin-top: 5px;
 }

+ 17 - 12
push/src/qfw/push/bid/bidpushjob.go

@@ -120,7 +120,7 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 		}
 	}()
 	//wxstr := ""
-	str := fmt.Sprintf("<div>根据您设置的关键词(%s),给您推送以下信息:</div>", strings.Join(k.Interest, " "))
+	str := fmt.Sprintf("<div>根据您设置的关键词(%s),给您推送以下信息:</div>", strings.Join(k.Interest, ";"))
 
 	//发送内容组合
 	i := 0
@@ -130,29 +130,34 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 	for ks := v.Front(); ks != nil; ks = ks.Next() {
 		k2 := *(ks.Value.(*map[string]interface{}))
 		i++
-		if firstTitle == "" {
+		if i == 1 {
 			firstTitle = strings.Replace(k2["title"].(string), "\n", "", -1)
+			lastInfoDate = k2["publishtime"].(int64)
 		}
 		str += "<div class='tslist'><span class='xh'>" + fmt.Sprintf("%d", i) + ".</span><a class='bt' target='_blank' href='" + k2["href"].(string) + "'>" + strings.Replace(k2["title"].(string), "\n", "", -1) + "</a></div>"
 		publishTimes[strconv.Itoa(i)] = k2["publishtime"]
 
-		date1 := k2["publishtime"].(int64)
-		if date1-lastInfoDate > 0 {
-			lastInfoDate = date1
-		}
 		if i >= MaxPushSize {
 			//限制最大信息条数
 			break
 		}
 
 	}
-	TITLE := TITLEA + fmt.Sprintf("%d条,关键词(%s)", i, strings.Join(k.Interest, ","))
+	TITLE := TITLEA + fmt.Sprintf("%d条,关键词(%s)", i, strings.Join(k.Interest, ";"))
 	WXTitle := fmt.Sprintf("%s《%s》%s", func() string {
-		minute := (now.Unix() - lastInfoDate) / 60
-		if minute > 120 || minute < 1 {
-			return ""
+		minute := now.Unix() - lastInfoDate
+		if minute > -1 && minute < 61 {
+			return fmt.Sprintf("%d秒前发布的", minute)
 		} else {
-			return fmt.Sprintf("%d分钟前发布的", minute)
+			minute = minute / 60
+			if minute > 121 {
+				return ""
+			} else {
+				if minute < 1 {
+					minute = 1
+				}
+				return fmt.Sprintf("%d分钟前发布的", minute)
+			}
 		}
 	}(), firstTitle, func() string {
 		if i == 1 {
@@ -191,7 +196,7 @@ func sendWeixin(k *push.MemberInterest, TITLE, str, nowtime, wxstr string, now t
 		"a_publishtime": publishTimes,
 	}
 	wid := mongodb.Save("wxpush", &wxpush)
-	wxstr = "\n点击下方“详情”查看详细信息。\n以上中标信息,是剑鱼根据关键字“" + strings.Join(k.Interest, " ") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
+	wxstr = "\n点击下方“详情”查看详细信息。\n以上中标信息,是剑鱼根据关键字“" + strings.Join(k.Interest, ";") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
 
 	wxDate := ""
 	if k.InterestDate > 0 {

+ 17 - 13
push/src/qfw/push/tender/tenderpushjob.go

@@ -119,7 +119,7 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 	}()
 
 	//wxstr := ""
-	str := fmt.Sprintf("<div>根据您设置的关键词(%s),给您推送以下信息:</div>", strings.Join(k.Interest, " "))
+	str := fmt.Sprintf("<div>根据您设置的关键词(%s),给您推送以下信息:</div>", strings.Join(k.Interest, ";"))
 	//发送内容组合
 	i := 0
 	lastInfoDate := int64(0)
@@ -128,29 +128,33 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 	for ks := v.Front(); ks != nil; ks = ks.Next() {
 		k2 := *(ks.Value.(*map[string]interface{}))
 		i++
-		if firstTitle == "" {
+		if i == 1 {
 			firstTitle = strings.Replace(k2["title"].(string), "\n", "", -1)
+			lastInfoDate = k2["publishtime"].(int64)
 		}
 		str += "<div class='tslist'><span class='xh'>" + fmt.Sprintf("%d", i) + ".</span><a class='bt' target='_blank' href='" + k2["href"].(string) + "'>" + strings.Replace(k2["title"].(string), "\n", "", -1) + "</a></div>"
 		publishTimes[strconv.Itoa(i)] = k2["publishtime"]
-
-		date1 := k2["publishtime"].(int64)
-		if date1-lastInfoDate > 0 {
-			lastInfoDate = date1
-		}
 		if i >= MaxPushSize {
 			//限制最大信息条数
 			break
 		}
 
 	}
-	TITLE := TITLEA + fmt.Sprintf("%d条,关键词(%s)", i, strings.Join(k.Interest, " "))
+	TITLE := TITLEA + fmt.Sprintf("%d条,关键词(%s)", i, strings.Join(k.Interest, ";"))
 	WXTitle := fmt.Sprintf("%s《%s》%s", func() string {
-		minute := (now.Unix() - lastInfoDate) / 60
-		if minute > 120 || minute < 1 {
-			return ""
+		minute := now.Unix() - lastInfoDate
+		if minute > -1 && minute < 61 {
+			return fmt.Sprintf("%d秒前发布的", minute)
 		} else {
-			return fmt.Sprintf("%d分钟前发布的", minute)
+			minute = minute / 60
+			if minute > 121 {
+				return ""
+			} else {
+				if minute < 1 {
+					minute = 1
+				}
+				return fmt.Sprintf("%d分钟前发布的", minute)
+			}
 		}
 	}(), firstTitle, func() string {
 		if i == 1 {
@@ -200,7 +204,7 @@ func sendWeixin(k *push.MemberInterest, TITLE, str, nowtime, wxstr string, now t
 		wxDate = time.Now().Local().Add(time.Duration(-n2) * time.Second).Add(time.Duration(-n1*24) * time.Hour).Format(util.Date_Full_Layout)
 	}
 
-	wxstr = "\n点击下方“详情”查看详细信息。\n以上招标信息,是剑鱼根据关键字“" + strings.Join(k.Interest, " ") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
+	wxstr = "\n点击下方“详情”查看详细信息。\n以上招标信息,是剑鱼根据关键字“" + strings.Join(k.Interest, ";") + "”奋力查找并推送,如不合您心意,请猛戳企明星菜单“会员服务—剑鱼”进行修改。"
 	push.SendWinXin(&qrpc.NotifyMsg{
 		Openid:  k.Openid,
 		Title:   push.PushConfig["tenderTitle"].(string),

+ 0 - 4
weixin/src/config.json

@@ -28,10 +28,6 @@
 		"identifytplid":"sKn4r0or615ETYC-aI5OACPO_Q4-B8GYmgWoqcDghN4",
 		"offLinemsgtplid":"ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
 		"msgnotifytplid":"fcke7PqteAtclzHV3ScdiePH48vxaH6M5aJF0O_7by8",
-<<<<<<< HEAD
 		"managernotirytplid":"dplgu5Q644vzPdqcPXY7RqgItS3eXACmU1XDl27CvTA"
-=======
-		"managernotifytplid":"DIwMrPQToOhGfa6ZAQCCrqquzbLKajiXsKY0K_lQtWQ"
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
 	}
 }

+ 11 - 35
weixin/src/qfw/weixin/menu.go

@@ -15,31 +15,10 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 
 	menu := &Menu{make([]MenuButton, 3)}
 
-	menu.Buttons[0].Name = "领取红包"
-	menu.Buttons[0].Type = MenuButtonTypeUrl
-	menu.Buttons[0].Url = "http://mp.weixin.qq.com/s?__biz=MzA5MTk0MTk5Ng==&mid=401971726&idx=1&sn=89d2470f1de7e80975223041b06c106a#rd"
-	//
-	//menu.Buttons[0].Name = "关于我们"
-	//menu.Buttons[0].SubButtons = make([]MenuButton, 3)
-	//menu.Buttons[0].SubButtons[0].Name = "关于企明星"
-	//menu.Buttons[0].SubButtons[0].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[0].Url = wf.SysConfig.Aboutmeurl
-	//menu.Buttons[0].SubButtons[1].Name = "联系我们"
-	//menu.Buttons[0].SubButtons[1].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[1].Url = wf.SysConfig.Conactusurl
-	//menu.Buttons[0].SubButtons[2].Name = "微社区"
-	//menu.Buttons[0].SubButtons[2].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[2].Url = wf.SysConfig.Wsqurl
-	//menu.Buttons[0].SubButtons[2].Name = "测试菜单"
-	//menu.Buttons[0].SubButtons[2].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[2].Url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + wf.SysConfig.Appid + "&redirect_uri=http://" + wf.SysConfig.Domain + "/weixinoauth?action=viewtest&response_type=code&scope=snsapi_base&state=1#wechat_redirect"
-	//log.Println(menu.Buttons[0].SubButtons[2].Url)
+	menu.Buttons[0].Name = "剑鱼"
+	menu.Buttons[0].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
+	menu.Buttons[0].Url = fmt.Sprintf(urlstr, "swordfishaction")
 
-	/**
-	menu.Buttons[1].Name = "企业会员认证"
-	menu.Buttons[1].Type = MenuButtonTypeKey
-	menu.Buttons[1].Key = "midentification"
-	**/
 	menu.Buttons[1].Name = "会员认证"
 	menu.Buttons[1].SubButtons = make([]MenuButton, 3)
 	menu.Buttons[1].SubButtons[0].Name = "企业认证"
@@ -57,20 +36,17 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 	menu.Buttons[2].SubButtons[0].Name = "微官网"
 	menu.Buttons[2].SubButtons[0].Type = MenuButtonTypeKey
 	menu.Buttons[2].SubButtons[0].Key = "msite" //"http://" + wf.SysConfig.Domain + "/weixin/site/edit" //微官网编辑
-	menu.Buttons[2].SubButtons[1].Name = "剑鱼"
-	//menu.Buttons[2].SubButtons[1].Type = MenuButtonTypeKey
-	//menu.Buttons[2].SubButtons[1].Key = "swordfish" //剑鱼
+
+	menu.Buttons[2].SubButtons[1].Name = "企业查询"
 	menu.Buttons[2].SubButtons[1].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
-	menu.Buttons[2].SubButtons[1].Url = fmt.Sprintf(urlstr, "swordfishaction")
+	menu.Buttons[2].SubButtons[1].Url = fmt.Sprintf(urlstr, "entsearchaction")
+	menu.Buttons[2].SubButtons[2].Name = "法规查询"
+	menu.Buttons[2].SubButtons[2].Type = MenuButtonTypeUrl
+	menu.Buttons[2].SubButtons[2].Url = fmt.Sprintf(urlstr, "lawsearchaction")
 
-	menu.Buttons[2].SubButtons[2].Name = "企业查询"
-	menu.Buttons[2].SubButtons[2].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
-	//menu.Buttons[2].SubButtons[2].Url = "http://" + wf.SysConfig.Domain + "/search/enterprise/ent.html" //
-	menu.Buttons[2].SubButtons[2].Url = fmt.Sprintf(urlstr, "entsearchaction")
-	menu.Buttons[2].SubButtons[3].Name = "法规查询"
+	menu.Buttons[2].SubButtons[3].Name = "领取红包"
 	menu.Buttons[2].SubButtons[3].Type = MenuButtonTypeUrl
-	//menu.Buttons[2].SubButtons[3].Url = "http://" + wf.SysConfig.Domain + "/law/qfw/index" //
-	menu.Buttons[2].SubButtons[3].Url = fmt.Sprintf(urlstr, "lawsearchaction")
+	menu.Buttons[2].SubButtons[3].Url = "http://mp.weixin.qq.com/s?__biz=MzA5MTk0MTk5Ng==&mid=401971726&idx=1&sn=89d2470f1de7e80975223041b06c106a#rd"
 
 	err := Mux.CreateMenu(menu)
 	if err != nil {

+ 21 - 0
weixin/src/qfw/weixin/rpc/jssdk.go

@@ -0,0 +1,21 @@
+package rpc
+
+//JS 微信接口
+import (
+	"fmt"
+	"qfw/util"
+	wf "qfw/weixinconfig"
+	"time"
+)
+
+//取得JS接口参数
+func (wxrpc *WeiXinRpc) GetJSInterfaceParam(currenturl /*当前页面的URL一定要真实*/ string, ret *[]string) (err error) {
+	timestamp := time.Now().Unix()
+	noncestr := util.Uuid(32)
+	signature, _ := wxrpc.wx.JsSignature(currenturl, timestamp, noncestr)
+	*ret = append(*ret, wf.SysConfig.Appid)
+	*ret = append(*ret, fmt.Sprintf("%d", timestamp))
+	*ret = append(*ret, noncestr)
+	*ret = append(*ret, signature)
+	return nil
+}

+ 4 - 52
weixin/src/qfw/weixin/rpc/rpc.go

@@ -25,22 +25,14 @@ const (
 	//msgnotify_tplid = "b7iuAMiTCIolnPhTdueKBVYThEMf2D-Bh2M_9v3J-68" //消息提醒
 )
 
-<<<<<<< HEAD
-var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managernotiry_tplid string
-=======
-var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managerNotify_tplid string
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
+var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managernotify_tplid string
 
 //读取配置
 func InitTpl() {
 	identify_tplid = wf.SysConfig.MessageTpl["identifytplid"]
 	offLineMsg_tplid = wf.SysConfig.MessageTpl["offLinemsgtplid"]
 	msgnotify_tplid = wf.SysConfig.MessageTpl["msgnotifytplid"]
-<<<<<<< HEAD
-	managernotiry_tplid = wf.SysConfig.MessageTpl["managernotirytplid"]
-=======
-	managerNotify_tplid = wf.SysConfig.MessageTpl["managernotifytplid"]
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
+	managernotify_tplid = wf.SysConfig.MessageTpl["managernotifytplid"]
 }
 
 func (wxrpc *WeiXinRpc) SendPushTplMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
@@ -126,8 +118,8 @@ func (wxrpc *WeiXinRpc) SendIdentifyTplMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcR
 	return
 }
 
+//发送管理员通知
 func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
-	log.Println("tpl::", identify_tplid)
 	//构造自定义消息文本
 	var msg struct {
 		ToUser   string `json:"touser"`
@@ -150,7 +142,7 @@ func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.Rp
 		} `json:"data"`
 	}
 	msg.ToUser = param.Openid
-	msg.TplId = managerNotify_tplid
+	msg.TplId = managernotify_tplid
 	msg.Url = param.Url
 	msg.Data.Title.Value = param.Title
 	msg.Data.Detail.Value = param.Detail
@@ -206,46 +198,6 @@ func (wxrpc *WeiXinRpc) SendOffLineMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResul
 	return
 }
 
-//发送管理员通知
-func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
-	//构造自定义消息文本
-	var msg struct {
-		ToUser   string `json:"touser"`
-		TplId    string `json:"template_id"`
-		Url      string `json:"url"`
-		Topcolor string `json:"topcolor"`
-		Data     struct {
-			Title struct {
-				Value string `json:"value"`
-			} `json:"first"`
-			Detail struct {
-				Value string `json:"value"`
-			} `json:"keyword1"`
-			Result struct {
-				Value string `json:"value"`
-			} `json:"keyword2"`
-			Remark struct {
-				Value string `json:"value"`
-			} `json:"remark"`
-		} `json:"data"`
-	}
-	msg.ToUser = param.Openid
-	msg.TplId = managernotiry_tplid
-	msg.Url = param.Url
-	msg.Data.Title.Value = param.Title
-	msg.Data.Detail.Value = param.Detail
-	msg.Data.Result.Value = param.Result
-	msg.Data.Remark.Value = param.Remark
-
-	err = wxrpc.wx.PostTextCustom(tplapi_url, &msg)
-	if err != nil {
-		log.Println(err.Error())
-	} else {
-		log.Println("send tplmsg success!")
-	}
-	return
-}
-
 func StartWeixinRpc(wx *weixin.Weixin) {
 	wrpc := &WeiXinRpc{wx: wx}
 	//在此可以注册多个Rpc服务接口

+ 343 - 61
weixin/src/qfw/weixin/weixinsdk.go

@@ -13,6 +13,7 @@ import (
 	"log"
 	"mime/multipart"
 	"net/http"
+	"net/url"
 	"os"
 	"path/filepath"
 	"regexp"
@@ -23,45 +24,71 @@ import (
 
 const (
 	// Event type
-	msgEvent         = "event"
-	EventSubscribe   = "subscribe"
-	EventUnsubscribe = "unsubscribe"
-	EventScan        = "scan"
-	EventClick       = "CLICK"
+	msgEvent          = "event"
+	EventSubscribe    = "subscribe"
+	EventUnsubscribe  = "unsubscribe"
+	EventScan         = "scan"
+	EventView         = "VIEW"
+	EventClick        = "CLICK"
+	EventLocation     = "LOCATION"
+	EventTemplateSent = "TEMPLATESENDJOBFINISH"
+
 	// Message type
-	MsgTypeDefault          = ".*"
-	MsgTypeText             = "text"
-	MsgTypeImage            = "image"
-	MsgTypeVoice            = "voice"
-	MsgTypeVideo            = "video"
-	MsgTypeLocation         = "location"
-	MsgTypeLink             = "link"
-	MsgTypeEvent            = msgEvent + ".*"
-	MsgTypeEventSubscribe   = msgEvent + "\\." + EventSubscribe
-	MsgTypeEventUnsubscribe = msgEvent + "\\." + EventUnsubscribe
-	MsgTypeEventScan        = msgEvent + "\\." + EventScan
-	MsgTypeEventClick       = msgEvent + "\\." + EventClick
+	MsgTypeDefault           = ".*"
+	MsgTypeText              = "text"
+	MsgTypeImage             = "image"
+	MsgTypeVoice             = "voice"
+	MsgTypeVideo             = "video"
+	MsgTypeShortVideo        = "shortvideo"
+	MsgTypeLocation          = "location"
+	MsgTypeLink              = "link"
+	MsgTypeEvent             = msgEvent + ".*"
+	MsgTypeEventSubscribe    = msgEvent + "\\." + EventSubscribe
+	MsgTypeEventUnsubscribe  = msgEvent + "\\." + EventUnsubscribe
+	MsgTypeEventScan         = msgEvent + "\\." + EventScan
+	MsgTypeEventView         = msgEvent + "\\." + EventView
+	MsgTypeEventClick        = msgEvent + "\\." + EventClick
+	MsgTypeEventLocation     = msgEvent + "\\." + EventLocation
+	MsgTypeEventTemplateSent = msgEvent + "\\." + EventTemplateSent
+
 	// Media type
 	MediaTypeImage = "image"
 	MediaTypeVoice = "voice"
 	MediaTypeVideo = "video"
 	MediaTypeThumb = "thumb"
 	// Button type
-	MenuButtonTypeKey        = "click"
-	MenuButtonTypeUrl        = "view"
-	MenuButtonTypeMedia      = "media_id"
-	MenuButtonTypePicOrAlbum = "pic_photo_or_album"
+	MenuButtonTypeKey             = "click"
+	MenuButtonTypeUrl             = "view"
+	MenuButtonTypeScancodePush    = "scancode_push"
+	MenuButtonTypeScancodeWaitmsg = "scancode_waitmsg"
+	MenuButtonTypePicSysphoto     = "pic_sysphoto"
+	MenuButtonTypePicPhotoOrAlbum = "pic_photo_or_album"
+	MenuButtonTypePicWeixin       = "pic_weixin"
+	MenuButtonTypeLocationSelect  = "location_select"
+	MenuButtonTypeMediaId         = "media_id"
+	MenuButtonTypeViewLimited     = "view_limited"
+	// Template Status
+	TemplateSentStatusSuccess      = "success"
+	TemplateSentStatusUserBlock    = "failed:user block"
+	TemplateSentStatusSystemFailed = "failed:system failed"
+	// Redirect Scope
+	RedirectURLScopeBasic    = "snsapi_base"
+	RedirectURLScopeUserInfo = "snsapi_userinfo"
 	// Weixin host URL
-	weixinHost        = "https://api.weixin.qq.com/cgi-bin"
-	weixinQRScene     = "https://api.weixin.qq.com/cgi-bin/qrcode"
-	weixinShowQRScene = "https://mp.weixin.qq.com/cgi-bin/showqrcode"
-	weixinFileURL     = "http://file.api.weixin.qq.com/cgi-bin/media"
-	weixinUserInfo    = "https://api.weixin.qq.com/cgi-bin/user/info"
+	weixinHost               = "https://api.weixin.qq.com/cgi-bin"
+	weixinQRScene            = "https://api.weixin.qq.com/cgi-bin/qrcode"
+	weixinShowQRScene        = "https://mp.weixin.qq.com/cgi-bin/showqrcode"
+	weixinShortURL           = "https://api.weixin.qq.com/cgi-bin/shorturl"
+	weixinUserInfo           = "https://api.weixin.qq.com/cgi-bin/user/info"
+	weixinFileURL            = "http://file.api.weixin.qq.com/cgi-bin/media"
+	weixinTemplate           = "https://api.weixin.qq.com/cgi-bin/template"
+	weixinRedirectURL        = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s#wechat_redirect"
+	weixinUserAccessTokenURL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code"
+	weixinJsApiTicketURL     = "https://api.weixin.qq.com/cgi-bin/ticket/getticket"
 	// Max retry count
 	retryMaxN = 3
 	// Reply format
 	replyText               = "<xml>%s<MsgType><![CDATA[text]]></MsgType><Content><![CDATA[%s]]></Content></xml>"
-	reply2CustomerService   = "<xml>%s<MsgType><![CDATA[transfer_customer_service]]></MsgType></xml>"
 	replyImage              = "<xml>%s<MsgType><![CDATA[image]]></MsgType><Image><MediaId><![CDATA[%s]]></MediaId></Image></xml>"
 	replyVoice              = "<xml>%s<MsgType><![CDATA[voice]]></MsgType><Voice><MediaId><![CDATA[%s]]></MediaId></Voice></xml>"
 	replyVideo              = "<xml>%s<MsgType><![CDATA[video]]></MsgType><Video><MediaId><![CDATA[%s]]></MediaId><Title><![CDATA[%s]]></Title><Description><![CDATA[%s]]></Description></Video></xml>"
@@ -70,10 +97,11 @@ const (
 	replyHeader             = "<ToUserName><![CDATA[%s]]></ToUserName><FromUserName><![CDATA[%s]]></FromUserName><CreateTime>%d</CreateTime>"
 	replyArticle            = "<item><Title><![CDATA[%s]]></Title> <Description><![CDATA[%s]]></Description><PicUrl><![CDATA[%s]]></PicUrl><Url><![CDATA[%s]]></Url></item>"
 	transferCustomerService = "<xml>" + replyHeader + "<MsgType><![CDATA[transfer_customer_service]]></MsgType></xml>"
+	reply2CustomerService   = "<xml>%s<MsgType><![CDATA[transfer_customer_service]]></MsgType></xml>"
 
 	// QR scene request
-	requestQRScene      = "{\"expire_seconds\":%d,\"action_name\":\"QR_SCENE\",\"action_info\":{\"scene\":{\"scene_id\":%d}}}"
-	requestQRLimitScene = "{\"action_name\":\"QR_LIMIT_SCENE\",\"action_info\":{\"scene\":{\"scene_id\":%d}}}"
+	requestQRScene      = `{"expire_seconds":%d,"action_name":"QR_SCENE","action_info":{"scene":{"scene_id":%d}}}`
+	requestQRLimitScene = `{"action_name":"QR_LIMIT_SCENE","action_info":{"scene":{"scene_id":%d}}}`
 )
 
 // Common message header
@@ -107,6 +135,7 @@ type Request struct {
 	Longitude    float32
 	Precision    float32
 	Recognition  string
+	Status       string
 }
 
 // Use to reply music message
@@ -142,10 +171,35 @@ type MenuButton struct {
 	Type       string       `json:"type,omitempty"`
 	Key        string       `json:"key,omitempty"`
 	Url        string       `json:"url,omitempty"`
-	Mediaid    int          `json:"media_id"`
+	MediaId    string       `json:"media_id,omitempty"`
 	SubButtons []MenuButton `json:"sub_button,omitempty"`
 }
 
+type UserAccessToken struct {
+	AccessToken   string `json:"access_token"`
+	RefreshToken  string `json:"refresh_token"`
+	ExpireSeconds int    `json:"expires_in"`
+	OpenId        string `json:"openid"`
+	Scope         string `json:"scope"`
+	UnionId       string `json:"unionid,omitempty"`
+}
+
+type UserInfo struct {
+	Subscribe     int    `json:"subscribe,omitempty"`
+	Language      string `json:"language,omitempty"`
+	OpenId        string `json:"openid,omitempty"`
+	UnionId       string `json:"unionid,omitempty"`
+	Nickname      string `json:"nickname,omitempty"`
+	Sex           int    `json:"sex,omitempty"`
+	City          string `json:"city,omitempty"`
+	Country       string `json:"country,omitempty"`
+	Province      string `json:"province,omitempty"`
+	HeadImageUrl  string `json:"headimgurl,omitempty"`
+	SubscribeTime int64  `json:"subscribe_time,omitempty"`
+	Remark        string `json:"remark,omitempty"`
+	GroupId       int    `json:"groupid,omitempty"`
+}
+
 // Use to output reply
 type ResponseWriter interface {
 	// Get weixin
@@ -168,6 +222,7 @@ type ResponseWriter interface {
 	PostVideo(mediaId string, title string, description string) error
 	PostMusic(music *Music) error
 	PostNews(articles []Article) error
+	PostTemplateMessage(templateid string, url string, data interface{}) (string, error)
 	// Media operator
 	UploadMediaFromFile(mediaType string, filepath string) (string, error)
 	DownloadMediaToFile(mediaId string, filepath string) error
@@ -201,11 +256,19 @@ type accessToken struct {
 	expires time.Time
 }
 
+type jsApiTicket struct {
+	ticket  string
+	expires time.Time
+}
+
 type Weixin struct {
-	token     string
-	routes    []*route
-	tokenChan chan accessToken
-	userData  interface{}
+	token      string
+	routes     []*route
+	tokenChan  chan accessToken
+	ticketChan chan jsApiTicket
+	userData   interface{}
+	appId      string
+	appSecret  string
 }
 
 //
@@ -219,9 +282,13 @@ func (qr *QRScene) ToURL() string {
 func New(token string, appid string, secret string) *Weixin {
 	wx := &Weixin{}
 	wx.token = token
+	wx.appId = appid
+	wx.appSecret = secret
 	if len(appid) > 0 && len(secret) > 0 {
 		wx.tokenChan = make(chan accessToken)
 		go createAccessToken(wx.tokenChan, appid, secret)
+		wx.ticketChan = make(chan jsApiTicket)
+		go createJsApiTicket(wx.tokenChan, wx.ticketChan)
 	}
 	return wx
 }
@@ -232,6 +299,14 @@ func NewWithUserData(token string, appid string, secret string, userData interfa
 	return wx
 }
 
+func (wx *Weixin) GetAppId() string {
+	return wx.appId
+}
+
+func (wx *Weixin) GetAppSecret() string {
+	return wx.appSecret
+}
+
 // Register request callback.
 func (wx *Weixin) HandleFunc(pattern string, handler HandlerFunc) {
 	regex, err := regexp.Compile(pattern)
@@ -387,6 +462,21 @@ func (wx *Weixin) DownloadMedia(mediaId string, writer io.Writer) error {
 	return downloadMedia(wx.tokenChan, mediaId, writer)
 }
 
+// Get ip list
+func (wx *Weixin) GetIpList() ([]string, error) {
+	reply, err := sendGetRequest(weixinHost+"/getcallbackip?access_token=", wx.tokenChan)
+	if err != nil {
+		return nil, err
+	}
+	var result struct {
+		IpList []string `json:"ip_list"`
+	}
+	if err := json.Unmarshal(reply, &result); err != nil {
+		return nil, err
+	}
+	return result.IpList, nil
+}
+
 // Create QR scene
 func (wx *Weixin) CreateQRScene(sceneId int, expires int) (*QRScene, error) {
 	reply, err := postRequest(weixinQRScene+"/create?access_token=", wx.tokenChan, []byte(fmt.Sprintf(requestQRScene, expires, sceneId)))
@@ -413,6 +503,31 @@ func (wx *Weixin) CreateQRLimitScene(sceneId int) (*QRScene, error) {
 	return &qr, nil
 }
 
+// Long url to short url
+func (wx *Weixin) ShortURL(url string) (string, error) {
+	var request struct {
+		Action  string `json:"action"`
+		LongUrl string `json:"long_url"`
+	}
+	request.Action = "long2short"
+	request.LongUrl = url
+	data, err := marshal(request)
+	if err != nil {
+		return "", err
+	}
+	reply, err := postRequest(weixinShortURL+"?access_token=", wx.tokenChan, data)
+	if err != nil {
+		return "", err
+	}
+	var shortUrl struct {
+		Url string `json:"short_url"`
+	}
+	if err := json.Unmarshal(reply, &shortUrl); err != nil {
+		return "", err
+	}
+	return shortUrl.Url, nil
+}
+
 // Custom menu
 func (wx *Weixin) CreateMenu(menu *Menu) error {
 	data, err := json.Marshal(menu)
@@ -431,16 +546,14 @@ func (wx *Weixin) GetMenu() (*Menu, error) {
 	reply, err := sendGetRequest(weixinHost+"/menu/get?access_token=", wx.tokenChan)
 	if err != nil {
 		return nil, err
-	} else {
-		var result struct {
-			MenuCtx *Menu `json:"menu"`
-		}
-		if err := json.Unmarshal(reply, &result); err != nil {
-			return nil, err
-		} else {
-			return result.MenuCtx, nil
-		}
 	}
+	var result struct {
+		MenuCtx *Menu `json:"menu"`
+	}
+	if err := json.Unmarshal(reply, &result); err != nil {
+		return nil, err
+	}
+	return result.MenuCtx, nil
 }
 
 func (wx *Weixin) DeleteMenu() error {
@@ -448,6 +561,129 @@ func (wx *Weixin) DeleteMenu() error {
 	return err
 }
 
+// Template
+func (wx *Weixin) SetTemplateIndustry(id1 string, id2 string) error {
+	var industry struct {
+		Id1 string `json:"industry_id1,omitempty"`
+		Id2 string `json:"industry_id2,omitempty"`
+	}
+	industry.Id1 = id1
+	industry.Id2 = id2
+	data, err := marshal(industry)
+	if err != nil {
+		return err
+	}
+	_, err = postRequest(weixinTemplate+"/api_set_industry?access_token=", wx.tokenChan, data)
+	return err
+}
+
+func (wx *Weixin) AddTemplate(shortid string) (string, error) {
+	var request struct {
+		Shortid string `json:"template_id_short,omitempty"`
+	}
+	request.Shortid = shortid
+	data, err := marshal(request)
+	if err != nil {
+		return "", err
+	}
+	reply, err := postRequest(weixinTemplate+"/api_set_industry?access_token=", wx.tokenChan, data)
+	if err != nil {
+		return "", err
+	}
+	var templateId struct {
+		Id string `json:"template_id,omitempty"`
+	}
+	if err := json.Unmarshal(reply, &templateId); err != nil {
+		return "", err
+	}
+	return templateId.Id, nil
+}
+
+func (wx *Weixin) PostTemplateMessage(touser string, templateid string, url string, data interface{}) (string, error) {
+	var msg struct {
+		ToUser     string      `json:"touser"`
+		TemplateId string      `json:"template_id"`
+		Url        string      `json:"url,omitempty"`
+		Data       interface{} `json:"data,omitempty"`
+	}
+	msg.ToUser = touser
+	msg.TemplateId = templateid
+	msg.Url = url
+	msg.Data = data
+	msgStr, err := marshal(msg)
+	if err != nil {
+		return "", err
+	}
+	reply, err := postRequest(weixinHost+"/message/template/send?access_token=", wx.tokenChan, msgStr)
+	if err != nil {
+		return "", err
+	}
+	var resp struct {
+		MsgId string `json:"msgid,omitempty"`
+	}
+	if err := json.Unmarshal(reply, &resp); err != nil {
+		return "", err
+	}
+	return resp.MsgId, nil
+}
+
+// Create redirect url
+func (wx *Weixin) CreateRedirectURL(urlStr string, scope string, state string) string {
+	return fmt.Sprintf(weixinRedirectURL, wx.appId, url.QueryEscape(urlStr), scope, state)
+}
+
+// Get open id
+func (wx *Weixin) GetUserAccessToken(code string) (*UserAccessToken, error) {
+	resp, err := http.Get(fmt.Sprintf(weixinUserAccessTokenURL, wx.appId, wx.appSecret, code))
+	if err != nil {
+		return nil, err
+	}
+	defer resp.Body.Close()
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		return nil, err
+	}
+	var res UserAccessToken
+	if err := json.Unmarshal(body, &res); err != nil {
+		return nil, err
+	}
+	return &res, nil
+}
+
+// Get user info
+func (wx *Weixin) GetUserInfo(openid string) (*UserInfo, error) {
+	reply, err := sendGetRequest(fmt.Sprintf("%s?openid=%s&lang=zh_CN&access_token=", weixinUserInfo, openid), wx.tokenChan)
+	if err != nil {
+		return nil, err
+	}
+	var result UserInfo
+	if err := json.Unmarshal(reply, &result); err != nil {
+		return nil, err
+	}
+	return &result, nil
+}
+
+func (wx *Weixin) GetJsApiTicket() (string, error) {
+	for i := 0; i < retryMaxN; i++ {
+		ticket := <-wx.ticketChan
+		if time.Since(ticket.expires).Seconds() < 0 {
+			return ticket.ticket, nil
+		}
+	}
+	return "", errors.New("Get JsApi Ticket Timeout")
+}
+
+func (wx *Weixin) JsSignature(url string, timestamp int64, noncestr string) (string, error) {
+	ticket, err := wx.GetJsApiTicket()
+	if err != nil {
+		return "", err
+	}
+	h := sha1.New()
+	h.Write([]byte(fmt.Sprintf("jsapi_ticket=%s&noncestr=%s&timestamp=%d&url=%s",
+		ticket, noncestr, timestamp, url)))
+	return fmt.Sprintf("%x", h.Sum(nil)), nil
+}
+
 // Create handler func
 func (wx *Weixin) CreateHandlerFunc(w http.ResponseWriter, r *http.Request) http.HandlerFunc {
 	return func(w http.ResponseWriter, r *http.Request) {
@@ -505,6 +741,16 @@ func (wx *Weixin) routeRequest(w http.ResponseWriter, r *Request) {
 	return
 }
 
+func marshal(v interface{}) ([]byte, error) {
+	data, err := json.Marshal(v)
+	if err == nil {
+		data = bytes.Replace(data, []byte("\\u003c"), []byte("<"), -1)
+		data = bytes.Replace(data, []byte("\\u003e"), []byte(">"), -1)
+		data = bytes.Replace(data, []byte("\\u0026"), []byte("&"), -1)
+	}
+	return data, err
+}
+
 func checkSignature(t string, w http.ResponseWriter, r *http.Request) bool {
 	r.ParseForm()
 	var signature string = r.FormValue("signature")
@@ -547,6 +793,25 @@ func authAccessToken(appid string, secret string) (string, time.Duration) {
 	return "", 0
 }
 
+func getJsApiTicket(c chan accessToken) (*jsApiTicket, error) {
+	reply, err := sendGetRequest(weixinJsApiTicketURL+"?type=jsapi&access_token=", c)
+	if err != nil {
+		return nil, err
+	}
+	var res struct {
+		Ticket    string `json:"ticket"`
+		ExpiresIn int64  `json:"expires_in"`
+	}
+	if err := json.Unmarshal(reply, &res); err != nil {
+		return nil, err
+	}
+	var ticket jsApiTicket
+	ticket.ticket = res.Ticket
+	ticket.expires = time.Now().Add(time.Duration(res.ExpiresIn * 1000 * 1000 * 1000))
+	return &ticket, nil
+
+}
+
 func createAccessToken(c chan accessToken, appid string, secret string) {
 	token := accessToken{"", time.Now()}
 	c <- token
@@ -560,6 +825,20 @@ func createAccessToken(c chan accessToken, appid string, secret string) {
 	}
 }
 
+func createJsApiTicket(cin chan accessToken, c chan jsApiTicket) {
+	ticket := jsApiTicket{"", time.Now()}
+	c <- ticket
+	for {
+		if time.Since(ticket.expires).Seconds() >= 0 {
+			t, err := getJsApiTicket(cin)
+			if err == nil {
+				ticket = *t
+			}
+		}
+		c <- ticket
+	}
+}
+
 func sendGetRequest(reqURL string, c chan accessToken) ([]byte, error) {
 	for i := 0; i < retryMaxN; i++ {
 		token := <-c
@@ -698,24 +977,22 @@ func downloadMedia(c chan accessToken, mediaId string, writer io.Writer) error {
 			if r.Header.Get("Content-Type") != "text/plain" {
 				_, err := io.Copy(writer, r.Body)
 				return err
-			} else {
-				reply, err := ioutil.ReadAll(r.Body)
-				if err != nil {
-					return err
-				}
-				var result response
-				if err := json.Unmarshal(reply, &result); err != nil {
-					return err
-				} else {
-					switch result.ErrorCode {
-					case 0:
-						return nil
-					case 42001: // access_token timeout and retry
-						continue
-					default:
-						return errors.New(fmt.Sprintf("WeiXin download[%d]: %s", result.ErrorCode, result.ErrorMessage))
-					}
-				}
+			}
+			reply, err := ioutil.ReadAll(r.Body)
+			if err != nil {
+				return err
+			}
+			var result response
+			if err := json.Unmarshal(reply, &result); err != nil {
+				return err
+			}
+			switch result.ErrorCode {
+			case 0:
+				return nil
+			case 42001: // access_token timeout and retry
+				continue
+			default:
+				return errors.New(fmt.Sprintf("WeiXin download[%d]: %s", result.ErrorCode, result.ErrorMessage))
 			}
 		}
 	}
@@ -823,6 +1100,11 @@ func (w responseWriter) PostNews(articles []Article) error {
 	return w.wx.PostNews(w.toUserName, articles)
 }
 
+// Post template message
+func (w responseWriter) PostTemplateMessage(templateid string, url string, data interface{}) (string, error) {
+	return w.wx.PostTemplateMessage(w.toUserName, templateid, url, data)
+}
+
 // Upload media from local file
 func (w responseWriter) UploadMediaFromFile(mediaType string, filepath string) (string, error) {
 	return w.wx.UploadMediaFromFile(mediaType, filepath)

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott