Эх сурвалжийг харах

Merge branch 'release' into dev2.10.4

# Conflicts:
#	src/web/staticres/wx_dataExport/css/dataExport.css
#	src/web/templates/pc/biddetail_rec.html
#	src/web/templates/weixin/dataExport/dataExport.html
zhangyuhan 5 жил өмнө
parent
commit
4320e2ee6a

+ 25 - 15
src/jfw/front/shorturl.go

@@ -21,8 +21,9 @@ import (
 
 type Short struct {
 	*xweb.Action
-	article xweb.Mapper `xweb:"/article/(\\w+)/(.*).html"` //([pm])
-	qr      xweb.Mapper `xweb:"/biddetail/(\\w+)/qr/(.+)"`
+	article     xweb.Mapper `xweb:"/article/(\\w+)/(.*).html"` //([pm])
+	qr          xweb.Mapper `xweb:"/biddetail/(\\w+)/qr/(.+)"`
+	replication xweb.Mapper `xweb:"/front/shorturl/replication"` //用户复制操作记录入库
 }
 
 var mobileReg = regexp.MustCompile("(?i)(Android|Mobile|Phone)")
@@ -182,15 +183,15 @@ func (s *Short) Article(stype, id string) error {
 				obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
 			}
 			s.T["obj"] = obj
-			var rec = ""
-			if ssOpenid != nil && ssOpenid != "" {
-				if redis.Get("recovery", "rec-"+ssOpenid.(string)) != nil {
-					rec = "_rec"
-				}
-			}
+			var rec = "_rec"
+			// if ssOpenid != nil && ssOpenid != "" {
+			// 	if redis.Get("recovery", "rec-"+ssOpenid.(string)) != nil {
+			// 		rec = "_rec"
+			// 	}
+			// }
 			s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail) //是否强制分享
 			content, _ := s.Render4Cache("/weixin/wxinfocontent"+rec+".html", &s.T)
-			//	redis.Put("other", "jywxdetail_"+sid+kds, string(content), 60*60*2)
+			// 	redis.Put("other", "jywxdetail_"+sid+kds, string(content), 60*60*2)
 			return s.SetBody(content)
 			//}
 		}
@@ -207,18 +208,18 @@ func (s *Short) Article(stype, id string) error {
 		isForceShare := false
 		sid := sids[0]
 		//log.Println("sid", sid)
-		var rec = ""
+		var rec = "_rec"
 		//log.Println(redis.Get("recovery", "rec-"+ssOpenid.(string)), "ssOpenid:", ssOpenid)
 		if ssOpenid != nil && ssOpenid != "" && userId != "" {
 			if stype == "content" {
 				//判断是否需要强制分享
 				isForceShare = public.CheckUserNeedForceShare(userId, public.ShareType_detail)
 			}
-			if !isForceShare {
-				if redis.Get("recovery", "rec-"+ssOpenid.(string)) != nil {
-					rec = "_rec"
-				}
-			}
+			// if !isForceShare {
+			// 	if redis.Get("recovery", "rec-"+ssOpenid.(string)) != nil {
+			// 		rec = "_rec"
+			// 	}
+			// }
 		}
 		var res interface{}
 		if !isForceShare {
@@ -311,3 +312,12 @@ func (s *Short) Qr(t, id string) error {
 	_, err := w.Write(pngdat)
 	return err
 }
+
+func (s *Short) Replication() {
+	mongodb.Save("copyaction", map[string]interface{}{
+		"userid":     s.GetSession("userId").(string),
+		"createtime": time.Now().Unix(),
+		"url":        s.Request.Referer(),
+		"client":     s.Header("User-Agent"),
+	})
+}

+ 4 - 4
src/jfw/front/swordfish.go

@@ -1278,7 +1278,7 @@ func pcVRT(sid, industry string) (po, bo, wo []map[string]interface{}, objdata m
 				var arrTags = util.ObjArrToStringArr(config.Sysconfig["detail_element"].([]interface{}))
 				var _detail = util.ObjToString(obj["detail"])
 				for _, v := range arrTags {
-					var intOpen = strings.Count(_detail, "<"+v+">")
+					var intOpen = strings.Count(_detail, "<"+v)
 					var intClose = strings.Count(_detail, "</"+v+">")
 					if intOpen >= intClose {
 						for di := 0; di < (intOpen - intClose); di++ {
@@ -1289,9 +1289,9 @@ func pcVRT(sid, industry string) (po, bo, wo []map[string]interface{}, objdata m
 							_detail = "<" + v + ">" + _detail
 						}
 					}
-					log.Println(intOpen, "--", intClose)
+					// log.Println(intOpen, "--", intClose)
 				}
-				log.Println("_detail:", _detail)
+				// log.Println("_detail:", _detail)
 				obj["detail"] = _detail
 			}
 			obj["stypeadd"], obj["areaadd"], obj["indadd"] = classify(finalType, area, industry)
@@ -2444,7 +2444,7 @@ func (f *Front) HasPushHistory() {
 			var twoRemind = int64(2 * 24 * 60 * 60)
 			var oneRemind = int64(1 * 24 * 60 * 60)
 			var o_vipjy map[string]interface{}
-			if (*user)["isread"]!=nil{
+			if (*user)["isread"] != nil {
 				isread = (*user)["isread"].(bool)
 			}
 			o_vipjy, _ = (*user)["o_vipjy"].(map[string]interface{})

+ 2 - 0
src/jfw/modules/app/src/web/templates/me/mine.html

@@ -522,6 +522,8 @@ color:#1d1d1d;
       return false
     }
     </script>
+<!--百度统计end-->
+{{include "/common/baiducc.html"}}
 </body>
 
 </html>

+ 3 - 0
src/jfw/modules/pushsubscribe/src/push/pusher/normalpush.go

@@ -50,6 +50,9 @@ func (n *NormalPush) OncePushBatch(taskType, batchIndex int, startId *string) (b
 			"vipstatus": map[string]interface{}{
 				"$in": []int{1, 2},
 			},
+			"ratemode": map[string]interface{}{
+				"$in": []int{1, 3, 4},
+			},
 		}
 	} else {
 		logger.Error("taskType error", taskType)

+ 119 - 50
src/jfw/modules/weixin/src/github.com/wizjin/weixin/weixin.go

@@ -15,6 +15,7 @@ import (
 	"net/url"
 	"os"
 	"path/filepath"
+	"qfw/util/redis"
 	"regexp"
 	"sort"
 	"time"
@@ -275,6 +276,9 @@ type Weixin struct {
 	appId        string
 	appSecret    string
 	refreshToken bool
+	//
+	refreshTokenChan  chan string
+	refreshTicketChan chan bool
 }
 
 // Convert qr scene to url
@@ -291,9 +295,27 @@ func New(token string, appid string, secret string) *Weixin {
 	wx.refreshToken = false
 	if len(appid) > 0 && len(secret) > 0 {
 		wx.tokenChan = make(chan accessToken)
-		go createAccessToken(wx.tokenChan, appid, secret, &wx.refreshToken)
+		wx.refreshTokenChan = make(chan string)
+		go createAccessToken(wx.tokenChan, appid, &wx.refreshToken, wx.refreshTokenChan)
 		wx.ticketChan = make(chan jsApiTicket)
-		go createJsApiTicket(wx.tokenChan, wx.ticketChan)
+		wx.refreshTicketChan = make(chan bool)
+		go createJsApiTicket(appid, wx.ticketChan, wx.refreshTicketChan)
+		go func() {
+			for {
+				select {
+				case t := <-wx.refreshTokenChan:
+					log.Println("重新获取 access token")
+					c := redis.RedisPool["sso"].Get()
+					c.Do("PUBLISH", "WxRefreshSub", fmt.Sprintf("token_%s %s", wx.appId, t))
+					c.Close()
+				case <-wx.refreshTicketChan:
+					log.Println("重新获取 jsApi ticket")
+					c := redis.RedisPool["sso"].Get()
+					c.Do("PUBLISH", "WxRefreshSub", fmt.Sprintf("ticket_%s", wx.appId))
+					c.Close()
+				}
+			}
+		}()
 	}
 	return wx
 }
@@ -313,8 +335,12 @@ func (wx *Weixin) GetAppSecret() string {
 }
 
 func (wx *Weixin) RefreshAccessToken() {
-	wx.refreshToken = true
-	<-wx.tokenChan
+	for i := 0; i < 10; i++ {
+		go func() {
+			wx.refreshToken = true
+			<-wx.tokenChan
+		}()
+	}
 }
 
 // Register request callback.
@@ -333,6 +359,11 @@ func (wx *Weixin) GetToken() string {
 	return token.token
 }
 
+func (wx *Weixin) GetTicket() string {
+	ticket := <-wx.ticketChan
+	return ticket.ticket
+}
+
 // Post text message
 func (wx *Weixin) PostText(touser string, text string) error {
 	var msg struct {
@@ -815,7 +846,27 @@ func checkSignature(t string, w http.ResponseWriter, r *http.Request) bool {
 	return fmt.Sprintf("%x", h.Sum(nil)) == signature
 }
 
-func authAccessToken(appid string, secret string) (string, time.Duration, int64) {
+func authAccessToken(appid, t string, r chan string) (string, int64, int64) {
+	r <- t
+	ret, err := redis.GetNewBytes("sso", fmt.Sprintf("WxToken_%s", appid))
+	if err != nil {
+		log.Println("redis中获取Token出错", err)
+	} else if ret != nil {
+		var res struct {
+			AccessToken string `json:"access_token"`
+			ExpiresIn   int64  `json:"expires_in"`
+			LastTime    int64  `json:"last_time"`
+		}
+		if err := json.Unmarshal(*ret, &res); err != nil {
+			log.Println("Parse access token failed: ", err)
+		} else {
+			return res.AccessToken, res.ExpiresIn, res.LastTime
+		}
+	}
+	return "", 0, 0
+}
+
+/*func authAccessToken(appid string, secret string) (string, time.Duration, int64) {
 	resp, err := http.Get(weixinHost + "/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret)
 	if err != nil {
 		log.Println("Get access token failed: ", err)
@@ -838,9 +889,30 @@ func authAccessToken(appid string, secret string) (string, time.Duration, int64)
 		}
 	}
 	return "", 0, 0
+}*/
+func getJsApiTicket(appid string, r chan bool) (*jsApiTicket, error) {
+	r <- true
+	ret, err := redis.GetNewBytes("sso", fmt.Sprintf("WxTicket_%s", appid))
+	if err != nil {
+		log.Println("redis中获取Token出错", err)
+	} else if ret != nil {
+		var res struct {
+			Ticket    string `json:"ticket"`
+			ExpiresIn int64  `json:"expires_in"`
+		}
+		if err := json.Unmarshal(*ret, &res); err != nil {
+			return nil, err
+		}
+		var ticket jsApiTicket
+		ticket.ticket = res.Ticket
+		ticket.expires = time.Unix(res.ExpiresIn, 0)
+		return &ticket, nil
+	}
+	time.Sleep(500 * time.Millisecond)
+	return nil, nil
 }
 
-func getJsApiTicket(c chan accessToken) (*jsApiTicket, error) {
+/*func getJsApiTicket(c chan accessToken) (*jsApiTicket, error) {
 	reply, err := sendGetRequest(weixinJsApiTicketURL+"?type=jsapi&access_token=", c)
 	if err != nil {
 		return nil, err
@@ -857,61 +929,58 @@ func getJsApiTicket(c chan accessToken) (*jsApiTicket, error) {
 	ticket.expires = time.Now().Add(time.Duration(res.ExpiresIn * 1000 * 1000 * 1000))
 	return &ticket, nil
 
-}
-
-type countTocken struct {
-	allTimes int64
-	dayTimes int64
-	day      int
-}
-
-var CountT = countTocken{0, 0, time.Now().Day()}
-
-func init() {
-	go func() {
-		for {
-			if time.Now().Day() != CountT.day {
-				CountT.dayTimes = 0
-				CountT.day = time.Now().Day()
-				log.Println("wx-tocken改变统计时间:", CountT.day, ",次数:", CountT.dayTimes)
-			}
-			time.Sleep(30 * time.Second)
-		}
-	}()
-}
+}*/
 
-func createAccessToken(c chan accessToken, appid string, secret string, refresh *bool) {
+func createAccessToken(c chan accessToken, appid string, refresh *bool, r chan string) {
 	lt := int64(0)
 	token := accessToken{"", time.Now(), &lt}
 	c <- token
 	for {
-		if *refresh || (time.Now().Unix()-*token.lasttime) > 90*60 || time.Since(token.expires).Seconds() >= 0 {
-			CountT.allTimes++
-			CountT.dayTimes++
-			*refresh = false
-			var expires time.Duration
-			var lasttime int64
-			token.token, expires, lasttime = authAccessToken(appid, secret)
-			log.Println("获取tocken:", CountT.dayTimes, "token", token.token)
-			token.expires = time.Now().Add(expires)
-			*token.lasttime = lasttime
+		reTry := 0
+		for {
+			if *refresh || (time.Now().Unix()-*token.lasttime) > 5400 || time.Since(token.expires).Seconds() >= 0 {
+				if reTry > 0 {
+					time.Sleep(time.Second)
+				}
+				reTry++
+				subToken := ""
+				if *refresh || *token.lasttime == -1 {
+					subToken = token.token
+				}
+				*refresh = false
+				var expires int64
+				var lasttime int64
+				token.token, expires, lasttime = authAccessToken(appid, subToken, r)
+				if (*refresh || *token.lasttime == -1) && token.expires.Unix() == expires {
+					continue
+				}
+				token.expires = time.Unix(expires, 0)
+				*token.lasttime = lasttime
+			} else {
+				break
+			}
 		}
 		c <- token
-		if CountT.dayTimes > 100 {
-			log.Println(">>-->>获取tocken%d次...<<--<<", CountT.dayTimes)
-			time.Sleep(1 * time.Minute)
-		}
 	}
 }
 
-func createJsApiTicket(cin chan accessToken, c chan jsApiTicket) {
+func createJsApiTicket(appid string, c chan jsApiTicket, r chan bool) {
 	ticket := jsApiTicket{"", time.Now()}
 	c <- ticket
 	for {
-		if time.Since(ticket.expires).Seconds() >= 0 {
-			t, err := getJsApiTicket(cin)
-			if err == nil {
-				ticket = *t
+		reTry := 0
+		for {
+			if time.Since(ticket.expires).Seconds() >= 0 {
+				if reTry > 0 {
+					time.Sleep(time.Second)
+				}
+				reTry++
+				t, err := getJsApiTicket(appid, r)
+				if err == nil && t != nil {
+					ticket = *t
+				}
+			} else {
+				break
 			}
 		}
 		c <- ticket
@@ -939,7 +1008,7 @@ func sendGetRequest(reqURL string, c chan accessToken) ([]byte, error) {
 			case 0:
 				return reply, nil
 			case 42001, 40001:
-				*token.lasttime = 0
+				*token.lasttime = -1
 				<-c
 				log.Println("reget the tocken by ", result.ErrorCode, result.ErrorMessage)
 				continue
@@ -972,7 +1041,7 @@ func postRequest(reqURL string, c chan accessToken, data []byte) ([]byte, error)
 			case 0:
 				return reply, nil
 			case 42001, 40001:
-				*token.lasttime = 0
+				*token.lasttime = -1
 				<-c
 				log.Println("reget the tocken by ", result.ErrorCode, result.ErrorMessage)
 				continue

+ 1 - 0
src/jfw/modules/weixin/src/main.go

@@ -38,6 +38,7 @@ func main() {
 	http.HandleFunc("/wx/lsmstr/", wx.NewStrQrHandle)
 	http.HandleFunc("/wx/lsm/", wx.AdvHandle)
 	http.HandleFunc("/wx/token", wx.GetToken)
+	http.HandleFunc("/wx/ticket", wx.GetTicket)
 	// 设置监听的端口
 	err := endless.ListenAndServe(":"+Sysconfig["weixinport"].(string), nil, func() {})
 	if err != nil {

+ 30 - 5
src/jfw/modules/weixin/src/wx/wx.go

@@ -619,6 +619,7 @@ func Subscribe(w ResponseWriter, r *Request) {
 	} else if strings.Count(r.EventKey, "_") >= 2 {
 		source = strings.SplitN(r.EventKey, "_", 2)[1]
 	}
+	go saveFixedCode(openid, r.Event, source)
 	log.Println("source:", source)
 	var shareData interface{}
 	shareData = redis.Get("sso", "p_shareData_"+source)
@@ -949,6 +950,7 @@ func ScanHandler(w ResponseWriter, r *Request) {
 		return
 	}
 	log.Println("openid======", openid, r.EventKey)
+	go saveFixedCode(openid, r.Event, r.EventKey)
 	if r.EventKey == "69" { //数据报告-扫码回复图文
 		datareportReply := util.ObjToMap(config.Sysconfig["datareportUserReply"])
 		if datareportReply != nil && len(*datareportReply) > 0 {
@@ -1494,6 +1496,11 @@ func GetToken(w http.ResponseWriter, r *http.Request) {
 	fmt.Fprint(w, Mux.GetToken())
 }
 
+//获取Ticket
+func GetTicket(w http.ResponseWriter, r *http.Request) {
+	fmt.Fprint(w, Mux.GetTicket())
+}
+
 //生成推广临时二维码地址
 func AdvHandle(w http.ResponseWriter, r *http.Request) {
 	param := r.RequestURI[8:]
@@ -1768,13 +1775,17 @@ func downloadUserFace(url string) string {
 		util.Try(func() {
 			os.MkdirAll(config.Sysconfig["headimage"].(string)+fmt.Sprintf("/upload/%s/%s/%s", tn.Format("2006"), tn.Format("01"), tn.Format("02")), 0777)
 			fi, err := os.OpenFile(config.Sysconfig["headimage"].(string)+filename, os.O_CREATE|os.O_TRUNC|os.O_SYNC|os.O_RDWR, 0x666)
-			defer fi.Close()
-			resp, err := http.Get(url)
-			defer resp.Body.Close()
 			if err == nil {
-				io.Copy(fi, resp.Body)
+				defer fi.Close()
+				resp, err := http.Get(url)
+				if err == nil {
+					defer resp.Body.Close()
+					io.Copy(fi, resp.Body)
+				} else {
+					log.Println("download userface err:", err.Error())
+				}
 			} else {
-				log.Println("download userface err:", err.Error())
+				log.Println("download userface OpenFile err:", err.Error())
 			}
 		}, func(e interface{}) {})
 	}()
@@ -1804,3 +1815,17 @@ func HashVal(src string) int {
 	}
 	return check
 }
+
+//记录固定码的扫码日志
+func saveFixedCode(openid, t, code string) {
+	defer util.Catch()
+	if !numCodeReg.MatchString(code) {
+		return
+	}
+	tools.MQFW.Save("wxfixedcode", map[string]interface{}{
+		"createtime": time.Now().Unix(),
+		"type":       t,
+		"code":       code,
+		"openid":     openid,
+	})
+}

+ 9 - 0
src/jfw/modules/wxtoken/src/config.json

@@ -0,0 +1,9 @@
+{
+	"wxs":[
+		{
+			"appid":"wx76e1309b01a7b17e",
+			"appsecret":"dd00e71cb2370432d9de848b674eb8e7"
+		}
+	],
+	"redis":"sso=192.168.3.128:1712"
+}

+ 306 - 0
src/jfw/modules/wxtoken/src/main.go

@@ -0,0 +1,306 @@
+package main
+
+import (
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"net/http"
+	"qfw/util"
+	"qfw/util/redis"
+	"strings"
+	"time"
+
+	redigo "github.com/garyburd/redigo/redis"
+)
+
+const (
+	weixinHost           = "https://api.weixin.qq.com/cgi-bin"
+	weixinJsApiTicketURL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket"
+	WxTokenKey           = "WxToken_%s"
+	WxTicketKey          = "WxTicket_%s"
+	RedisCode            = "sso"
+	MaxExpSec            = 5400
+	retryMaxN            = 3
+)
+
+var (
+	Config    *config
+	AllCountT = map[string]*countTocken{}
+	AllWxs    = map[string]*wx{}
+)
+
+type wx struct {
+	Appid      string
+	Appsecret  string
+	TokenChan  chan accessToken
+	TicketChan chan jsApiTicket
+}
+type config struct {
+	Wxs   []*wx
+	Redis string
+}
+type accessToken struct {
+	Token    string
+	Expires  time.Time
+	Lasttime *int64
+}
+
+type wxToken struct {
+	AccessToken string `json:"access_token"`
+	ExpiresIn   int64  `json:"expires_in"`
+	LastTime    int64  `json:"last_time"`
+}
+
+type wxTicket struct {
+	Ticket    string `json:"ticket"`
+	ExpiresIn int64  `json:"expires_in"`
+}
+
+type jsApiTicket struct {
+	Ticket  string
+	Expires time.Time
+}
+type countTocken struct {
+	allTimes int64
+	dayTimes int64
+	day      int
+}
+
+func init() {
+	util.ReadConfig(&Config)
+	redis.InitRedis(Config.Redis)
+	for _, v := range Config.Wxs {
+		v.TokenChan = make(chan accessToken)
+		v.TicketChan = make(chan jsApiTicket)
+		AllWxs[v.Appid] = v
+		AllCountT[v.Appid] = &countTocken{0, 0, time.Now().Day()}
+	}
+	go func() {
+		for {
+			for CountK, CountT := range AllCountT {
+				if time.Now().Day() != CountT.day {
+					CountT.dayTimes = 0
+					CountT.day = time.Now().Day()
+					log.Println(CountK, "wx-tocken改变统计时间:", CountT.day, ",次数:", CountT.dayTimes)
+				}
+			}
+			time.Sleep(30 * time.Second)
+		}
+	}()
+	go func() {
+		for {
+			defer util.Catch()
+		L:
+			for {
+				conn := redis.RedisPool[RedisCode].Get()
+				if conn.Err() == nil {
+					psc := redigo.PubSubConn{Conn: conn}
+					if err := psc.Subscribe(redigo.Args{}.AddFlat("WxRefreshSub")...); err != nil {
+						log.Println(err)
+					}
+					for {
+						msg := psc.Receive()
+						switch n := msg.(type) {
+						case error:
+							log.Println("redis receive error", msg)
+							conn.Close()
+							break L
+						case redigo.Message:
+							res := string(n.Data)
+							if flag := "token_"; strings.HasPrefix(res, flag) {
+								params := strings.Split(strings.TrimLeft(res, flag), " ")
+								appid := params[0]
+								c := AllWxs[appid]
+								if c != nil {
+									token := <-c.TokenChan
+									//意外情况,导致token失效,需要重新获取token
+									if token.Token == params[1] {
+										refreshAccessToken(appid)
+									}
+								} else {
+									log.Println("appid", appid, "不存在")
+								}
+							} else if flag := "ticket_"; strings.HasPrefix(res, flag) {
+								appid := strings.TrimLeft(res, flag)
+								c := AllWxs[appid]
+								if c != nil {
+									<-c.TicketChan
+								} else {
+									log.Println("appid", appid, "不存在")
+								}
+							}
+						}
+					}
+				}
+				time.Sleep(1 * time.Second)
+			}
+			time.Sleep(500 * time.Millisecond)
+		}
+	}()
+}
+func main() {
+	log.Println("程序启动。。。")
+	for _, v := range AllWxs {
+		log.Println("初始化 token ticket", v.Appid)
+		go createAccessToken(v.Appid)
+		go createJsApiTicket(v.Appid)
+	}
+	<-chan bool(nil)
+}
+func createAccessToken(appid string) {
+	lt := int64(0)
+	token := accessToken{"", time.Now(), &lt}
+	AllWxs[appid].TokenChan <- token
+	tokenKey := fmt.Sprintf("WxToken_%s", appid)
+	for {
+		ret, err := redis.GetNewBytes(RedisCode, tokenKey)
+		if err == nil {
+			if ret != nil {
+				var res wxToken
+				err := json.Unmarshal(*ret, &res)
+				if err != nil {
+					log.Println(appid, "从redis加载token出错", err)
+				} else {
+					token.Token = res.AccessToken
+					token.Expires = time.Now().Add(time.Duration(res.ExpiresIn * 1000 * 1000 * 1000))
+					*token.Lasttime = res.LastTime
+				}
+			} else {
+				*token.Lasttime = 0
+				token.Expires = time.Now()
+			}
+		}
+		if (time.Now().Unix()-*token.Lasttime) > MaxExpSec || time.Since(token.Expires).Seconds() >= 0 {
+			AllCountT[appid].allTimes++
+			AllCountT[appid].dayTimes++
+			resp, err := http.Get(weixinHost + "/token?grant_type=client_credential&appid=" + appid + "&secret=" + AllWxs[appid].Appsecret)
+			if err != nil {
+				log.Println(appid, "Get access token failed: ", err)
+			} else {
+				defer resp.Body.Close()
+				body, err := ioutil.ReadAll(resp.Body)
+				if err != nil {
+					log.Println(appid, "Read access token failed: ", err)
+				} else {
+					var res wxToken
+					if err := json.Unmarshal(body, &res); err != nil {
+						log.Println(appid, "Parse access token failed: ", err)
+					} else {
+						token.Token = res.AccessToken
+						token.Expires = time.Now().Add(time.Duration(res.ExpiresIn * 1000 * 1000 * 1000))
+						*token.Lasttime = time.Now().Unix()
+						redis.Put(RedisCode, tokenKey, map[string]interface{}{
+							"access_token": res.AccessToken,
+							"expires_in":   token.Expires.Unix(),
+							"last_time":    token.Lasttime,
+						}, MaxExpSec)
+						log.Println(appid, "获取tocken:", AllCountT[appid].dayTimes, "token", res.AccessToken, "expires_in", res.ExpiresIn, "expires", token.Expires.Unix())
+					}
+				}
+			}
+		}
+		AllWxs[appid].TokenChan <- token
+		if AllCountT[appid].dayTimes > 100 {
+			log.Println(appid, ">>-->>获取tocken...<<--<<", AllCountT[appid].dayTimes, "次")
+			time.Sleep(1 * time.Minute)
+		}
+	}
+}
+
+//刷新token
+func refreshAccessToken(appid string) {
+	redis.Del(RedisCode, fmt.Sprintf(WxTokenKey, appid))
+	<-AllWxs[appid].TokenChan
+}
+
+func createJsApiTicket(appid string) {
+	ticket := jsApiTicket{"", time.Now()}
+	AllWxs[appid].TicketChan <- ticket
+	ticketKey := fmt.Sprintf(WxTicketKey, appid)
+	for {
+		ret, err := redis.GetNewBytes(RedisCode, ticketKey)
+		if err == nil {
+			if ret != nil {
+				var res wxTicket
+				err := json.Unmarshal(*ret, &res)
+				if err != nil {
+					log.Println(appid, "从redis加载ticket出错", err)
+				} else {
+					ticket.Ticket = res.Ticket
+					ticket.Expires = time.Now().Add(time.Duration(res.ExpiresIn * 1000 * 1000 * 1000))
+				}
+			} else {
+				ticket.Expires = time.Now()
+			}
+		}
+		if time.Since(ticket.Expires).Seconds() >= 0 {
+			t, err := getJsApiTicket(appid, ticketKey)
+			if err == nil {
+				ticket = *t
+			}
+		}
+		AllWxs[appid].TicketChan <- ticket
+	}
+}
+
+func getJsApiTicket(appid, ticketKey string) (*jsApiTicket, error) {
+	reply, err := sendGetRequest(appid, weixinJsApiTicketURL+"?type=jsapi&access_token=")
+	if err != nil {
+		log.Println(appid, "getJsApiTicket error", err)
+		return nil, err
+	}
+	var res wxTicket
+	if err := json.Unmarshal(reply, &res); err != nil {
+		log.Println(appid, "getJsApiTicket json.Unmarshal error", err)
+		return nil, err
+	}
+	var ticket jsApiTicket
+	ticket.Ticket = res.Ticket
+	ticket.Expires = time.Now().Add(time.Duration(res.ExpiresIn * 1000 * 1000 * 1000))
+	redis.Put(RedisCode, ticketKey, map[string]interface{}{
+		"ticket":     res.Ticket,
+		"expires_in": ticket.Expires.Unix(),
+	}, int(res.ExpiresIn))
+	log.Println(appid, "获取ticket:", "ticket", res.Ticket, "expires_in", res.ExpiresIn, "expires", ticket.Expires.Unix())
+	return &ticket, nil
+}
+
+func sendGetRequest(appid, reqURL string) ([]byte, error) {
+	for i := 0; i < retryMaxN; i++ {
+		token := <-AllWxs[appid].TokenChan
+		if time.Since(token.Expires).Seconds() < 0 {
+			r, err := http.Get(reqURL + token.Token)
+			if err != nil {
+				log.Println(appid, "get JsApiTicket error", err)
+				continue
+			}
+			defer r.Body.Close()
+			reply, err := ioutil.ReadAll(r.Body)
+			if err != nil {
+				log.Println(appid, "Read access token failed: ", err)
+				return nil, err
+			}
+			var result struct {
+				ErrorCode    int    `json:"errcode,omitempty"`
+				ErrorMessage string `json:"errmsg,omitempty"`
+			}
+			if err := json.Unmarshal(reply, &result); err != nil {
+				log.Println(appid, "Parse JsApiTicket error", err)
+				return nil, err
+			}
+			switch result.ErrorCode {
+			case 0:
+				return reply, nil
+			case 42001, 40001:
+				refreshAccessToken(appid)
+				log.Println(appid, "reget the tocken by ", result.ErrorCode, result.ErrorMessage)
+				continue
+			default:
+				return nil, errors.New(fmt.Sprintf("WeiXin send get request reply[%d]: %s", result.ErrorCode, result.ErrorMessage))
+			}
+		}
+	}
+	return nil, errors.New("WeiXin post request too many times:" + reqURL)
+}

BIN
src/jfw/modules/wxtoken/src/src.exe~


+ 1 - 0
src/web/staticres/css/pc.css

@@ -3863,6 +3863,7 @@ h6 {
 	font-size: 14px;
     color: #2cb7ca;
     cursor: pointer;
+    display: none;
 }
 #tab2 #candidate{
 	border-right: 0px !important;

+ 325 - 324
src/web/staticres/css/wxcontentinfo.css

@@ -1,325 +1,326 @@
-
-/**div2.1**/
-.fatNav{
-	height:45px;
-}
-.childNav{
-	height: 45px;
-    line-height: 45px;
-    border-bottom: 1px solid #EBEBEB;
-    border-top: 1px solid #EBEBEB;
-	top:0px;
-	width: 100%;
-	background-color: #fff;
-	z-index: 999;
-}
-.childNav div{
-	width: 50%;
-    text-align: center;
-    float:left;
-	height: 43px;
-    
-}
-.childNav .active{
-	color:#2cb7ca;
-	border-bottom: 2px solid #2cb7ca;
-}
-.tabfix{
-	position:fixed
-}
-#tab1{
-	margin-left: -10px;
-	margin-right: -10px;
-	background-color: #f4f4f9;
-/*    padding-bottom: 10px;*/
-/*	border-bottom: 1px solid #EBEBEB;*/
-	margin-top:-5px;
-}
-#tab1 ul{
-	margin-bottom:0px;
-}
-#tab1 .publicTitle {
-	height: .85rem;
-	line-height: .85rem;
-	padding-left: .3rem;
-	background-color: #f4f4f9;
-/*	border-top: 1px solid #EBEBEB;*/
-	border-bottom: 1px solid #EBEBEB;
-	font-size: .28rem;
-	color: #686868;
-	display: flex;
-	align-items: center;
-}
-
-#tab1 .publicTitle>.line {
-	display: inline-block;
-	width: .07rem;
-	height: .28rem;
-	background-color: #2cb7ca;
-	margin-right: .15rem;
-}
-#tab1 .itemInfo{
-	background-color: #fff;
-}
-#tab1 .itemInfo>ul {
-	padding-left: .3rem;
-}
-
-#tab1 .itemInfo>ul>li {
-	padding-top: .3rem;
-	padding-bottom: .3rem;
-	border-bottom: 1px solid #EBEBEB;
-	font-size: .3rem;
-	color: #1d1d1d;
-	text-align: left;
-	display: flex;
-	align-items: center;
-	position: relative;
-}
-
-#tab1 .itemInfo>ul>li p.name {
-	width: 1.8rem;
-	margin-right: .15rem;
-}
-
-#tab1 .itemInfo>ul>li p.textcontent {
-	width: 4.2rem;
-}
-
-#tab1 .itemInfo>ul>li p.textcontent.long {
-	
-	line-height: .4rem;
-	overflow: hidden;
-	background: #fff url(/images/down.png) right bottom no-repeat;
-	background-size: .25rem .16rem;
-	
-}
-
-#tab1 .itemInfo>ul>li p.textcontent.long.up {
-	background: #fff url(/images/up.png) right bottom no-repeat;
-	background-size: .25rem .16rem;
-	
-}
-
-#tab1 .itemInfo>ul>li>a {
-	position: absolute;
-	right: .3rem;
-	color: #2cb7ca;
-	font-size: .26rem;
-}
-#tab1 .itemInfo>ul>li p{
-	margin-bottom:0px !important;
-}
-.tab-ct{
-	margin-bottom:20px;
-}
-#tab2{
-	margin-top: 25px;
-	margin-bottom: 30px;
-}
-.recoveryerror{
-	position: fixed;
-    bottom: 10px;
-    height: 65px;
-    border-radius: 5px;
-    margin: auto;
-    right: 10px;
-    left: 10px;
-	background: #fff;
-	box-shadow: 0 0 20px rgba(0,0,0, .5);
-}
-.recoveryerror .rhclose{
-	position:absolute;
-	box-shadow: 0 0 20px rgba(0,0,0, .25);
-	right: -5px;
-    top: -14px;
-    width: 23px;
-	border-radius: 100%;
-}
-.recoveryerror .rh-content{
-	padding: 13px;
-	width: 7.12rem;
-}
-.recoveryerror .rhtext{
-	float: left;
-    width: 3.8rem;
-	font-size: .28rem;
-	color: #1d1d1d;
-}
-.recoveryerror .rhright img{
-	width: 0.35rem;
-}
-.recoveryerror .rhwrong img{
-	width: 0.3rem;
-}
-.recoveryerror .rhright,.recoveryerror .rhwrong{
-	display: inline-block;
-    border: 1px solid #e0e0e0;
-    background: #f2f2f7;
-    width: 1.2rem;
-    height: 35px;
-	text-align: center;
-	padding: 8px;
-	float:right;
-	border-radius:2px;
-}
-.recoveryerror .rhright{
-	margin-right: 10px;
-}
-.fphl{
-	background-color:#e2e2e2;
-}
-.recoveryerror .rh-recovery{
-	padding: 13px 10px;
-	width: 7.12rem;
-}
-.recoveryerror .rhrinput{
-	width:100%;
-	position: relative;
-}
-.recoveryerror .rhrinput input{
-	border: 1px solid #cecece;
-    border-bottom-left-radius: 4px;
-    border-top-left-radius: 4px;
-    height: 40px;
-    color: #1d1d1d;
-	width: 100%;
-	padding-right: 1.5rem;
-	font-size: .28rem;
-    padding-left: 6px;
-}
-.recoveryerror .rhrsub{
-	height: 40px;
-/*    border: 1px solid #2cb7ca;*/
-    color: #fff;
-    background: #2cb7ca;
-    border-bottom-right-radius: 3px;
-    border-top-right-radius: 3px;
-    line-height: 40px;
-    text-align: center;
-	width: 1.4rem;
-	position: absolute;
-    right: 0px;
-    top: 0px;
-}
-#tab1 .ulfg{
-	height: 13px;
-    background: #f4f4f9;
-    padding-left: 0px !important;
-    border-bottom: 1px solid #EBEBEB;
-    border-top: 1px solid #EBEBEB;
-}
-#tab1 .bbm0{
-	border-bottom:0px !important;
-}
-#tab1  #baseInfo,#tab1  #bidInfo,#tab1  #bagInfo,#tab1  #candidateInfo{
-	border-bottom: 1px solid #EBEBEB;
-}
-.rec-null{
-	position: fixed;
-    border-radius: 5px;
-    margin: auto;
-    background: #fff;
-    box-shadow: 0 0 20px rgba(0,0,0, .5);
-    width: 5.6rem;
-    height: 2.6rem;
-    left: 50%;
-    margin-left: -2.8rem;
-    top: 50%;
-    margin-top: -1.3rem;
-}
-.null-head{
-	border-bottom: 1px solid #ebebeb;
-    padding: 5px 15px;
-}
-.null-cont{
-	height: 50px;
-    line-height: 50px;
-    text-align: center;
-    border-bottom: 1px solid #ebebeb;
-	font-size: .3rem;
-}
-.null-feet{
-	text-align: right;
-    margin-top: 12px;
-}
-.null-yes{
-	display: inline-block;
-    border: 1px solid #2cbacf;
-    background: #2cb7ca;
-    color: #fff;
-    padding: 0px 15px;
-    margin-right: 20px;
-    border-radius: 2px;
-}
-.null-no{
-	display: inline-block;
-    border: 1px solid #ccc;
-    background: #ccc;
-    color: #fff;
-    padding: 0px 15px;
-    margin-right: 10px;
-    border-radius: 2px;
-}
-.explain{
-	font-size: .25rem;
-    color: #888;
-    background-color: #f4f4f9;    
-	height: 60px;
-    line-height: 40px;
-    padding-left: 10px;
-    margin: 0px -10px 0px -10px;
-    border-bottom: 1px solid #ebebeb;
-/*    border-top: 1px solid #ebebeb;*/
-}
-/* *** */
-.share, .iknow {
-    text-align: right;
-    padding-right: .9rem;
-}
-.share img {
-    width: 5.13rem;
-    height: 4.37rem;
-    margin-top: 30px;
-}
-.iknow img {
-    width: 1.99rem;
-    height: 0.92rem;
-    margin-top: 50px;
-}
-.smask{
-	position: fixed;
-    top: 0px;
-    background-color: #000;
-    background: rgba(0, 0, 0, 0.8);
-    width: 100%;
-    height: 100%;
-    z-index: 9999;
-}
-/* forceShare start */
-.sharel {
-	text-align: right;
-	padding-right: .9rem;
-}
-.sharel img {
-	width: 5.13rem;
-	height: 4.37rem;
-	margin-top: 17px;
-}
-.smaskl{
-	position: fixed;
-	top: 0px;
-	background-color: #000;
-	background: rgba(0, 0, 0, 0.8);
-	width: 100%;
-	height: 100%;
-	z-index: 9999;
-}
-.infoFilter{
-	-webkit-filter: blur(5px); /* Chrome, Opera */
-	-moz-filter: blur(5px);
-	-ms-filter: blur(5px);
-	filter: blur(5px);
-	filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius=10, MakeShadow=false);
-}
+
+/**div2.1**/
+.fatNav{
+	height:45px;
+}
+.childNav{
+	height: 45px;
+    line-height: 45px;
+    border-bottom: 1px solid #EBEBEB;
+    border-top: 1px solid #EBEBEB;
+	top:0px;
+	width: 100%;
+	background-color: #fff;
+	z-index: 999;
+}
+.childNav div{
+	width: 50%;
+    text-align: center;
+    float:left;
+	height: 43px;
+    
+}
+.childNav .active{
+	color:#2cb7ca;
+	border-bottom: 2px solid #2cb7ca;
+}
+.tabfix{
+	position:fixed
+}
+#tab1{
+	margin-left: -10px;
+	margin-right: -10px;
+	background-color: #f4f4f9;
+/*    padding-bottom: 10px;*/
+/*	border-bottom: 1px solid #EBEBEB;*/
+	margin-top:-5px;
+}
+#tab1 ul{
+	margin-bottom:0px;
+}
+#tab1 .publicTitle {
+	height: .85rem;
+	line-height: .85rem;
+	padding-left: .3rem;
+	background-color: #f4f4f9;
+/*	border-top: 1px solid #EBEBEB;*/
+	border-bottom: 1px solid #EBEBEB;
+	font-size: .28rem;
+	color: #686868;
+	display: flex;
+	align-items: center;
+}
+
+#tab1 .publicTitle>.line {
+	display: inline-block;
+	width: .07rem;
+	height: .28rem;
+	background-color: #2cb7ca;
+	margin-right: .15rem;
+}
+#tab1 .itemInfo{
+	background-color: #fff;
+}
+#tab1 .itemInfo>ul {
+	padding-left: .3rem;
+}
+
+#tab1 .itemInfo>ul>li {
+	padding-top: .3rem;
+	padding-bottom: .3rem;
+	border-bottom: 1px solid #EBEBEB;
+	font-size: .3rem;
+	color: #1d1d1d;
+	text-align: left;
+	display: flex;
+	align-items: center;
+	position: relative;
+}
+
+#tab1 .itemInfo>ul>li p.name {
+	width: 1.8rem;
+	margin-right: .15rem;
+}
+
+#tab1 .itemInfo>ul>li p.textcontent {
+	width: 4.2rem;
+}
+
+#tab1 .itemInfo>ul>li p.textcontent.long {
+	
+	line-height: .4rem;
+	overflow: hidden;
+	background: #fff url(/images/down.png) right bottom no-repeat;
+	background-size: .25rem .16rem;
+	
+}
+
+#tab1 .itemInfo>ul>li p.textcontent.long.up {
+	background: #fff url(/images/up.png) right bottom no-repeat;
+	background-size: .25rem .16rem;
+	
+}
+
+#tab1 .itemInfo>ul>li>a {
+	position: absolute;
+	right: .3rem;
+	color: #2cb7ca;
+	font-size: .26rem;
+	display: none;
+}
+#tab1 .itemInfo>ul>li p{
+	margin-bottom:0px !important;
+}
+.tab-ct{
+	margin-bottom:20px;
+}
+#tab2{
+	margin-top: 25px;
+	margin-bottom: 30px;
+}
+.recoveryerror{
+	position: fixed;
+    bottom: 10px;
+    height: 65px;
+    border-radius: 5px;
+    margin: auto;
+    right: 10px;
+    left: 10px;
+	background: #fff;
+	box-shadow: 0 0 20px rgba(0,0,0, .5);
+}
+.recoveryerror .rhclose{
+	position:absolute;
+	box-shadow: 0 0 20px rgba(0,0,0, .25);
+	right: -5px;
+    top: -14px;
+    width: 23px;
+	border-radius: 100%;
+}
+.recoveryerror .rh-content{
+	padding: 13px;
+	width: 7.12rem;
+}
+.recoveryerror .rhtext{
+	float: left;
+    width: 3.8rem;
+	font-size: .28rem;
+	color: #1d1d1d;
+}
+.recoveryerror .rhright img{
+	width: 0.35rem;
+}
+.recoveryerror .rhwrong img{
+	width: 0.3rem;
+}
+.recoveryerror .rhright,.recoveryerror .rhwrong{
+	display: inline-block;
+    border: 1px solid #e0e0e0;
+    background: #f2f2f7;
+    width: 1.2rem;
+    height: 35px;
+	text-align: center;
+	padding: 8px;
+	float:right;
+	border-radius:2px;
+}
+.recoveryerror .rhright{
+	margin-right: 10px;
+}
+.fphl{
+	background-color:#fff;
+}
+.recoveryerror .rh-recovery{
+	padding: 13px 10px;
+	width: 7.12rem;
+}
+.recoveryerror .rhrinput{
+	width:100%;
+	position: relative;
+}
+.recoveryerror .rhrinput input{
+	border: 1px solid #cecece;
+    border-bottom-left-radius: 4px;
+    border-top-left-radius: 4px;
+    height: 40px;
+    color: #1d1d1d;
+	width: 100%;
+	padding-right: 1.5rem;
+	font-size: .28rem;
+    padding-left: 6px;
+}
+.recoveryerror .rhrsub{
+	height: 40px;
+/*    border: 1px solid #2cb7ca;*/
+    color: #fff;
+    background: #2cb7ca;
+    border-bottom-right-radius: 3px;
+    border-top-right-radius: 3px;
+    line-height: 40px;
+    text-align: center;
+	width: 1.4rem;
+	position: absolute;
+    right: 0px;
+    top: 0px;
+}
+#tab1 .ulfg{
+	height: 13px;
+    background: #f4f4f9;
+    padding-left: 0px !important;
+    border-bottom: 1px solid #EBEBEB;
+    border-top: 1px solid #EBEBEB;
+}
+#tab1 .bbm0{
+	border-bottom:0px !important;
+}
+#tab1  #baseInfo,#tab1  #bidInfo,#tab1  #bagInfo,#tab1  #candidateInfo{
+	border-bottom: 1px solid #EBEBEB;
+}
+.rec-null{
+	position: fixed;
+    border-radius: 5px;
+    margin: auto;
+    background: #fff;
+    box-shadow: 0 0 20px rgba(0,0,0, .5);
+    width: 5.6rem;
+    height: 2.6rem;
+    left: 50%;
+    margin-left: -2.8rem;
+    top: 50%;
+    margin-top: -1.3rem;
+}
+.null-head{
+	border-bottom: 1px solid #ebebeb;
+    padding: 5px 15px;
+}
+.null-cont{
+	height: 50px;
+    line-height: 50px;
+    text-align: center;
+    border-bottom: 1px solid #ebebeb;
+	font-size: .3rem;
+}
+.null-feet{
+	text-align: right;
+    margin-top: 12px;
+}
+.null-yes{
+	display: inline-block;
+    border: 1px solid #2cbacf;
+    background: #2cb7ca;
+    color: #fff;
+    padding: 0px 15px;
+    margin-right: 20px;
+    border-radius: 2px;
+}
+.null-no{
+	display: inline-block;
+    border: 1px solid #ccc;
+    background: #ccc;
+    color: #fff;
+    padding: 0px 15px;
+    margin-right: 10px;
+    border-radius: 2px;
+}
+.explain{
+	font-size: .25rem;
+    color: #888;
+    background-color: #f4f4f9;    
+	height: 80px;
+    line-height: 40px;
+    padding-left: 10px;
+    margin: 0px -10px 0px -10px;
+    border-bottom: 1px solid #ebebeb;
+/*    border-top: 1px solid #ebebeb;*/
+}
+/* *** */
+.share, .iknow {
+    text-align: right;
+    padding-right: .9rem;
+}
+.share img {
+    width: 5.13rem;
+    height: 4.37rem;
+    margin-top: 30px;
+}
+.iknow img {
+    width: 1.99rem;
+    height: 0.92rem;
+    margin-top: 50px;
+}
+.smask{
+	position: fixed;
+    top: 0px;
+    background-color: #000;
+    background: rgba(0, 0, 0, 0.8);
+    width: 100%;
+    height: 100%;
+    z-index: 9999;
+}
+/* forceShare start */
+.sharel {
+	text-align: right;
+	padding-right: .9rem;
+}
+.sharel img {
+	width: 5.13rem;
+	height: 4.37rem;
+	margin-top: 17px;
+}
+.smaskl{
+	position: fixed;
+	top: 0px;
+	background-color: #000;
+	background: rgba(0, 0, 0, 0.8);
+	width: 100%;
+	height: 100%;
+	z-index: 9999;
+}
+.infoFilter{
+	-webkit-filter: blur(5px); /* Chrome, Opera */
+	-moz-filter: blur(5px);
+	-ms-filter: blur(5px);
+	filter: blur(5px);
+	filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius=10, MakeShadow=false);
+}
 /* forceShare end */

+ 1 - 0
src/web/staticres/pccss/public-nav-1200.css

@@ -169,6 +169,7 @@ input:-ms-input-placeholder {
     width: 0;
     height: 0;
     top: -8px;
+    left: 50%;
     margin-left: -2.5px;
     position: absolute;
     border-left: 5px solid transparent;

+ 38 - 1
src/web/staticres/wx_dataExport/css/dataExport.css

@@ -24,7 +24,7 @@ html .page .progress {
   justify-content: space-around;
   padding: .28rem 0;
   background: #fff;
-  border-bottom: 1px solid #e0e0e0;
+  height: 70px;
 }
 html .page .progress .p-item {
   -webkit-box-flex: 1;
@@ -266,4 +266,41 @@ html .match_way .box .box_bd img {
 
 html .match_way .box .box_bd .weui-check:checked + .weui-icon-checked:before {
   color: #2CB7CA;
+}
+
+.cion_img{
+	position: relative;
+	border: 1px solid #E8E8E8;
+	margin: 0 auto;
+	border-radius: 10px;
+}
+
+.cion_img:before,
+.cion_img:after {
+	content: '';
+	position: absolute;
+	top: 50%;
+	width: 3rem;
+	height: 1px;
+	background-color: #E8E8E8;
+}
+
+.cion_img:before {
+	left: 0.38rem;
+}
+
+.cion_img:after {
+	left: -3rem;
+}
+
+
+.j-icon {
+	display: inline-block;
+	width: 20px;
+	height: 20px;
+}
+
+.icon-arrow-top {
+	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABHNCSVQICAgIfAhkiAAAAN9JREFUSEvt0rENwjAQBdB/RWoyChugTAAp4hbYADZgA9iAtLkUYQNgg6yQDehTBAURCaHYvpNQaOz628/+Z8LEiyb2EMCfNx4q/X+lVVXFbdseAdyNMbn2RuoZMvMFwPINbbWoCiyKIiei9derVKgYtGC9/QCQGGNqSb0ikJk3AM6OA8WoFxRgwz1EqBNUYANaR1GUpGna46PLCjLzHMAVQCyZzUfGibrAG4CFEnvFiWifZdlpbK8VLMty13XdAcBMiTYAVrZf6/00SswbD6C3Im0gVKptzJsPlXor0gaecJo+HVRwOokAAAAASUVORK5CYII=) no-repeat;
+	background-size: contain;
 }

BIN
src/web/staticres/wx_dataExport/images/jt.png


+ 191 - 64
src/web/templates/pc/biddetail_rec.html

@@ -94,7 +94,7 @@ a{
 	text-align: center;
 	margin-bottom: -6px;
 	margin-top: -16px;
-	
+
 }
 .j-wx-code>.code-wxm>img{
 	width: 200px;
@@ -102,7 +102,7 @@ a{
 	margin-top: -5px;
 }
 .j-wx-code>.code-text{
-	text-align: center;	
+	text-align: center;
 }
 .j-wx-code>.code-bottom{
 	width: 470px;
@@ -153,7 +153,7 @@ a{
 }
 .adv-pccontent-right{
 	position:absolute;
-	top:0px; 
+	top:0px;
 	right:-5px;
 	width:200px;
 	height:200px;
@@ -243,13 +243,13 @@ function isWechat() {
 		<div class="com-title" id="com-title">
 <!--			<span style="border-bottom:1px solid #2cb7ca">{{.T.obj.title}}</span>-->
 			{{.T.obj.title}}
-			
+
 		</div>
 		<div class="com-statusbar" id="statusbar">
 			<span class="com-guanzhu">
 				<img src="{{Msg "seo" "cdn"}}/images/guanzhu.png">
 				<font>关注项目</font>
-				<div class="scanqr"> 
+				<div class="scanqr">
 					<span>微信扫一扫</span>
 					<img class="img" id="wxCode" src="/front/share/{{.T.shareid}}" alt="微信订阅号">
 					<span>扫码关注此项目<br>实时查看最新公告</span>
@@ -257,7 +257,7 @@ function isWechat() {
 			</span>
 			<span class="com-wxshare">
 				<img src="{{Msg "seo" "cdn"}}/images/wxshare.png">微信分享
-				<div class="scanqr"> 
+				<div class="scanqr">
 					<span>微信扫一扫</span>
 					<img class="img" src="/biddetail/normal/qr/{{.T.obj._id}}" alt="微信分享">
 				</div>
@@ -353,7 +353,7 @@ function isWechat() {
 				<div style="clear:none"></div>
 			</div>
 		</div>
-		<div class="tabfat">	
+		<div class="tabfat">
 			<div id="tab2" style="display:none;">
 				<div class="baseInfo">基本信息</div>
 				<div class="baseTable">
@@ -443,7 +443,7 @@ function isWechat() {
 				</div>
 			</div>
 			<div class="explain" style="display:none;">*以上摘要信息由剑鱼标讯智能提取,如有错漏,欢迎纠错!</div>
-		
+
 			<div id="tab1">
 				<div class="com-detail">
 					{{Html (Regexp (Regexp (Regexp (Regexp (Regexp (Regexp .T.obj.detail "(\\n|\\\\n)\\s+" "\n") "(\\n|\\\\n)+" "<br/>") "<td>\\s*$" "") "<tr>\\s*$" "") "<tbody>\\s*$" "") "<table>\\s*$" "")}}
@@ -462,7 +462,7 @@ function isWechat() {
 			<a href="{{.T.obj.url}}" target="_blank" class="com-original hidden">
 				<img src="{{Msg "seo" "cdn"}}/images/pc_15.png">查看原文
 			</a>
-			<!--#onekey{padding:8px 40px;}-->	
+			<!--#onekey{padding:8px 40px;}-->
 			<!--<div class="onekey" data-toggle="modal" data-target="#myModal">一键报告排版问题</div>-->
 			<!--<div class="clicklike hidden">
 				<div class="jyuseful">
@@ -786,7 +786,7 @@ $(window).scroll(function(event){
 	}else{
 		$(".recoveryhead").removeClass("tabfix");
 	}
-	
+
 	//纠错高亮位置
 	if($(".com-detail .fphl").length>0){
 		heightLight = $(".com-detail .fphl").offset().top;
@@ -1113,12 +1113,12 @@ $(function(){
 					'<div style="display:none;"></div>'+
 					'</td>'+
 					'</tr>'
-			
+
 			}
 		pkchtml+='</table></div>'
 		$("#tab2").append(pkchtml)
 	}
-	
+
 	//
 	haslogin({{.T.logid}},{{.T.obj.projectname}},"D");
 	JYLogin({{.T.logid}})
@@ -1173,7 +1173,7 @@ $(function(){
 			var average = uli/tdno.find("td").length ;
 			$("#"+sparr[m]).parent("td").css("width",average);
 		}
-		
+
 	}
 	var attaflag = false;
 	{{if .T.obj.projectinfo.attachments}}
@@ -1203,7 +1203,7 @@ $(function(){
 		//}
 		$(".preb-enclosure").append(pdfhtml)
 	}
-	
+
 	//
 	{{end}}
 	if({{.T.obj.subtype}}=="拟建"||{{.T.obj.toptype}}=="拟建"||{{.T.obj.subtype}}=="违规"){
@@ -1220,7 +1220,7 @@ $(function(){
 	{{if .T.obj.infoformat}}
 	{{if eq .T.obj.infoformat 2}}
 	$(".com-prebuilt").removeClass("hidden");
-	
+
 	{{else}}
 	$(".com-original").removeClass("hidden");
 	{{end}}
@@ -1247,7 +1247,7 @@ $(function(){
 			window.open('javascript:window.name', '<script>location.replace("'+url+'")<\/script>');
 		}
 	});
-	
+
 	//var sds = {{.T.keywords}};
 	var sds = getQueryString("kds");
 	sds = sds.replace(/\++/g," ");
@@ -1303,13 +1303,13 @@ $(function(){
 						var prebExamcont = $(this).text();
 						prebExamcont = keyWordHighlight(prebExamcont,wordsArray[i],"<span class='jykeyword' style=\"border-bottom:1px solid #2cb7ca\">$1</span>");
 						$(this).html(prebExamcont);
-					})				
+					})
 			}
 		}
 	}
-		
+
 	$(".com-detail").html(content);
-	
+
 	$("#com-title").html(titleCopy);
     companyAdd();
 })
@@ -1344,7 +1344,7 @@ function companyAdd(){
                 +'</div></div>');
 		}
     }
-	
+
 	function getElementLeft(element){
 	    var actualLeft = element.offsetLeft;
 	    var current = element.offsetParent;
@@ -1369,7 +1369,7 @@ function companyAdd(){
 		$(".animathistory_ent").each(function(){
 			if($(this).parents(".winner").attr("dataNum") == that.attr("dataNum")){
 				return true
-			}			
+			}
 			$(this).fadeOut(1000);
 		})
         $(this).find(".animathistory_ent").fadeIn(1000);
@@ -1677,7 +1677,7 @@ var thishtlists = function(){
 				hthtml += listtitle
 			}
 				hthtml +='</a></div></div>'
-			
+
 			$(".animathistory .htcontent").append(hthtml);
 		}
 			$(".htlist").find("a").mouseover(function(){
@@ -1848,7 +1848,7 @@ function upordown(type){
 		        url:'/swordfish/praise',
 		        data:{type:type,aosup:aosup,aosdown:aosdown,id:{{.T.obj._id}}},
 		        cache:false,
-		        dataType:'json', 
+		        dataType:'json',
 		        success:function(data){
 					if(data.flag == "T"){
 						$.cookie("up{{.T.obj._id}}",'', { expires: -1 })
@@ -1863,7 +1863,7 @@ function upordown(type){
 		        },
 				error: function(){
 					isReqing = false;
-				}    
+				}
 		    });
 		}
 	}else{
@@ -1893,7 +1893,7 @@ function upordown(type){
 		        url:'/swordfish/praise',
 		        data:{type:type,aosup:aosup,aosdown:aosdown,id:{{.T.obj._id}}},
 		        cache:false,
-		        dataType:'json', 
+		        dataType:'json',
 		        success:function(data){
 					if(data.flag == "T"){
 						$.cookie("up{{.T.obj._id}}",cookieup,{expires:300});
@@ -1907,7 +1907,7 @@ function upordown(type){
 		        },
 				error: function(){
 					isReqing = false;
-				}     
+				}
 		    });
 		}
 	}
@@ -1958,7 +1958,6 @@ function conversionMoeny(money){
 {{include "/common/baiducc.html"}}
 <!--百度统计end-->
 </body>
-=======
 <html>
 
 <head>
@@ -2055,7 +2054,7 @@ a{
 	text-align: center;
 	margin-bottom: -6px;
 	margin-top: -16px;
-	
+
 }
 .j-wx-code>.code-wxm>img{
 	width: 200px;
@@ -2063,7 +2062,7 @@ a{
 	margin-top: -5px;
 }
 .j-wx-code>.code-text{
-	text-align: center;	
+	text-align: center;
 }
 .j-wx-code>.code-bottom{
 	width: 470px;
@@ -2114,7 +2113,7 @@ a{
 }
 .adv-pccontent-right{
 	position:absolute;
-	top:0px; 
+	top:0px;
 	right:-5px;
 	width:200px;
 	height:200px;
@@ -2159,7 +2158,23 @@ a{
     font-size: 14px;
 }
 .com-buyerclass > a{
-    color: #fff;
+	color: #fff;
+}
+.join{
+  color:#fff;
+  background-color:#35B2C8;
+  margin-left: 15px;
+  border:none;
+  border-radius: 5px;
+  font-size:14px;
+  width:75px;
+  height:25px;
+  line-height: 25px;
+  display: inline-block;
+  text-align: center;
+}
+.adv_tosieve{
+  display: inline-block;
 }
 </style>
 </head>
@@ -2193,13 +2208,13 @@ function isWechat() {
 		<div class="com-title" id="com-title">
 <!--			<span style="border-bottom:1px solid #2cb7ca">{{.T.obj.title}}</span>-->
 			{{.T.obj.title}}
-			
+
 		</div>
 		<div class="com-statusbar" id="statusbar">
 			<span class="com-guanzhu">
 				<img src="{{Msg "seo" "cdn"}}/images/guanzhu.png">
 				<font>关注项目</font>
-				<div class="scanqr"> 
+				<div class="scanqr">
 					<span>微信扫一扫</span>
 					<img class="img" id="wxCode" src="/front/share/{{.T.shareid}}" alt="微信订阅号">
 					<span>扫码关注此项目<br>实时查看最新公告</span>
@@ -2207,7 +2222,7 @@ function isWechat() {
 			</span>
 			<span class="com-wxshare">
 				<img src="{{Msg "seo" "cdn"}}/images/wxshare.png">微信分享
-				<div class="scanqr"> 
+				<div class="scanqr">
 					<span>微信扫一扫</span>
 					<img class="img" src="/biddetail/normal/qr/{{.T.obj._id}}" alt="微信分享">
 				</div>
@@ -2294,7 +2309,8 @@ function isWechat() {
 				</table>
 			</div>
 		</div>
-		{{if .T.obj.detail}}
+    <div class="lead-btn-nj" style="color:#2cb7ca;margin:15px 0;display:none;"><div class="adv_tosieve"></div><div class="join" onclick="adv_statistics(this)" adv_name="PC三级页引导按钮"><a style="color:#fff;text-decoration:none" class="adv_tosieve-btn"></a></div></div>
+    {{if .T.obj.detail}}
 		<div class="recoveryfat" style="display:none;">
 			<div class="recoveryhead">
 				<div class="tab2 active" onclick="jumpTab('2')">公告摘要</div>
@@ -2303,7 +2319,7 @@ function isWechat() {
 				<div style="clear:none"></div>
 			</div>
 		</div>
-		<div class="tabfat">	
+		<div class="tabfat">
 			<div id="tab2" style="display:none;">
 				<div class="baseInfo">基本信息</div>
 				<div class="baseTable">
@@ -2392,14 +2408,13 @@ function isWechat() {
 					</table>
 				</div>
 			</div>
-			<div class="explain" style="display:none;">*以上摘要信息由剑鱼标讯智能提取,如有错漏,欢迎纠错!</div>
-		
+			<div class="explain" style="display:none;">*以上摘要信息由剑鱼标讯智能提取</div>
+      <div class="lead-btn" style="color:#2cb7ca;margin:15px 0;display:none;"><div class="adv_tosieve"></div><div class="join" onclick="adv_statistics(this)" adv_name="PC三级页引导按钮"><a style="color:#fff;text-decoration:none" class="adv_tosieve-btn"></a></div></div>
 			<div id="tab1">
 				<div class="com-detail">
 					{{Html (Regexp (Regexp (Regexp (Regexp (Regexp (Regexp .T.obj.detail "(\\n|\\\\n)\\s+" "\n") "(\\n|\\\\n)+" "<br/>") "<td>\\s*$" "") "<tr>\\s*$" "") "<tbody>\\s*$" "") "<table>\\s*$" "")}}
 				</div>
 			</div>
-
 		</div>
 		{{end}}
 		{{if .T.obj.projectinfo.attachments}}
@@ -2412,7 +2427,7 @@ function isWechat() {
 			<a href="{{.T.obj.url}}" target="_blank" class="com-original hidden">
 				<img src="{{Msg "seo" "cdn"}}/images/pc_15.png">查看原文
 			</a>
-			<!--#onekey{padding:8px 40px;}-->	
+			<!--#onekey{padding:8px 40px;}-->
 			<!--<div class="onekey" data-toggle="modal" data-target="#myModal">一键报告排版问题</div>-->
 			<!--<div class="clicklike hidden">
 				<div class="jyuseful">
@@ -2619,6 +2634,60 @@ var projectname = {{.T.obj.projectname}}//统计标识
 var reg ="";
 var titleCopy ="";
 var tyflag = false;//纠错是否是金额
+var area_ = {{.T.obj.area}};
+var city_ = {{.T.obj.city}};
+var agency_ = {{.T.obj.agency}};
+var projectname_ = {{.T.obj.projectname}};
+var buyer_ = {{.T.obj.buyer}};
+var buyerperson_ = {{.T.obj.buyerperson}};
+var buyertel_ = {{.T.obj.buyertel}};
+var isbid =false; //是否是中标,需要显示所有
+//拟建项目广告
+var nj_adv=["批量导出拟建项目"]
+//招标公告广告
+var zb_adv=[
+  "更多项目联系人、电话批量导出",
+  "采购单位招标数据批量导出",
+  "全面展示行业项目的数据字段"
+]
+//中标公告
+var win_adv=[
+  "中标项目信息字段全面展示",
+  "更多中标项目、业主、联系人数据批量导出",
+  "中标企业数据字段定制化导出"
+]
+//任意类型  --更多数据字段定制化导出,立即查看! 其他都是立即体验
+var any_adv=[
+  "更多数据字段定制化导出",
+  "导出数据,分析市场",
+  "导出数据,分析竞争对手",
+  "导出数据,分析合作伙伴",
+  "导出数据,分析客户"
+]
+
+var count=0;
+if (area_!=""&&area_!=null){
+  count++
+}
+if (city_!=""&&city_!=null){
+  count++
+}
+if (agency_!=""&&agency_!=null){
+  count++
+}
+if (projectname_!=""&&projectname_!=null){
+  count++
+}
+if (buyer_!=""&&buyer_!=null){
+  count++
+}
+if (buyerperson_!=""&&buyerperson_!=null){
+  count++
+}
+if (buyertel_!=""&&buyertel_!=null){
+  count++
+}
+
 //
 function isWechat() {
     var ua = navigator.userAgent.toLowerCase();
@@ -2703,13 +2772,62 @@ function clearup(rp){
 	$(".com-detail").html(dtcontent);
 	$("#com-title").html(dttitlecopy);
 }
+
 //
 if({{.T.obj.subtype}}=="中标"||{{.T.obj.subtype}}=="成交"||{{.T.obj.subtype}}=="合同"){
+  isbid=true
+  var winner_ ={{.T.obj.winner}}
 	var bidmt = {{.T.obj.bidamount}}
-	$("#bidamount").text(bidmt)
-	$("#bidInfoTitle").show();
-	$("#bidInfoCont").show();
+  if(winner_!=""&&winner_!=null){
+    count++
+  }
+  if(bidmt!=""&&bidmt!=null){
+    count++
+  }
+  if(count>=5){
+   	$("#bidamount").text(bidmt)
+	  $("#bidInfoTitle").show();
+	  $("#bidInfoCont").show();
+  }
+}
+var subtype={{.T.obj.subtype}};
+var adv_from=getinfotype(subtype);
+var adv=any_adv;
+if(adv_from=="中标公告"){
+  adv=adv.concat(win_adv);
+}else if(adv_from=="招标公告"){
+  adv=adv.concat(zb_adv);
+}else if(adv_from=="拟建项目"){
+  adv=adv.concat(nj_adv);
+}
+var x = Math.floor(Math.random()*adv.length)
+$(".adv_tosieve").text(adv[x])
+var btn_text="立即体验"
+if (adv[x]==any_adv[0]){
+  btn_text="立即查看";
+}
+$(".adv_tosieve-btn").text(btn_text)
+$(".join > a").attr("dataHref","/front/dataExport/toSieve?adv_from="+getinfotype(subtype));
+
+function getinfotype(subtype){
+  var infotype=""
+  switch (subtype){
+		case "拟建":
+      infotype="拟建项目"
+			break;
+    case "招标": case "邀标": case "询价": case "竞谈": case "变更": case "竞价": case "单一": case "其他":
+      infotype="招标公告"
+			break;
+		case "中标": case "成交": case "废标": case "流标":
+      infotype="中标公告"
+			break;
+		default:
+    infotype="其他"
+			break;
+	}
+  return infotype
 }
+
 //
 $(window).scroll(function(event){
 	if(cHeight <= 0){
@@ -2736,7 +2854,7 @@ $(window).scroll(function(event){
 	}else{
 		$(".recoveryhead").removeClass("tabfix");
 	}
-	
+
 	//纠错高亮位置
 	if($(".com-detail .fphl").length>0){
 		heightLight = $(".com-detail .fphl").offset().top;
@@ -2863,6 +2981,9 @@ $(function(){
 		}else{
 			$(".pop-botton").css({"background":"#2cbfca"})
 		}
+      var pathname_url=window.location.pathname+window.location.search;
+     $.get("/front/shorturl/replication");
+
     });
 	//纠错输入框
 	$("#pop-textarea").on("input propertychange",function(){
@@ -3063,12 +3184,12 @@ $(function(){
 					'<div style="display:none;"></div>'+
 					'</td>'+
 					'</tr>'
-			
+
 			}
 		pkchtml+='</table></div>'
 		$("#tab2").append(pkchtml)
 	}
-	
+
 	//
 	haslogin({{.T.logid}},{{.T.obj.projectname}},"D");
 	JYLogin({{.T.logid}})
@@ -3123,8 +3244,11 @@ $(function(){
 			var average = uli/tdno.find("td").length ;
 			$("#"+sparr[m]).parent("td").css("width",average);
 		}
-		
+
 	}
+  if({{.T.obj.subtype}}=="拟建"){
+      $(".lead-btn-nj").show();
+  }
 	var attaflag = false;
 	{{if .T.obj.projectinfo.attachments}}
 	var attachments = {{.T.obj.projectinfo.attachments}}
@@ -3153,7 +3277,7 @@ $(function(){
 		//}
 		$(".preb-enclosure").append(pdfhtml)
 	}
-	
+
 	//
 	{{end}}
 	if({{.T.obj.subtype}}=="拟建"||{{.T.obj.toptype}}=="拟建"||{{.T.obj.subtype}}=="违规"){
@@ -3162,15 +3286,18 @@ $(function(){
 			$(".pdf-div").removeClass("hidden");
 		}
 	}else{
-		$(".recoveryfat").show();
-		$("#tab2").show();
-		$(".explain").show();
+    if((count>=4 && !isbid)||(count>=5&&isbid)){
+    		$(".recoveryfat").show();
+    		$("#tab2").show();
+    		$(".explain").show();
+        $(".lead-btn").show();
+    }
 	}
 	//
 	{{if .T.obj.infoformat}}
 	{{if eq .T.obj.infoformat 2}}
 	$(".com-prebuilt").removeClass("hidden");
-	
+	//
 	{{else}}
 	$(".com-original").removeClass("hidden");
 	{{end}}
@@ -3197,7 +3324,7 @@ $(function(){
 			window.open('javascript:window.name', '<script>location.replace("'+url+'")<\/script>');
 		}
 	});
-	
+
 	//var sds = {{.T.keywords}};
 	var sds = getQueryString("kds");
 	sds = sds.replace(/\++/g," ");
@@ -3253,13 +3380,13 @@ $(function(){
 						var prebExamcont = $(this).text();
 						prebExamcont = keyWordHighlight(prebExamcont,wordsArray[i],"<span class='jykeyword' style=\"border-bottom:1px solid #2cb7ca\">$1</span>");
 						$(this).html(prebExamcont);
-					})				
+					})
 			}
 		}
 	}
-		
+
 	$(".com-detail").html(content);
-	
+
 	$("#com-title").html(titleCopy);
     companyAdd();
 })
@@ -3294,7 +3421,7 @@ function companyAdd(){
                 +'</div></div>');
 		}
     }
-	
+
 	function getElementLeft(element){
 	    var actualLeft = element.offsetLeft;
 	    var current = element.offsetParent;
@@ -3319,7 +3446,7 @@ function companyAdd(){
 		$(".animathistory_ent").each(function(){
 			if($(this).parents(".winner").attr("dataNum") == that.attr("dataNum")){
 				return true
-			}			
+			}
 			$(this).fadeOut(1000);
 		})
         $(this).find(".animathistory_ent").fadeIn(1000);
@@ -3627,7 +3754,7 @@ var thishtlists = function(){
 				hthtml += listtitle
 			}
 				hthtml +='</a></div></div>'
-			
+
 			$(".animathistory .htcontent").append(hthtml);
 		}
 			$(".htlist").find("a").mouseover(function(){
@@ -3794,7 +3921,7 @@ function upordown(type){
 		        url:'/swordfish/praise',
 		        data:{type:type,aosup:aosup,aosdown:aosdown,id:{{.T.obj._id}}},
 		        cache:false,
-		        dataType:'json', 
+		        dataType:'json',
 		        success:function(data){
 					if(data.flag == "T"){
 						$.cookie("up{{.T.obj._id}}",'', { expires: -1 })
@@ -3809,7 +3936,7 @@ function upordown(type){
 		        },
 				error: function(){
 					isReqing = false;
-				}    
+				}
 		    });
 		}
 	}else{
@@ -3839,7 +3966,7 @@ function upordown(type){
 		        url:'/swordfish/praise',
 		        data:{type:type,aosup:aosup,aosdown:aosdown,id:{{.T.obj._id}}},
 		        cache:false,
-		        dataType:'json', 
+		        dataType:'json',
 		        success:function(data){
 					if(data.flag == "T"){
 						$.cookie("up{{.T.obj._id}}",cookieup,{expires:300});
@@ -3853,7 +3980,7 @@ function upordown(type){
 		        },
 				error: function(){
 					isReqing = false;
-				}     
+				}
 		    });
 		}
 	}
@@ -3870,4 +3997,4 @@ function getQueryString(name){
 {{include "/common/baiducc.html"}}
 <!--百度统计end-->
 </body>
-</html>
+</html>

+ 26 - 0
src/web/templates/pc/dataExport_sieve.html

@@ -422,6 +422,24 @@
         	border-color: #2CB7CA;
     		color: #2CB7CA;
         }
+        .sieve-tit{
+          font-size: 14px;
+          font-weight: 600;
+          color: #2CB7CA;
+        }
+        .sieve-cont{
+          font-size: 12px;
+          color:#8E8E8E;
+        }
+        .mt5{
+          margin-top:5px;
+        }
+        .mt10{
+          margin-top:10px;
+        }
+        .mar-bot10{
+          margin-bottom:30px;
+        }
     </style>
 </head>
 <body>
@@ -495,6 +513,14 @@
     </div>
     <!--选择区域-->
     <div class="inner">
+      <div style="margin-left: 50px;">
+      <div class="sieve-tit">数据自助导出</div>
+      <div class="sieve-cont mt5">剑鱼标讯提供全国招投标数据的自助导出功能,企业可指定关键词、发布时间、地区或行业等筛选条件,剑鱼标讯以EXCEL表格形式提供数据。</div>
+      <div class="sieve-tit mt10">通过分析招标数据,可以帮助你</div>
+      <div class="sieve-cont mt5">1、全面获取市场信息,紧跟市场趋势,提前布局;</div>
+      <div class="sieve-cont ">2、准确掌握行业客户、竞争对手、合作伙伴的招投标活动;</div>
+      <div class="sieve-cont mar-bot10">3、轻松挖掘潜在客户、合作伙伴、拓展市场空间。</div>
+      </div>
         <!--日期-->
         <div class="line-box float-box">
             <div class="left">筛选日期</div>

+ 88 - 6
src/web/templates/weixin/dataExport/dataExport.html

@@ -12,6 +12,8 @@
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/dataExport.css?v={{Msg "seo" "version"}}14">
 <!--    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/weui.min.css">-->
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/css/wxbutton.css?v={{Msg "seo" "version"}}1">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/dataExport.css?v={{Msg "seo" "version"}}5">
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/weui.min.css">
     <script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/rem.js?v={{Msg "seo" "version"}}"></script>
     {{include "/common/weixin.html"}}
     <script src="/js/jquery.js"></script>
@@ -25,10 +27,26 @@
     <script type="text/javascript" src="{{Msg "seo" "cdn"}}/vipsubscribe/js/weui.min.js"></script>
 </head>
 <style>
+  .j-container {
+  	display: flex;
+  	flex-direction: column;
+  	justify-content: space-between;
+  	height: 100%;
+  }
+  .j-main {
+    position: relative;
+    display: flex;
+    flex-direction: column;
+    flex: 1;
+    overflow-y: scroll;
+    overflow-x: hidden;
+  }
+  .j-footer {
+    box-shadow: 0px -2Px 8Px rgba(54, 147, 179, 0.051);
+  }
+
 	.confirm{
 		height: 0.94rem;
-		position: fixed;
-    	bottom: 0px;
     	width: 100%;
 	}
     .mbsc-ios .dwbc{
@@ -137,10 +155,45 @@
 		flex: 1;
 		text-align: right;
 	}
+  .tit{
+    text-align: center;
+    background-color: #fff;
+    padding-bottom: 15px;
+
+  }
+  .cont{
+    background-color: #fff
+  }
+  .sieve-tit{
+    font-size: 14px;
+    font-weight: bolder;
+    color: #2CB7CA;
+  }
+  .sieve-cont{
+    font-size: 12px;
+    color:#8E8E8E;
+  }
+  .mt5{
+    margin-top:5px;
+  }
+  .mt10{
+    margin-top:10px;
+  }
+  .mar-bot10{
+    margin-bottom:30px;
+  }
+  .helpwhat{
+    border: 1px solid #E8E8E8;
+    width: 175px;
+    margin: 0 auto;
+    border-radius: 10px;
+    padding-left: 7px;
+  }
 </style>
 <body class="p13">
-    <div class="page">
-        <div class="main">
+    <div class="page j-container">
+      <div class="main j-main">
+       <div>
         <div class="progress">
         	<div class="p-item">
         		<p class="p-item-icon" style="background: #2cb7ca;">
@@ -165,6 +218,23 @@
         		<span>数据导出</span>
         	</div>
         </div>
+            <div class="tit">
+              <div class="helpwhat">数据导出可以帮助您做什么<img style="width: 15px; margin-top: -2px; margin-left: 2px;transform: rotate(180deg);" src="/wx_dataExport/images/jt.png"/></div>
+              <div class="btn_img" style="display:none;" >
+                <span class="j-icon icon-arrow-top cion_img"></span>
+              </div>
+            </div>
+             <div class="cont" style="display:none">
+                <div style="padding-left: 20px; padding-right: 20px; padding-bottom: 1px;text-align: left;">
+                <div class="sieve-tit">数据自助导出</div>
+                <div class="sieve-cont mt5">剑鱼标讯提供全国招投标数据的自助导出功能,企业可指定关键词、发布时间、地区或行业等筛选条件,剑鱼标讯以EXCEL表格形式提供数据。</div>
+                <div class="sieve-tit mt10">通过分析招标数据,可以帮助你</div>
+                <div class="sieve-cont mt5">1、全面获取市场信息,紧跟市场趋势,提前布局;</div>
+                <div class="sieve-cont ">2、准确掌握行业客户、竞争对手、合作伙伴的招投标活动;</div>
+                <div class="sieve-cont mar-bot10">3、轻松挖掘潜在客户、合作伙伴、拓展市场空间。</div>
+              </div>
+          </div>
+         <div>
         <!-- dateChooseStart -->
         <div class="chooseTime">
             <ul>
@@ -284,9 +354,9 @@
                 </div>
             </div>
         </div>
-
     </div>
-
+      </div>
+    </div>
 <script>
     initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
     $(function(){
@@ -313,6 +383,18 @@
                 }
             });
         });
+
+        $(".helpwhat").on("click",function(){
+          $(".btn_img").show();
+          $(".helpwhat").hide();
+          $(".cont").show();
+        })
+
+        $(".btn_img").on("click",function(){
+          $(".btn_img").hide();
+          $(".helpwhat").show();
+          $(".cont").hide();
+        })
         /* 选择匹配方式*/
         $('input:radio[name="way"]').click(function() {
         	var checkValue = $('input:radio[name="way"]:checked').val();

+ 151 - 25
src/web/templates/weixin/wxinfocontent_rec.html

@@ -3,7 +3,7 @@
 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
 <title>公告信息</title>
 <link href="{{Msg "seo" "cdn"}}/css/font.css?v={{Msg "seo" "version"}}" rel="stylesheet">
-<link href="{{Msg "seo" "cdn"}}/css/wxcontentinfo.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+<link href="{{Msg "seo" "cdn"}}/css/wxcontentinfo.css?v={{Msg "seo" "version"}}1" rel="stylesheet">
 <link href="{{Msg "seo" "cdn"}}/css/bootstrap.min.css" rel="stylesheet">
 <link href="{{Msg "seo" "cdn"}}/wxswordfish/style.css?v={{Msg "seo" "version"}}" rel="stylesheet">
 {{include "/common/weixin.html"}}
@@ -475,7 +475,22 @@ pre {
     line-height: 0.40rem;
 	display: inline-block;
 }
-
+.join{
+  color:#fff;
+  background-color:#35B2C8;
+  margin-left:0.1rem;
+  border:none;
+  border-radius: 5px;
+  font-size: .25rem;
+  width: 1.35rem;
+  height: 0.5rem;
+  line-height: 0.5rem;
+  display: inline-block;
+  text-align: center;
+}
+.adv_tosieve{
+  display: inline-block;
+}
 </style>
 </head>
 <body>
@@ -669,7 +684,8 @@ pre {
 				{{end}}
 			</ul>
 		</div>
-		<div class="tab-ct">
+    <div class="lead-btn-nj" style="color:#2cb7ca;margin:15px 0;display:none;margin-top:20px;"><div class="adv_tosieve" style="font-size:.25rem;"></div><div class="join" onclick="adv_statistics(this)" adv_name="微信三级页引导按钮"><a style="color:#fff;text-decoration:none" class="adv_tosieve-btn"></a></div></div>
+    <div class="tab-ct">
 			<div id="tab1" style="display:none;">
 				<div class="publicTitle">
 					基本信息
@@ -686,8 +702,9 @@ pre {
 					</ul>
 				</div>
 			</div>
-			<div class="explain" style="display:none;">*以上摘要信息由剑鱼标讯智能提取,如有错漏,欢迎纠错!</div>
-			<div id="tab2">
+			  <div class="explain" style="display:none;">*以上摘要信息由剑鱼标讯智能提取。</div>
+        <div class="lead-btn" style="color:#2cb7ca;margin:15px 0;display:none;margin-top: -40px;"><div class="adv_tosieve" style="font-size:.25rem;"></div><div class="join" onclick="adv_statistics(this)" adv_name="微信三级页引导按钮"><a style="color:#fff;text-decoration:none" class="adv_tosieve-btn"></a></div></div>
+	    <div id="tab2">
 				<pre id="h_content">{{Html (Regexp (Regexp .T.obj.detail "(\\n|\\\\n)\\s+" "\n") "(\\n|\\\\n)+" "<br/>")}}</pre>
 			</div>
 		</div>
@@ -854,10 +871,111 @@ var reccont = "";
 var forceShareFlag = {{.T.forceShareFlag}};
 var scan_source = getParameter("scan_source");
 var ispcforceshare = getParameter("ispcforceshare");
+
+var city_ = {{.T.obj.city}};
+var agency_ = {{.T.obj.agency}};
+var buyer_ = {{.T.obj.buyer}};
+var buyerperson_ = {{.T.obj.buyerperson}};
+var buyertel_ = {{.T.obj.buyertel}};
+var isbid =false; //是否是中标,需要显示所有
+//拟建项目广告
+var nj_adv=["批量导出拟建项目"]
+//招标公告广告
+var zb_adv=[ 
+  "更多项目联系人、电话批量导出",
+  "采购单位招标数据批量导出",
+  "全面展示行业项目的数据字段"
+]
+//中标公告广告
+var win_adv=[
+  "中标项目信息字段全面展示",
+  "更多中标项目、业主、联系人数据批量导出",
+  "中标企业数据字段定制化导出"
+]
+//任意类型广告
+var any_adv=[
+  "更多数据字段定制化导出",
+  "导出数据,分析市场",
+  "导出数据,分析竞争对手",
+  "导出数据,分析合作伙伴",
+  "导出数据,分析客户"
+]
+var count=0;
+if (area!=""&&area!=null){
+  count++
+}
+if (city_!=""&&city_!=null){
+  count++
+}
+if (agency_!=""&&agency_!=null){
+  count++
+}
+if (projectname!=""&&projectname!=null){
+  count++
+}
+if (buyer_!=""&&buyer_!=null){
+  count++
+}
+if (buyerperson_!=""&&buyerperson_!=null){
+  count++
+}
+if (buyertel_!=""&&buyertel_!=null){
+  count++
+}
+var adv_from=getinfotype(subtype);
+var adv=any_adv;
+if(adv_from=="中标公告"){
+  adv=adv.concat(win_adv);
+}else if(adv_from=="招标公告"){
+  adv=adv.concat(zb_adv);
+}else if(adv_from=="拟建项目"){
+  adv=adv.concat(nj_adv);
+}
+var x = Math.floor(Math.random()*adv.length)
+$(".adv_tosieve").text(adv[x])
+var btn_text="立即体验"
+if (adv[x]==any_adv[0]){
+  btn_text="立即查看";
+}
+$(".adv_tosieve-btn").text(btn_text)
+$(".join > a").attr("dataHref","/front/wx_dataExport/toSieve?adv_from="+getinfotype(subtype));
+
+function getinfotype(subtype){
+  var infotype=""
+  switch (subtype){
+		case "拟建":
+      infotype="拟建项目"
+			break;
+    case "招标": case "邀标": case "询价": case "竞谈": case "变更": case "竞价": case "单一": case "其他":
+      infotype="招标公告"
+			break;
+		case "中标": case "成交": case "废标": case "流标":
+      infotype="中标公告"
+			break;
+		default:
+    infotype="其他"
+			break;
+	}
+  return infotype
+}
+if({{.T.obj.subtype}}=="中标"||{{.T.obj.subtype}}=="成交"||{{.T.obj.subtype}}=="合同"){
+    var winner_ = {{.T.obj.winner}};
+    var bidamount_ = {{.T.obj.bidamount}};
+    if(winner_!=""&&winner_!=null){
+      count++
+    }
+    if(bidamount_!=""&&bidamount_!=null){
+      count++
+    }
+  isbid=true;
+}
 if({{.T.obj.subtype}}!="拟建"&&{{.T.obj.toptype}}!="拟建"&&{{.T.obj.subtype}}!="违规"){
-	$(".fatNav").show();
-	$("#tab1").show();
-	$(".explain").show();
+  if((count>=4 && !isbid)||(count>=5&&isbid)){
+  	$(".fatNav").show();
+  	$("#tab1").show();
+  	$(".explain").show();
+    $(".lead-btn").show();
+  }
 }
 //根据是否打开推送显示警告条
 var i_applystatus = {{.T.i_applystatus}};
@@ -886,7 +1004,7 @@ function recoveryAction(e){
 	var dtcontent = originalCon;
 	$("#fphl").removeClass("fphl");
 	//$(".rhtext").html('剑鱼标讯分析并<span class="fphl">高亮</span>了'+dataName+',是否正确?');
-	$("#ryhd").show().removeClass("recovery-head");
+	$("#ryhd").removeClass("recovery-head");
 	$(".rh-content").hide().siblings().show();
 	$(".rhrinput input").attr("placeholder","输入或选择正确的"+dataName+"并按“复制”");
 	$(".tab2").addClass("active").siblings().removeClass("active");
@@ -1018,7 +1136,7 @@ function rhwrong(){
 function tabCh(n){
 	$(".tab"+n).addClass("active").siblings().removeClass("active");
 	if(n=="1"){
-		$(window).scrollTop(0);
+		$(window).scrollTop($("#tab"+n).offset().top-inithgt);
 	}else{
 		$(window).scrollTop($("#tab"+n).offset().top-inithgt);
 	}
@@ -1046,13 +1164,14 @@ $(window).scroll(function(event){
 	if($("#h_content .fphl").length>0){
 		heightLight = $("#h_content .fphl").offset().top;
 	}
-	if(localStorage.getItem("ere-"+{{.T.obj._id}})==null){
+	/*if(localStorage.getItem("ere-"+{{.T.obj._id}})==null){
 		if(heightLight!=0&&heightLight>(scrollTop+inithgt)&&heightLight<(scrollTop+cHeight-80)){
 			$(".recovery-head").fadeIn();
 		}else{
 			$(".recovery-head").fadeOut();
 		}
 	}
+  */
 	if(scrollFlag){
 		m3 = document.documentElement.scrollTop || document.body.scrollTop;
 		scrollFlag = false;
@@ -1077,12 +1196,12 @@ $(window).scroll(function(event){
 function pscp(){
 	m2 = document.documentElement.scrollTop || document.body.scrollTop;
    	if(m2 == m1){
-		scrollFlag = true;
-		if($(".explain").offset().top<=(m2+cHeight-inithgt*2)){
-			$(".tab2").addClass("active").siblings().removeClass("active");
-		}else if($(".explain").offset().top>(m2+inithgt)){
-			$(".tab1").addClass("active").siblings().removeClass("active");
-		}
+  		scrollFlag = true;
+  		if($("#tab2").offset().top<=(m2+inithgt*2-30)){
+  			$(".tab2").addClass("active").siblings().removeClass("active");
+  		}else if($("#tab2").offset().top>(m2+inithgt-30)){
+  			$(".tab1").addClass("active").siblings().removeClass("active");
+  		}
   	}
 }
 if(!industry){
@@ -1212,7 +1331,7 @@ $(function(){
 		}
 		outhtml +='<li><p class="name">招标代理机构</p><p class="textcontent">'+reragency+'</p><a dataName="招标代理机构" dataCont="'+reragency+'" dataCode="agency" onClick="recoveryAction(this)">纠错</a></li>'
 		var rerprojectname = {{.T.obj.projectname}};
-		if(rerprojectname!=undefined||rerprojectname==null){
+		if(rerprojectname==undefined||rerprojectname==null){
 			rerprojectname=""
 		}
 		outhtml +='<li><p class="name">项目名称</p><p class="textcontent">'+rerprojectname+'</p><a dataName="项目名称" dataCont="'+rerprojectname+'" dataCode="projectname" onClick="recoveryAction(this)">纠错</a></li>'
@@ -1247,8 +1366,7 @@ $(function(){
 		}
 	$("#baseInfo ul").html(outhtml)
 	//中标信息
-	if({{.T.obj.subtype}}=="中标"||{{.T.obj.subtype}}=="成交"||{{.T.obj.subtype}}=="合同"){
-		$("#bidInfoTitle").show();
+	if(isbid){
 		var rerwinner = {{.T.obj.winner}};
       if(rerwinner==null){
         rerwinner=""
@@ -1257,9 +1375,12 @@ $(function(){
       if(rerbidamount==null){
         rerbidamount=""
       }
-		var bidInfohtml ='<li><p class="name">中标单位</p><p class="textcontent">'+rerwinner+'</p><a dataName="中标单位" dataCont="'+rerwinner+'" dataCode="winner" onClick="recoveryAction(this)">纠错</a></li>'
-		bidInfohtml +='<li class="bbm0"><p class="name">中标金额(元)</p><p class="textcontent">'+rerbidamount+'</p><a dataName="中标金额(元)" dataCont="'+rerbidamount+'" dataCode="bidamount" onClick="recoveryAction(this)">纠错</a></li>'
-		$("#bidInfo ul").html(bidInfohtml)
+    if(count>=5){
+		$("#bidInfoTitle").show();
+  		var bidInfohtml ='<li><p class="name">中标单位</p><p class="textcontent">'+rerwinner+'</p><a dataName="中标单位" dataCont="'+rerwinner+'" dataCode="winner" onClick="recoveryAction(this)">纠错</a></li>'
+  		bidInfohtml +='<li class="bbm0"><p class="name">中标金额(元)</p><p class="textcontent">'+rerbidamount+'</p><a dataName="中标金额(元)" dataCont="'+rerbidamount+'" dataCode="bidamount" onClick="recoveryAction(this)">纠错</a></li>'
+  		$("#bidInfo ul").html(bidInfohtml)
+    }
 	}
 	var rerwinnerorder = {{.T.obj.winnerorder}}//中标候选人
 	//分包信息
@@ -1377,6 +1498,7 @@ $(function(){
 		}else{
 			$(".rhrsub").css("opacity","");
 		}
+    $.get("/front/shorturl/replication");
     });
 	
 	//纠错输入框
@@ -1496,6 +1618,9 @@ $(function(){
 		sessionStorage.removeItem("rewardStatus");
 	}
 	
+  if({{.T.obj.subtype}}=="拟建"){
+      $(".lead-btn-nj").show();
+  }
 	{{if .T.obj.projectinfo.attachments}}
 	var attachments = {{.T.obj.projectinfo.attachments}}
 	var j = 0;
@@ -1531,6 +1656,7 @@ $(function(){
 	{{if .T.obj.infoformat}}
 	{{if eq .T.obj.infoformat 2}}
 	$(".prebuilt").removeClass("hidden");
+
 	$("#h_content").css("font-size","16px");
 	{{else}}
 	$(".abs>.original").removeClass("hidden");
@@ -1698,13 +1824,13 @@ $(function(){
 			if($("#h_content .fphl").length>0){
 				heightLight = $("#h_content .fphl").offset().top;
 			}
-			if(localStorage.getItem("ere-"+{{.T.obj._id}})==null){
+			/*if(localStorage.getItem("ere-"+{{.T.obj._id}})==null){
 				if(heightLight>m1&&heightLight<(m1+cHeight-80)&&fwtsname!=""){
 					$(".recovery-head").fadeIn();
 				}else{
 					$(".recovery-head").fadeOut();
 				}
-			}
+			}*/
 		},300)
 	}
 	//