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

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

zhanghongbo 9 éve
szülő
commit
7fb7015c5f
41 módosított fájl, 527 hozzáadás és 153 törlés
  1. 12 4
      common/src/qfw/util/encrypt_test.go
  2. 8 8
      core/src/luckdraw.json
  3. 1 0
      core/src/message.json
  4. 91 21
      core/src/qfw/active/activemanage.go
  5. 12 1
      core/src/qfw/member/memberindex.go
  6. 3 1
      core/src/qfw/mobile/wxmenu.go
  7. 12 1
      core/src/qfw/search/searchService.go
  8. 2 0
      core/src/qfw/swordfish/swordfish.go
  9. 32 13
      core/src/qfw/swordfish/swordfishmanage.go
  10. 10 7
      core/src/qfw/yellowpage/yellowpagemanager.go
  11. 1 1
      core/src/timetask.json
  12. 2 1
      core/src/web/staticres/css/entcommunity.css
  13. BIN
      core/src/web/staticres/images/activeimages/lotteryBg.jpg
  14. 35 20
      core/src/web/staticres/js/entportrait.js
  15. 125 0
      core/src/web/staticres/js/qfw.js
  16. 1 1
      core/src/web/staticres/js/relation.js
  17. BIN
      core/src/web/staticres/wxswordfish/images/share-cj.jpg
  18. BIN
      core/src/web/staticres/wxswordfish/images/share-cj.png
  19. 5 0
      core/src/web/staticres/wxswordfish/main.js
  20. 18 0
      core/src/web/staticres/wxswordfish/share.js
  21. 2 5
      core/src/web/staticres/wxswordfish/style.css
  22. 1 1
      core/src/web/templates/active/luckdraw.html
  23. 0 1
      core/src/web/templates/member/credit/mcreditindex.html
  24. 1 1
      core/src/web/templates/search/enterpriseList.html
  25. 14 12
      core/src/web/templates/service/detail.html
  26. 2 4
      core/src/web/templates/service/list.html
  27. 2 2
      core/src/web/templates/service/viewsingledemand.html
  28. 43 0
      core/src/web/templates/swordfish/protocol.html
  29. 24 0
      core/src/web/templates/swordfish/protocoltxt.html
  30. 1 24
      core/src/web/templates/swordfish/rssset.html
  31. 3 0
      core/src/web/templates/swordfish/wxindex.html
  32. 13 0
      core/src/web/templates/swordfish/wxprotocol.html
  33. 1 0
      core/src/web/templates/swordfish/wxpush.html
  34. 6 2
      core/src/web/templates/swordfish/wxrssset.html
  35. 18 10
      core/src/web/templates/swordfish/wxshare.html
  36. 8 3
      core/src/web/templates/swordfish/wxtoolbar.html
  37. 4 4
      core/src/web/templates/yellowpage/enterpriseinfo.html
  38. 3 1
      credit/src/config.json
  39. 2 2
      credit/src/main.go
  40. 1 1
      credit/src/qfw/creditrpc/creditrpc.go
  41. 8 1
      push/src/qfw/push/dopush/dopush.go

+ 12 - 4
common/src/qfw/util/encrypt_test.go

@@ -4,6 +4,7 @@ import (
 	"encoding/base64"
 	"fmt"
 	"log"
+	"strconv"
 	"testing"
 	"time"
 )
@@ -20,11 +21,18 @@ func Test_sim(t *testing.T) {
 	//s := "obEpLuMMDUYUM-zlzCbQ0MbuQOzc,eqweqwewqeqwe,349483204"
 	//s2 := "GyUlIhEDDjcfWCAyIl4xBkgsERYiLAwZLCg9VkkbLj4zMRYDPRs5ATVZOxccPAkzFxw7CCpEFj41QlRAQFdFXlRMQVZcHRIbBgsWBxYcFQwEBwoa"
 
-	s3 := "RFYoal5bCFdXWQoQB0JuWwlXAQFZCUVfFj4JMFtT"
-	s4 := "3333_55a8597fa442ceca9e20bfc2_444"
-	se := SimpleEncrypt{Key: "qfw_hongbao"}
+	//s3 := "RFYoal5bCFdXWQoQB0JuWwlXAQFZCUVfFj4JMFtT"
+	s4 := "oJULtwzXo6EFV1Ah-XeyRBimXGM8,uid,123456,swordfishaction"
+	se := SimpleEncrypt{Key: "topnet"}
 	log.Println(se.EncodeString(s4))
-	log.Println(se.DecodeString(s3))
+	log.Println(se.DecodeString("GyUlIhEDDjcfWCAyIl4xBkgsERYiLAwZLCg9VkkSEkMWCEkHAwACCgMdBwcRDREdGwE=566666666666666"))
+	now := time.Now()
+	tom := time.Date(now.Year(), now.Month(), now.Day(), 18, 0, 0, 0, time.Local)
+	log.Println(now.Unix(), tom.Unix(), 1453686600-1453716000)
+
+	log.Println(GetSubDay(time.Now().AddDate(0, 1, 0).Unix()))
+
+	log.Println("/mobile/sess/" + se.EncodeString("oJULtwzXo6EFV1Ah-XeyRBimXGM8"+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushlist") + "/" + "uid" + "/" + "563acdbe36b82b1df0000002" + "/aa")
 
 }
 

+ 8 - 8
core/src/luckdraw.json

@@ -1,6 +1,6 @@
 {
 	"startDate":1452750000,
-	"endDate":1454256000,
+	"endDate":1455552000,
 	"getAmount":[{
 		"min":0,
 		"max":40,
@@ -8,31 +8,31 @@
 	},{
 		"min":50,
 		"max":85,
-		"proportion":24.2
+		"proportion":37.21
 	},{
 		"min":95,
 		"max":130,
-		"proportion":1
+		"proportion":0.5
 	},{
 		"min":140,
 		"max":175,
-		"proportion":24.2
+		"proportion":20
 	},{
 		"min":185,
 		"max":220,
-		"proportion":2
+		"proportion":1
 	},{
 		"min":230,
 		"max":265,
-		"proportion":24.2
+		"proportion":37.21
 	},{
 		"min":275,
 		"max":310,
-		"proportion":0.3
+		"proportion":0.08
 	},{
 		"min":320,
 		"max":355,
-		"proportion":24.1
+		"proportion":4
 	}],
 	"promotioncode":"2001001501",
 	"weixin":{

+ 1 - 0
core/src/message.json

@@ -5,6 +5,7 @@
 	"entsearchaction":"/wx/search/enterprise/ent.html",
 	"lawsearchaction":"/law/qfw/index",
 	"msiteaction":"/ent/wsite/edit",
+	"wxpushlist":"/wxpush/bid/%s/%s/%s",
 	"indentify":{
 		"success":{
 			"result":"企业认证",

+ 91 - 21
core/src/qfw/active/activemanage.go

@@ -12,7 +12,9 @@ import (
 	"qfw/coreutil"
 	mob "qfw/mobile"
 	. "qfw/util"
+	"qfw/util/credit"
 	. "qfw/util/mongodb"
+	"qfw/util/redis"
 	qrpc "qfw/util/rpc"
 	"strconv"
 	"time"
@@ -22,6 +24,23 @@ type Activemanage struct {
 	*xweb.Action
 	luckdraw    xweb.Mapper `xweb:"/activity/(\\w+)/([^.]*)"`
 	getluckdraw xweb.Mapper `xweb:"/activity/luckdraw"`
+	addredis    xweb.Mapper `xweb:"/activity/addredis"`
+}
+
+//分享成功后建立redis判断值
+func (a *Activemanage) Addredis() error {
+	//
+	openid := a.Session().Get("openid").(string)
+	n := time.Now()
+	tmp := n.Unix()
+	n2 := n.AddDate(0, 0, 1)
+	yxq := time.Date(n2.Year(), n2.Month(), n2.Day(), 23, 59, 59, 0, time.Local).Unix() - tmp
+	yxqs := fmt.Sprintf("%d", yxq)
+	yxqt, _ := strconv.Atoi(yxqs)
+	key := fmt.Sprintf("cj_%s_%s", openid, n2.Format("2006_01_02"))
+	redis.Put("other", key, "cj", yxqt)
+
+	return nil
 }
 
 //进入抽奖页面
@@ -32,7 +51,6 @@ func (a *Activemanage) Luckdraw(activecode, id string) error {
 	a.T["shareid"] = coreutil.FindMyShareId(activecode, openid)
 	//
 	if activecode == "topcj" {
-
 		f := FindOne("user", "{'s_m_openid':'"+openid+"'}")
 		username := (*f)["s_bindweixin"]
 		userid := (*f)["_id"]
@@ -44,10 +62,18 @@ func (a *Activemanage) Luckdraw(activecode, id string) error {
 		a.T["signature"] = mob.GetSignature(a.Url())
 		u := FindOne("winningrecord", "{'s_openid':'"+openid+"'}")
 		if *u != nil {
-			//a.T = *u
-			a.T["flog"] = "A"
-			a.T["msg"] = "小主莫贪心,每人只有一次抽奖机会呦!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
-			return a.Render("/active/luckdraw.html", &a.T)
+			if ret := redis.Get("other", "cj_"+openid+"_"+time.Now().Format("2006_01_02")); ret == nil {
+				//a.T = *u
+				fmt.Println("ret:::::::::", ret, "33333333333", time.Now().Format("2006_01_02"))
+				a.T["flog"] = "A"
+				Tm := time.Now().AddDate(0, 0, 1)
+				if ret := redis.Get("other", "cj_"+openid+"_"+Tm.Format("2006_01_02")); ret == nil {
+					a.T["msg"] = "小主,快分享朋友圈或好友即获得明天的抽奖资格吧!千万不要再忘记了,大奖可能就在明天~"
+				} else {
+					a.T["msg"] = "小主莫贪心,每人每天只有一次抽奖机会呦!分享后明天再来吧!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+				}
+				return a.Render("/active/luckdraw.html", &a.T)
+			}
 		}
 		a.SetSession("username", username)
 		a.SetSession("userid", userid)
@@ -74,9 +100,14 @@ func (a *Activemanage) Getluckdraw() error {
 	} else {
 		u := FindOne("winningrecord", "{'s_openid':'"+openid+"'}")
 		if *u != nil {
-			flog = "A"
-			msg = "  小主莫贪心,每人只有一次抽奖机会呦!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
-			return a.Write(`{"flog":"` + flog + `","msg":"` + msg + `"}`)
+			if ret := redis.Get("other", "cj_"+openid+"_"+time.Now().Format("2006_01_02")); ret == nil {
+				//a.T = *u
+				fmt.Println("ret22:::::::::", ret)
+				a.T["flog"] = "A"
+				a.T["msg"] = "小主莫贪心,每天只有一次抽奖机会呦!分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
+				return a.Write(`{"flog":"` + flog + `","msg":"` + msg + `"}`)
+			}
+			redis.Del("other", "cj_"+openid+"_"+time.Now().Format("2006_01_02"))
 		}
 	}
 	data := make(map[string]interface{})
@@ -95,8 +126,15 @@ func (a *Activemanage) Getluckdraw() error {
 	if len(id) > 0 {
 		flog = "T"
 	}
-	if i > 185 && i < 220 {
-		amount := 500 //红包金额以“元”为单位,微信红包以“分”为单位
+	//红包
+	if (i > 185 && i < 220) || (i > 320 && i < 355) {
+		var amount int //红包金额以“元”为单位,微信红包以“分”为单位
+		if i > 185 && i < 220 {
+			amount = 500 //红包金额以“元”为单位,微信红包以“分”为单位
+
+		} else if i > 320 && i < 355 {
+			amount = 100 //红包金额以“元”为单位,微信红包以“分”为单位
+		}
 		bm := qrpc.BonusMsg{Mchbillno: fmt.Sprint(today.Unix()),
 			Sendname:    LuckDraw.Weixin["sendname"].(string),
 			Reopenid:    openid,
@@ -121,22 +159,28 @@ func (a *Activemanage) Getluckdraw() error {
 			redpackage["s_actcode"] = s_actcode
 			Save("redpackage", redpackage)
 		}
-	}
-	if i > 185 && i < 220 {
-		msg = "  小主是真真的好运气,五元现金红包落入您囊中!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+		msg = "  小主是真真的好运气," + s_prize + "落入您囊中。红包将由系统自动发放到您的微信,请注意查收。<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
 	} else if (i > 275 && i < 310) || (i > 95 && i < 130) {
-		//时间判断,提醒不同
-		now := time.Now()
-		//不在工作时间
-		if now.Weekday() == 6 || now.Weekday() == 0 || (now.Hour() > 18 || now.Hour() < 9) {
+		id := a.GetSession("userid").(string)
+		b := credit.UpuserCreditSession(id, "b6", "B", nil, a.Action)
+		if b == true {
+			//时间判断,提醒不同
+			//now := time.Now()
+			//不在工作时间
+			//if now.Weekday() == 6 || now.Weekday() == 0 || (now.Hour() > 18 || now.Hour() < 9) {
 			//
-			msg = "  小主是真真的好运气," + s_prize + "落入您囊中!<br/>  请在微信留下您的联系方式(手机号或qq号),企明星客服会在下一个工作日9:00-17:00给小主回复哦!<br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
-		} else { //在工作时间
-			msg = "  小主是真真的好运气," + s_prize + "落入您囊中,请速速微信联系企明星确认领奖事宜!<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+			//	msg = "  小主是真真的好运气," + s_prize + "落入您囊中!<br/>  请在微信留下您的联系方式(手机号或qq号),企明星客服会在下一个工作日9:00-17:00给小主回复哦!<br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+			//} else { //在工作时间
+			msg = "  小主是真真的好运气," + s_prize + "落入您囊中。请将您的联系方式和邮寄地址留言给企明星。我们会在活动截止后尽快为您发出。<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
+			//}
+		} else {
+			msg = "  抽奖出错!小主不要桑心,联系企明星管理员,200积分还是您的!"
 		}
 
+	} else if i > 140 && i < 175 {
+		msg = "  小主是真真的好运气,200积分落入您囊中。积分将由系统自动发放到您的企明星账户,请登录www.qmx.top查看。<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
 	} else { //不中奖
-		msg = "  小主不要桑心,这次没有中奖不代表什么,猴年依然会好运气爆棚滴~~<br/><br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
+		msg = "  小主不要桑心,这次没有中奖哦,明天记得要来拼运气啊!<br/><br/>分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
 	}
 	return a.Write(`{"flog":"` + flog + `","msg":"` + msg + `","rotate":` + strconv.Itoa(int(i)) + `}`)
 
@@ -157,6 +201,26 @@ func getLuckDraw() int {
 		amount := min + rand.New(rand.NewSource(time.Now().UnixNano())).Intn(max-min)
 		if amount <= 0 {
 			return 1
+		} else if amount > 275 && amount < 310 {
+			count := Count("winningrecord", "{'s_prize':'《牛奶可乐经济学》'}")
+			if count > 6 {
+				amount = 240
+			}
+		} else if amount > 95 && amount < 130 {
+			count := Count("winningrecord", "{'s_prize':'限量版U盘'}")
+			if count > 100 {
+				amount = 260
+			}
+		} else if amount > 185 && amount < 220 {
+			count := Count("winningrecord", "{'s_prize':'五元现金红包'}")
+			if count > 200 {
+				amount = 60
+			}
+		} else if amount > 320 && amount < 355 {
+			count := Count("winningrecord", "{'s_prize':'一元现金红包'}")
+			if count > 1500 {
+				amount = 80
+			}
 		}
 		return amount
 	}
@@ -188,12 +252,18 @@ func getPrize(i int) string {
 		} else if 91 <= i && i < 136 {
 			prize = "限量版U盘"
 
+		} else if 140 <= i && i < 175 {
+			prize = "200积分"
+
 		} else if 181 <= i && i < 226 {
 			prize = "五元现金红包"
 
 		} else if 271 <= i && i < 316 {
 			prize = "《牛奶可乐经济学》"
 
+		} else if 320 <= i && i < 355 {
+			prize = "一元现金红包"
+
 		} else {
 			prize = "谢谢参与"
 		}

+ 12 - 1
core/src/qfw/member/memberindex.go

@@ -38,8 +38,10 @@ func init() {
 }
 
 func (m *MemberIndex) Sess(str string) error {
+
 	util.Try(func() {
-		str := strings.Split(sewx.DecodeString(str), ",")
+		strs := strings.Split(str, "/")
+		str := strings.Split(sewx.DecodeString(strs[0]), ",")
 		if len(str) == 4 {
 			openid := str[0]
 			//openid unionid time action
@@ -58,6 +60,15 @@ func (m *MemberIndex) Sess(str string) error {
 					UpdateCookieSession(m.Action, "s_nickname", false, person)
 					actionurl := util.ObjToString(coreconfig.MessageConfig[str[3]])
 					if actionurl != "" {
+						if len(strs) > 1 {
+							actionurl = fmt.Sprintf(actionurl, func(tmps []string) []interface{} {
+								res := make([]interface{}, len(tmps))
+								for k, v := range tmps {
+									res[k] = v
+								}
+								return res
+							}(strs[1:])...)
+						}
 						m.Redirect(actionurl)
 					} else {
 						m.Render("_error.html")

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

@@ -25,6 +25,7 @@ func init() {
 
 func (m *Mobile) Guide() error {
 	m.T["signature"] = GetSignature(m.Url())
+	m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 	return m.Render("/swordfish/wxindex.html", &m.T)
 }
 func (m *Mobile) Share(shareid string) error {
@@ -78,7 +79,7 @@ func (m *Mobile) Wxrssset() error {
 			}
 			m.T["msgset"] = (*userInfo)["o_msgset"]
 			//取Shareid
-			m.T["shareid"] = cutil.FindMyShareId("topcj", m.Session().Get("s_m_openid").(string))
+			m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 		}
 
 		return m.Render("/swordfish/wxrssset.html", &m.T)
@@ -331,6 +332,7 @@ func (m *Mobile) WxpushList(s_m_openid string, _id string, msgid string) error {
 	m.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1,"s_type":1}`)
 	m.T["_id"] = _id
 	m.T["signature"] = GetSignature(m.Url())
+	m.T["shareid"] = cutil.FindMyShareId("topjy", m.Session().Get("s_m_openid").(string))
 	return m.Render("/swordfish/wxpush.html", &m.T)
 }
 

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

@@ -502,13 +502,24 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 
 			EntName, _ := res[i]["EntName"].(string)
 			tmpNo := res[i]["EntType"]
+			res[i]["RegCapEntType"] = tmpNo
 			if tmpNo != nil {
 				switch tmpNo.(string) {
 				case "4500", "6800", "6810", "6820", "7100", "7110", "7120", "7130", "7190", "9200", "6840", "2100", "2110", "2120", "2121", "2122", "2123", "2130", "2140", "2150", "2151", "2152", "2190", "2200", "2210", "2211", "2212", "2213", "2219", "2220", "2221", "2222", "2223", "2229", "4000", "4300", "4310", "4320", "4330", "4340", "4550", "4551", "4552", "4553", "4560", "5800", "5810", "5820":
 					res[i]["EntType"] = "5810"
 				}
 			}
-
+			//处理分公司
+			if res[i]["RegCapEntType"] != nil && res[i]["RegCapEntType"].(string) != "" {
+				RegCapEntType := res[i]["RegCapEntType"].(string)
+				if RegCapEntType == "5810" || RegCapEntType == "6810" || RegCapEntType == "7310" || RegCapEntType == "3200" || RegCapEntType == "3100" {
+					res[i]["RegCapEntType"] = "5810"
+				} else if len(RegCapEntType) > 1 {
+					if RegCapEntType[:1] == "2" {
+						res[i]["RegCapEntType"] = "5810"
+					}
+				}
+			}
 			entlerp, _ := res[i]["LeRep"].(string)
 			tmpentno, _ := res[i]["RegNo"].(string)
 			if len(keyword) < 1 {

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

@@ -15,6 +15,8 @@ type SwordFish struct {
 	swordfishlist xweb.Mapper `xweb:"/member/swordfish/swordfishlist"` //剑鱼列表
 	setVisited    xweb.Mapper `xweb:"/member/swordfish/setVisited"`    //已经访问过的列表
 	visitRedirect xweb.Mapper `xweb:"/visit/redirect"`                 //剑鱼跳转访问请求,后续统计
+	protocol      xweb.Mapper `xweb:"/member/swordfish/protocol"`      //剑鱼协议
+	wxprotocol    xweb.Mapper `xweb:"/member/swordfish/wxprotocol"`    //微信剑鱼协议
 }
 
 func init() {

+ 32 - 13
core/src/qfw/swordfish/swordfishmanage.go

@@ -21,7 +21,7 @@ func (s *SwordFish) Swordfish() error {
 			s.T["data"] = r
 		}
 		content, _ := s.Render4Cache("/swordfish/index.html", &s.T)
-		redis.Put("other", "swordfish", string(content), 1000) //缓存半个小时
+		redis.Put("other", "swordfish", string(content), 30*60*1000) //缓存半个小时
 		return s.SetBody(content)
 	}
 }
@@ -49,22 +49,24 @@ func (s *SwordFish) RssSet() error {
 			}
 		}
 	}
-	//list := mongodb.Find("bidding", nil, `{"comeintime":-1}`, `{"title":1,"href":1,"publishtime":1}`, false, 0, 10)
-	if ret := redis.Get("other", "swordfish_rsset"); ret != nil {
-		s.T["list"] = ret.([]interface{})
-	} 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["list"] = *r
-		}
-		redis.Put("other", "swordfish_rsset", *r, 1000) //缓存半个小时
-	}
+	list := getNewest()
+	s.T["list"] = list
 	s.T["msgset"] = msgset
 	return s.Render("/swordfish/rssset.html", &s.T)
 }
 
+//剑鱼用户协议
+func (s *SwordFish) Protocol() error {
+	data := getNewest()
+	s.T["data"] = data
+	return s.Render("/swordfish/protocol.html", &s.T)
+}
+
+//剑鱼用户协议
+func (s *SwordFish) Wxprotocol() error {
+	return s.Render("/swordfish/wxprotocol.html")
+}
+
 //跳转到用户中心剑鱼信息列表
 func (s *SwordFish) Infolist() error {
 	ms := mongodb.FindById("user", s.GetSession("userId").(string), `{"o_msgset":1}`)
@@ -146,3 +148,20 @@ func (s *SwordFish) VisitRedirect() {
 		s.Redirect(surl)
 	}
 }
+
+//剑鱼最新信息列表
+func getNewest() (list []interface{}) {
+	if ret := redis.Get("other", "swordfish_newest_list"); ret != nil {
+		list = ret.([]interface{})
+		return list
+	} 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)
+		redis.Put("other", "swordfish_newest_list", *r, 30*60*1000) //缓存半个小时
+		for _, v := range *r {
+			list = append(list, v)
+		}
+		return list
+	}
+}

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

@@ -83,14 +83,17 @@ func GetEntInfo(id string) interface{} {
 		if OpFrom != nil {
 			(*res)["EstDate"] = FormatDate(&EstDate)
 		}
-		EntType, _ := (*res)["EntType"].(string)
-		//处理分公司
-		if EntType != "" {
-			if EntType == "5810" || EntType == "6810" || EntType == "7310" || EntType == "3200" || EntType == "3100" {
-				(*res)["EntType"] = "5810"
-			} else if len(EntType) > 1 {
-				if EntType[:1] == "2" {
+		var EntType string
+		if (*res)["EntType"] != nil && (*res)["EntType"].(string) != "" {
+			EntType = (*res)["EntType"].(string)
+			//处理分公司
+			if EntType != "" {
+				if EntType == "5810" || EntType == "6810" || EntType == "7310" || EntType == "3200" || EntType == "3100" {
 					(*res)["EntType"] = "5810"
+				} else if len(EntType) > 1 {
+					if EntType[:1] == "2" {
+						(*res)["EntType"] = "5810"
+					}
 				}
 			}
 		}

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-22 20:24:52"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-22 20:24:52"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-26 08:13:30"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-26 08:13:30"}},"marketisstart":true,"marketrate":300}

+ 2 - 1
core/src/web/staticres/css/entcommunity.css

@@ -116,7 +116,8 @@ a:focus, a:hover{
 	color: #16a086;
 }
 .entinfo-page .b-com-head .b-com-title{
-	font-size: 18px;
+	font-size: 20px;
+	color: #405e51;
 	font-weight: bold;
 	margin-right: 5px;
 }

BIN
core/src/web/staticres/images/activeimages/lotteryBg.jpg


+ 35 - 20
core/src/web/staticres/js/entportrait.js

@@ -4,7 +4,7 @@ var serviceList = null;
 //解析服务列表
 $(function(){
 	//联系地址
-	if(address){
+	if($address){
 		loadJS("/js/jquery.cxselect.js",function(){
 			$('#city_china').cxSelect({
 				selects: ['province', 'city', 'area'],
@@ -72,27 +72,42 @@ function b_afterLogin(flag){
 //加载关系网
 function initRelation(){
 	if(isLogined){
-		$.post("/member/getRelation",{regNo:regNo,entName:entName},function(r){
-			if(r.flag == false){
-				$("#entrelation-nologin").addClass("hide");
-				$("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
-				$("#entrelation-infovis").hide();
-			}else if(r.flag == true && (r == null || typeof(r) == "undefined" || typeof(r.relation.links) == "undefined" || r.relation.links.length == 0 || typeof(r.relation.nodes) == "undefined" || r.relation.nodes.length <= 1)){
-				$("#entrelation-limit,#entrelation-nologin").addClass("hide");
-				relation = "";
-				$("#entrelation-infovis").hide();
-				$("#entrelation-findnull").removeClass("hide");
-			}else{
-				loadJS("/js/d3.v3.min.js",function(){
-					loadJS("/js/geometry.js",function(){
-						loadJS("/js/relation.js",function(){
-							$("#entrelation-limit,#entrelation-nologin").addClass("hide");
-							$(".entrelation").height(500);
-							relation = new Relation(legcerNo,regNo,r.relation);
-							relation.init();
+		$(".entrelation").height(500);
+		var relationNoData = function(){
+			$("#entrelation-limit,#entrelation-nologin").addClass("hide");
+			relation = "";
+			$("#entrelation-infovis").hide();
+			$("#entrelation-findnull").removeClass("hide");
+			$(".entrelation").css("height","auto");
+		}
+		$.ajax({
+			url: "/member/getRelation",
+			method: "post",
+			data: {regNo:regNo,entName:entName},
+			success: function(r){
+				if(r.flag == false){
+					$("#entrelation-nologin").addClass("hide");
+					$("#entrelation-limit,#entrelation-noauthe").removeClass("hide");
+					$("#entrelation-infovis").hide();
+					$(".entrelation").css("height","auto");
+				}else if(r.flag == true && (r == null || typeof(r) == "undefined" || typeof(r.relation.links) == "undefined" || r.relation.links.length == 0 || typeof(r.relation.nodes) == "undefined" || r.relation.nodes.length <= 1)){
+					relationNoData();
+				}else if(r.flag == true){
+					$("#entrelation-limit,#entrelation-nologin").addClass("hide");
+					loadJS("/js/d3.v3.min.js",function(){
+						loadJS("/js/geometry.js",function(){
+							loadJS("/js/relation.js",function(){
+								relation = new Relation(legcerNo,regNo,r.relation);
+								relation.init();
+							});
 						});
 					});
-				});
+				}else{
+					relationNoData();
+				}
+			},
+			error: function(){
+				relationNoData();
 			}
 		});
 	}else{

+ 125 - 0
core/src/web/staticres/js/qfw.js

@@ -44,6 +44,131 @@ var ValidDatatype = {
 		return true;
 	}
 }
+/*
+ * Date Format 1.2.3
+ * (c) 2007-2009 Steven Levithan <stevenlevithan.com>
+ * MIT license
+ *
+ * Includes enhancements by Scott Trenda <scott.trenda.net>
+ * and Kris Kowal <cixar.com/~kris.kowal/>
+ *
+ * Accepts a date, a mask, or a date and a mask.
+ * Returns a formatted version of the given date.
+ * The date defaults to the current date/time.
+ * The mask defaults to dateFormat.masks.default.
+ */
+
+var dateFormat = function () {
+	var	token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
+		timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
+		timezoneClip = /[^-+\dA-Z]/g,
+		pad = function (val, len) {
+			val = String(val);
+			len = len || 2;
+			while (val.length < len) val = "0" + val;
+			return val;
+		};
+
+	// Regexes and supporting functions are cached through closure
+	return function (date, mask, utc) {
+		var dF = dateFormat;
+
+		// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
+		if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
+			mask = date;
+			date = undefined;
+		}
+
+		// Passing date through Date applies Date.parse, if necessary
+		date = date ? new Date(date) : new Date;
+		if (isNaN(date)) throw SyntaxError("invalid date");
+
+		mask = String(dF.masks[mask] || mask || dF.masks["default"]);
+
+		// Allow setting the utc argument via the mask
+		if (mask.slice(0, 4) == "UTC:") {
+			mask = mask.slice(4);
+			utc = true;
+		}
+
+		var	_ = utc ? "getUTC" : "get",
+			d = date[_ + "Date"](),
+			D = date[_ + "Day"](),
+			m = date[_ + "Month"](),
+			y = date[_ + "FullYear"](),
+			H = date[_ + "Hours"](),
+			M = date[_ + "Minutes"](),
+			s = date[_ + "Seconds"](),
+			L = date[_ + "Milliseconds"](),
+			o = utc ? 0 : date.getTimezoneOffset(),
+			flags = {
+				d:    d,
+				dd:   pad(d),
+				ddd:  dF.i18n.dayNames[D],
+				dddd: dF.i18n.dayNames[D + 7],
+				m:    m + 1,
+				mm:   pad(m + 1),
+				mmm:  dF.i18n.monthNames[m],
+				mmmm: dF.i18n.monthNames[m + 12],
+				yy:   String(y).slice(2),
+				yyyy: y,
+				h:    H % 12 || 12,
+				hh:   pad(H % 12 || 12),
+				H:    H,
+				HH:   pad(H),
+				M:    M,
+				MM:   pad(M),
+				s:    s,
+				ss:   pad(s),
+				l:    pad(L, 3),
+				L:    pad(L > 99 ? Math.round(L / 10) : L),
+				t:    H < 12 ? "a"  : "p",
+				tt:   H < 12 ? "am" : "pm",
+				T:    H < 12 ? "A"  : "P",
+				TT:   H < 12 ? "AM" : "PM",
+				Z:    utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
+				o:    (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
+				S:    ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
+			};
+
+		return mask.replace(token, function ($0) {
+			return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
+		});
+	};
+}();
+
+// Some common format strings
+dateFormat.masks = {
+	"default":      "ddd mmm dd yyyy HH:MM:ss",
+	shortDate:      "m/d/yy",
+	mediumDate:     "mmm d, yyyy",
+	longDate:       "mmmm d, yyyy",
+	fullDate:       "dddd, mmmm d, yyyy",
+	shortTime:      "h:MM TT",
+	mediumTime:     "h:MM:ss TT",
+	longTime:       "h:MM:ss TT Z",
+	isoDate:        "yyyy-mm-dd",
+	isoTime:        "HH:MM:ss",
+	isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
+	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
+};
+
+// Internationalization strings
+dateFormat.i18n = {
+	dayNames: [
+		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
+		"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+	],
+	monthNames: [
+		"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+	]
+};
+
+// For convenience...
+Date.prototype.FormatEnhance = function (mask, utc) {
+	return dateFormat(this, mask, utc);
+};
 Date.prototype.Format = function (fmt) { //author: meizz 
     var o = {
         "M+": this.getMonth() + 1, //月份 

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

@@ -110,7 +110,7 @@ Relation.prototype.dataProcess = function(){
 			if(text.length > 2){//小于两个字符不生效
 				nodeObj.shortText = text;
 			}
-			if(nodeObj.name == this.regno){//先找本企业位置
+			if(nodeObj.name == this.regNo){//先找本企业位置
 				this.index = i;
 				nodeObj["regcap"] = (typeof(d1) == "undefined")?0:d1;
 				nodeObj["legcerno"] = this.legcerNo;

BIN
core/src/web/staticres/wxswordfish/images/share-cj.jpg


BIN
core/src/web/staticres/wxswordfish/images/share-cj.png


+ 5 - 0
core/src/web/staticres/wxswordfish/main.js

@@ -517,4 +517,9 @@ $(function(){
 				break;
 		}
 	});
+
+	//剑鱼协议
+	if(winWidth<341){
+		$("#prexieyi").html("");
+	}
 });

+ 18 - 0
core/src/web/staticres/wxswordfish/share.js

@@ -15,6 +15,15 @@ function initShare(signature,shareid){
 			    imgUrl: 'http://www.qimingxing.info/wxswordfish/images/share-icon.png', // 分享图标
 			    success: function () { 
 			       //alert('分享成功');
+							$.ajax({    
+						        type:'post',        
+						        url:'/activity/addredis',    
+						        cache:false,    
+						        dataType:'json', 
+						        success:function(data){
+			      					 //alert('分享成功后第二天可以抽一次奖!');
+						        }    
+						        }); 
 			    },
 			    cancel: function () { 
 			       //alert('分享失败,或用户取消了');
@@ -30,6 +39,15 @@ function initShare(signature,shareid){
 			    dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
 			    success: function () { 
 			        //alert('分享成功');
+							$.ajax({    
+						        type:'post',        
+						        url:'/activity/addredis',    
+						        cache:false,    
+						        dataType:'json', 
+						        success:function(data){
+			      					 //alert('分享成功后第二天可以抽一次奖!');
+						        }    
+						        }); 
 			    },
 			    cancel: function () { 
 					//alert('分享失败,或用户取消了');

+ 2 - 5
core/src/web/staticres/wxswordfish/style.css

@@ -59,7 +59,7 @@ img{
 /**************/
 .operation{
 	background-color: #F8F8F8;
-	margin-bottom: 50px;
+	margin-bottom: 20px;
 }
 .operation>.parent-node{
 	width: 100%;
@@ -96,10 +96,7 @@ img{
 	background-image: url("/wxswordfish/images/off.png");
 	background-size: 100% 100%;
 }
-.operation>.parent-node>.rule{
-	background: url("/wxswordfish/images/right.png") no-repeat 10px;
-	background-size: 30% 50%;
-}
+
 .rule-content div{
 	height:30px;
 }

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

@@ -19,7 +19,7 @@
 <style>
 *{padding:0; margin:0;}
 .lotteryMain{ width:100%;}
-.lotteryBg{ width:100%; height:603px; margin:0 auto; background:url(/images/activeimages/lotteryBg.jpg) no-repeat center center; position:relative; overflow:hidden;background-size: 375px 603px;}
+.lotteryBg{ width:100%; height:100%; margin:0 auto; background:url(/images/activeimages/lotteryBg.jpg) no-repeat center center; position:relative; overflow:hidden;background-size: 375px 603px;}
 #run{ width:145px; height:145px; position:absolute; left:50%; top:50%;  margin-left:-73px; margin-top:-53px; z-index:1; transform:rotate(0deg); -ms-transform:rotate(0deg); }
 #btn_run{ width:80px; height:80px; background:url(/images/activeimages/btn_start.png) no-repeat; border:none; outline:none; position:absolute; left:50%; top:50%; margin-left:-40px; margin-top:-22px; z-index:2;cursor:pointer;background-position:0px 0px;background-size: 100% 100%;}
 </style>

+ 0 - 1
core/src/web/templates/member/credit/mcreditindex.html

@@ -387,7 +387,6 @@
 					$("#indexbookinbtn").attr("class","btn  btn-default bookin");
 					$("#bookinbtn").attr("class","btn   bookin");
 					$("#bookinbtn").attr("disabled","disabled"); 
-					
 				}
 				changeStatus();
 			});

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

@@ -114,7 +114,7 @@
 											{{end}}
 										{{end}}
 										{{if index $v "RegCap"}}
-											{{if and (ne $v.EntType "9600") (ne $v.EntType "5810")}}
+											{{if and (ne $v.RegCapEntType "9600") (ne $v.RegCapEntType "5810")}}
 												<span class="margin-l-15"><font class="b-disabled">注册资本:</font><font  class="lineb " ><script>var d1={{$v.RegCap}};d1=d1?d1:0; var lenD1=(d1+"").length ;if(lenD1>4&&(d1+"").indexOf(".")>-1&&(lenD1-(d1+"").indexOf("."))>4){document.write(d1.toFixed(4))}else{document.write(d1)}</script>万元</font></span>
 											{{end}}
 										{{end}}

+ 14 - 12
core/src/web/templates/service/detail.html

@@ -129,22 +129,12 @@
 								{{ if $v.i_identType }}
 									{{ if eq $v.i_identType 1}}
 										<span class="glyphicon qyrz   margin-l-10 jhtb"></span><span class="lineb " ><small style="margin-left:5px;margin-right:5px;">已认证企业 </small></span>
-										{{ if $v.i_comauthenttype }}
-												{{ if eq $v.i_comauthenttype 2}}
-													<span class="glyphicon mprz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="margin-right:-7px;">名片认证</small></span>					
-												{{else if eq $v.i_comauthenttype 1}}
-													<span class="glyphicon yyzzrz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="margin-left:3px;margin-right:-7px;">营业执照认证</small></span>
-												{{else if eq $v.i_comauthenttype 3}}
-													<span class="glyphicon yjrz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="margin-right:-7px;">年报邮箱认证</small></span>
-												{{end}}
-										{{else}}
-												<span class="glyphicon yyzzrz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="margin-left:3px;margin-right:-7px;">营业执照认证</small></span>
-										{{end}}
 									{{else if eq $v.i_identType 2}}
 										<span class="glyphicon grrz   margin-l-10 jhtb"></span><span class="lineb " ><small style="margin-left:-5px;margin-right:5px;"> 已认证个人</small></span>
 									{{else if eq $v.i_identType 3}}
 										<span class="glyphicon jgrz   margin-l-10 jhtb"></span><span class="lineb " ><small style="margin-left:5px;margin-right:5px;">已认证机构</small></span>
 									{{end}}
+									<span  id="sjrz"></span><span class="lineb " id="sjrzlinb" ><small style="margin-left:3px;margin-right:5px;" ></small></span>
 								{{end}}
 						</span>
 						</div>
@@ -652,7 +642,6 @@ function comment(){
 					var s_servicename = r[i].s_servicename;
 					var l_createdate = r[i].l_createdate;
 					var src="/images/u885.png";
-					console.log(r[i]);
 					if (r[i]["s_pic"] && r[i]["s_pic"]!=""){
 						src=r[i]["s_pic"];
 					}
@@ -747,6 +736,19 @@ function comment(){
 			$("#releaseService").css("color","#FF5A5F");
 			$("#releaseService").css("font-weight","600");
 			$(".img-circle.b-com-first").css("background-color","#FF5A5F");
+			var sjrz="{{$v.i_comauthenttype}}";
+			var sjrzclass="";
+			var sjrzname="";
+			if (sjrz=="1"){
+				$("#sjrz").attr("class","glyphicon yyzzrz   margin-r-10 jhtbtype");
+				$("#sjrzlinb small").text("营业执照认证");
+			}else if (sjrz=="2"){
+				$("#sjrz").attr("class","glyphicon mprz   margin-r-10 jhtbtype");
+				$("#sjrzlinb small").text("名片认证");
+			}else if (sjrz=="3"){
+				$("#sjrz").attr("class","glyphicon yjrz   margin-r-10 jhtbtype");
+				$("#sjrzlinb small").text("年报邮箱认证");
+			}
 		});
 </script>
 </body>

+ 2 - 4
core/src/web/templates/service/list.html

@@ -1,4 +1,4 @@
-<html>
+<html>
 <head>
 <title>{{Msg "seo" "qfw.market.title"}}</title>
 {{include "/common/inc.html"}}
@@ -258,11 +258,10 @@
 			{{end}}	
 			{{if gt (len .T.data) 0}}
 			<!--分页-->
-			<div>
+			<div class="f-clear">
 				<div class="text-center" style="margin-top: -20px;">
 					<!--页码信息-->
 					<!--页码信息-->
-					<div class="text-center">
 						<ul class="pagination pagination-md ">
 						{{range $k,$v:=.T.pagination}}
 							<li {{if index $v "iscurrent"}} class="disabled active"{{end}}>
@@ -270,7 +269,6 @@
 							</li>
 						{{end}}
 						</ul>
-					</div>
 				</div>
 			</div>
 			<!--页码信息结束-->

+ 2 - 2
core/src/web/templates/service/viewsingledemand.html

@@ -1,4 +1,4 @@
-<html>
+<html>
   <head>
     <title>{{.T.demandInfo.s_name}}_{{Msg "seo" "qfw.market.title"}}</title>
     <meta charset="utf-8" />
@@ -108,7 +108,7 @@
 											{{if .T.demandInfo.i_identtype}}
 												{{if eq 1 .T.demandInfo.i_identtype}}
 													<span class="glyphicon qyrz   margin-l-10 jhtb"></span>
-													<small style="color:#000;margin-left:5px;">已认证企业</small>
+													<small style="color:#4e5051;margin-left:5px;">已认证企业</small>
 													{{ if .T.demandInfo.i_comauthenttype }}
 															{{ if eq .T.demandInfo.i_comauthenttype 2}}
 																<span class="glyphicon mprz   margin-r-10 jhtbtype"></span><span class="lineb " ><small style="margin-right:5px;color:#4e5051;">名片认证</small></span>					

+ 43 - 0
core/src/web/templates/swordfish/protocol.html

@@ -0,0 +1,43 @@
+<html>
+<head>
+<title>{{Msg "seo" "qfw.swordfish.title"}}</title>
+<meta name="Keywords" content="{{Msg "seo" "qfw.swordfish.key"}}"/>
+<meta name="Description" content="{{Msg "seo" "qfw.swordfish.description"}}"/>
+{{include "/common/inc.html"}}
+</head>
+<body>
+<!-- 头部 -->
+{{include "/common/swordfishhead.html"}}
+<!-- 中间 -->
+<div class="b-content container-fluid swordfish-index">
+	<div class="b-left" style="padding-left:50px">
+	{{include "/swordfish/protocoltxt.html"}}
+	</div>
+	<div class="b-right">
+		<div class="swordfish-right-title">
+			剑鱼最新消息
+		</div>
+		<div id="list"></div>
+	</div>
+</div>
+<!-- 底部 -->
+{{include "/common/bottom.html"}}
+<script type="text/javascript">
+$(function(){
+	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" onclick="open_window(\''+data[i].href+'\')">'
+					+data[i].title+'</a></div>';
+		}
+		$("#list").html(html);
+	}else{
+		$(".swordfish-index").find(".b-right").remove();
+	}
+});
+</script>
+</body>
+</html>

+ 24 - 0
core/src/web/templates/swordfish/protocoltxt.html

@@ -0,0 +1,24 @@
+<style>
+.pinden{
+	padding: 0px 0px 0px 25px;
+}
+</style>
+<div class="col-xs-12" style="line-height:30px;padding:0px 30px 0px 50px">
+	<p style="text-align:center;font-size:20px;">剑鱼用户服务协议<p>
+	<p>一,您以任何方式(包括但不限于企明星网站www.qmx.top、www.qimingxing.info、微信公众号qmx-cn)使用剑鱼服务即表示您已充分阅读、理解并同意接受本规则的条款和条件。</p>
+	<p>二,企明星有权根据业务发展的需要修订本规则,在本规则更新时不再单独通知您。经修订的规则一经在企明星公布,即产生效力,您继续使用剑鱼,则视为您已接受修订的规则。当使用过程中发生争议时,应以最新的规则为准。</p>
+	<p>三,服务条件</p>
+	<p class="pinden">1,您使用剑鱼,需要自行确保具备以下条件:(1),关注企明星微信公众号,(2),您的企明星积分余额足以兑换您申请开通的剑鱼订阅服务。</p>
+	<p class="pinden">2,企明星按照一定的周期(比如一个月)扣除服务所需的积分。企明星的服务积分兑换标准和积分管理规则以企明星的相关公告为准。</p>
+	<p class="pinden">3,您需要为您订阅的剑鱼服务指定相应的订阅条件,企明星将按照此条件向您推送相应的信息。</p>
+	<p class="pinden">4,如果您订阅的某项服务有效期已过期,而您的积分余额不足以兑换下一个周期的服务,企明星将停止您的此项服务。</p>
+	<p class="pinden">5,如果您订阅的某项服务有效期未过期,而此时您主动取消了此项服务,企明星将不会向您退还此周期剩余时间折合的积分;在同一周期内,您重新开通了此项服务,企明星将此情形视为原有效期未过期,不会立即扣除积分,直到原有效期过期为止。</p>
+	<p>四,服务质量</p>
+	<p class="pinden">1,剑鱼推送信息全部来源于互联网,其真实性、合法性由企明星抓取的原始网站保证,您负责自行辨别。企明星会提供原始网页链接以供您查看。由于您收到剑鱼推送信息的真实性、合法性问题造成的任何结果,企明星不承担责任。</p>
+	<p class="pinden">2,从原始信息发布到您收到剑鱼推送信息会经过一个复杂的技术处理和网络传输过程,企明星对您收到剑鱼推送信息的时间延迟指标不做承诺。由于您未能在某个时间内收到剑鱼推送信息而造成的任何结果,企明星不承担责任。</p>
+	<p class="pinden">3,企明星保证您收到的剑鱼推送信息符合您指定的订阅条件。企明星不保证您收到的剑鱼推送信息准确符合您的真实意图。</p>
+	<p class="pinden">4,您保证您使用剑鱼的设备以及微信App正常运行。如果由于您使用剑鱼的设备或微信App的问题造成您无法接收剑鱼推送信息,企明星不承担责任。</p>
+	<div class="col-xs-12 hidden-sm hidden-md hidden-lg" style="text-align:center;">
+	 <button class="btn btn-primary" onclick="window.location.href='/swordfish/page'" style="padding-top:3px;padding-bottom:3px;">返回</button></td>
+	</div>
+</div>

+ 1 - 24
core/src/web/templates/swordfish/rssset.html

@@ -13,7 +13,7 @@
 	<div class="b-left">
 		<div class="swordfish-page-title">
 			<i class="img-circle glyphicon jianyu"></i>订阅设置
-			<!--<span >继续使用表明你已经同意了<span><a onclick="$('#yhxyModal').modal('show')">剑鱼用户服务协议</a>-->
+			<span >继续使用表明你已经同意了<span><a href='/member/swordfish/protocol'>剑鱼用户服务协议</a>
 			<span style="float:right;width:190px">
 			<a id="ckys">查看演示&nbsp;&nbsp;</a>
 			<a id="sfbz" onclick="$('#sfbzModal').modal('show')">收费标准</a>
@@ -272,29 +272,6 @@
 	</div>
 </div>
 
-<!-- 用户协议 -->
-<div class="modal fade b-modal" id="yhxyModal" tabindex="-1" role="dialog" aria-labelledby="yhxyModalLabel">
-  	<div class="modal-dialog" role="document">
-		<div class="modal-content">
-		  	<div class="modal-header-jy">
-				<span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1"></span>
-				<span class="modal-title" id="yhxyModalLabel">用户协议</span>
-			</div>
-			<div style="background-color: #FCF8E3;padding:10px;line-height:25px">
-				<div>
-					<p style="margin-left:5px">剑鱼用户协议:</p>
-					<p style="margin-left:15px">
-					 
-					</p>
-				</div>
-				<div style="text-align:center;padding:10px 0;">
-					<button class='btn btn-primary' onclick="$('#yhxyModal').modal('hide')">确定</button>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
-
 <!-- 收费标准 -->
 <div class="modal fade b-modal" id="sfbzModal" tabindex="-1" role="dialog" aria-labelledby="sfbzModalLabel">
   	<div class="modal-dialog" role="document">

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

@@ -8,6 +8,9 @@
 <script src="/js/jquery.js"></script>
 <script src="/wxswordfish/share.js"></script>
 <script src="/swiper/swiper.min.js"></script>
+<script>
+	var shareid="{{.T.shareid}}";
+</script>
 </head>
 <body>
 <div class="swiper-container">

+ 13 - 0
core/src/web/templates/swordfish/wxprotocol.html

@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>{{Msg "seo" "qfw.swordfish.title"}}</title>
+<meta name="Keywords" content="{{Msg "seo" "qfw.swordfish.key"}}"/>
+<meta name="Description" content="{{Msg "seo" "qfw.swordfish.description"}}"/>
+{{include "/common/inc.html"}}
+</head>
+<body>
+<div class="container-fluid" style="padding-left:20px">
+	{{include "/swordfish/protocoltxt.html"}} 
+</div>
+</body>
+</html>

+ 1 - 0
core/src/web/templates/swordfish/wxpush.html

@@ -7,6 +7,7 @@
 <script src="/js/jquery.js"></script>
 <script src="/wxswordfish/share.js"></script>
 <script>
+	var shareid="{{.T.shareid}}";
 $(function(){
 	var hm = document.createElement("script");
 	hm.src = "//hm.baidu.com/hm.js?ed198b177e527bb53684db20bb390e77";

+ 6 - 2
core/src/web/templates/swordfish/wxrssset.html

@@ -66,10 +66,14 @@
 		<li class="parent-node">
 			<img src="/wxswordfish/images/feerule.png">
 			收费规则
-			<span class="rule" id="rule"></span>
+			<span style="right:0" class="rule"><img src="/wxswordfish/images/right.png" style="width: 10px;height: 17px;float: right;"></span>
 		</li>
 	</ul>
-	
+	<!--剑鱼服务协议-->
+	<div style="margin-bottom:80px;text-align:center;">
+		<span id="prexieyi" style="color:#CCCCDD">继续使用表明你已经同意了</span>
+		<a style="color:#33ABFF" href='/member/swordfish/wxprotocol'>剑鱼用户服务协议</a>
+	</div>
 	<!--关键词-->
 	<div class="dialog keyword-dialog" id="tender-keyword">
 		<div class="dialog-main">

+ 18 - 10
core/src/web/templates/swordfish/wxshare.html

@@ -5,22 +5,30 @@
 <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
 <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0" user-scalable="no" />
 <meta name="renderer" content="webkit">
+<link href="/css/bootstrap.min.css" rel="stylesheet">
+
 <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 <script src="/js/jquery.js"></script>
+<script src="/js/bootstrap.min.js"></script>
+
 <script src="/wxswordfish/share.js"></script>
 <script>
 	initShare({{.T.signature}},{{.T.shareid}});
 </script>
 </head>
-<body style="margin:0px;">
-<div style="width: 100%;height: 603px; margin: 0 auto;background: url(/wxswordfish/images/share-cj.png) no-repeat top center;overflow: hidden;background-size: 375px 603px">
-</div>
-<table align=center width=100%>
-	<tr>
-		<td width=80><img src="/front/weixinshare/{{.T.shareid}}" style="width:80px; height:80px;" /></td>
-		<td style="word-break:break-all;word-wrap:break-word;line-height:22px;max-width:210px;">
- 长按图片识别二维码<br/>回复“抽奖”,有机会抽取iPad mini</td>
-	</tr>
-</table>
+<body style="margin:0px; background-color:#C5F7FE;">
+<img src="/wxswordfish/images/share-cj.jpg" class="img-responsive" alt="Cinque Terre">
+<img id="img2" style="position:absolute;" class="img-responsive" src="/front/weixinshare/{{.T.shareid}}" >
 </body>
+<script>
+$(function(){
+	var width=$(window).width();
+	var max=750
+	if(width>max){
+		width=max
+	}
+	$("#img2").css({"width":width*0.48,"top":width*0.78,"left":width*0.26})
+	
+})
+</script>
 </html>

+ 8 - 3
core/src/web/templates/swordfish/wxtoolbar.html

@@ -86,8 +86,13 @@ $(function(){
 		$("#feedback-textarea").focus().parent().removeClass("red-border");
 	});
 	$("[id='goToShare']").click(function(){
-		$(".share-dialog").show();
-		$("html,body").addClass("overflow-hidden");
+		if(typeof(shareid) == "undefined" || shareid == ""){
+			window.location.href = "/swordfish/share/-1";
+		}else{
+			window.location.href = "/swordfish/share/"+shareid;
+		}
+		//$(".share-dialog").show();
+		//$("html,body").addClass("overflow-hidden");
 	});
 	$("#share-dialog-back").click(function(){
 		$(".share-dialog").hide();
@@ -102,7 +107,7 @@ $(function(){
 		}
 	});
 	//
-	initShare({{.T.signature}},typeof(shareid)=="undefined"?"":shareid);
+	initShare({{.T.signature}},typeof(shareid)=="undefined"?"-1":shareid);
 });
 //意见反馈
 function Feedback(){

+ 4 - 4
core/src/web/templates/yellowpage/enterpriseinfo.html

@@ -326,13 +326,13 @@
 					{{range $k,$v := .T.res.alterInfo}}
 						<li>
 							<div>
-								<div><script>document.write(new Date(Number({{$v.AltDate}})).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
+								<div><script>document.write(new Date({{$v.AltDate}}).FormatEnhance("yyyy-mm-dd HH:MM:ss"));</script></div>
 								<div>{{$v.AltItemName}}</div>
 								<div>变更前:{{$v.AltBe}}<br>变更后:{{$v.AltAf}}</div>
 								<a></a>
 							</div>
 							<div>
-								<div><script>document.write(new Date(Number({{$v.AltDate}})).Format("yyyy-MM-dd hh:mm:ss"));</script></div>
+								<div><script>document.write(new Date({{$v.AltDate}}).FormatEnhance("yyyy-mm-dd HH:MM:ss"));</script></div>
 								<div>{{$v.AltItemName}}</div>
 								<div>变更前:{{$v.AltBe}}<br>变更后:{{$v.AltAf}}</div>
 								<a></a>
@@ -407,9 +407,9 @@ var province = {{.T.res.i_province}};
 var city = {{.T.res.i_city}};
 var area = {{.T.res.i_area}};
 var as1="{{.T.res.s_address}}";
-var address=false,$listent=false;
+var $address=false,$listent=false;
 {{if or .T.res.i_province .T.res.i_city .T.res.i_area .T.res.s_address}}
-	address = true;
+	$address = true;
 {{else if .T.res.Dom}}
 	initMap();
 {{end}}

+ 3 - 1
credit/src/config.json

@@ -36,6 +36,7 @@
         "b4_n": 3,
         "b5": 20,
         "b5_n": 2,
+        "b6": 200,
         "c1": 100,
         "c2": 80,
         "c3": 150,
@@ -67,13 +68,14 @@
         "txt_a13": "首次分享服务",
         "txt_a14": "完成首次交易",
         "txt_a15": "完成首次交易评价",
-		"txt_a61": "剑鱼首次推送",
+        "txt_a61": "剑鱼首次推送",
         "txt_a62": "完成一次性所有任务",
         "txt_b1": "签到",
         "txt_b2": "企业查询",
         "txt_b3": "发服务",
         "txt_b4": "发需求",
         "txt_b5": "分享服务/需求",
+		"txt_b6": "抽奖",
         "txt_c1": "交易",
         "txt_c2": "评价",
         "txt_c3": "邀请用户",

+ 2 - 2
credit/src/main.go

@@ -258,13 +258,13 @@ func doSubCreditByUser(userId, umid, typeName, code string, next *time.Time, use
 			bsub = true
 		}
 		if bsub { //扣分操作
-			newDate := next.AddDate(0, 1, 0)
+			newDate := time.Now().AddDate(0, 1, 0)
 			creditDoc := map[string]interface{}{
 				"s_uid":     userId,
 				"s_umid":    umid,
 				"s_code":    code,
 				"i_type":    0, //是扣
-				"l_date":    next.Unix(),
+				"l_date":    time.Now().Unix(),
 				"l_enddate": newDate.Unix(),
 				"i_score":   codeNum,
 				"s_type":    typeName,

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

@@ -272,7 +272,7 @@ func (c *CreditRpc) OutCreadit(param *qrpc.CreditData, replay *int) error {
 		var newDate time.Time
 		switch first {
 		case "A":
-			newDate = GetTimeByNow(now, Hour).AddDate(0, 1, 0)
+			newDate = time.Now().AddDate(0, 1, 0)
 			creditDoc["l_enddate"] = newDate.Unix()
 			creditDoc["i_valid"] = 1
 			if param.OtherParam != nil {

+ 8 - 1
push/src/qfw/push/dopush/dopush.go

@@ -16,6 +16,12 @@ import (
 	"time"
 )
 
+var se util.SimpleEncrypt
+
+func init() {
+	se = util.SimpleEncrypt{Key: "topnet"}
+}
+
 type Pjob struct {
 	Dfa         *dfa.DFA
 	Cache       *map[string]*[]*push.MemberInterest
@@ -221,6 +227,7 @@ func SendWeixin(k *push.MemberInterest, TITLE, ShortTitle, str, stype string, no
 		Detail:  WXTitle,
 		Date:    wxDate,
 		Service: "剑鱼君",
-		Url:     push.PushConfig["bidViewDomain"].(string) + "/wxpush/bid/" + k.Openid + "/" + wid + "/aa"})
+		//Url:     push.PushConfig["bidViewDomain"].(string) + "/wxpush/bid/" + k.Openid + "/" + wid + "/aa"})
+		Url: push.PushConfig["bidViewDomain"].(string) + "/mobile/sess/" + se.EncodeString(k.Openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushlist") + "/" + k.Openid + "/" + wid + "/aa"})
 
 }