فهرست منبع

Merge branch 'master' into feature/v4.8.75

lianbingjie 1 سال پیش
والد
کامیت
128d6dff88
44فایلهای تغییر یافته به همراه993 افزوده شده و 398 حذف شده
  1. 1 1
      src/go.mod
  2. 2 2
      src/go.sum
  3. 28 0
      src/jfw/filter/cookie.go
  4. 1 0
      src/jfw/filter/filter.go
  5. 12 0
      src/jfw/front/entsearch.go
  6. 28 4
      src/jfw/front/login.go
  7. 13 1
      src/jfw/front/pcIndex.go
  8. 6 0
      src/jfw/front/supsearch.go
  9. 10 11
      src/jfw/front/websocket.go
  10. 28 0
      src/jfw/modules/app/src/app/filter/cookie.go
  11. 1 0
      src/jfw/modules/app/src/app/filter/filter.go
  12. 98 27
      src/jfw/modules/app/src/app/front/login.go
  13. 5 3
      src/jfw/modules/app/src/app/front/shorturl.go
  14. 2 2
      src/jfw/modules/app/src/go.mod
  15. 4 4
      src/jfw/modules/app/src/go.sum
  16. 12 6
      src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html
  17. 1 0
      src/jfw/modules/publicapply/src/channel/entity/entity.go
  18. 10 0
      src/jfw/modules/publicapply/src/channel/init.go
  19. 8 0
      src/jfw/modules/publicapply/src/channel/service/action.go
  20. 59 0
      src/jfw/modules/publicapply/src/channel/service/service.go
  21. 29 0
      src/jfw/modules/publicapply/src/filter/cookie.go
  22. 1 0
      src/jfw/modules/publicapply/src/filter/filter.go
  23. 1 1
      src/jfw/modules/publicapply/src/filter/sessionfilter.go
  24. 2 2
      src/jfw/modules/publicapply/src/go.mod
  25. 4 4
      src/jfw/modules/publicapply/src/go.sum
  26. 1 0
      src/jfw/modules/publicapply/src/main.go
  27. 64 36
      src/jfw/modules/publicapply/src/oneclick/entity/entity.go
  28. 1 0
      src/jfw/modules/publicapply/src/oneclick/service/service.go
  29. 216 216
      src/jfw/modules/publicapply/src/util/util.go
  30. 1 1
      src/jfw/modules/weixin/src/go.mod
  31. 2 2
      src/jfw/modules/weixin/src/go.sum
  32. 29 0
      src/jfw/modules/weixin/src/service/usersource.go
  33. 6 6
      src/jfw/modules/weixin/src/wx/subscribe.go
  34. 53 14
      src/jfw/modules/weixin/src/wx/wx.go
  35. 8 0
      src/jfw/qrmanager/qrmanager.go
  36. 8 4
      src/seo.json
  37. BIN
      src/web/staticres/common-module/channel/image/everythingok.png
  38. 7 2
      src/web/staticres/js/ent-search-index-pc.js
  39. 9 2
      src/web/staticres/js/pur-search-index-pc.js
  40. 91 7
      src/web/staticres/public-pc/css/pc-bottom.css
  41. 86 8
      src/web/templates/common/pcbottom.html
  42. 11 8
      src/web/templates/pc/entsearchindex.html
  43. 11 8
      src/web/templates/pc/pursearchindex.html
  44. 23 16
      src/web/templates/pc/supsearch.html

+ 1 - 1
src/go.mod

@@ -6,7 +6,7 @@ require (
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230308011651-df591d32df88
 	app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v0.0.0-20231017032120-01da044f6c92
+	app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/bwmarrin/snowflake v0.3.0

+ 2 - 2
src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6 h1:uyaBp5Iuc/Il4+O
 app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v0.0.0-20231017032120-01da044f6c92 h1:ZEe+lUFbCk+MWUnNxTx4L+lsJmiAEIdFsgFyMT4ua+E=
-app.yhyue.com/moapp/jypkg v0.0.0-20231017032120-01da044f6c92/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a h1:mUqyzXj24uoi9gE9P+EVoiMi/deUHH2+0jbTnwLhOZ0=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=

+ 28 - 0
src/jfw/filter/cookie.go

@@ -0,0 +1,28 @@
+package filter
+
+import (
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"log"
+	"net/http"
+	"strings"
+)
+
+// CookieInfo 信息
+type CookieInfo struct {
+	W http.ResponseWriter
+	R *http.Request
+}
+
+// Do 继承过滤器方法
+func (ci *CookieInfo) Do() {
+	log.Println(ci.R.Referer(), "----------------------", ci.R.RequestURI)
+	if crr := ci.R.Referer(); crr != "" {
+		if strings.Contains(crr, "cooperate") {
+			match := strings.Split(crr, "cooperate/")
+			if len(match) > 1 {
+				jy.SetCookieValue(ci.W, jy.ChannelCookieName, match[1], 172800) //两天
+			}
+			log.Println("---------------pc-------------", match)
+		}
+	}
+}

+ 1 - 0
src/jfw/filter/filter.go

@@ -54,6 +54,7 @@ func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
 		identity.SwitchToBest(util.Int64All(getSession["base_user_id"]), session, Middleground, &public.MQFW, false)
 	}
 	(&AnonymousAuth{w, r, session, getSession, make(map[string]interface{})}).Do()
+	(&CookieInfo{w, r}).Do()
 
 	if !(&logFilter{w, r, session, getSession, make(map[string]interface{})}).Do() {
 		return false

+ 12 - 0
src/jfw/front/entsearch.go

@@ -38,6 +38,7 @@ func (e *Entsearch) EntSearchIndex() error {
 		shareid = "10"
 	}
 	e.T["isLogin"] = 0
+	cooperateCode := ""
 	if userId, _ := e.GetSession("userId").(string); userId != "" {
 		userInfo := jy.GetVipState(e.Session(), *config.Middleground, userId)
 		e.T["isVip"] = userInfo.VipState > 0
@@ -46,7 +47,12 @@ func (e *Entsearch) EntSearchIndex() error {
 		e.T["isEntnicheNew"] = userInfo.IsNewEnt
 		e.T["isEntService"] = userInfo.EntService
 		e.T["isLogin"] = 1
+	} else { //P414
+		if cc, err := e.GetCookie(jy.ChannelCookieName); err == nil {
+			cooperateCode = cc.Value
+		}
 	}
+	e.T["cooperateCode"] = cooperateCode
 	e.T["shareid"] = se.EncodeString(shareid)
 	e.T["searchvalue"] = e.GetString("searchvalue")
 	e.T["logid"] = config.Seoconfig["jyzbqyss"].(string)
@@ -60,6 +66,7 @@ func (e *Entsearch) PushSearchIndex() error {
 	}
 	getsession := e.Session().GetMultiple()
 	e.T["isLogin"] = 0
+	cooperateCode := ""
 	if userId, _ := getsession["userId"].(string); userId != "" {
 		userInfo := jy.GetVipState(e.Session(), *config.Middleground, userId)
 		e.T["isVip"] = userInfo.VipState > 0
@@ -68,7 +75,12 @@ func (e *Entsearch) PushSearchIndex() error {
 		e.T["isEntnicheNew"] = userInfo.IsNewEnt
 		e.T["isEntService"] = userInfo.EntService
 		e.T["isLogin"] = 1
+	} else { //P414
+		if cc, err := e.GetCookie(jy.ChannelCookieName); err == nil {
+			cooperateCode = cc.Value
+		}
 	}
+	e.T["cooperateCode"] = cooperateCode
 	e.T["login"] = getsession["user"]
 	e.T["shareid"] = se.EncodeString(shareid)
 	e.T["searchvalue"] = e.GetString("searchvalue")

+ 28 - 4
src/jfw/front/login.go

@@ -1,6 +1,7 @@
 package front
 
 import (
+	"app.yhyue.com/moapp/jybase/date"
 	"fmt"
 	"jy/src/jfw/config"
 	jutil "jy/src/jfw/jyutil"
@@ -11,6 +12,7 @@ import (
 
 	qutil "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/dchest/captcha"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	. "app.yhyue.com/moapp/jybase/mongodb"
@@ -78,7 +80,12 @@ func (l *Login) Login() error {
 		result           = map[string]interface{}{}
 		reqType          = l.GetString("reqType")
 		isAutoLogin, err = l.GetBool("isAutoLogin") //用户是否选择自动登录
+		channelCode      = "jy_pc_phone"
 	)
+	cc, ckErr := l.Request.Cookie(jy.ChannelCookieName)
+	if ckErr == nil {
+		channelCode = cc.Value
+	}
 	status, isLogin := func() (int, bool) {
 		if reqType == "phoneLogin" { //手机号登录
 			phone := l.GetString("phone")
@@ -162,6 +169,7 @@ func (l *Login) Login() error {
 						},
 						"s_regsource": "pc",
 						"s_platform":  "pc",
+						"s_sourceid":  channelCode,
 					}
 					//注册邮箱
 					email := l.GetString("email")
@@ -209,8 +217,7 @@ func (l *Login) Login() error {
 								"baseUserId": resp.Data.Id,
 								"positionId": l.GetSession("positionId"),
 							})
-
-							return 1, true
+							return 2, true
 						}
 					}
 				} else {
@@ -239,14 +246,30 @@ func (l *Login) Login() error {
 					if ok {
 						result["userInfo"] = userInfo
 						go anonymousLogin(l.Session(), l.Cookie("JYTrustedId"))
-						return 1, true
+						return 3, true
 					}
 				}
 			}
 		}
 		return 0, false
 	}()
-	if status == 1 && isLogin {
+	if status >= 1 && isLogin {
+		//登录source 更新 p414
+		us := jy.UserSource{
+			UserId:           qutil.ObjToString(l.GetSession("mgoUserId")),
+			PositionId:       qutil.Int64All(l.GetSession("positionId")),
+			Phone:            qutil.ObjToString(l.GetSession("phone")),
+			State:            qutil.If(status == 2, status, 1).(int), //注册/登录标志 1:登录;2:注册
+			ChannelCode:      channelCode,
+			EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
+			CreateTime:       time.Now().Format(date.Date_Full_Layout),
+			LoginWay:         qutil.If(status == 1, status, 2).(int), //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
+			Platform:         1,
+			Ip:               qutil.GetIp(l.Request),
+		}
+		go func(us jy.UserSource) {
+			jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, qutil.StructToMapMore(us))
+		}(us)
 		//当前用户登录选择 下次自动登录
 		if isAutoLogin && err == nil {
 			baseUserId := qutil.Int64All(l.GetSession("base_user_id"))
@@ -255,6 +278,7 @@ func (l *Login) Login() error {
 				jutil.SetCookieValueForAutoLogin(l.ResponseWriter, baseUserId)
 			}
 		}
+		status = 1
 	}
 	result["status"] = status
 	l.ServeJson(result)

+ 13 - 1
src/jfw/front/pcIndex.go

@@ -227,6 +227,17 @@ func (m *PcIndex) NewSordfish(flag string) error {
 	}
 }
 
+var secSeoWebConfig *SecSeoWebdomainConfig
+
+func init() {
+	gconv.Struct(config.Seoconfig["secSeoWebConfig"], &secSeoWebConfig)
+}
+
+type SecSeoWebdomainConfig struct {
+	AreaCodeMap    map[string]string `json:"areaCodeMap"`
+	AreaHrefFormat string            `json:"area_href_format"`
+}
+
 // GetJycmsAreaLink 获取资讯站地区首页地址
 func GetJycmsAreaLink() []map[string]interface{} {
 	redisKey := "IndexJycmsAreaLink"
@@ -247,8 +258,9 @@ func GetJycmsAreaLink() []map[string]interface{} {
 	var ha, nmg int
 	for i, m := range *res {
 		alias, name := util.ObjToString(m["alias"]), util.ObjToString(m["area"])
+		//config.Sysconfig["webdomain"].(string)
 		tmp := map[string]interface{}{
-			"url":  fmt.Sprintf("/jycms/a_%s.html", alias),
+			"url":  fmt.Sprintf(secSeoWebConfig.AreaHrefFormat, secSeoWebConfig.AreaCodeMap[name]),
 			"name": fmt.Sprintf("%s招标网", name),
 		}
 		if alias == "ha" {

+ 6 - 0
src/jfw/front/supsearch.go

@@ -571,10 +571,16 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	p.T["isEntService"] = userInfo.EntService
 	p.T["vipBefore202209"] = userInfo.VipState > 0 && userInfo.VipStartData < util.Int64All(config.Sysconfig["contextOldVipLimit"]) //超级订阅 超强项目
 	//
+	cooperateCode := ""
 	if userId != "" {
 		//企业画像 权限
 		p.T["portraitpower"] = jylabutil.IsAuthorized(userId, "i_portraitpower")
+	} else {
+		if cc, err := p.GetCookie(jy.ChannelCookieName); err == nil {
+			cooperateCode = cc.Value
+		}
 	}
+	p.T["cooperateCode"] = cooperateCode
 	p.T["isLimit"] = isLimit
 	if module == "supsearch" {
 		p.T["simpleTemplateData"] = map[string]interface{}{

+ 10 - 11
src/jfw/front/websocket.go

@@ -20,7 +20,7 @@ import (
 	"time"
 )
 
-//socket对象放在内存中,待rpc回调使用
+// socket对象放在内存中,待rpc回调使用
 type Wss struct {
 	Conn    *websocket.Conn
 	session *httpsession.Session
@@ -47,7 +47,7 @@ func (m *MapSocket) GC() {
 var MSPOOL = 20
 var MapSocketArr = make([]*MapSocket, MSPOOL)
 
-//初始化
+// 初始化
 func init() {
 	for i := 0; i < MSPOOL; i++ {
 		ms := &MapSocket{Map: map[string]*Wss{}}
@@ -57,7 +57,6 @@ func init() {
 	redis.InitRedisLogin(public.DbConf.Redis.Login.Address)
 }
 
-//
 func GetRedisPoolVal() {
 	redis.GetLoginVal("loginCode", GetWsByCode)
 	//	var res string
@@ -71,7 +70,7 @@ func GetRedisPoolVal() {
 	//	}
 }
 
-//根据代码和ws做映射
+// 根据代码和ws做映射
 func PutWsByCode(src string, ws *websocket.Conn, session *httpsession.Session) {
 	defer qutil.Catch()
 	n := HashVal(src) % MSPOOL
@@ -92,7 +91,7 @@ func PutWsByCode(src string, ws *websocket.Conn, session *httpsession.Session) {
 	ms.Lock.Unlock()
 }
 
-//计算代码的hash值
+// 计算代码的hash值
 func HashVal(src string) int {
 	check := 0
 	for i := len(src) / 2; i < len(src); i++ {
@@ -101,7 +100,7 @@ func HashVal(src string) int {
 	return check
 }
 
-//rpc回调,写到前台
+// rpc回调,写到前台
 func GetWsByCode(param []string) bool {
 	if len(param) < 2 {
 		return false
@@ -145,7 +144,7 @@ func GetWsByCode(param []string) bool {
 				if ok := redis.Del("newother", fmt.Sprintf(jyutil.KeepLoginTimeKey, src)) && redis.Del("newother", fmt.Sprintf(jyutil.KeepLoginTimeKey, erStr)); !ok {
 					log.Println(fmt.Sprintf("%d 清除用户登录延期标识 异常", baseUserId))
 				}
-				//
+				//登录source 更新
 				//收到webSocket消息后,您无法设置cookie.一旦建立了webSocket连接,它就是一个开放的TCP套接字,协议不再是http,因此没有内置的方式来交换cookie.
 				//jyutil.SetCookieValueForAutoLogin(wss.Conn.W, baseUserId)  不可用
 				//您可以将自己的webSocket消息发送回客户端,告知它设置cookie,然后在客户端中侦听该消息,当它收到该消息时,它可以在浏览器中设置cookie.
@@ -167,7 +166,7 @@ func GetWsByCode(param []string) bool {
 	}
 }
 
-//用户登录信息
+// 用户登录信息
 func LoginInfo(shareid, openid string, Sess interface{}) map[string]interface{} {
 	if Sess == nil {
 		return nil
@@ -216,7 +215,7 @@ func ServeWss(conn *websocket.Conn) {
 
 }
 
-//实验室
+// 实验室
 func QrToLabWss(conn *websocket.Conn) {
 	defer qutil.Catch()
 	var receive, userId string
@@ -286,7 +285,7 @@ func QrToLabWss(conn *websocket.Conn) {
 	}
 }
 
-//电脑端强制分享,扫码分享到朋友圈
+// 电脑端强制分享,扫码分享到朋友圈
 func QrToShareTimeline(conn *websocket.Conn) {
 	defer qutil.Catch()
 	var receive string
@@ -341,7 +340,7 @@ func QrToShareTimeline(conn *websocket.Conn) {
 	}
 }
 
-//pc弹框 最新一条消息
+// pc弹框 最新一条消息
 func GetBuoyMsg(conn *websocket.Conn) {
 	defer qutil.Catch()
 	sess := xweb.RootApp().SessionManager.Session(conn.R, conn.W)

+ 28 - 0
src/jfw/modules/app/src/app/filter/cookie.go

@@ -0,0 +1,28 @@
+package filter
+
+import (
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"log"
+	"net/http"
+	"strings"
+)
+
+// CookieInfo 信息
+type CookieInfo struct {
+	W http.ResponseWriter
+	R *http.Request
+}
+
+// Do 继承过滤器方法
+func (ci *CookieInfo) Do() {
+	log.Println(ci.R.Referer(), "----------------------", ci.R.RequestURI)
+	if crr := ci.R.Referer(); crr != "" {
+		if strings.Contains(crr, "cooperate") {
+			match := strings.Split(crr, "cooperate/")
+			if len(match) > 1 {
+				jy.SetCookieValue(ci.W, jy.ChannelCookieName, match[1], 172800) //两天
+			}
+			log.Println("---------------app-------------", match)
+		}
+	}
+}

+ 1 - 0
src/jfw/modules/app/src/app/filter/filter.go

@@ -45,6 +45,7 @@ func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
 		identity.SwitchToBest(util.Int64All(getSession["base_user_id"]), session, Middleground, &public.MQFW, false)
 	}
+	(&CookieInfo{w, r}).Do()
 	if !(&logFilter{w, r, getSession}).Do() {
 		return false
 	}

+ 98 - 27
src/jfw/modules/app/src/app/front/login.go

@@ -1,6 +1,8 @@
 package front
 
 import (
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"encoding/json"
 	"fmt"
 	"jy/src/jfw/modules/app/src/jfw/config"
@@ -103,18 +105,24 @@ func (l *Login) Login() error {
 			}
 		}
 	}
-	returnSign := ""
-	userInfo := map[string]interface{}{}
-	status := func() int {
+	var (
+		returnSign  = ""
+		userInfo    = map[string]interface{}{}
+		channelCode = qutil.If(strings.Contains(l.Request.Host, "h5"), "jy_h5_phone", "jy_app_phone").(string)
+	)
+	cc, ckErr := l.Request.Cookie(jy.ChannelCookieName)
+	if ckErr == nil {
+		channelCode = cc.Value
+	}
+	status, state := func() (int, int) {
 		nsqPath, _ := config.Sysconfig["nsq"].(string)
 		nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
-
 		reqType := l.GetString("reqType")
 		if reqType == "phoneLogin" {
 			phone := l.GetString("phone")
 			password := l.GetString("password")
 			if strings.TrimSpace(phone) == "" || strings.TrimSpace(password) == "" {
-				return -1
+				return -1, -1
 			}
 			query := map[string]interface{}{
 				"i_appid": 2,
@@ -134,7 +142,6 @@ func (l *Login) Login() error {
 				deviceId := l.GetString("deviceId")
 				phoneType := l.GetString("phoneType")
 				returnSign = afterLogin((*user)[0], l.Session(), rid, oid, phoneType, channel, deviceId, false, l.ResponseWriter)
-
 				jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", BsonIdToSId((*user)[0]["_id"]), jy.Jyapp_node1, map[string]interface{}{
 					"code":       1014, //下载app任务
 					"types":      "downloadApp",
@@ -142,9 +149,9 @@ func (l *Login) Login() error {
 					"baseUserId": l.GetSession("base_user_id"),
 					"positionId": l.GetSession("positionId"),
 				})
-				return 1
+				return 1, 1
 			}
-			return -1 //用户名或密码不正确
+			return -1, -1 //用户名或密码不正确
 		} else if reqType == "signLogin" {
 			returnStatus := 0
 			if l.GetSession("mgoUserId") != nil {
@@ -157,7 +164,7 @@ func (l *Login) Login() error {
 			(userInfo)["s_phone"] = l.GetSession("s_phone")
 			(userInfo)["userid"] = l.GetSession("mgoUserId")
 			(userInfo)["app_name"] = l.GetSession("app_name")
-			return returnStatus
+			return returnStatus, 2
 		} else if reqType == "sendIdentCode" {
 			phone := jy.CheckSendMsg(l.GetString("token"))
 			if phone == "" {
@@ -165,18 +172,18 @@ func (l *Login) Login() error {
 			}
 			//手机号验证不通过
 			if phone == "" {
-				return -2
+				return -2, -1
 			} else if !phoneReg.MatchString(phone) {
-				return -1
+				return -1, -1
 			} else if jy.SendPhoneIdentCode(qutil.ObjToString(config.Sysconfig["smsServiceRpc"]), phone, l.Session()) {
-				return 1
+				return 1, -1
 			}
-			return 0
+			return 0, -1
 		} else if reqType == "identCodeLogin" {
 			disWord := l.GetString("disWord")
 			phone, _ := l.GetSession("identCodeKey").(string)
 			if phone == "" || l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
-				return -1
+				return -1, -1
 			} else {
 				RegLock.Lock()
 				reg := RegMap[phone]
@@ -193,7 +200,7 @@ func (l *Login) Login() error {
 				ok, user := getPhoneUser(phone)
 				//登录成功
 				if !ok {
-					return 0
+					return 0, -1
 				}
 				//用户不存在
 				rid := l.GetString("rid")
@@ -221,6 +228,7 @@ func (l *Login) Login() error {
 							"l_modifydate": time.Now().Unix(),
 						},
 						"s_platform": "app",
+						"s_sourceid": channelCode,
 					}
 					// 新用户注册 记录活动来源
 					activity := l.GetString("activity")
@@ -241,7 +249,7 @@ func (l *Login) Login() error {
 						data["base_user_id"] = resp.Data.Id
 					} else {
 						log.Println(phone, "调用usercenter失败")
-						return -4
+						return -4, -1
 					}
 					_id := mongodb.Save("user", data)
 					if _id != "" {
@@ -276,7 +284,7 @@ func (l *Login) Login() error {
 							"baseUserId": l.GetSession("base_user_id"),
 							"positionId": l.GetSession("positionId"),
 						})
-						return 1
+						return 1, 3
 					}
 				} else {
 					//以s_m_phone登录的 需要把s_m_phone转化为s_phone
@@ -297,7 +305,6 @@ func (l *Login) Login() error {
 					}
 					jy.ClearPhoneIdentSession(l.Session())
 					returnSign = afterLogin(user, l.Session(), rid, oid, phoneType, channel, deviceId, false, l.ResponseWriter)
-
 					jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", BsonIdToSId(user["_id"]), jy.Jyapp_node1, map[string]interface{}{
 						"code":       1014, //下载app任务
 						"types":      "downloadApp",
@@ -305,12 +312,28 @@ func (l *Login) Login() error {
 						"baseUserId": l.GetSession("base_user_id"),
 						"positionId": l.GetSession("positionId"),
 					})
-					return 1
+					return 1, 4
 				}
 			}
 		}
-		return 0
+		return 0, -1
 	}()
+	//登录source 更新 p414
+	us := jy.UserSource{
+		UserId:           qutil.ObjToString(l.GetSession("mgoUserId")),
+		PositionId:       qutil.Int64All(l.GetSession("positionId")),
+		Phone:            qutil.ObjToString(l.GetSession("phone")),
+		State:            qutil.If(state == 3, 2, 1).(int), //注册/登录标志 1:登录;2:注册
+		ChannelCode:      channelCode,
+		EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
+		CreateTime:       time.Now().Format(date.Date_Full_Layout),
+		LoginWay:         qutil.If(state == 1, state, 2).(int),                         //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
+		Platform:         qutil.If(strings.Contains(l.Request.Host, "h5"), 4, 3).(int), //登录端;1:PC;2:WX;3:APP;4:H5
+		Ip:               qutil.GetIp(l.Request),
+	}
+	go func(us jy.UserSource) {
+		jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, qutil.StructToMapMore(us))
+	}(us)
 	result := map[string]interface{}{
 		"status": status,
 		"userId": l.GetSession("mgoUserId"),
@@ -486,9 +509,16 @@ func (l *Login) Register() error {
 		}
 		return l.Render("/me/register.html", &l.T)
 	}
-	var returnSign string
-	nsqPath, _ := config.Sysconfig["nsq"].(string)
-	nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
+	var (
+		returnSign   string
+		nsqPath, _   = config.Sysconfig["nsq"].(string)
+		nsq_topic, _ = config.Sysconfig["nsq_topic"].(string)
+		channelCode  = qutil.If(strings.Contains(l.Request.Host, "h5"), "jy_h5_phone", "jy_app_phone").(string)
+		cc, ckErr    = l.Request.Cookie(jy.ChannelCookieName)
+	)
+	if ckErr == nil {
+		channelCode = cc.Value
+	}
 	status := func() string {
 		reqType := l.GetString("reqType")
 		if reqType == "sendIdentCode" { //发短信
@@ -540,6 +570,7 @@ func (l *Login) Register() error {
 					"s_opushid":     oid,
 					"s_appponetype": phoneType,
 					"s_company":     s_entname,
+					"s_sourceid":    channelCode,
 				}
 				email := l.GetString("email")
 				registerclient := jy.NewRegister(jyutil.Compatible.Mgo, jyutil.Compatible.BaseService, jyutil.Compatible.MainMysql, jyutil.Compatible.Middleground)
@@ -569,7 +600,7 @@ func (l *Login) Register() error {
 					}()
 					l.DelSession("registerStep")
 					jy.ClearPhoneIdentSession(l.Session())
-
+					//剑鱼币
 					jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", qutil.ObjToString(l.GetSession("mgoUserId")), jy.Jyapp_node1, map[string]interface{}{
 						"code":       1014, //下载app任务
 						"types":      "downloadApp",
@@ -580,7 +611,7 @@ func (l *Login) Register() error {
 				})
 				if errStr == "y" {
 					returnSign = afterLogin(data, l.Session(), rid, oid, phoneType, channel, deviceId, true, l.ResponseWriter)
-
+					//剑鱼币
 					jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", qutil.ObjToString(l.GetSession("mgoUserId")), jy.Jyapp_node1, map[string]interface{}{
 						"code":       1014, //下载app任务
 						"types":      "downloadApp",
@@ -588,6 +619,22 @@ func (l *Login) Register() error {
 						"baseUserId": l.GetSession("base_user_id"),
 						"positionId": l.GetSession("positionId"),
 					})
+					//登录source 更新 p414
+					us := jy.UserSource{
+						UserId:           qutil.ObjToString(l.GetSession("mgoUserId")),
+						PositionId:       qutil.Int64All(l.GetSession("positionId")),
+						Phone:            qutil.ObjToString(l.GetSession("phone")),
+						State:            2, //注册/登录标志 1:登录;2:注册
+						ChannelCode:      channelCode,
+						EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
+						CreateTime:       time.Now().Format(date.Date_Full_Layout),
+						LoginWay:         1,                                                            //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
+						Platform:         qutil.If(strings.Contains(l.Request.Host, "h5"), 4, 3).(int), //登录端;1:PC;2:WX;3:APP;4:H5
+						Ip:               qutil.GetIp(l.Request),
+					}
+					go func(us jy.UserSource) {
+						jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, qutil.StructToMapMore(us))
+					}(us)
 				}
 				return errStr
 			}()
@@ -615,6 +662,11 @@ func (l *Login) WxLogin() {
 	disWord := l.GetString("disWord")
 	defer qutil.Catch()
 	returnSign := ""
+	channelCode := "jy_app_wx"
+	cc, ckErr := l.Request.Cookie(jy.ChannelCookieName)
+	if ckErr == nil {
+		channelCode = cc.Value
+	}
 	status := func() int {
 		u, err := jy.GetMsgFromWxSign(l.GetString("param"))
 		if err != nil {
@@ -716,6 +768,7 @@ func (l *Login) WxLogin() {
 				},
 				"s_platform": "app",                                                               //用户注册平台 app 微信 pc
 				"s_jyname":   jy.GetUserName("newother", config.Sysconfig["namePrefix"].(string)), //剑鱼昵称
+				"s_sourceid": channelCode,
 			}
 			//注册邮箱
 			email := l.GetString("email")
@@ -758,7 +811,7 @@ func (l *Login) WxLogin() {
 						log.Println("nsq队列写入失败-->", jy.Jyapp_wx_register, _id)
 					}
 				}
-				return 1
+				return 2
 			}
 		}
 		return 0
@@ -773,9 +826,27 @@ func (l *Login) WxLogin() {
 		"baseUserId": l.GetSession("base_user_id"),
 		"positionId": l.GetSession("positionId"),
 	})
+	if status > 0 {
+		//登录source 更新 p414
+		us := jy.UserSource{
+			UserId:           qutil.ObjToString(l.GetSession("mgoUserId")),
+			PositionId:       qutil.Int64All(l.GetSession("positionId")),
+			Phone:            qutil.ObjToString(l.GetSession("phone")),
+			State:            status, //注册/登录标志 1:登录;2:注册
+			ChannelCode:      channelCode,
+			EncryptionUserId: encrypt.SE.Encode2Hex(qutil.ObjToString(l.GetSession("userId"))),
+			CreateTime:       time.Now().Format(date.Date_Full_Layout),
+			LoginWay:         3,                                                            //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
+			Platform:         qutil.If(strings.Contains(l.Request.Host, "h5"), 4, 3).(int), //登录端;1:PC;2:WX;3:APP;4:H5
+			Ip:               qutil.GetIp(l.Request),
+		}
+		go func(us jy.UserSource) {
+			jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, qutil.StructToMapMore(us))
+		}(us)
+	}
 	//返回
 	result := map[string]interface{}{
-		"status": status,
+		"status": qutil.If(status > 0, 1, status).(int),
 		"userId": l.GetSession("mgoUserId"),
 	}
 	if returnSign != "" {

+ 5 - 3
src/jfw/modules/app/src/app/front/shorturl.go

@@ -318,9 +318,10 @@ func (s *Short) Article(contentType, stype, id string) error {
 			}
 		} else {
 			obj = map[string]interface{}{
-				"title":   obj["title"],
-				"_id":     obj["_id"],
-				"subtype": obj["subtype"],
+				"title":      obj["title"],
+				"_id":        obj["_id"],
+				"subtype":    obj["subtype"],
+				"hasSession": false,
 			}
 		}
 		if userId == "" && ipTrue {
@@ -328,6 +329,7 @@ func (s *Short) Article(contentType, stype, id string) error {
 		}
 		if userId != "" {
 			s.T["userId"] = se.Encode2Hex(userId) //加密用户userid
+			obj["hasSession"] = true
 		}
 		s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail, config.Sysconfig)
 		s.T["rewardText"], s.T["advertText"] = getRewardText()

+ 2 - 2
src/jfw/modules/app/src/go.mod

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25
+	app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.3.1
@@ -139,7 +139,7 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
-	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 // indirect
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a // indirect
 	k8s.io/api v0.26.3 // indirect
 	k8s.io/apimachinery v0.27.0-alpha.3 // indirect
 	k8s.io/client-go v0.26.3 // indirect

+ 4 - 4
src/jfw/modules/app/src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40 h1:/FcBvpf/KW8g6GB
 app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25 h1:2q7b1auPihIJD3Ewsd7Zi8ESeLkxuP57avWL8UoBr9U=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25/go.mod h1:gPCOY8bVXdY5bD7nry7th+YNkKC/viG8Dc9+z4fUaRo=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a h1:mUqyzXj24uoi9gE9P+EVoiMi/deUHH2+0jbTnwLhOZ0=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=
@@ -1429,8 +1429,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 h1:BItxi1gkQUs3sjxaBk6tc34fZWSO4hUSXcTM3PcnY4I=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a h1:kwjO4pqB3gnNGrQ9aXyz6f8s9qXAUenPUDWip8gYR/Q=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
 k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=

+ 12 - 6
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -3642,12 +3642,18 @@
     $(function(){
       areaNavModule.init()
       backToTop.init()
-      // 未登录状态下距顶部距离为顶部搜索框高度
-      var headerTop = document.querySelector('.jy-app-header ').clientHeight
-      $('.app-layout-content-b').css('top', headerTop)
-      $('.h5-tabfix').css('top', headerTop)
-      $('.wx-tabfix').css('top', headerTop)
-      $('.childNav').css('top', headerTop)
+      var timer = setInterval(function () {
+        // 判断页面所有资源已加载完毕
+        if (document.readyState === "complete") {
+          // 未登录状态下距顶部距离为顶部搜索框高度
+          var headerTop = document.querySelector('.jy-app-header ').clientHeight
+          $('.app-layout-content-b').css('top', headerTop)
+          $('.h5-tabfix').css('top', headerTop)
+          $('.wx-tabfix').css('top', headerTop)
+          $('.childNav').css('top', headerTop)
+          window.clearInterval(timer);
+        }
+      }, 800)
       $('.tag-breadcrumb-navigation').css('background', '#EDEFF2')
       $('.search-container').on('click', function (e) {
         e.preventDefault()

+ 1 - 0
src/jfw/modules/publicapply/src/channel/entity/entity.go

@@ -0,0 +1 @@
+package entity

+ 10 - 0
src/jfw/modules/publicapply/src/channel/init.go

@@ -0,0 +1,10 @@
+package channel
+
+import (
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"jy/src/jfw/modules/publicapply/src/channel/service"
+)
+
+func init() {
+	xweb.AddAction(&service.ChannelStruct{})
+}

+ 8 - 0
src/jfw/modules/publicapply/src/channel/service/action.go

@@ -0,0 +1,8 @@
+package service
+
+import "app.yhyue.com/moapp/jybase/go-xweb/xweb"
+
+type ChannelStruct struct {
+	*xweb.Action
+	cooperation xweb.Mapper `xweb:"/channel/cooperation"` //招标信息收藏
+}

+ 59 - 0
src/jfw/modules/publicapply/src/channel/service/service.go

@@ -0,0 +1,59 @@
+package service
+
+import (
+	. "app.yhyue.com/moapp/jybase/api"
+	qu "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"encoding/json"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"log"
+)
+
+// P414
+func (c *ChannelStruct) Cooperation() {
+	defer qu.Catch()
+	r := func() Result {
+		//已登录 不做任何操作
+		if userId, _ := c.GetSession("userId").(string); userId != "" {
+			return Result{Data: nil}
+		}
+		if c.Method() != "POST" {
+			return Result{Data: nil, Error_msg: Error_msg_1005}
+		}
+		var (
+			res = Result{}
+		)
+		channelCode := c.GetString("channelCode")
+		req := make(map[string]interface{})
+		if len(c.Body()) > 0 {
+			if err := json.Unmarshal(c.Body(), &req); err == nil {
+				channelCode = qu.ObjToString(req["channelCode"])
+			}
+		}
+		cc, err := c.Request.Cookie(jy.ChannelCookieName)
+		log.Println(err, "---channelCode.Value:--", channelCode)
+		if err == nil {
+			channelCode = cc.Value
+		}
+		if channelCode != "" {
+			selectSql := `SELECT * FROM thirdparty.ent_channel_info WHERE channel_code = ?`
+			data := db.BaseMysql.SelectBySql(selectSql, channelCode)
+			if data != nil && len(*data) > 0 {
+				var customMap = make(map[string]interface{})
+				if customInfo := qu.ObjToString((*data)[0]["custom_info"]); customInfo != "" {
+					err := json.Unmarshal([]byte(customInfo), &customMap)
+					if err != nil {
+						log.Println("err.Error():", err.Error())
+					}
+				}
+				res.Data = customMap
+			} else {
+				log.Println("未查到相关数据")
+			}
+		} else {
+			log.Println("不是 渠道合作商")
+		}
+		return res
+	}()
+	c.ServeJson(r)
+}

+ 29 - 0
src/jfw/modules/publicapply/src/filter/cookie.go

@@ -0,0 +1,29 @@
+package filter
+
+import (
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"log"
+	"net/http"
+	"strings"
+)
+
+// CookieInfo 信息
+type CookieInfo struct {
+	App *xweb.App
+}
+
+// Do 继承过滤器方法
+func (ci *CookieInfo) Do(w http.ResponseWriter, req *http.Request) bool {
+	log.Println(req.Referer(), "----------------------", req.RequestURI)
+	if crr := req.Referer(); crr != "" {
+		if strings.Contains(crr, "cooperate") {
+			match := strings.Split(crr, "cooperate/")
+			if len(match) > 1 {
+				jy.SetCookieValue(w, jy.ChannelCookieName, match[1], 172800) //两天
+			}
+			log.Println("---------------pc-------------", match)
+		}
+	}
+	return true
+}

+ 1 - 0
src/jfw/modules/publicapply/src/filter/filter.go

@@ -7,4 +7,5 @@ import (
 func init() {
 	xweb.AddFilter(&logfilter{App: xweb.RootApp()})
 	xweb.AddFilter(&sessionfilter{App: xweb.RootApp()})
+	xweb.AddFilter(&CookieInfo{App: xweb.RootApp()})
 }

+ 1 - 1
src/jfw/modules/publicapply/src/filter/sessionfilter.go

@@ -22,7 +22,7 @@ var reg_share = regexp.MustCompile("^/publicapply/shareFission/.*")
 var reg_nps = regexp.MustCompile("^/publicapply/nps/.*")
 var regWhiteList = regexp.MustCompile("^/publicapply/userbase/whitelist$")
 var regEntSearch = regexp.MustCompile("^/publicapply/enterpriseSearch/doQuery") //企业搜索接口
-var regOneClick = regexp.MustCompile("^/publicapply/oneClick/.*")
+var regOneClick = regexp.MustCompile("^/publicapply/(oneClick|channel)/.*")
 
 func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 	session := l.App.SessionManager.Session(req, w)

+ 2 - 2
src/jfw/modules/publicapply/src/go.mod

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230727083622-4dfc804ea6cf
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25
+	app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.4
@@ -148,7 +148,7 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
-	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 // indirect
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a // indirect
 	k8s.io/api v0.26.3 // indirect
 	k8s.io/apimachinery v0.27.0-alpha.3 // indirect
 	k8s.io/client-go v0.26.3 // indirect

+ 4 - 4
src/jfw/modules/publicapply/src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230727083622-4dfc804ea6cf h1:/Tk5haITmGc5c3/
 app.yhyue.com/moapp/jybase v0.0.0-20230727083622-4dfc804ea6cf/go.mod h1:D40Ae0rQilH8Hc5o2Vtt04Tjh/DNEFpcS3/WkJMPJb8=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25 h1:2q7b1auPihIJD3Ewsd7Zi8ESeLkxuP57avWL8UoBr9U=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25/go.mod h1:gPCOY8bVXdY5bD7nry7th+YNkKC/viG8Dc9+z4fUaRo=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a h1:mUqyzXj24uoi9gE9P+EVoiMi/deUHH2+0jbTnwLhOZ0=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231109032304-2da6db20132a/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=
@@ -1481,8 +1481,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 h1:BItxi1gkQUs3sjxaBk6tc34fZWSO4hUSXcTM3PcnY4I=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a h1:kwjO4pqB3gnNGrQ9aXyz6f8s9qXAUenPUDWip8gYR/Q=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
 k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=

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

@@ -26,6 +26,7 @@ import (
 	_ "jy/src/jfw/modules/publicapply/src/transfer"
 	"net/http"
 
+	_ "jy/src/jfw/modules/publicapply/src/channel"
 	_ "jy/src/jfw/modules/publicapply/src/shareFission"
 	_ "jy/src/jfw/modules/publicapply/src/subscribe"
 	_ "jy/src/jfw/modules/publicapply/src/subscribePush"

+ 64 - 36
src/jfw/modules/publicapply/src/oneclick/entity/entity.go

@@ -1,34 +1,34 @@
 package entity
 
 import (
-	"encoding/json"
-	"errors"
-	"fmt"
-	"jy/src/jfw/modules/publicapply/src/config"
-	"jy/src/jfw/modules/publicapply/src/db"
-	"jy/src/jfw/modules/publicapply/src/jyutil"
-	"jy/src/jfw/modules/publicapply/src/oneclick/initjson"
-	"log"
-	"net/http"
-	"strings"
-	"sync"
-	"time"
+    "encoding/json"
+    "errors"
+    "fmt"
+    "jy/src/jfw/modules/publicapply/src/config"
+    "jy/src/jfw/modules/publicapply/src/db"
+    "jy/src/jfw/modules/publicapply/src/jyutil"
+    "jy/src/jfw/modules/publicapply/src/oneclick/initjson"
+    "log"
+    "net/http"
+    "strings"
+    "sync"
+    "time"
 
-	"app.yhyue.com/moapp/jybase/common"
-	qutil "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/date"
-	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
-	"app.yhyue.com/moapp/jybase/mongodb"
-	"app.yhyue.com/moapp/jybase/redis"
-	qrpc "app.yhyue.com/moapp/jybase/rpc"
-	"app.yhyue.com/moapp/jybase/usercenter"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
-	openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
-	dypnsapi20170525 "github.com/alibabacloud-go/dypnsapi-20170525/v2/client"
-	util "github.com/alibabacloud-go/tea-utils/v2/service"
-	"github.com/alibabacloud-go/tea/tea"
+    "app.yhyue.com/moapp/jybase/common"
+    "app.yhyue.com/moapp/jybase/date"
+    "app.yhyue.com/moapp/jybase/encrypt"
+    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+    "app.yhyue.com/moapp/jybase/mongodb"
+    "app.yhyue.com/moapp/jybase/redis"
+    qrpc "app.yhyue.com/moapp/jybase/rpc"
+    "app.yhyue.com/moapp/jybase/usercenter"
+    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+    "app.yhyue.com/moapp/jypkg/public"
+    "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
+    openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
+    dypnsapi20170525 "github.com/alibabacloud-go/dypnsapi-20170525/v2/client"
+    util "github.com/alibabacloud-go/tea-utils/v2/service"
+    "github.com/alibabacloud-go/tea/tea"
 )
 
 type OneClickInfo struct {
@@ -50,6 +50,7 @@ type OneClickInfo struct {
 	Session        *httpsession.Session
 	ResponseWriter *http.ResponseWriter
 	Host           string
+	R              *http.Request
 }
 
 var (
@@ -301,7 +302,6 @@ func (o *OneClickInfo) ProcessPhone(phone string) (map[string]interface{}, error
 		}
 		returnData = rs
 	}
-
 	return returnData, nil
 }
 
@@ -309,6 +309,16 @@ func (o *OneClickInfo) ProcessPhone(phone string) (map[string]interface{}, error
 func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error) {
 	returnSign := ""
 	userInfo := map[string]interface{}{}
+	channelCode := "jy_app_phone"
+	platform := "app"
+	if strings.Contains(o.Host, "h5.jianyu360.cn") {
+		platform = "h5"
+		channelCode = "jy_h5_phone"
+	}
+	cc, ckErr := o.R.Cookie(jy.ChannelCookieName)
+	if ckErr == nil {
+		channelCode = cc.Value
+	}
 	status := func() int {
 		RegLock.Lock()
 		reg := RegMap[phone]
@@ -331,10 +341,6 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 			client := o.UA
 			log.Println(client)
 			//clearRidByRid(rid)
-			s_platform := "app"
-			if strings.Contains(o.Host, "h5.jianyu360.cn") {
-				s_platform = "h5"
-			}
 			data := map[string]interface{}{
 				"i_appid":       2,
 				"s_phone":       phone,
@@ -350,7 +356,8 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 					"i_ratemode":   2,
 					"l_modifydate": time.Now().Unix(),
 				},
-				"s_platform": s_platform,
+				"s_platform": platform,
+				"s_sourceid": channelCode,
 			}
 			// 新注册用户
 			if o.Activity != "" {
@@ -394,7 +401,7 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 				}
 				mgoUserId, _ := o.Session.Get("mgoUserId").(string)
 				go o.saveLog(mgoUserId, "o_register")
-				return 1
+				return 2
 			}
 		} else {
 			//以s_m_phone登录的 需要把s_m_phone转化为s_phone
@@ -415,8 +422,9 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 		}
 		return 0
 	}()
-	if status == 1 {
-		mgoUserId := qutil.ObjToString(o.Session.Get("mgoUserId"))
+	if status > 0 {
+		//mgoUserId := qutil.ObjToString(o.Session.Get("mgoUserId"))
+		mgoUserId, _ := o.Session.Get("mgoUserId").(string)
 		err := jy.Publish(db.Mgo_Log, config.Config.Nsq, config.Config.NsqTopic, "task", mgoUserId, "", map[string]interface{}{
 			"code":       1014, //下载app任务
 			"types":      "downloadApp",
@@ -427,6 +435,26 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 		if err != nil {
 			log.Println(mgoUserId, "下载app任务,发送nsq消息错误-->", err)
 		}
+		log.Println("一键登录  session信息:", o.Session.GetMultiple())
+		//登录source 更新 p414
+		phone, _ := o.Session.Get("phone").(string)
+		positionId, _ := o.Session.Get("positionId").(int64)
+		us := jy.UserSource{
+			UserId:           mgoUserId,
+			PositionId:       positionId,
+			Phone:            phone,
+			State:            status, //注册/登录标志 1:登录;2:注册
+			ChannelCode:      channelCode,
+			EncryptionUserId: encrypt.SE.Encode2Hex(mgoUserId),
+			CreateTime:       time.Now().Format(date.Date_Full_Layout),
+			LoginWay:         4,                                                                  //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
+			Platform:         common.If(strings.Contains(o.Host, "h5.jianyu360.cn"), 4, 3).(int), //登录端;1:PC;2:WX;3:APP;4:H5
+			Ip:               common.GetIp(o.R),
+		}
+		go func(us jy.UserSource) {
+			jy.SaveUserSource(public.BaseMysql, jy.ChannelTableName, common.StructToMapMore(us))
+		}(us)
+		status = 1
 	}
 	result := map[string]interface{}{
 		"status": status,

+ 1 - 0
src/jfw/modules/publicapply/src/oneclick/service/service.go

@@ -33,6 +33,7 @@ func (o *OneClick) GetPhoneByToken() {
 				Vender:         o.GetString("vender"),
 				Host:           o.Request.Host,
 				Activity:       o.GetString("activity"),
+				R:              o.Request,
 			}
 		)
 		if oci.SpToken == "" && oci.AccessToken == "" {

+ 216 - 216
src/jfw/modules/publicapply/src/util/util.go

@@ -1,37 +1,37 @@
 package util
 
 import (
-    "encoding/json"
-    "fmt"
-    "jy/src/jfw/modules/publicapply/src/config"
-    "jy/src/jfw/modules/publicapply/src/db"
-    "regexp"
-    "strconv"
-    "strings"
-    "time"
+	"encoding/json"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/config"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"regexp"
+	"strconv"
+	"strings"
+	"time"
 
-    qutil "app.yhyue.com/moapp/jybase/common"
-    . "app.yhyue.com/moapp/jybase/date"
-    "app.yhyue.com/moapp/jybase/encrypt"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	. "app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 )
 
 var ClearHtml = regexp.MustCompile("<[^>]*>")
 
-//加密
+// 加密
 func EncodeId(sid string) string {
-    if sid == "" {
-        return ""
-    }
-    return encrypt.EncodeArticleId2ByCheck(sid)
+	if sid == "" {
+		return ""
+	}
+	return encrypt.EncodeArticleId2ByCheck(sid)
 }
 
-//解密
+// 解密
 func DecodeId(eid string) string {
-    if eid == "" {
-        return ""
-    }
-    return encrypt.CommonDecodeArticle("content", eid)[0]
+	if eid == "" {
+		return ""
+	}
+	return encrypt.CommonDecodeArticle("content", eid)[0]
 }
 
 //收藏列表
@@ -43,231 +43,231 @@ func DecodeId(eid string) string {
 	   开始时间-结束时间:1622476800-1623859200
 */
 type CollList struct {
-    Pagenum     int    `json:"pagenum"`     //页数
-    Label       string `json:"label"`       //标签 用,分隔开
-    SelectTime  string `json:"selectTime"`  //收藏时间
-    Buyerclass  string `json:"buyerclass"`  //采购单位 用,分隔开
-    BuyerPhone  int    `json:"buyerPhone"`  //是否需要采购单位联系方式 1:需要 -1:不需要 0:未选中
-    WinnerPhone int    `json:"winnerPhone"` //是否需要中标单位联系方式 1:需要 -1:不需要 0:未选中
-    Pagesize    int    `json:"pagesize"`    //每页展示数量
+	Pagenum     int    `json:"pagenum"`     //页数
+	Label       string `json:"label"`       //标签 用,分隔开
+	SelectTime  string `json:"selectTime"`  //收藏时间
+	Buyerclass  string `json:"buyerclass"`  //采购单位 用,分隔开
+	BuyerPhone  int    `json:"buyerPhone"`  //是否需要采购单位联系方式 1:需要 -1:不需要 0:未选中
+	WinnerPhone int    `json:"winnerPhone"` //是否需要中标单位联系方式 1:需要 -1:不需要 0:未选中
+	Pagesize    int    `json:"pagesize"`    //每页展示数量
 }
 
-//搜藏列表
+// 搜藏列表
 func CollListSql(c *CollList, isPay bool, userid string) string {
-    sql := fmt.Sprintf(`select bid from %s where userid ='%s'`, db.DbConf.Bdcollection, userid)
-    limit := config.BidCollConfig.FreeUserCollLimit
-    //个人标签
-    if c.Label != "" {
-        i := 0
-        sql += ` and `
-        if labelArr := strings.Split(c.Label, ","); len(labelArr) > 0 {
-            sql += `(`
-            for _, v := range labelArr {
-                i++
-                labid := encrypt.SE.DecodeString(v)
-                if i == len(labelArr) {
-                    sql += fmt.Sprintf(`FIND_IN_SET(%s,labelid)`, labid)
-                } else {
-                    sql += fmt.Sprintf(`FIND_IN_SET(%s,labelid) or `, labid)
-                }
-            }
-            sql += `)`
-        }
-    }
-    now := time.Now()
-    start, end := "", ""
-    //收藏时间
-    if c.SelectTime == "lately-7" { //最近7天
-        start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
-    } else if c.SelectTime == "lately-30" { //最近30天
-        start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
-    } else if c.SelectTime == "thisyear" { //去年
-        start = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
-        end = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Format(Date_Full_Layout))
-    } else if len(strings.Split(c.SelectTime, "_")) == 2 {
-        if c.SelectTime != "0_0" {
-            starttime := strings.Split(c.SelectTime, "_")[0]
-            startstamp, _ := strconv.Atoi(starttime)
-            start = time.Unix(int64(startstamp), 0).Format(Date_Full_Layout)
-            endtime := strings.Split(c.SelectTime, "_")[1]
-            et, _ := strconv.ParseInt(endtime, 0, 64)
-            etTime := time.Unix(et, 0)
-            end = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
-        }
-    }
-    if start != "" && end != "" {
-        sql += ` and createdate >= '` + start + `' and createdate < '` + end + `'`
-    } else if start != "" && end == "" {
-        sql += ` and createdate >= '` + start + `'`
-    } else if start == "" && end != "" {
-        sql += ` and createdate < '` + end + `'`
-    }
-    if isPay {
+	sql := fmt.Sprintf(`select bid from %s where userid ='%s'`, db.DbConf.Bdcollection, userid)
+	limit := config.BidCollConfig.FreeUserCollLimit
+	//个人标签
+	if c.Label != "" {
+		i := 0
+		sql += ` and `
+		if labelArr := strings.Split(c.Label, ","); len(labelArr) > 0 {
+			sql += `(`
+			for _, v := range labelArr {
+				i++
+				labid := encrypt.SE.DecodeString(v)
+				if i == len(labelArr) {
+					sql += fmt.Sprintf(`FIND_IN_SET(%s,labelid)`, labid)
+				} else {
+					sql += fmt.Sprintf(`FIND_IN_SET(%s,labelid) or `, labid)
+				}
+			}
+			sql += `)`
+		}
+	}
+	now := time.Now()
+	start, end := "", ""
+	//收藏时间
+	if c.SelectTime == "lately-7" { //最近7天
+		start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
+	} else if c.SelectTime == "lately-30" { //最近30天
+		start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
+	} else if c.SelectTime == "thisyear" { //去年
+		start = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
+		end = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Format(Date_Full_Layout))
+	} else if len(strings.Split(c.SelectTime, "_")) == 2 {
+		if c.SelectTime != "0_0" {
+			starttime := strings.Split(c.SelectTime, "_")[0]
+			startstamp, _ := strconv.Atoi(starttime)
+			start = time.Unix(int64(startstamp), 0).Format(Date_Full_Layout)
+			endtime := strings.Split(c.SelectTime, "_")[1]
+			et, _ := strconv.ParseInt(endtime, 0, 64)
+			etTime := time.Unix(et, 0)
+			end = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Format(Date_Full_Layout))
+		}
+	}
+	if start != "" && end != "" {
+		sql += ` and createdate >= '` + start + `' and createdate < '` + end + `'`
+	} else if start != "" && end == "" {
+		sql += ` and createdate >= '` + start + `'`
+	} else if start == "" && end != "" {
+		sql += ` and createdate < '` + end + `'`
+	}
+	if isPay {
 
-        //采购单位 用,分隔开
-        if c.Buyerclass != "" {
-            i := 0
-            sql += ` and buyerclass in (`
-            if buyClassArr := strings.Split(c.Buyerclass, ","); len(buyClassArr) > 0 {
-                for _, v := range buyClassArr {
-                    i++
-                    buyerclassid := fmt.Sprint(jy.PushMapping.Buyerclass[v])
-                    if i == len(buyClassArr) {
-                        sql += buyerclassid + `)`
-                    } else {
-                        sql += buyerclassid + ","
-                    }
-                }
-            }
-        }
-        //是否存在采购单位电话
-        if c.BuyerPhone == 1 {
-            sql += ` and buyerinfo = 1`
-        } else if c.BuyerPhone == -1 {
-            sql += ` and buyerinfo = 0`
-        }
-        //是否存在中标单位电话
-        if c.WinnerPhone == 1 {
-            sql += ` and winnerinfo = 1`
-        } else if c.WinnerPhone == -1 {
-            sql += ` and winnerinfo = 0`
-        }
-        limit = config.BidCollConfig.PayUserCollLimit
-    }
-    sql += fmt.Sprintf(` order by createdate desc limit %v`, limit)
-    return sql
+		//采购单位 用,分隔开
+		if c.Buyerclass != "" {
+			i := 0
+			sql += ` and buyerclass in (`
+			if buyClassArr := strings.Split(c.Buyerclass, ","); len(buyClassArr) > 0 {
+				for _, v := range buyClassArr {
+					i++
+					buyerclassid := fmt.Sprint(jy.PushMapping.Buyerclass[v])
+					if i == len(buyClassArr) {
+						sql += buyerclassid + `)`
+					} else {
+						sql += buyerclassid + ","
+					}
+				}
+			}
+		}
+		//是否存在采购单位电话
+		if c.BuyerPhone == 1 {
+			sql += ` and buyerinfo = 1`
+		} else if c.BuyerPhone == -1 {
+			sql += ` and buyerinfo = 0`
+		}
+		//是否存在中标单位电话
+		if c.WinnerPhone == 1 {
+			sql += ` and winnerinfo = 1`
+		} else if c.WinnerPhone == -1 {
+			sql += ` and winnerinfo = 0`
+		}
+		limit = config.BidCollConfig.PayUserCollLimit
+	}
+	sql += fmt.Sprintf(` order by createdate desc limit %v`, limit)
+	return sql
 }
 
 func ConfirmIntArr(arr []interface{}) []int {
-    tmp := make([]int, 0)
-    for _, v := range arr {
-        tmp = append(tmp, qutil.IntAll(v))
-    }
-    return tmp
+	tmp := make([]int, 0)
+	for _, v := range arr {
+		tmp = append(tmp, qutil.IntAll(v))
+	}
+	return tmp
 }
 
-//判断同一个数组是否重复
+// 判断同一个数组是否重复
 func IsRepeat(slice1 []string) bool {
-    m := make(map[string]int)
-    for _, v := range slice1 {
-        m[v]++
-        if m[v] > 1 {
-            return true
-        }
-    }
-    return false
+	m := make(map[string]int)
+	for _, v := range slice1 {
+		m[v]++
+		if m[v] > 1 {
+			return true
+		}
+	}
+	return false
 }
 
-//判断数组是否包含
+// 判断数组是否包含
 func IsContain(slice []string, s string) bool {
-    for _, qq := range slice {
-        if qq == s {
-            return true
-        }
-    }
-    return false
+	for _, qq := range slice {
+		if qq == s {
+			return true
+		}
+	}
+	return false
 }
 
 // jsonStr转map
 func JsonToMap(jsonStr string) (map[string]interface{}, error) {
-    m := map[string]interface{}{}
-    err := json.Unmarshal([]byte(jsonStr), &m)
-    if err != nil {
-        fmt.Printf("Unmarshal with error: %+v\n", err)
-        return nil, err
-    }
-    return m, nil
+	m := map[string]interface{}{}
+	err := json.Unmarshal([]byte(jsonStr), &m)
+	if err != nil {
+		fmt.Printf("Unmarshal with error: %+v\n", err)
+		return nil, err
+	}
+	return m, nil
 }
 
-//判断stringArr相等方法
+// 判断stringArr相等方法
 func StringArrEqual(a, b []string) bool {
-    if (len(a) == 0) != (len(b) == 0) {
-        return false
-    }
-    if len(a) != len(b) {
-        return false
-    }
-    for i := range a {
-        if a[i] != b[i] {
-            return false
-        }
-    }
-    return true
+	if (len(a) == 0) != (len(b) == 0) {
+		return false
+	}
+	if len(a) != len(b) {
+		return false
+	}
+	for i := range a {
+		if a[i] != b[i] {
+			return false
+		}
+	}
+	return true
 }
 
-//获取频次信息:fre="周-1"(每周周一);"天-3":每三天一个周期;"日-3":每天三点;
+// 获取频次信息:fre="周-1"(每周周一);"天-3":每三天一个周期;"日-3":每天三点;
 func GetFrequencyInfo(fre string) (string, bool, int) {
-    if fre != "" && len(strings.Split(fre, "-")) > 1 {
-        f := strings.Split(fre, "-")[0]
-        d, _ := strconv.Atoi(strings.Split(fre, "-")[1])
-        switch f {
-        case "月":
-            day := time.Now().Day()
-            return fmt.Sprintf("nps_%s", time.Now().Month().String()), day == d, 31 * 24 * 60 * 60
-        case "周":
-            mi := ConvertWeekday(time.Now().Weekday().String())
-            return fmt.Sprintf("nps_%s", WeekByDate(time.Now())), mi == d, 7 * 24 * 60 * 60
-        case "日":
-            day := time.Now().Day()
-            hour := time.Now().Hour()
-            return fmt.Sprintf("nps_%s", strconv.Itoa(day)), hour == d, 24 * 60 * 60
-        case "天":
-            return fmt.Sprintf("nps_%s", strings.Split(fre, "-")[1]), true, d * 24 * 60 * 60
-        }
-    }
-    return "", false, 0
+	if fre != "" && len(strings.Split(fre, "-")) > 1 {
+		f := strings.Split(fre, "-")[0]
+		d, _ := strconv.Atoi(strings.Split(fre, "-")[1])
+		switch f {
+		case "月":
+			day := time.Now().Day()
+			return fmt.Sprintf("nps_%s", time.Now().Month().String()), day == d, 31 * 24 * 60 * 60
+		case "周":
+			mi := ConvertWeekday(time.Now().Weekday().String())
+			return fmt.Sprintf("nps_%s", WeekByDate(time.Now())), mi == d, 7 * 24 * 60 * 60
+		case "日":
+			day := time.Now().Day()
+			hour := time.Now().Hour()
+			return fmt.Sprintf("nps_%s", strconv.Itoa(day)), hour == d, 24 * 60 * 60
+		case "天":
+			return fmt.Sprintf("nps_%s", strings.Split(fre, "-")[1]), true, d * 24 * 60 * 60
+		}
+	}
+	return "", false, 0
 }
 
-//获取当年第几周
+// 获取当年第几周
 func WeekByDate(t time.Time) string {
-    yearDay := t.YearDay()
-    yearFirstDay := t.AddDate(0, 0, -yearDay+1)
-    firstDayInWeek := int(yearFirstDay.Weekday())
+	yearDay := t.YearDay()
+	yearFirstDay := t.AddDate(0, 0, -yearDay+1)
+	firstDayInWeek := int(yearFirstDay.Weekday())
 
-    //今年第一周有几天
-    firstWeekDays := 1
-    if firstDayInWeek != 0 {
-        firstWeekDays = 7 - firstDayInWeek + 1
-    }
-    var week int
-    if yearDay <= firstWeekDays {
-        week = 1
-    } else {
-        week = (yearDay-firstWeekDays)/7 + 2
-    }
-    return fmt.Sprintf("%d-%d", t.Year(), week)
+	//今年第一周有几天
+	firstWeekDays := 1
+	if firstDayInWeek != 0 {
+		firstWeekDays = 7 - firstDayInWeek + 1
+	}
+	var week int
+	if yearDay <= firstWeekDays {
+		week = 1
+	} else {
+		week = (yearDay-firstWeekDays)/7 + 2
+	}
+	return fmt.Sprintf("%d-%d", t.Year(), week)
 }
 
 func ConvertWeekday(weekday string) int {
-    _weekday := 0
-    if weekday == "Sunday" {
-        _weekday = 7
-    } else if weekday == "Monday" {
-        _weekday = 1
-    } else if weekday == "Tuesday" {
-        _weekday = 2
-    } else if weekday == "Wednesday" {
-        _weekday = 3
-    } else if weekday == "Thursday" {
-        _weekday = 4
-    } else if weekday == "Friday" {
-        _weekday = 5
-    } else if weekday == "Saturday" {
-        _weekday = 6
-    }
-    return _weekday
+	_weekday := 0
+	if weekday == "Sunday" {
+		_weekday = 7
+	} else if weekday == "Monday" {
+		_weekday = 1
+	} else if weekday == "Tuesday" {
+		_weekday = 2
+	} else if weekday == "Wednesday" {
+		_weekday = 3
+	} else if weekday == "Thursday" {
+		_weekday = 4
+	} else if weekday == "Friday" {
+		_weekday = 5
+	} else if weekday == "Saturday" {
+		_weekday = 6
+	}
+	return _weekday
 }
 
-//map转结构体
+// map转结构体
 func JsonUnmarshal(m interface{}, s interface{}) interface{} {
-    var b []byte
-    if v, ok := m.(string); ok {
-        b = []byte(v)
-    } else if v, ok := m.([]byte); ok {
-        b = v
-    } else {
-        b, _ = json.Marshal(m)
-    }
-    json.Unmarshal(b, &s)
-    return s
+	var b []byte
+	if v, ok := m.(string); ok {
+		b = []byte(v)
+	} else if v, ok := m.([]byte); ok {
+		b = v
+	} else {
+		b, _ = json.Marshal(m)
+	}
+	json.Unmarshal(b, &s)
+	return s
 }

+ 1 - 1
src/jfw/modules/weixin/src/go.mod

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230718012114-37013054344b
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.0.3
+	app.yhyue.com/moapp/jypkg v1.0.4-0.20231108013952-a37ecebda2ed
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.3.1

+ 2 - 2
src/jfw/modules/weixin/src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230718012114-37013054344b h1:Wtytm2QqQWtBV+s
 app.yhyue.com/moapp/jybase v0.0.0-20230718012114-37013054344b/go.mod h1:D40Ae0rQilH8Hc5o2Vtt04Tjh/DNEFpcS3/WkJMPJb8=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v1.0.3 h1:aeW4CuNvhevbVwpSVeik19C4C1Uc39eHXfmpTMlZUYU=
-app.yhyue.com/moapp/jypkg v1.0.3/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231108013952-a37ecebda2ed h1:rd5FDHAWiM1MLbgi79KBpRTMQfH5e2Y+knkk2JMsFP4=
+app.yhyue.com/moapp/jypkg v1.0.4-0.20231108013952-a37ecebda2ed/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=

+ 29 - 0
src/jfw/modules/weixin/src/service/usersource.go

@@ -0,0 +1,29 @@
+package service
+
+import (
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"fmt"
+	"jy/src/jfw/modules/weixin/src/tools"
+	"log"
+	"time"
+)
+
+// P414
+func SaveUserSource(channelCode, userId, phone, ip string, state int, positionId int64) {
+	us := jy.UserSource{
+		UserId:           userId,
+		Phone:            phone,
+		State:            state, //注册/登录标志 1:登录;2:注册
+		ChannelCode:      qutil.If(channelCode == "", fmt.Sprintf("%s%s", "jy_wx", qutil.If(state == 1, "_scan", "_sub")), channelCode).(string),
+		EncryptionUserId: encrypt.SE.Encode2Hex(userId),
+		CreateTime:       time.Now().Format(date.Date_Full_Layout),
+		LoginWay:         3,                                       //登录方式;1:手机号密码;2:手机号验证码;3:微信;4:手机号一键登录
+		Platform:         qutil.If(channelCode != "", 1, 2).(int), //登录端;1:PC;2:WX;3:APP;4:H5
+		Ip:               ip,
+	}
+	b := jy.SaveUserSource(tools.Mysql, jy.ChannelTableName, qutil.StructToMapMore(us))
+	log.Println("user source  保存 状态:", b)
+}

+ 6 - 6
src/jfw/modules/weixin/src/wx/subscribe.go

@@ -30,7 +30,7 @@ type ReplyStruct struct {
 	User      map[string]interface{}
 }
 
-//ri 0:w.ReplyText;1:w.PostText
+// ri 0:w.ReplyText;1:w.PostText
 // isScan true:扫码;false:关注
 func (rs *ReplyStruct) SubscribeAction() (ReplyText string, ri int) {
 	ri = 0
@@ -67,7 +67,7 @@ func (rs *ReplyStruct) SubscribeAction() (ReplyText string, ri int) {
 		}
 	case "13", "130": //扫码关注项目
 		param := new(jrpc.FollowData)
-		param.UserId = FindUserId(rs.Openid) //查询userid
+		param.UserId, _, _ = FindUserId(rs.Openid) //查询userid
 		param.Server = fmt.Sprint(config.Sysconfig["webrpcport"])
 		param.Projectname = redis.GetStr("sso", "pc_subscribe_"+rs.Source)
 		if param.Projectname != "" {
@@ -88,7 +88,7 @@ func (rs *ReplyStruct) SubscribeAction() (ReplyText string, ri int) {
 		rs.Subkey = redis.GetStr("sso", "pc_subscribe_"+rs.Source) //企业名称
 		s_id := Findent(rs.Subkey)                                 //查询s_id
 		if rs.Subkey != "" {
-			userId := FindUserId(rs.Openid) //查询userid
+			userId, _, _ := FindUserId(rs.Openid) //查询userid
 			var url = fmt.Sprintf(config.Sysconfig["proxysess"].(string), tools.SE.EncodeString(fmt.Sprintf(moduleEncode, "entListFollow")))
 			pchints := config.Sysconfig["company"].(map[string]interface{})
 			if tools.MQFW.Count("jylab_followent", `{"s_userid":"`+userId+`","s_id":"`+s_id+`"}`) > 0 {
@@ -116,7 +116,7 @@ func (rs *ReplyStruct) SubscribeAction() (ReplyText string, ri int) {
 	return
 }
 
-//扫码订阅关键词
+// 扫码订阅关键词
 func (rs *ReplyStruct) ScanKeys() {
 	if rs.VipStatus > 0 {
 		if rs.Subkey != "" {
@@ -141,7 +141,7 @@ type KeysWords struct {
 	From   int      `json:"from"`
 }
 
-//免费用户扫码快速订阅关键词
+// 免费用户扫码快速订阅关键词
 func (rs *ReplyStruct) freeFastSubscribe() {
 	rs.Pcresult = "ok"
 	o_jy, _ := rs.User["o_jy"].(map[string]interface{})
@@ -201,7 +201,7 @@ func (rs *ReplyStruct) freeFastSubscribe() {
 	}
 }
 
-//付费用户扫码快速订阅关键词
+// 付费用户扫码快速订阅关键词
 func (rs *ReplyStruct) vipFastSubscribe() {
 	if rs.Subkey == "" {
 		return

+ 53 - 14
src/jfw/modules/weixin/src/wx/wx.go

@@ -4,6 +4,7 @@ import (
 	"encoding/json"
 	"fmt"
 	"jy/src/jfw/modules/weixin/src/config"
+	"jy/src/jfw/modules/weixin/src/service"
 	"net/url"
 
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
@@ -27,10 +28,17 @@ import (
 	"github.com/SKatiyar/qr"
 )
 
-var Mux *Weixin
-
-// 锁
-var sharelock *sync.Mutex = &sync.Mutex{}
+var (
+	Mux *Weixin
+	// 锁
+	sharelock *sync.Mutex = &sync.Mutex{}
+	MSPOOL                = 20
+	MapScans              = make([]*MapScan, MSPOOL)
+	// 微信菜单 click;点击菜单 回复文案;
+	menuClickReplyTextMap map[string]string
+	//time.sleep 用户来源信息收集延时时间
+	userCTS = 1 * time.Minute
+)
 
 /*扫码锁,目前发现android手机,扫码的时候有时会请求两个,不是微信回调两次,
 是在手机上扫完码之后,看扫码的框里面请求了两次,如果是回调超时,重复回调的话,createtime是一样的,
@@ -54,9 +62,6 @@ func (m *MapScan) GC() {
 	time.AfterFunc(15*time.Minute, m.GC)
 }
 
-var MSPOOL = 20
-var MapScans = make([]*MapScan, MSPOOL)
-
 func init() {
 	InitSSLClient("./apiclient_cert.pem", "./apiclient_key.pem", "")
 	Mux = New(config.Sysconfig["apptoken"].(string), config.Sysconfig["appid"].(string), config.Sysconfig["appsecret"].(string))
@@ -86,9 +91,6 @@ func init() {
 	}
 }
 
-// 微信菜单 click;点击菜单 回复文案;
-var menuClickReplyTextMap map[string]string
-
 func MenuClickHandler(w ResponseWriter, r *Request) {
 	if len(config.ReplyConfig.BusinessCoop) > 0 {
 		user, err := Mux.GetUserInfo(r.FromUserName)
@@ -688,6 +690,8 @@ func Subscribe(w ResponseWriter, r *Request) {
 		}
 	}
 	go saveSubscribe(openid, r.Event, r.EventKey, 1)
+	//P414 用注册登录资源收集
+	go SaveUserSource(source, openid, 2)
 }
 
 func saveUserLog(shareId, openid, activeName string, shareflag bool) {
@@ -714,6 +718,8 @@ func saveUserLog(shareId, openid, activeName string, shareflag bool) {
 		userData["s_activeCode"] = util.ObjToString(infoData["RActiveCode"])
 		userData["s_os"] = util.ObjToString(infoData["Ros"])
 		userData["s_browse"] = util.ObjToString(infoData["Rbrowse"])
+		userData["channelCode"] = util.ObjToString(infoData["channelCode"])
+		userData["ip"] = util.ObjToString(infoData["Rip"])
 	} else {
 		userData["s_module"] = "首页"
 		userData["s_referer"] = "剑鱼标讯网站"
@@ -917,8 +923,37 @@ func ScanHandler(w ResponseWriter, r *Request) {
 	} else {
 		log.Println("scan-error,mongodb-conn-error")
 	}
+	//P414
+	if r.EventKey != "" {
+		go SaveUserSource(r.EventKey, openid, 1)
+	}
 }
 
+// SaveUserSource state 1:扫码 2:关注
+func SaveUserSource(erCode, openid string, state int) {
+	log.Println("-------userSource---信息 收集 开始----------")
+	userData := redis.Get("sso", "p_shareData_"+erCode)
+	channelCode := ""
+	ip := ""
+	if userData != nil {
+		infoData := map[string]interface{}{}
+		tmp, err := json.Marshal(userData)
+		if err == nil {
+			if err = json.Unmarshal(tmp, &infoData); err == nil {
+				channelCode = util.ObjToString(infoData["channelCode"])
+				ip = util.ObjToString(infoData["Rip"])
+			} else {
+				log.Println("序列化异常 infoData")
+			}
+		} else {
+			log.Println("序列化异常 userData")
+		}
+	}
+	time.Sleep(userCTS)
+	userId, phone, positionId := FindUserId(openid)
+	service.SaveUserSource(channelCode, userId, phone, ip, state, positionId)
+	log.Println("-------userSource---信息 收集 结束----------")
+}
 func WxBind(code, openId string, w ResponseWriter, newUnionId string) bool {
 	//获取信息
 	log.Println(code)
@@ -1059,14 +1094,18 @@ func Findent(entname string) string {
 }
 
 // 通过openid查userid
-func FindUserId(openid string) string {
+func FindUserId(openid string) (userId, phone string, positionId int64) {
 	defer util.Catch()
-	userId := ""
-	tem, ok := tools.MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`","s_unionid":{"$ne":"`+openid+`"}}`, `{"_id":1}`)
+	tem, ok := tools.MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`","s_unionid":{"$ne":"`+openid+`"}}`, `{"_id":1,"s_m_phone":1,"s_phone":1,"login_positionid":1}`)
 	if ok && len(*tem) > 0 {
 		userId = util.ObjToString(BsonIdToSId((*tem)["_id"]))
+		phone = util.ObjToString((*tem)["s_m_phone"])
+		if phone == "" {
+			phone = util.ObjToString((*tem)["s_phone"])
+		}
+		positionId = util.Int64All((*tem)["login_positionid"])
 	}
-	return userId
+	return
 }
 
 // 取消关注事件

+ 8 - 0
src/jfw/qrmanager/qrmanager.go

@@ -1,6 +1,7 @@
 package qrmanager
 
 import (
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	. "jy/src/jfw/config"
 	"net/http"
 	"regexp"
@@ -26,6 +27,13 @@ func RedisInfo(oid, action, sione, sitwo string, i int, hsn *httpsession.Session
 		rhdua = rheader["User-Agent"][0]
 	}
 	userData := make(map[string]interface{})
+	//P414
+	channelCode := "jy_pc_wx"
+	ccVal, ckErr := hrt.Cookie(jy.ChannelCookieName)
+	if ckErr == nil {
+		channelCode = ccVal.Value
+	}
+	userData["channelCode"] = channelCode
 	userData["Ros"] = util.GetOS(rhdua)
 	userData["Rip"] = util.GetIp(hrt)
 	userData["Rbrowse"] = util.GetBrowse(rhdua)

+ 8 - 4
src/seo.json

@@ -4782,19 +4782,23 @@
   "appNewUserTime":1668155814,
   "tagsLimitCount":300,
   "hotWinner": {
-    "cacheKey": "hotWinnerCache",
+    "cacheKey": "hotWinnerCache2",
     "cacheTimeout": 86400,
-    "limit": 200
+    "limit": 80
   },
   "hotBuyer": {
-    "cacheKey": "hotBuyerCache",
+    "cacheKey": "hotBuyerCache2",
     "cacheTimeout": 86400,
-    "limit": 200
+    "limit": 80
   },
   "infoTypeToLetter": {
     "招标预告":   "ZBYG",
     "招标公告":   "ZBGG",
     "招标结果":   "ZBJG",
     "招标信用信息": "ZBXYXX"
+  },
+  "secSeoWebConfig": {
+    "areaCodeMap": {"上海": "shanghai", "云南": "yunnan", "内蒙古": "neimenggu", "北京": "beijing", "吉林": "jilin", "四川": "sichuan", "天津": "tianjin", "宁夏": "ningxia", "安徽": "anhui", "山东": "shandong", "山西": "shanxi", "广东": "guangdong", "广西": "guangxi", "新疆": "xinjiang", "江苏": "jiangsu", "江西": "jiangxi", "河北": "hebei", "河南": "henan", "浙江": "zhejiang", "海南": "hainan", "湖北": "hubei", "湖南": "hunan", "甘肃": "gansu", "福建": "fujian", "西藏": "xizang", "贵州": "guizhou", "辽宁": "liaoning", "重庆": "chongqing", "陕西": "shaanxi", "青海": "qinghai", "黑龙江": "heilongjiang"},
+    "area_href_format": "https://%s.jianyu360.cn"
   }
 }

BIN
src/web/staticres/common-module/channel/image/everythingok.png


+ 7 - 2
src/web/staticres/js/ent-search-index-pc.js

@@ -712,9 +712,9 @@ var entSearch = new Vue({
                     keywords: '企业信息查询,工商查询,招投标公司查询,中标企业查询,中标单位,中标企业画像,剑鱼标讯',
                     description: '剑鱼标讯企业搜索为您精准提供全国工商企业信息、招投标公司及中标企业信息查询服务,涵盖企业信息查询,工商查询,招投标公司查询,中标企业搜索,中标企业画像查看等多维度服务,帮您快速了解企业招投标情况,提前预判风险,拓展合作商机。'
                 })
-                
+
             }
-            
+
         },
         doSearch: function () {
             this.setPageTdk()
@@ -878,6 +878,11 @@ var entSearch = new Vue({
             var svipLink = '/swordfish/page_big_pc/svip/ent_ser_portrait/' + id
             // 大会员画像
             var memberLink = '/swordfish/page_big_pc/ent_portrait/' + id
+            // 是渠道合作页面需要登录后重定向
+            if(cooperateCode) {
+              openLoginDig(null, svipLink)
+              return
+            }
             try {
                 item.visited = true
                 visitedPath.pathVisiting(

+ 9 - 2
src/web/staticres/js/pur-search-index-pc.js

@@ -672,11 +672,18 @@ var vm = new Vue({
             this.getList()
         },
         goTitle: function(name) {
+          // 是渠道合作页面需要登录后重定向
+            var url = '/swordfish/page_big_pc/unit_portrayal/' + name
             if (this.isNewEntNiche) {
-              window.open('/entpc/unit_portrayal/' + name)
+              url = '/entpc/unit_portrayal/' + name
             } else {
-              window.open('/swordfish/page_big_pc/unit_portrayal/' + name)
+              url = '/swordfish/page_big_pc/unit_portrayal/' + name
             }
+            if(cooperateCode) {
+              openLoginDig(null, url)
+              return
+            }
+            window.open(url)
         },
         // 全选
         allChange: function() {

+ 91 - 7
src/web/staticres/public-pc/css/pc-bottom.css

@@ -498,6 +498,86 @@
   display: inherit;
   color: white;
 }
+/*可配置的侧边栏*/
+.right-side-box .config-right-side-item .text-customer{
+    display: inherit;
+}
+.right-side-box .config-right-side-item:hover .text-customer {
+    display: none;
+}
+.right-side-box .config-right-side-item .text-customer-hover{
+    display: none;
+}
+.right-side-box .config-right-side-item:hover .text-customer-hover{
+    display: inherit;
+}
+.right-side-box .config-right-side-item{
+    display: flex;
+    align-items: center;
+    flex-direction: column;
+    position: relative;
+    width: 100%;
+    height: 80px;
+    background: #fff;
+    box-sizing: border-box;
+    cursor: pointer;
+    border-bottom:1px solid #F1F4F9;
+}
+.right-side-box .config-right-side-item:nth-of-type(1) {
+    background: linear-gradient(180deg, #1699F9 0%, #19C6DC 100%);
+    border-top: 2px solid #FFF;
+    border-left: 2px solid #FFF;
+}
+.right-side-box .config-right-side-item:nth-of-type(1)  .desc_text_b{
+    color: #fff;
+}
+.right-side-box .config-right-side-item:nth-of-type(1){
+    border-radius: 10px 0 0 0;
+}
+.right-side-box .config-right-side-item.last-config-item{
+    border-radius: 0 0 0 10px;
+}
+.right-side-box .config-right-side-item .slidePop {
+    display: none;
+    position: absolute;
+    right:92px;
+    top: 0;
+
+}
+.right-side-box .config-right-side-item .slidePop-content{
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    flex-direction: column;
+    background: linear-gradient(180deg, #F1F4F8 0%, #FEFEFF 100%);
+    border: 2px solid #FFFFFF;
+    box-shadow: 0px 0px 20px rgba(8, 31, 38, 0.12);
+    border-radius: 8px;
+    padding: 12px 20px;
+    box-sizing: border-box;
+    font-size: 14px;
+    line-height: 22px;
+    color: #1D1D1D;
+    white-space: nowrap;
+}
+.right-side-box .config-right-side-item .slidePop p {
+    font-size: 14px;
+    line-height: 22px;
+    text-align: center;
+    color: #1D1D1D;
+    margin-top: 2px;
+}
+.right-side-box .config-right-side-item:hover .slidePop{
+    display: block;
+}
+
+.right-side-box .config-right-side-item .slidePop img {
+    width: 104px;
+    height: 104px;
+    margin: auto;
+    display: block;
+}
+
 
 @media all and (-ms-high-contrast: none),
 (-ms-high-contrast: active) {
@@ -724,13 +804,14 @@
 }
 
 .qr_box div {
-  /* width: 64px;
-  height: 64px;
-  background: #FFFFFF;
-  border-radius: 4px;
-  display: flex;
-  justify-content: center;
-  align-items: center; */
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    flex-direction: column;
+    flex:1;
+}
+.qr_box div:nth-last-of-type(1){
+    margin-left: 5px;
 }
 
 .jy_classify_r .qr_box div img {
@@ -772,6 +853,9 @@
   z-index: 9;
 
 } */
+/*.jy_classify_r .config_classify_r_box{*/
+/*    display: none;*/
+/*}*/
 
 .right-side-box {
   display: none;

+ 86 - 8
src/web/templates/common/pcbottom.html

@@ -16,7 +16,8 @@
           {{end}}
         </div>
         <div class="jy_classify_r">
-          <div class="jy_classify_r_box">
+            {{if not .T.cooperateCode }}
+                <div class="jy_classify_r_box common_classify_r_box">
             <div class="jy_classify_kefu">
                 <img src='{{Msg "seo" "cdn"}}/images/pc/logo.png?v={{Msg "seo" "version"}}' alt="" />
                 <span>400-108-6670</span>
@@ -61,6 +62,9 @@
               </div>
             </div>
           </div>
+            {{else}}
+                <div class="jy_classify_r_box config_classify_r_box"></div>
+            {{end}}
         </div>
 			</div>
 		</div>
@@ -115,14 +119,14 @@
 		</div>
   </div>
 </div>
-
 <!--S-侧边栏-->
 <div class="right-side-box right-side-box-only" data-backside>
+    {{if not .T.cooperateCode }}
 <!--      <div id="shareslider" style="width: 88px"></div>-->
-    <div id="sideIcon" class="" style="right: 1px;width: 88px;height: 88px;display: none;">
+    <div id="sideIcon" class="common-right-side-item" style="right: 1px;width: 88px;height: 88px;display: none;">
 <!--        <a href="/swordfish/frontPage/share/sess/index"><img src="{{Msg "seo" "cdn"}}/share/img/active-icon.png"  alt="" style="width: 88px;"></a>-->
     </div>
-      <div class="right-side-phone right-side-pop">
+      <div class="right-side-phone right-side-pop common-right-side-item">
         <span class=" text-customer">
           <img src='{{Msg "seo" "cdn"}}/images/index/new/telphone.png?v={{Msg "seo" "version"}}' alt="">
         </span>
@@ -130,7 +134,7 @@
         <p class="desc_text">客服热线</p>
         <div class="silde-float kf-phone">客服热线:400-108-6670<br>服务时间:工作日 9:00-17:40</div>
       </div>
-      <div class="right-side-item right-side-kf open-customer" id="go-customer-4" style="display: block">
+      <div class="right-side-item right-side-kf open-customer common-right-side-item" id="go-customer-4" style="display: block">
           <div class="hover-open-box" style="padding: 0;">
               <!-- <div class="icon-customer white icon-badge-number" data-badge-number=""></div> -->
               <div class="icon-badge-number text-customer" data-badge-number="">
@@ -147,7 +151,7 @@
             </div>
           </div> -->
       </div>
-      <div class="right-side-phone right-side-wx">
+      <div class="right-side-phone right-side-wx common-right-side-item">
           <span class=" text-customer"><img src='{{Msg "seo" "cdn"}}/images/index/new/wx.png?v={{Msg "seo" "version"}}' alt=""></span>
           <span class="text-customer text-customer-hover"><img src='{{Msg "seo" "cdn"}}/images/index/new/wx1.png?v={{Msg "seo" "version"}}' alt=""></span>
           <p class="desc_text_b">关注剑鱼</p>
@@ -156,7 +160,7 @@
               <p>关注剑鱼标讯<br>免费追踪全国商机</p>
           </div>
       </div>
-      <div class="right-side-phone right-side-wx right-side-app">
+      <div class="right-side-phone right-side-wx right-side-app common-right-side-item">
         <span class=" text-customer"><img src='{{Msg "seo" "cdn"}}/images/index/new/weixin_miam_b.png?v={{Msg "seo" "version"}}' alt=""></span>
         <span class="text-customer text-customer-hover"><img src='{{Msg "seo" "cdn"}}/images/index/new/weixin_miam.png?v={{Msg "seo" "version"}}' alt=""></span>
         <p class="desc_text_b">下载App</p>
@@ -165,6 +169,8 @@
             <p>下载App<br>免费查看全国商机</p>
         </div>
     </div>
+    {{end}}
+<!--    可配置数据类config-right-side-item-->
     <div class="right-side-item back-to-up" data-backtop>
         <div class="hover-open-box">
             <div class="icon-arrow--up white"></div>
@@ -193,9 +199,81 @@ if(ADList.length>0){
 }
   $("#sideIcon").append(ADHtml);
 </script>
-
 <script src='{{Msg "seo" "cdn"}}/public-pc/js/pc-bottom.js?v={{Msg "seo" "version"}}'></script>
 <!--用于生成加密UID-->
 <script defer src='//cdn-common.jianyu360.com/cdn/lib/jsencrypt/3.3.2/jsencrypt.min.js'></script>
 <script defer src='//cdn-common.jianyu360.com/cdn/lib/fid-sdk/v4/fid.js'></script>
 <script defer src='{{Msg "seo" "cdn"}}/common-module/public/js/automatic-id.min.js?v={{Msg "seo" "version"}}'></script>
+<!--渠道合作商侧边栏、底部配置-->
+<script>
+  // 是渠道合作商则读取侧边栏以及底部配置数据
+  $(function() {
+    {{if .T.cooperateCode }}
+        getCooperationConfig()
+    {{end}}
+    // 获取渠道商配置的侧边栏和底部数据
+    function getCooperationConfig() {
+      $.ajax({
+        type:'post',
+        url:'/publicapply/channel/cooperation',
+        success: function(res){
+          if (res.error_code === 0 && res.data) {
+            var broadside = res.data.broadside || []
+            var bottomside = res.data.bottomside || {}
+            if(broadside.length > 0) {
+              // $('.common-right-side-item').hide()
+              // $('.config-right-side-item').show()
+              renderRightSide(broadside)
+            }
+            if(bottomside && Object.keys(bottomside)) {
+              renderBottomCustomer(bottomside)
+            }
+          }
+        }
+      })
+    }
+    // 可配置侧边栏信息渲染
+    function renderRightSide (list) {
+      var html = ''
+      list.forEach(function(item,ind) {
+        html += `
+       <div class="right-side-item config-right-side-item ${ind+1 === list.length ? 'last-config-item' : ''}">
+        <span class="text-customer"><img src='${item.icon}' alt=""></span>
+        <span class="text-customer text-customer-hover"><img src='${item.activeIcon}' alt=""></span>
+        <p class="desc_text_b">${item.tip}</p>
+        <div class="slidePop">
+            <div class="slidePop-content">
+                ${item.rich}
+            </div>
+        </div>
+    </div>
+     `
+      })
+      $('.right-side-box').prepend(html)
+      // $('.config-right-side-item').show()
+    }
+    // 可配置底部客服信息渲染
+    function renderBottomCustomer (obj) {
+      var html = ''
+      if(obj.phone) {
+        html+= `<div class="jy_classify_kefu">
+                <img src='/images/pc/logo.png' alt="" />
+                <span>${obj.phone}</span>
+            </div>`
+      }
+      if(obj.imgs && $.isArray(obj.imgs) && obj.imgs.length > 0) {
+        html+= '<div class="qr_box">'
+        obj.imgs.forEach(function(item, index) {
+          html+= ` <div>
+                     <img src='${item.img}' alt="">
+                     <p>${item.tip}</p>
+                    </div>`
+        })
+        html+= '</div>'
+      }
+      $('.config_classify_r_box').append(html)
+    }
+  })
+
+
+</script>

+ 11 - 8
src/web/templates/pc/entsearchindex.html

@@ -184,16 +184,18 @@
                                     >${ item.name }</div>
                             </div>
                         </div>
-                        <div class="search-right-wx">
-                            <img src='{{Msg "seo" "cdn"}}/images/biddingSearch/sea-right-wx.png' />
-                            <div class="search-right-wx-inner">
-                                <div class="wx-inner-title">扫码关注剑鱼标讯</div>
-                                <div class="wx-inner-ewm">
-                                    <img id="keyImg" src="/front/share/{{.T.shareid}}"/>
+                        {{if not .T.cooperateCode}}
+                            <div class="search-right-wx">
+                                <img src='{{Msg "seo" "cdn"}}/images/biddingSearch/sea-right-wx.png' />
+                                <div class="search-right-wx-inner">
+                                    <div class="wx-inner-title">扫码关注剑鱼标讯</div>
+                                    <div class="wx-inner-ewm">
+                                        <img id="keyImg" src="/front/share/{{.T.shareid}}"/>
+                                    </div>
+                                    <div class="wx-inner-bottom">微信扫一扫<br>随时随地掌握招标信息</div>
                                 </div>
-                                <div class="wx-inner-bottom">微信扫一扫<br>随时随地掌握招标信息</div>
                             </div>
-                        </div>
+                        {{end}}
                     </div>
                     <!-- <div class="search-header-bottom">
                         <el-tabs v-model="tabActive">
@@ -467,6 +469,7 @@
         var pageInfo = {
             searchContent: {{.T.searchvalue}},
         }
+        var cooperateCode = {{.T.cooperateCode}} // 渠道合作投放
         haslogin({{.T.logid}})
 	</script>
     <script src='{{Msg "seo" "cdn"}}/common-module/public/js/china-map-data.js?v={{Msg "seo" "version"}}'></script>

+ 11 - 8
src/web/templates/pc/pursearchindex.html

@@ -132,16 +132,18 @@
                                     >${ item.name }</div>
                             </div>
                         </div>
-                        <div class="search-right-wx">
-                            <img src="{{Msg "seo" "cdn"}}/images/biddingSearch/sea-right-wx.png" />
-                            <div class="search-right-wx-inner">
-                                <div class="wx-inner-title">扫码关注剑鱼标讯</div>
-                                <div class="wx-inner-ewm">
-                                    <img id="keyImg" src="/front/share/{{.T.shareid}}"/>
+                        {{if not .T.cooperateCode}}
+                            <div class="search-right-wx">
+                                <img src="{{Msg "seo" "cdn"}}/images/biddingSearch/sea-right-wx.png" />
+                                <div class="search-right-wx-inner">
+                                    <div class="wx-inner-title">扫码关注剑鱼标讯</div>
+                                    <div class="wx-inner-ewm">
+                                        <img id="keyImg" src="/front/share/{{.T.shareid}}"/>
+                                    </div>
+                                    <div class="wx-inner-bottom">微信扫一扫<br>随时随地掌握招标信息</div>
                                 </div>
-                                <div class="wx-inner-bottom">微信扫一扫<br>随时随地掌握招标信息</div>
                             </div>
-                        </div>
+                        {{end}}
                     </div>
                     <!-- <div class="search-header-bottom">
                         <el-tabs v-model="tabActive">
@@ -389,6 +391,7 @@
         var pageInfo = {
             searchContent: {{.T.searchvalue}},
         }
+        var cooperateCode = {{.T.cooperateCode}} // 渠道合作投放
         haslogin({{.T.logid}})
 	</script>
   <script src='{{Msg "seo" "cdn"}}/common-module/selector/js/buyerClass.js?v={{Msg "seo" "version"}}'></script>

+ 23 - 16
src/web/templates/pc/supsearch.html

@@ -55,6 +55,7 @@
       })
     }
     isPower()
+    var cooperateCode = {{.T.cooperateCode}} // 是否是渠道合作投放
     var areas = {{.T.area}}!=null?{{.T.area}}:"";
     var selectPublishtime = {{.T.publishtime}};
     var selectTimeslot = {{.T.timeslot}}!=null?{{.T.timeslot}}:"";
@@ -800,22 +801,24 @@
           {{end}}
         </div>
         <!--二维码-->
-        {{if not .T.bidField}}
-        <div class="search-right-wx">
-          <img src='{{Msg "seo" "cdn"}}/images/biddingSearch/sea-right-wx.png' />
-          <div class="search-right-wx-inner">
-            <div class="wx-inner-title">
-              扫码关注剑鱼标讯
-            </div>
-            <div class="wx-inner-ewm">
-              <img id="keyImg" src="/front/share/10"/>
-            </div>
-            <div class="wx-inner-bottom">
-              微信扫一扫<br>随时随地掌握招标信息
+        {{if not .T.bidField }}
+          {{if not .T.cooperateCode}}
+            <div class="search-right-wx">
+              <img src='{{Msg "seo" "cdn"}}/images/biddingSearch/sea-right-wx.png' />
+              <div class="search-right-wx-inner">
+                <div class="wx-inner-title">
+                  扫码关注剑鱼标讯
+                </div>
+                <div class="wx-inner-ewm">
+                  <img id="keyImg" src="/front/share/10"/>
+                </div>
+                <div class="wx-inner-bottom">
+                  微信扫一扫<br>随时随地掌握招标信息
+                </div>
+              </div>
             </div>
-          </div>
-        </div>
         {{end}}
+       {{end}}
       </div>
       <div class="keyword-input-container" v-if="showAddKeyword || keywordMult">
         <keyword-tags-component class="keyword-tags-component" :before-change="function(){return true}" :list="keywordTags" placeholder="请输入关键词" @change="onAddKeyChange">
@@ -2800,10 +2803,14 @@ function checkTagDisabled () {
           )
         )
       } catch (error) {}
-
       checkVisited('nologin')
+      // 渠道合作页,未登录跳转需要弹出登录,重置到已登录后的详情页
+      if(cooperateCode) {
+        openLoginDig(null, "/article/content/"+thisId+aHref)
+      } else {
+        window.open("/nologin/content/"+thisId+aHref);
+      }
 
-      window.open("/nologin/content/"+thisId+aHref);
       // $('#bidLogin').modal("show");
     }
   }