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

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/jfw/modules/publicapply/src/go.sum
wangshan 4 hónapja
szülő
commit
2fa63c599b
100 módosított fájl, 3210 hozzáadás és 1611 törlés
  1. 4 2
      src/config.json
  2. 1 1
      src/go.mod
  3. 2 2
      src/go.sum
  4. 18 4
      src/jfw/filter/phonefilter.go
  5. 12 1
      src/jfw/filter/wxUserSalesFilter.go
  6. 37 24
      src/jfw/front/commonPayPc.go
  7. 27 10
      src/jfw/front/commonPayWx.go
  8. 1 1
      src/jfw/front/dataExport.go
  9. 14 13
      src/jfw/front/front.go
  10. 15 13
      src/jfw/front/login.go
  11. 12 11
      src/jfw/front/org_structure.go
  12. 6 5
      src/jfw/front/otherAct.go
  13. 8 7
      src/jfw/front/pchelper.go
  14. 2 2
      src/jfw/front/searchOptimize.go
  15. 5 1
      src/jfw/front/shorturl.go
  16. 47 0
      src/jfw/front/singleLogin.go
  17. 1 1
      src/jfw/front/tags.go
  18. 1 1
      src/jfw/front/ws_dataExport.go
  19. 2 1
      src/jfw/jyutil/jyutil.go
  20. 19 2
      src/jfw/modules/app/src/app/filter/phonefilter.go
  21. 10 4
      src/jfw/modules/app/src/app/front/accountPage.go
  22. 19 0
      src/jfw/modules/app/src/app/front/commonPay.go
  23. 573 570
      src/jfw/modules/app/src/app/front/login.go
  24. 5 0
      src/jfw/modules/app/src/app/front/shorturl.go
  25. 1 1
      src/jfw/modules/app/src/app/front/ws_dataExport.go
  26. 3 6
      src/jfw/modules/app/src/config.yaml
  27. 1 3
      src/jfw/modules/app/src/go.mod
  28. 2 2
      src/jfw/modules/app/src/go.sum
  29. 75 6
      src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js
  30. 55 0
      src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/unit_portrayal.js
  31. 5 4
      src/jfw/modules/app/src/web/staticres/jyapp/js/common.js
  32. 6 2
      src/jfw/modules/app/src/web/staticres/jyapp/me/js/phone_bind.js
  33. 215 2
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_introduce.css
  34. 8 8
      src/jfw/modules/app/src/web/templates/big-member/page_ent_portrait.html
  35. 4 0
      src/jfw/modules/app/src/web/templates/big-member/page_ent_portrait_change.html
  36. 4 4
      src/jfw/modules/app/src/web/templates/big-member/page_free_buyer_project_news.html
  37. 4 4
      src/jfw/modules/app/src/web/templates/big-member/page_free_ent_project_news.html
  38. 33 7
      src/jfw/modules/app/src/web/templates/big-member/page_landingPage.html
  39. 7 7
      src/jfw/modules/app/src/web/templates/big-member/page_unit_portrayal.html
  40. 30 1
      src/jfw/modules/app/src/web/templates/exhibition/index.html
  41. 1 1
      src/jfw/modules/app/src/web/templates/frontRouter/activity/free/202402.html
  42. 9 0
      src/jfw/modules/app/src/web/templates/frontRouter/activity/free/register.html
  43. 3 2
      src/jfw/modules/app/src/web/templates/frontRouter/bidedoc/free/index.html
  44. 3 2
      src/jfw/modules/app/src/web/templates/frontRouter/bidedoc/sess/index.html
  45. 2 1
      src/jfw/modules/app/src/web/templates/frontRouter/declaration/free/relationship.html
  46. 29 1
      src/jfw/modules/app/src/web/templates/frontRouter/partner/free/index.html
  47. 25 1
      src/jfw/modules/app/src/web/templates/frontRouter/partner/sess/index.html
  48. 6 4
      src/jfw/modules/app/src/web/templates/frontRouter/solution/free/dataInterface.html
  49. 55 18
      src/jfw/modules/app/src/web/templates/frontRouter/solution/free/index.html
  50. 29 3
      src/jfw/modules/app/src/web/templates/frontRouter/solution/sess/index.html
  51. 1 1
      src/jfw/modules/app/src/web/templates/me/account/phone_bind.html
  52. 61 17
      src/jfw/modules/app/src/web/templates/structeddata/marketing.html
  53. 149 33
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_introduce.html
  54. 37 2
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_pay_success.html
  55. 3 2
      src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go
  56. 16 0
      src/jfw/modules/bigmember/src/service/use/use.go
  57. 19 11
      src/jfw/modules/publicapply/src/activityday/config.json
  58. 9 3
      src/jfw/modules/publicapply/src/activityday/config/config.go
  59. 2 1
      src/jfw/modules/publicapply/src/activityday/consts/consts.go
  60. 26 0
      src/jfw/modules/publicapply/src/activityday/dao/InternalCheck.go
  61. 10 7
      src/jfw/modules/publicapply/src/activityday/dao/dao.go
  62. 32 38
      src/jfw/modules/publicapply/src/activityday/dao/drawLottery.go
  63. 149 18
      src/jfw/modules/publicapply/src/activityday/dao/exchange.go
  64. 42 0
      src/jfw/modules/publicapply/src/activityday/dao/history.go
  65. 14 8
      src/jfw/modules/publicapply/src/activityday/dao/raffle.go
  66. 2 0
      src/jfw/modules/publicapply/src/activityday/entity/exchange.go
  67. 8 6
      src/jfw/modules/publicapply/src/activityday/service/action.go
  68. 26 1
      src/jfw/modules/publicapply/src/activityday/service/exchange.go
  69. 24 0
      src/jfw/modules/publicapply/src/activityday/service/history.go
  70. 7 0
      src/jfw/modules/publicapply/src/activityday/service/raffle.go
  71. 4 4
      src/jfw/modules/publicapply/src/activityday/util/send.go
  72. 2 1
      src/jfw/modules/publicapply/src/config.json
  73. 1 0
      src/jfw/modules/publicapply/src/config.yaml
  74. 19 1
      src/jfw/modules/publicapply/src/detail/config.json
  75. 2 3
      src/jfw/modules/publicapply/src/detail/config/config.go
  76. 7 0
      src/jfw/modules/publicapply/src/detail/consts/consts.go
  77. 99 49
      src/jfw/modules/publicapply/src/detail/dao/baseInfo.go
  78. 71 1
      src/jfw/modules/publicapply/src/detail/dao/bidding.go
  79. 16 0
      src/jfw/modules/publicapply/src/detail/dao/preAgent.go
  80. 5 1
      src/jfw/modules/publicapply/src/detail/entity/config.go
  81. 1 0
      src/jfw/modules/publicapply/src/detail/entity/entity.go
  82. 1 0
      src/jfw/modules/publicapply/src/detail/init.go
  83. 69 0
      src/jfw/modules/publicapply/src/detail/timetask/task.go
  84. 66 0
      src/jfw/modules/publicapply/src/detail/util/match.go
  85. 32 0
      src/jfw/modules/publicapply/src/detail/util/util.go
  86. 7 4
      src/jfw/modules/publicapply/src/enterpriseSearch/entity/entQuery.go
  87. 10 0
      src/jfw/modules/publicapply/src/filter/cookie.go
  88. 7 1
      src/jfw/modules/publicapply/src/go.mod
  89. 6 7
      src/jfw/modules/publicapply/src/go.sum
  90. 1 1
      src/jfw/modules/publicapply/src/npsValue/service/action.go
  91. 2 1
      src/jfw/modules/publicapply/src/oneclick/entity/entity.go
  92. 22 9
      src/jfw/modules/publicapply/src/subscribe/entity/entity.go
  93. 4 6
      src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go
  94. 34 23
      src/jfw/modules/publicapply/src/subscribePush/service/subscribe.go
  95. 57 21
      src/jfw/modules/publicapply/src/util/send.go
  96. 31 29
      src/jfw/modules/publicapply/src/util/userInfo.go
  97. 533 533
      src/jfw/modules/publicapply/src/util/util.go
  98. 2 0
      src/jfw/modules/subscribepay/src/a/init.go
  99. 4 2
      src/jfw/modules/subscribepay/src/config.json
  100. 2 0
      src/jfw/modules/subscribepay/src/config/config.go

+ 4 - 2
src/config.json

@@ -64,7 +64,8 @@
     "weChatUrl": "/jy_mobile/project/joined/list",
     "agencyInfo": "/jy_mobile/message/todoList?msgType=11",
     "report_analysis": "/jyapp/big/page/report_analysis?id=%s",
-    "subVipSetPage": "/front/vipsubscribe/toSubVipSetPage?vSwitch=v"
+    "subVipSetPage": "/front/vipsubscribe/toSubVipSetPage?vSwitch=v",
+    "aiSearch":"/jy_mobile/ai/search?from=wxmenu"
   },
   "jy_activeset": {
     "activitystartcode": "3201000000",
@@ -488,5 +489,6 @@
       "search": "建筑/环境",
       "code": "16"
     }
-  ]
+  ],
+  "levelCacheTime": 259200
 }

+ 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-20250225094323-2f6419d0d916
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.31.8
+	app.yhyue.com/moapp/jypkg v1.33.6
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.21
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/bwmarrin/snowflake v0.3.0

+ 2 - 2
src/go.sum

@@ -20,8 +20,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20250225094323-2f6419d0d916/go.mod h1:/HT/UZ4d
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 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.31.8 h1:nbdjgRCvtVLA/27lM9WqoNqhU1sIb7qcOO5WnxX3MGg=
-app.yhyue.com/moapp/jypkg v1.31.8/go.mod h1:bdHYv0sag7HhH89ft9nbOXHk21cNKes4xu1Ocpc021Y=
+app.yhyue.com/moapp/jypkg v1.33.5 h1:XVzoi4POBZ8Tprr9Sk/HSC0CB3WcbPFwMpuu0o3B4jI=
+app.yhyue.com/moapp/jypkg v1.33.5/go.mod h1:m/OMjugcf4XK5c/2mErxnXEyAZ+WNya8HP0x8jFGw4U=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 18 - 4
src/jfw/filter/phonefilter.go

@@ -46,10 +46,23 @@ func init() {
 }
 
 func (l *phoneFilter) Do() bool {
+	userId, _ := l.GetSession["mgoUserId"].(string)
 	if qu.Int64All(l.GetSession["positionType"]) == 1 {
 		return true
 	}
-	userId, _ := l.GetSession["mgoUserId"].(string)
+	//体验-绑定-标识
+	var (
+		phone, _   = l.GetSession["phone"].(string)
+		expBinding bool
+		//host       = l.R.Host
+	)
+	//if !strings.HasPrefix(host, ".") {
+	//	host = "." + host
+	//}
+	if phone == "" && qu.Int64All(l.GetSession["experience_binding"]) == 1 {
+		//jy.SetCookie(l.W, l.R, jy.ExperienceSign, "experiencing", host, 8*60*60)
+		expBinding = true
+	}
 	// 请求过滤
 	pass := func() bool {
 		if !initflag || l.R.Method == "POST" || userId == "" {
@@ -63,7 +76,6 @@ func (l *phoneFilter) Do() bool {
 			if (v.MatchString(l.R.URL.Path) || v.MatchString(l.R.URL.String())) && !strings.Contains(l.R.URL.Path, "bidedoc") && !strings.Contains(l.R.URL.Path, "squeeze") && !strings.Contains(l.R.URL.Path, "partner") {
 				return true
 			}
-
 		}
 		return false
 	}()
@@ -74,7 +86,7 @@ func (l *phoneFilter) Do() bool {
 	//是否需要跳转绑定手机号
 	needBindPhone := func() bool {
 		//绑定手机号判断
-		if phone := l.GetSession["phone"]; phone != nil && phone != "" {
+		if phone != "" {
 			return false
 		}
 		if person, sessionVal := jyutil.GetSessionVal(map[string]interface{}{"_id": mongodb.StringTOBsonId(qu.ObjToString(userId))}); len(sessionVal) > 0 && person != nil {
@@ -130,10 +142,12 @@ func (l *phoneFilter) Do() bool {
 		}
 		return false
 	}()
-
 	var href string
 	// 跳转绑定手机号页面
 	if needBindPhone {
+		if expBinding {
+			return expBinding
+		}
 		if mobileReg.MatchString(l.R.UserAgent()) {
 			href = "/front/account/phone/bind?mode=mergeBind&redirectTo=" + encodeURIComponent(l.R.URL.String())
 		} else {

+ 12 - 1
src/jfw/filter/wxUserSalesFilter.go

@@ -40,9 +40,20 @@ func (l *salesFilter) Do() bool {
 	if userAgent := l.R.UserAgent(); mobileReg.MatchString(userAgent) || public.CheckWxBrowser(l.R) {
 		href := "/jy_mobile/uersales/newuser" //wx判断是否需要留资
 		if uid := l.GetSession["userId"]; uid != nil && uid != "" {
-			data := jyutil.Compatible.Select(qu.InterfaceToStr(uid), `{"l_registedate":1,"app_first_login":1}`)
+			data := jyutil.Compatible.Select(qu.InterfaceToStr(uid), `{"l_registedate":1,"app_first_login":1,"experience_binding":1}`)
 			if data != nil && len(*data) > 0 {
 				if qu.Int64All((*data)["l_registedate"]) >= qu.Int64All(config.Seoconfig["appNewUserTime"]) && qu.IntAll((*data)["app_first_login"]) == 0 {
+					expBinding := qu.IntAll((*data)["experience_binding"])
+					if expBinding == 1 { //体验绑定手机号 用户标识
+						rd := time.Unix(qu.Int64All((*data)["l_registedate"]), 10)
+						nextDay := time.Date(rd.Year(), rd.Month(), rd.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, 1)
+						if time.Now().Sub(nextDay) > 0 { //用户注册当天  不进设置兴趣爱好页面
+							expBinding = 0
+						}
+					}
+					if expBinding > 0 {
+						return true
+					}
 					//设置cookie 前端跳转
 					SetCookie(l.R.URL.String(), int(time.Hour*24/time.Second), l.W)
 					http.Redirect(l.W, l.R, href, 302)

+ 37 - 24
src/jfw/front/commonPayPc.go

@@ -1,14 +1,16 @@
 package front
 
 import (
-	"fmt"
-	"jy/src/jfw/config"
-	"strings"
-	"time"
+    "app.yhyue.com/moapp/jypkg/public"
+    "fmt"
+    "github.com/gogf/gf/v2/util/gconv"
+    "jy/src/jfw/config"
+    "strings"
+    "time"
 
-	qutil "app.yhyue.com/moapp/jybase/common"
+    qutil "app.yhyue.com/moapp/jybase/common"
 
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+    "app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
 
 type JyOrder struct {
@@ -23,13 +25,13 @@ func init() {
 	xweb.AddAction(&JyOrder{})
 }
 
-//pc端详情页
+// pc端详情页
 func (this *JyOrder) OrderDetail(orderType, orderCode string) {
 	this.T["orderId"] = orderCode
 	this.Render(fmt.Sprintf("/order/pc/%s/detail.html", orderType))
 }
 
-//pc端订单支付页
+// pc端订单支付页
 func (this *JyOrder) OrderPay(orderType, orderCode string) error {
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	if userId == "" {
@@ -41,25 +43,36 @@ func (this *JyOrder) OrderPay(orderType, orderCode string) error {
 	return this.Render("/order/pc/orderPay.html")
 }
 
-//pc支付成功页面
+// pc支付成功页面
 func (this *JyOrder) PaySuccess(orderType, orderCode string) error {
-	userId := qutil.ObjToString(this.GetSession("userId"))
-	if userId == "" {
-		return this.Redirect("/notin/page")
-	}
-	this.T["payway"] = qutil.If(strings.Index(this.GetString("payway"), "wx") > -1, "微信", "支付宝")
-	this.T["email"] = this.GetString("email")
-	if payTime, err := this.GetInt("payTime"); err == nil {
-		this.T["payTime"] = time.Unix(payTime, 0).Format("2006年01月02日")
-	}
-	this.T["price"] = this.GetString("price")
-	this.T["shareid"] = "10"
-	this.T["orderType"] = orderType
-	this.T["orderCode"] = orderCode
-	return this.Render("/order/pc/paySuccess.html")
+    userId := qutil.ObjToString(this.GetSession("userId"))
+    if userId == "" {
+        return this.Redirect("/notin/page")
+    }
+    this.T["payway"] = qutil.If(strings.Index(this.GetString("payway"), "wx") > -1, "微信", "支付宝")
+    this.T["email"] = this.GetString("email")
+    if payTime, err := this.GetInt("payTime"); err == nil {
+        this.T["payTime"] = time.Unix(payTime, 0).Format("2006年01月02日")
+    }
+    positionType := gconv.String(this.GetSession("positionType"))
+    this.T["price"] = this.GetString("price")
+    this.T["shareid"] = "10"
+    this.T["positionType"] = positionType
+    this.T["orderType"] = orderType
+    this.T["orderCode"] = orderCode
+    //订单详情查询
+    data := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
+        "order_code": orderCode,
+    }, "vip_type", "")
+    vipType := int64(0)
+    if data != nil && len(*data) > 0 {
+        vipType = gconv.Int64((*data)["vip_type"])
+    }
+    this.T["vipType"] = vipType
+    return this.Render("/order/pc/paySuccess.html")
 }
 
-//我的订单
+// 我的订单
 func (this *JyOrder) ToMyOrder() error {
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	if userId == "" {

+ 27 - 10
src/jfw/front/commonPayWx.go

@@ -3,7 +3,8 @@ package front
 import (
 	"errors"
 	"fmt"
-	"jy/src/jfw/config"
+    "github.com/gogf/gf/v2/util/gconv"
+    "jy/src/jfw/config"
 	"jy/src/jfw/wx"
 	"net/url"
 
@@ -83,15 +84,31 @@ func (w *WxPayCommon) PaySuccess(doType string) error {
 	w.T["title"] = "支付"
 	titleArr, exist := titleMap[doType]
 	if exist && t < len(titleArr) {
-		w.T["title"] = titleArr[t]
-	}
-	if doType == "dataexport" { //数据导出支付成功
-		return w.Render("/weixin/dataExport/dataExport_paySuccess.html", &w.T)
-	} else if doType == "subvip" { //vip订阅支付成功
-		return w.Render("/weixin/vipsubscribe/vip_pay_success.html")
-	}
-	w.T["doType"] = doType
-	return w.Render("/weixin/commonPay/paySuccess.html", &w.T)
+        w.T["title"] = titleArr[t]
+    }
+    productType := ""
+    if doType == "subvip" {
+        productType = "VIP订阅"
+    }
+    sessVal := w.Session().GetMultiple()
+    positionType := gconv.String(sessVal["positionType"])
+    w.T["productType"] = productType
+    w.T["positionType"] = positionType
+    data := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
+        "order_code": w.GetString("orderCode"),
+    }, "vip_type", "")
+    vipType := int64(0)
+    if data != nil && len(*data) > 0 {
+        vipType = gconv.Int64((*data)["vip_type"])
+    }
+    w.T["vipType"] = vipType
+    if doType == "dataexport" { //数据导出支付成功
+        return w.Render("/weixin/dataExport/dataExport_paySuccess.html", &w.T)
+    } else if doType == "subvip" { //vip订阅支付成功
+        return w.Render("/weixin/vipsubscribe/vip_pay_success.html")
+    }
+    w.T["doType"] = doType
+    return w.Render("/weixin/commonPay/paySuccess.html", &w.T)
 }
 
 func (w *WxPayCommon) ToMyWxOrder() error {

+ 1 - 1
src/jfw/front/dataExport.go

@@ -721,7 +721,7 @@ func (d *DataExport) ToCreateOrderPage(_id string) error {
 
 	if resEmail == "" || resPhone == "" {
 		lastEmail, lastPhone := "", ""
-		if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId, util.ObjToString(sessVal["entUserId"])); lastPhone == "" || lastEmail == "" {
+		if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId); lastPhone == "" || lastEmail == "" {
 			userData := jyutil.Compatible.Select(userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
 			if userData != nil && len(*userData) > 0 {
 				if lastEmail == "" {

+ 14 - 13
src/jfw/front/front.go

@@ -969,25 +969,26 @@ func (m *Front) Sess(ostr string) error {
 				}
 			}
 			if actionurl != "" {
-				//绑定手机号 跳转
-				if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); flag { //开关是否开启
-					//action走的nginx配置,需要单独在sess中判断
-					for k, v := range config.PhoneFilterConfig["sessUrl"].(map[string]interface{}) {
-						if strings.Contains(actionurl, k) {
-							uid, _ := m.GetSession("userId").(string)
-							if NeedBind(uid) {
-								if mobileReg.MatchString(m.UserAgent()) {
-									redirectTo := actionurl
-									if util.ObjToString(v) != "" {
-										redirectTo = util.ObjToString(v)
+				if util.Int64All(m.GetSession("experience_binding")) != 1 {
+					//绑定手机号 跳转
+					if flag, _ := config.Sysconfig["phoneFilterFlag"].(bool); flag { //开关是否开启
+						//action走的nginx配置,需要单独在sess中判断
+						for k, v := range config.PhoneFilterConfig["sessUrl"].(map[string]interface{}) {
+							if strings.Contains(actionurl, k) {
+								uid, _ := m.GetSession("userId").(string)
+								if NeedBind(uid) {
+									if mobileReg.MatchString(m.UserAgent()) {
+										redirectTo := actionurl
+										if util.ObjToString(v) != "" {
+											redirectTo = util.ObjToString(v)
+										}
+										actionurl = bindUrl + "&redirectTo=" + encodeURIComponent(redirectTo)
 									}
-									actionurl = bindUrl + "&redirectTo=" + encodeURIComponent(redirectTo)
 								}
 							}
 						}
 					}
 				}
-
 				//工作桌面内嵌 塞斯 PC
 				if !mobileReg.MatchString(m.UserAgent()) && !strings.Contains(actionurl, "page_workDesktop") && strings.Contains(actionurl, "/succbi/crm_system/") {
 					return m.Redirect(fmt.Sprintf("%s%s%s", strings.ReplaceAll(config.Sysconfig["workDesktopUrl"].(string), "aside=0&", ""), config.Sysconfig["webdomain"].(string), url.QueryEscape(actionurl)))

+ 15 - 13
src/jfw/front/login.go

@@ -220,19 +220,20 @@ func (l *Login) Login() error {
 					}
 					_id := mongodb.Save("user", data)
 					if _id != "" {
-						redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
-						//用户日志保存
-						go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", source, "", gconv.String(l.GetSession("RSource")), gconv.String(sessVal["RSource"]), qutil.GetIp(l.Request), l.UserAgent(), "jybx", "")
-						jy.ClearPhoneIdentSession(l.Session())
-						ok, _, userInfo := afterLogin(l.Request, phone, l.Session(), false)
-						userInfo["isNewUser"] = true
-						nsqPath, _ := config.Sysconfig["nsq"].(string)
-						nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
-						er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2, nil)
-						if er != nil {
-							log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
-						}
-						if ok {
+                        redis.Del("limitation", fmt.Sprintf("firstVisitTagByWX_%s", l.Session().Id()))
+                        //用户日志保存
+                        referer := l.Refer()
+                        go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", source, "", gconv.String(l.GetSession("RSource")), gconv.String(sessVal["RSource"]), qutil.GetIp(l.Request), l.UserAgent(), "jybx", "", referer)
+                        jy.ClearPhoneIdentSession(l.Session())
+                        ok, _, userInfo := afterLogin(l.Request, phone, l.Session(), false)
+                        userInfo["isNewUser"] = true
+                        nsqPath, _ := config.Sysconfig["nsq"].(string)
+                        nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
+                        er := jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, jy.Jypc_phone_register, _id, jy.Jyweb_node2, nil)
+                        if er != nil {
+                            log.Println("nsq队列写入失败-->", jy.Jypc_phone_register, _id)
+                        }
+                        if ok {
 							sessVal = l.Session().GetMultiple()
 							result["userInfo"] = userInfo
 							go anonymousLogin(l.Session(), l.Cookie("JYTrustedId"))
@@ -368,6 +369,7 @@ func (l *Login) ForgetPwd() error {
 			//if l.GetSession("identCodeValue") == nil || l.GetString("identCode") != l.GetSession("identCodeValue") { //验证码不正确
 			//	return "identCodeError"
 			//}
+			l.SetSession("identCodeKey", phone)
 			l.SetSession("forgetPwdStep", "2")
 			return "y"
 		} else if reqType == "save" {

+ 12 - 11
src/jfw/front/org_structure.go

@@ -197,17 +197,18 @@ func (this *OrgStructure) AutoLogon() error {
 			}); resp != nil && resp.Data.Id > 0 {
 				data["base_user_id"] = resp.Data.Id
 				if id := mongodb.Save("user", data); id != "" {
-					go jy.SaveUserLog(public.Mgo_Log, id, openId, "wx", "pc", source, openId, gconv.String(this.GetSession("RSource")), gconv.String(this.GetSession("RSource")), util.GetIp(this.Request), this.UserAgent(), "jybx", "")
-					nsqPath, _ := config.Sysconfig["nsq"].(string)
-					nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
-					jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", id, jy.Jyweb_node2, map[string]interface{}{
-						"code":       1007,
-						"types":      "bindPhone",
-						"num":        50,
-						"baseUserId": resp.Data.Id,
-						"positionId": this.GetSession("positionId"),
-					})
-					if mail != "" {
+                    referer := this.Refer()
+                    go jy.SaveUserLog(public.Mgo_Log, id, openId, "wx", "pc", source, openId, gconv.String(this.GetSession("RSource")), gconv.String(this.GetSession("RSource")), util.GetIp(this.Request), this.UserAgent(), "jybx", "", referer)
+                    nsqPath, _ := config.Sysconfig["nsq"].(string)
+                    nsq_topic, _ := config.Sysconfig["nsq_topic"].(string)
+                    jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", id, jy.Jyweb_node2, map[string]interface{}{
+                        "code":       1007,
+                        "types":      "bindPhone",
+                        "num":        50,
+                        "baseUserId": resp.Data.Id,
+                        "positionId": this.GetSession("positionId"),
+                    })
+                    if mail != "" {
 						jy.Publish(public.Mgo_Log, nsqPath, nsq_topic, "task", id, jy.Jyweb_node2, map[string]interface{}{
 							"code":       1009,
 							"types":      "bindMail",

+ 6 - 5
src/jfw/front/otherAct.go

@@ -154,11 +154,12 @@ func (f *Front) Lpsubmit() error {
 			}
 			_id := mongodb.Save("user", data)
 			if _id != "" {
-				//用户日志保存
-				go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "landPage", "", gconv.String(f.GetSession("RSource")), util.ObjToString(f.GetSession("RSource")), util.GetIp(f.Request), f.UserAgent(), "jybx", "")
-				deleteIdentSession(f.Session())
-				return "y"
-			}
+                //用户日志保存
+                referer := f.Refer()
+                go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "landPage", "", gconv.String(f.GetSession("RSource")), util.ObjToString(f.GetSession("RSource")), util.GetIp(f.Request), f.UserAgent(), "jybx", "", referer)
+                deleteIdentSession(f.Session())
+                return "y"
+            }
 			return "saveError"
 		}()
 	}

+ 8 - 7
src/jfw/front/pchelper.go

@@ -154,13 +154,14 @@ func (l *PcHelper) Login() error {
 						}
 						_id := mongodb.Save("user", data)
 						if _id != "" {
-							go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "pc", "", gconv.String(l.GetSession("RSource")), gconv.String(l.GetSession("RSource")), util.GetIp(l.Request), l.UserAgent(), "jybx", "")
-							jy.ClearPhoneIdentSession(l.Session())
-							reToken = getUToken(mac, phone)
-							reOpenId = phone
-							reNickname = phone
-							return 1
-						}
+                            referer := l.Refer()
+                            go jy.SaveUserLog(public.Mgo_Log, _id, phone, "phone", "pc", "pc", "", gconv.String(l.GetSession("RSource")), gconv.String(l.GetSession("RSource")), util.GetIp(l.Request), l.UserAgent(), "jybx", "", referer)
+                            jy.ClearPhoneIdentSession(l.Session())
+                            reToken = getUToken(mac, phone)
+                            reOpenId = phone
+                            reNickname = phone
+                            return 1
+                        }
 					} else {
 						updataMap := map[string]interface{}{}
 						if (*datas)[0]["s_m_phone"] != nil {

+ 2 - 2
src/jfw/front/searchOptimize.go

@@ -292,7 +292,7 @@ func (so *SearchOptimize) GetSearchKeyWordsQueryStr() string {
 	if so.KeyWords != "" {
 		if so.SearchMode == 1 {
 			if ikWords := jy.HttpEs(so.KeyWords, "ik_smart", pc.DbConf.Elasticsearch.Main.Address); ikWords != "" {
-				so.KeyWords = jy.KeywordsProcessing(strings.ReplaceAll(ikWords, "+", " "), " ")
+				so.KeyWords = jy.KeywordsProcessing(strings.ReplaceAll(ikWords, "+", " "), so.KeyWords, " ")
 			}
 		}
 		searchWords = append(searchWords, so.KeyWords)
@@ -305,7 +305,7 @@ func (so *SearchOptimize) GetSearchKeyWordsQueryStr() string {
 			)
 			for _, awv := range strings.Split(so.AdditionalWords, ",") {
 				if ikWords := jy.HttpEs(awv, "ik_smart", pc.DbConf.Elasticsearch.Main.Address); ikWords != "" {
-					addWords = append(addWords, jy.KeywordsProcessing(strings.ReplaceAll(ikWords, "+", " "), " "))
+					addWords = append(addWords, jy.KeywordsProcessing(strings.ReplaceAll(ikWords, "+", " "), awv, " "))
 				}
 			}
 			if len(addWords) > 0 {

+ 5 - 1
src/jfw/front/shorturl.go

@@ -141,6 +141,9 @@ func (s *Short) Article(stype, id string) error {
 	sess := s.Session().GetMultiple()
 	//未登录用户是否访问的微信浏览器
 	userId, _ := sess["userId"].(string)
+	if strings.Contains(id, "/") {
+		id = url.QueryEscape(id)
+	}
 	if userId == "" {
 		if IsWxBrowserContent[stype] {
 			if s.GetString("state") == "wx" {
@@ -152,10 +155,11 @@ func (s *Short) Article(stype, id string) error {
 							//生session后 重新获取一下
 							//userId, _ = s.GetSession("userId").(string)
 							sess = s.Session().GetMultiple()
+							experienceBinding := util.Int64All(sess["experience_binding"])
 							userId, _ = sess["userId"].(string)
 							//新关注微信公众号用户是否绑定手机号
 							phone, ok := sess["phone"].(string)
-							if ok && phone == "" {
+							if ok && phone == "" && experienceBinding != 1 { //微信用户 体验绑定手机号
 								//注册时间
 								regTime := util.Int64All(s.GetSession("registedate"))
 								//新用户时间

+ 47 - 0
src/jfw/front/singleLogin.go

@@ -1,7 +1,9 @@
 package front
 
 import (
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
 	"jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
 	"log"
@@ -27,6 +29,7 @@ type SingleLogin struct {
 	singleLogin xweb.Mapper `xweb:"/swordfish/SingleLogin"` //微信登录中转
 	shortUrl    xweb.Mapper `xweb:"/stl/(.*)"`              //短地址跳转
 	keyPhrases  xweb.Mapper `xweb:"/kph/(.*)"`              //微信自动回复关键字组
+	vipGiftUrl  xweb.Mapper `xweb:"/vipGiftUrl/(.*)"`       //告知页面跳转链接
 }
 
 func init() {
@@ -39,6 +42,50 @@ const (
 	setPage = "/front/vipsubscribe/toSubVipSetPage?vSwitch=%s"
 )
 
+// 709vip赠送  告知页面跳转
+func (this *SingleLogin) VipGiftUrl(key string) error {
+	var redirectUrl = ""
+	isSubscribe := false
+	chatIdInt := gconv.Int64(encrypt.SE.Decode4HexByCheck(key))
+	isWxB := public.CheckWxBrowser(this.Request)
+	sess := this.Session().GetMultiple()
+	userId, _ := sess["userId"].(string)
+	openid := ""
+	log.Println("1111", key, chatIdInt, isWxB, userId)
+	if isWxB && userId == "" {
+		if this.GetString("state") == "wx" {
+			//微信跳回来的
+			if code := this.GetString("code"); code != "" {
+				openid = jyutil.Getopenid(code)
+				if CheckUserIsSubscribe(openid) {
+					FindUserAndCreateSess(openid, this.Session(), "wx", false, true)
+					//生session后 重新获取一下
+					sess = this.Session().GetMultiple()
+					userId, _ = sess["userId"].(string)
+				}
+			}
+		} else {
+			//所有参数都不再使用,跳到微信验证用户
+			log.Println(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"))
+			return this.Redirect(fmt.Sprintf(config.Wxoauth, url.QueryEscape(this.Site()+this.Url()), "wx"), 302)
+		}
+	}
+	if key != "" && chatIdInt > 0 {
+		openid = qutil.InterfaceToStr(this.GetSession("s_m_openid"))
+		//查看是否关注公众号
+		log.Println("VIP订阅赠送", key, chatIdInt, openid)
+		if openid == "" || (openid != "" && !CheckUserIsSubscribe(openid)) {
+			//没有关注  跳转关注页面
+		} else {
+			isSubscribe = true
+		}
+		redirectUrl = fmt.Sprintf("/jy_mobile/giving/share?isSubscribe=%v&giftId=%s", isSubscribe, key)
+	} else {
+		redirectUrl = "/swordfish/about"
+	}
+	return this.Redirect(redirectUrl)
+}
+
 // P506 关键词组 短地址跳转
 func (this *SingleLogin) KeyPhrases(key string) error {
 	defer qutil.Catch()

+ 1 - 1
src/jfw/front/tags.go

@@ -513,7 +513,7 @@ func (this *Tags) GetNewBidInfo() (list []map[string]interface{}) {
 	}
 	var bidInfosToCache = func(list []map[string]interface{}) {
 		redis.Put("seoCache", redisKey, list, cacheTime)
-		ok := redis.Put("seoCache", redisKeySL, list, -1)
+		ok := redis.Put("seoCache", redisKeySL, list, qu.IntAll(config.Sysconfig["levelCacheTime"]))
 		log.Println(redisKeySL, "--00--", ok)
 	}
 	list = bidInfosByCache(redisKey)

+ 1 - 1
src/jfw/front/ws_dataExport.go

@@ -320,7 +320,7 @@ func (w *WsDataExport) SubmitOrder() error {
 
 	if resEmail == "" || resPhone == "" {
 		lastEmail, lastPhone := "", ""
-		if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId, util.ObjToString(w.GetSession("entUserId"))); lastPhone == "" || lastEmail == "" {
+		if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId); lastPhone == "" || lastEmail == "" {
 			userData := jyutil.Compatible.Select(userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
 			if userData != nil && len(*userData) > 0 {
 				if lastEmail == "" {

+ 2 - 1
src/jfw/jyutil/jyutil.go

@@ -132,7 +132,7 @@ func Getopenid(code string) (openid string) {
 }
 
 func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[string]interface{}) {
-	person, ok := public.MQFW.FindOneByField("user", q, `{"_id":1,"i_shareknow":1,"s_m_openid":1,"s_nickname":1,"s_headimage":1,"s_headimageurl":1,"s_phone":1,"s_m_phone":1,"l_registedate":1,"i_ispush":1,"i_unlimited":1,"s_jyname":1,"base_user_id":1}`)
+	person, ok := public.MQFW.FindOneByField("user", q, `{"_id":1,"i_shareknow":1,"s_m_openid":1,"s_nickname":1,"s_headimage":1,"s_headimageurl":1,"s_phone":1,"s_m_phone":1,"l_registedate":1,"i_ispush":1,"i_unlimited":1,"s_jyname":1,"base_user_id":1,"experience_binding":1}`)
 	sessionVal := make(map[string]interface{})
 	if !ok || person == nil || len(*person) == 0 {
 		return nil, sessionVal
@@ -166,6 +166,7 @@ func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[strin
 		phone = util.ObjToString((*person)["s_m_phone"])
 	}
 	sessionVal["phone"] = phone
+	sessionVal["experience_binding"] = util.IntAll((*person)["experience_binding"]) //体验-绑定-手机号
 	sessionVal["i_unlimited"] = util.IntAll((*person)["i_unlimited"])
 	sessionVal["base_user_id"] = util.IntAll((*person)["base_user_id"])   //用户中台的uid
 	sessionVal["registedate"] = util.Int64All((*person)["l_registedate"]) //注册时间

+ 19 - 2
src/jfw/modules/app/src/app/filter/phonefilter.go

@@ -41,10 +41,23 @@ func init() {
 }
 
 func (l *phoneFilter) Do() bool {
+	userId, _ := l.GetSession["mgoUserId"].(string)
 	if qu.Int64All(l.GetSession["positionType"]) == 1 {
 		return true
 	}
-	userId, _ := l.GetSession["mgoUserId"].(string)
+	//体验-绑定-标识
+	var (
+		phone, _   = l.GetSession["phone"].(string)
+		expBinding bool
+		//host       = l.R.Host
+	)
+	//if !strings.HasPrefix(host, ".") {
+	//	host = "." + host
+	//}
+	if phone == "" && qu.Int64All(l.GetSession["experience_binding"]) == 1 {
+		//jy.SetCookie(l.W, l.R, jy.ExperienceSign, "experiencing", host, 8*60*60)
+		expBinding = true
+	}
 	// 请求过滤
 	pass := func() bool {
 		if !initflag || l.R.Method == "POST" || userId == "" {
@@ -63,10 +76,11 @@ func (l *phoneFilter) Do() bool {
 	if pass {
 		return true
 	}
+
 	isNewUser := false
 	//是否需要跳转绑定手机号
 	needBindPhone := func() bool {
-		if phone := l.GetSession["phone"]; phone != nil && phone != "" {
+		if phone != "" {
 			return false
 		}
 		if person := utils.Compatible.Select(userId, `{"s_phone":1,"s_m_phone":1,"l_registedate":1}`); person != nil {
@@ -120,6 +134,9 @@ func (l *phoneFilter) Do() bool {
 	}()
 	var href string
 	if needBindPhone {
+		if expBinding {
+			return expBinding
+		}
 		href = "/jyapp/account/phone/bind?mode=mergeBind"
 		if isNewUser {
 			href += "&act=logout"

+ 10 - 4
src/jfw/modules/app/src/app/front/accountPage.go

@@ -1,11 +1,12 @@
 package front
 
 import (
-	"fmt"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"fmt"
+	"net/http"
 )
 
-//用户账户前端路由
+// 用户账户前端路由
 type AccountPage struct {
 	*xweb.Action
 	privacy     xweb.Mapper `xweb:"/jyapp/free/privacy"`     //隐私协议
@@ -33,8 +34,13 @@ func (this *AccountPage) AuthCheck() {
 	this.Render("/me/account/auth_check.html")
 }
 
-func (this *AccountPage) Phone(page string) {
-	this.Render(fmt.Sprintf("/me/account/phone_%s.html", page))
+func (this *AccountPage) Phone(page string) error {
+	sessVal := this.Session().GetMultiple()
+	phone, _ := sessVal["phone"].(string)
+	if phone != "" && page == "bind" && this.Refer() != "" {
+		return this.Redirect(this.Refer(), http.StatusFound)
+	}
+	return this.Render(fmt.Sprintf("/me/account/phone_%s.html", page))
 }
 
 func (this *AccountPage) Mail(page string) {

+ 19 - 0
src/jfw/modules/app/src/app/front/commonPay.go

@@ -1,8 +1,10 @@
 package front
 
 import (
+	"app.yhyue.com/moapp/jypkg/public"
 	"errors"
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
 	"strings"
 
 	util "app.yhyue.com/moapp/jybase/common"
@@ -85,12 +87,29 @@ func (w *AppPayCommon) PaySuccess(doType string) error {
 	if exist && t < len(titleArr) {
 		w.T["title"] = titleArr[t]
 	}
+	productType := ""
+	if doType == "subvip" {
+		productType = "VIP订阅"
+	}
+	sessVal := w.Session().GetMultiple()
+	positionType := gconv.String(sessVal["positionType"])
+	w.T["productType"] = productType
+	w.T["positionType"] = positionType
+	data := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
+		"order_code": w.GetString("orderCode"),
+	}, "vip_type", "")
+	vipType := int64(0)
+	if data != nil && len(*data) > 0 {
+		vipType = gconv.Int64((*data)["vip_type"])
+	}
+	w.T["vipType"] = vipType
 	if doType == "dataexport" { //数据导出支付成功页面
 		return w.Render("/dataExport/dataExport_paySuccess.html", &w.T)
 	} else if doType == "subvip" { //vip订阅支付成功
 		return w.Render("/vipsubscribe/vip_pay_success.html")
 	}
 	w.T["doType"] = doType
+
 	return w.Render("/commonPay/paySuccess.html", &w.T)
 }
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 573 - 570
src/jfw/modules/app/src/app/front/login.go


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

@@ -923,6 +923,11 @@ func (s *Short) TransitRoute(key string) error {
 			if util.ObjToString(shortUrl["href"]) != "" && util.ObjToString(s.GetSession("userId")) == "" {
 				redirectUrl = util.ObjToString(shortUrl["href"])
 			}
+			go func(pageLabel string) {
+				if ui := public.Mysql.UpdateOrDeleteBySql(`update short_url SET visits=visits+1 WHERE mold = 1 AND code = ?;`, pageLabel); ui <= 0 {
+					log.Println("update short_url visits false ,source:", pageLabel)
+				}
+			}(key)
 		}
 
 		//未登录

+ 1 - 1
src/jfw/modules/app/src/app/front/ws_dataExport.go

@@ -296,7 +296,7 @@ func (w *WsDataExport) ToCreateOrderPage() error {
 
 	if resEmail == "" || resPhone == "" {
 		lastEmail, lastPhone := "", ""
-		if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId, util.ObjToString(w.GetSession("entUserId"))); lastPhone == "" || lastEmail == "" {
+		if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId); lastPhone == "" || lastEmail == "" {
 			userData := utils.Compatible.Select(userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
 			if userData != nil && len(*userData) > 0 {
 				if lastEmail == "" {

+ 3 - 6
src/jfw/modules/app/src/config.yaml

@@ -1,17 +1,14 @@
 etcd:
   hosts:
-    - 172.31.31.203:2379
-  #- 192.168.3.165:2379
-  #- 192.168.3.204:2379
+  - 172.31.31.203:2379
 userCenterKey: "usercenter.rpc" #用户中台rpc
 powerCheckCenterKey: "powercheck.rpc" #权益校验中台
 entManageApplication: "entmanageapplication.rpc" #企业管理中台
-
-GuideRegistedate: 1734451200  #该时间之前注册的付费用户不用进订阅向导
-
 miniprogram:
   jyzbw:
     name: "剑鱼招标网"
     appid: "wx37f06c38292f7d82"
     appsecret: "f7dba667a47b4b10c1f581e3de46d0d3"
 wxTokenRpc: "172.17.162.29:1166"
+GuideRegistedate: 1735034400  #该时间之前注册的付费用户不用进订阅向导
+experienceRatio: 2

+ 1 - 3
src/jfw/modules/app/src/go.mod

@@ -5,7 +5,7 @@ go 1.20
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20250225094323-2f6419d0d916
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.31.8
+	app.yhyue.com/moapp/jypkg v1.33.5
 	bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20231226074509-942d80dc34eb
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.21
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
@@ -14,8 +14,6 @@ require (
 	go.mongodb.org/mongo-driver v1.14.0
 )
 
-replace github.com/go-xorm/xorm v0.7.9 => gitea.com/xorm/xorm v0.7.9
-
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230304035551-21bb1eedf547 // indirect

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

@@ -22,8 +22,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20250225094323-2f6419d0d916/go.mod h1:/HT/UZ4d
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 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.31.8 h1:nbdjgRCvtVLA/27lM9WqoNqhU1sIb7qcOO5WnxX3MGg=
-app.yhyue.com/moapp/jypkg v1.31.8/go.mod h1:bdHYv0sag7HhH89ft9nbOXHk21cNKes4xu1Ocpc021Y=
+app.yhyue.com/moapp/jypkg v1.33.5 h1:XVzoi4POBZ8Tprr9Sk/HSC0CB3WcbPFwMpuu0o3B4jI=
+app.yhyue.com/moapp/jypkg v1.33.5/go.mod h1:m/OMjugcf4XK5c/2mErxnXEyAZ+WNya8HP0x8jFGw4U=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 75 - 6
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -1,3 +1,6 @@
+try {
+  Vue.use(TestBindPhone)
+} catch (error) {}
 var vNode = {
   delimiters: ['${', '}'],
   el: '#ent-portrait',
@@ -343,7 +346,7 @@ var vNode = {
       var info = this.powerInfo
       var isNoMember = info.memberStatus <= 0
       var isOldVip = info.vipStatus > 0 && !info.viper
-      var isNewVip = info.vipStatus > 0 && info.viper && !this.surplus
+      var isNewVip = info.vipStatus > 0 && info.viper && !this.surplus && !this.entvisit.visited
       var isNotAll = this.entvisit.provin !== -1
       return (isOldVip || (isNewVip && isNotAll)) && isNoMember
     },
@@ -441,7 +444,7 @@ var vNode = {
             const filterSelect = _this.groupingList.filter(item => !!item.isSelect)
             const selectList = filterSelect.map(item => item.s_name) || ['默认分组']
             _this.$refs.portrayalGrouping.setState(selectList)
-            
+
           } else {
             if(!res?.data?.status) {
                 // 监控达到上限
@@ -930,7 +933,7 @@ var vNode = {
     },
     changeGroupState: function (type) {
       console.log(type);
-      this.getEntGroupListData() 
+      this.getEntGroupListData()
       this.$nextTick(() => {
         this.setGroupState = type
         this.showGroupingDialog = true
@@ -996,7 +999,7 @@ var vNode = {
         } else {
           _this.changeFollowStateRequest()
         }
-        
+
       } else {
         this.getEntFollowState((res) => {
           const { surplus, used } = res.info
@@ -1245,13 +1248,13 @@ var vNode = {
                   //  展开监控菜单 active:3
                   window.location.href = location.origin + '/jy_mobile/push/pushsetting?active=' + active
                 })
-        
+
               } else if(res.data.msg_open && res.data.status){
                 _this.$toast({
                   duration: 2000,
                   message: '监控成功,您可前往“工作台-商机-企业情报监控”查看'
                 })
-        
+
               }
             } else {
               return _this.showToast(res.error_msg || '监控失败')
@@ -1937,6 +1940,72 @@ var vNode = {
         }
       }
       this.isOneRow = isOneRow
+    },
+    bindPhoneDataExport: function() {
+      var _this = this
+      return {
+        props: {
+          name: '企业画像-中标动态数据导出'
+        },
+        next: function() {
+          _this.onExport()
+        }
+      }
+    },
+    bindPhoneAddKeep: function(item) {
+      var _this = this
+      return {
+        props: {
+          name: '企业画像-中标动态收藏'
+        },
+        next: function() {
+          _this.addKeepStatus(item)
+        }
+      }
+    },
+    bindPhoneUnlock: function() {
+      var _this = this
+      return {
+        props: {
+          name: '企业画像-工商信息解锁查看'
+        },
+        next: function() {
+          _this.goToUnlock()
+        }
+      }
+    },
+    bindPhoneEntHistory: function() {
+      var _this = this
+      return {
+        props: {
+          name: '企业画像-工商变动'
+        },
+        next: function() {
+          _this.goToEntHistory()
+        }
+      }
+    },
+    bindPhoneGoGiveAnalysis: function() {
+      var _this = this
+      return {
+        props: {
+          name: '企业画像- 免费赠送1次【企业中标分析】权益体验机会!-去解锁'
+        },
+        next: function() {
+          _this.goGiveAnalysis()
+        }
+      } 
+    },
+    bindPhoneDtTextClick: function(type) {
+      var _this = this
+      return {
+        props: {
+          name: '企业画像-开通超级订阅'
+        },
+        next: function () {
+          _this.onDtTextClick(type)
+        }
+      }
     }
   }
 }

+ 55 - 0
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/unit_portrayal.js

@@ -1,5 +1,8 @@
 // var hotChart = null;
 // var pieChart = null;
+try {
+  Vue.use(TestBindPhone)
+} catch (error) {}
 var vNode = {
   delimiters: ['${', '}'],
   el: '#unit_portrayal',
@@ -2077,6 +2080,58 @@ var vNode = {
       } else if (type === 'buy') {
         location.href = '/jy_mobile/common/order/create/svip?type=buy'
       }
+    },
+    bindPhoneDataExport: function() {
+      var _this = this
+      var pass = !this.isLogin ? function () {
+        window.location.href = "/jyapp/free/login?to=back";
+      } : null
+      return {
+        props: {
+          name: '采购单位画像-招标动态数据导出'
+        },
+        pass: pass,
+        next: function () {
+          _this.onExport()
+        }
+      }
+    },
+    bindPhoneAddKeep: function (item) {
+      var _this = this
+      var pass =!this.isLogin ? function () {
+        window.location.href = "/jyapp/free/login?to=back"; 
+      } : null
+      return {
+        props: {
+          name: '采购单位画像-招标动态收藏'
+        },
+        pass: pass,
+        next: function () {
+          _this.addKeepStatus(item)
+        }
+      }
+    },
+    bindPhoneGoGiveAnalysis: function() {
+      var _this = this
+      return {
+        props: {
+          name: '采购单位画像- 免费赠送1次【采购单位全景分析】权益体验机会!-去解锁'
+        },
+        next: function () {
+          _this.goGiveAnalysis()
+        }
+      }
+    },
+    bindPhoneDtTextClick: function(type) {
+      var _this = this
+      return {
+        props: {
+          name: '采购单位画像-开通超级订阅'
+        },
+        next: function () {
+          _this.onDtTextClick(type)
+        }
+      }
     }
   }
 }

+ 5 - 4
src/jfw/modules/app/src/web/staticres/jyapp/js/common.js

@@ -990,7 +990,7 @@ $(function () {
   }
   if (isIphoneX()) {
     // $(".app-layout-header").css("padding-top"," 40px");//标题
-    $(".app-back.jyapp-icon.jyapp-icon-zuojiantou").css("padding-top", " 40px");//返回
+    // $(".app-back.jyapp-icon.jyapp-icon-zuojiantou").css("padding-top", " 40px");//返回
     $(".header-share").css("padding-top", " 40px");//分享
     // $(".app-layout-content-a, .app-layout-content-b").css("top","64px");//正文
     $(".feedback-nav").css("top", "85px");//意见反馈
@@ -1628,18 +1628,19 @@ function checkNeedGoNewUserSettingPage () {
  * @returns {*}
  */
 function checkNeedGoBindPhonePage () {
-  var userPhone
+  let userPhone,expBinding;
   $.ajax({
     url: "/jypay/user/getAccountInfo?t=" + Date.now(),
     type: "GET",
     async: false,
     success: function(res){
-      if(res.error_code == 0 && res.data){
+      if(res.error_code === 0 && res.data){
         userPhone = res.data.phone;
+        expBinding = res.data.expBinding
       }
     }
   })
-  if (!userPhone) {
+  if (!userPhone&&expBinding===0) {
     locationReplace('/jyapp/account/phone/bind?mode=mergeBind&act=logout')
     return true
   }

+ 6 - 2
src/jfw/modules/app/src/web/staticres/jyapp/me/js/phone_bind.js

@@ -271,7 +271,9 @@ var vm = new Vue({
             var data = {
                 phone: _this.info.phone,
                 code: _this.info.picCode,
-                step: 1
+                step: 1,
+                from: utils.getParam('from'),
+                activity: utils.getParam('activity')
             }
             this.trackClick('绑定-发送验证码')
             $.ajax({
@@ -354,7 +356,9 @@ var vm = new Vue({
                 phone: this.info.phone,
                 code: this.info.code,
                 step: 2,
-                email: this.info.email
+                email: this.info.email,
+                from: utils.getParam('from'),
+                activity: utils.getParam('activity')
             }
 
             if (this.mode === 'mergeBind') {

+ 215 - 2
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/css/vip_introduce.css

@@ -34,7 +34,6 @@ html,body {
 }
 
 .j-header {
-  position: absolute;
   width: 100%;
   display: flex;
   align-items: center;
@@ -115,7 +114,7 @@ html,body {
 .vip_introduce {
   width: 100%;
   height: 100%;
-  overflow: hidden;
+  overflow-y: scroll;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
@@ -515,3 +514,217 @@ body .j-container {
   padding-bottom: 0;
   margin-bottom: -1.8rem;
 }
+/* new */
+.vip_introduce .landing-banner{
+  position: relative;
+}
+
+.vip_introduce .statistic-info{
+  position: absolute;
+  bottom: .56rem;
+  left: .24rem;
+  right: .24rem;
+  width: calc(100% - .56rem);
+  display: flex;
+  align-items: center;
+  padding: .2rem 0;
+  border-radius: .24rem;
+  background: linear-gradient(rgba(255, 249, 238, 1), rgba(255, 255, 255, 1));
+  box-shadow: 0px 6px 24px 0px rgba(128, 65, 2, 0.1);
+}
+.vip_introduce .statistic-item{
+  width: 33.33%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+.vip_introduce .statistic-item:not(:last-child) {
+  border-right: 1px solid#ececec;
+}
+.vip_introduce .statistic-item .item-count{
+  font-size: .4rem;
+  line-height: .48rem;
+  font-weight: bold;
+  color: rgba(177, 112, 14, 1);
+}
+.vip_introduce .statistic-item p{
+  margin-top: .12rem;
+  color:#1d1d1d;
+  font-size: .24rem;
+  line-height: .36rem;
+}
+.vip_introduce .vip_introduce{
+  padding: .72rem 0 .68rem;
+}
+.vip_introduce .cooperate-container{
+  padding-top: .72rem;
+}
+.vip_introduce .cooperate-header {
+  text-align: center;
+}
+.vip_introduce .cooperate-header-title{
+  height: .6rem;
+  background: url(/common-module/vipsubscribe/image/cooperate-header.png) no-repeat center center;
+  background-size: contain;
+}
+.vip_introduce .cooperate-header-subtitle {
+  text-align: center;
+}
+.vip_introduce .line-flex{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-top: .24rem;
+}
+.vip_introduce .split-box--before::before{
+  content: "";
+  display: inline-block;
+  width: .64rem;
+  height: 1px;
+  margin-bottom: 4px;
+  background: linear-gradient(90deg, rgba(204, 173, 135, 0), #ccad87 100%);
+}
+.vip_introduce .split-box--before::after {
+  content: "";
+  display: inline-block;
+  width: 8px;
+  height: 8px;
+  background: #ccad87;
+  transform: rotate(45deg);
+}
+.vip_introduce .split-box--after::before{
+  content: "";
+  display: inline-block;
+  width: 6px;
+  height: 6px;
+  background: #ccad87;
+  transform: rotate(45deg);
+}
+.vip_introduce .split-box--after::after{
+  content: "";
+  display: inline-block;
+  width: .64rem;
+  height: 1px;
+  margin-bottom: 4px;
+  background: linear-gradient(90deg, rgba(204, 173, 135, 0), #ccad87 100%);
+}
+.vip_introduce .split-box--text{
+  margin: 0 .12rem;
+  font-size: .32rem;
+  line-height: .48rem;
+  color: #1d1d1d;
+}
+.vip_introduce  .cooperate-list{
+  display: flex;
+  flex-wrap: wrap;
+  margin-top: .64rem;
+  padding: 0 .26rem;
+}
+.vip_introduce  .cooperate-list .cooperate-item{
+  width: 2.16rem;
+  padding: .26rem 0;
+  margin-bottom: .24rem;
+  text-align: center;
+  border-radius: .24rem;
+  border: 1px solid rgba(250, 231, 202, 1);
+  color:#1d1d1d;
+  font-size: .28rem;
+  line-height: .4rem;
+  background: #fff;
+}
+.vip_introduce  .cooperate-list .cooperate-item:not(:nth-child(3n)) {
+  margin-right:.24rem; 
+}
+.vip_introduce .cooperate-item .cooperate-item-icon{
+  width: .72rem;
+  height: .72rem;
+  margin: 0 auto .08rem;
+  background-size: contain;
+  background-repeat: no-repeat;
+  background-position: center center;
+}
+.vip_introduce .cooperate-item .cooperate-item-icon-1{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-1.png);
+}
+.vip_introduce .cooperate-item .cooperate-item-icon-2{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-2.png);
+}
+.vip_introduce .cooperate-item .cooperate-item-icon-3{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-3.png);
+}
+.vip_introduce .cooperate-item .cooperate-item-icon-4{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-4.png);
+}
+.vip_introduce .cooperate-item .cooperate-item-icon-5{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-5.png);
+}
+.vip_introduce .cooperate-item .cooperate-item-icon-6{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-6.png);
+}
+.vip_introduce .cooperate-item:hover{
+  background: linear-gradient(rgba(255, 248, 236, 1), rgba(255, 241, 219, 1));
+  color: rgba(177, 112, 14, 1);
+}
+.vip_introduce .cooperate-item:hover .cooperate-item-icon-1{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-1-gold.png);
+}
+.vip_introduce .cooperate-item:hover .cooperate-item-icon-2{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-2-gold.png);
+}
+.vip_introduce .cooperate-item:hover .cooperate-item-icon-3{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-3-gold.png);
+}
+.vip_introduce .cooperate-item:hover .cooperate-item-icon-4{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-4-gold.png);
+}
+.vip_introduce .cooperate-item:hover .cooperate-item-icon-5{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-5-gold.png);
+}
+.vip_introduce .cooperate-item:hover .cooperate-item-icon-6{
+  background-image: url(/common-module/vipsubscribe/image/icon/cooperate-6-gold.png);
+}
+.vip_introduce .cooperate-footer{
+  margin: 0 .28rem;
+  padding: .22rem;
+  border-radius: .24rem;
+  border: 1px solid rgba(250, 231, 202, 1);
+  font-size: .32rem;
+  line-height: .48rem;
+  color: rgba(177, 112, 14, 1);
+  text-align: center;
+}
+.vip_introduce .vs-container{
+  margin: .68rem 0 0;
+  background: linear-gradient(to right, #4A4A5C, #2F2F3D);
+}
+.popup-bottom-group{
+  display: flex;
+  width: 100%;
+  padding: .16rem .32rem;
+  background: #fff;
+}
+.popup-bottom-group .btn-customer{
+  width: 3.3rem;
+  height: .8rem;
+  margin-right: .3rem;
+  font-size: .32rem;
+  line-height: .8rem;
+  color: rgba(194, 111, 51, 1);
+  background: linear-gradient(rgba(255, 255, 255, 1), rgba(255, 251, 246, 1));
+  border: 1px solid rgba(214, 158, 85, 1);
+  box-shadow: 0px 10px 16px 0px rgba(233, 183, 105, 0.2);
+  border-radius: .12rem;
+  text-align: center;
+}
+.popup-bottom-group .btn-buy{
+  width: 3.3rem;
+  height: .8rem;
+  font-size: .32rem;
+  line-height: .8rem;
+  color: #fff;
+  background: linear-gradient(rgba(248, 205, 141, 1), rgba(218, 142, 53, 1));
+  box-shadow: 0px 10px 16px 0px rgba(233, 183, 105, 0.2);
+  border-radius: .12rem;
+  text-align: center;
+}

+ 8 - 8
src/jfw/modules/app/src/web/templates/big-member/page_ent_portrait.html

@@ -6,7 +6,6 @@
 
   <!--引入公共资源头部-->
   {{include "/big-member/meta.html"}}
-
   <!--S-当前页面的css资源-->
   <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
   <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
@@ -192,7 +191,7 @@
                   <div class="ent-info-label">企业通讯录</div>
                   <div class="ent-info-text">
                     <p>${entBaseInfo.phone ? entBaseInfo.phone : '-'}</p>
-                    <p class="highlight-text" v-show="phoneUnlockTip" @click="goToUnlock">解锁查看</p>
+                    <p class="highlight-text" v-show="phoneUnlockTip" @click="goToUnlock" v-bound-phone="bindPhoneUnlock()">解锁查看</p>
                   </div>
                 </div>
               </div>
@@ -291,7 +290,7 @@
         </van-tab>
         <!-- 工商变动 -->
         <van-tab :name="moduleList[1].name" :title="moduleList[1].title">
-          <div class="module-title-container bg-white tab-card ent-change-history" @click="goToEntHistory">
+          <div class="module-title-container bg-white tab-card ent-change-history" @click="goToEntHistory" v-bound-phone="bindPhoneEntHistory()">
             <div class="module-title ent-change-l">
               <span>工商变动</span>
               <!-- <span class="module-title-num">10</span> -->
@@ -325,7 +324,7 @@
                 <span class="module-title-num">${topProject.total}</span>
               </div>
               <div class="action-group" key="action-group">
-                <div class="action-button export" @click="onExport" v-if="topProject.list.length">
+                <div class="action-button export" @click="onExport" v-bound-phone="bindPhoneDataExport()" v-if="topProject.list.length">
                     <i class="j-icon base-icon icon-download"></i>
                     <em class="action-button-text">数据导出</em>
                 </div>
@@ -350,7 +349,7 @@
                     @click="toProjectDetail(item)">
                   <div class="head-group">
                     <p class="i_title visited-hd">${item.title}</p>
-                    <span class="icon weishoucang" :class="idx.indexOf(item.id) >-1 ? 'shoucang' : 'weishoucang'" @click.stop="addKeepStatus(item)"></span>
+                    <span class="icon weishoucang" :class="idx.indexOf(item.id) >-1 ? 'shoucang' : 'weishoucang'" @click.stop="addKeepStatus(item)" v-bound-phone="bindPhoneAddKeep(item)"></span>
                   </div>
                 <div class="project-name" v-if="false">${item.title}</div>
                   <div class="project-info">
@@ -370,7 +369,7 @@
                 <li v-if="powerInfo.power.indexOf(4) == -1 && ((isFree && !canFreeTrial) || updateVipStatus || customerServiceStatus)" class="dt-text-tips light-bg">
                   免费用户支持查看最近30条招标动态,数据更新频率为每周1次,最近更新时间为${topProject.updateTime},您可
                   <!-- 免费用户 -->
-                  <span class="highlight-text" v-if="(isFree && !canFreeTrial)" @click="onDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
+                  <span class="highlight-text" v-if="(isFree && !canFreeTrial)" @click="onDtTextClick('buy')"  v-bound-phone="bindPhoneDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
                   <!-- 老版超级订阅用户、新版超级订阅(购买非全国)用户余额为0 -->
                   <span class="highlight-text" v-if="updateVipStatus" @click="onDtTextClick('update')">升级超级订阅实时查看更多数据</span>
                   <!-- 新版超级订阅(购买全国)用户余额为0、大会员自定义用户、商机管理用户 -->
@@ -393,7 +392,7 @@
                 <div v-if="(isFree && !canFreeTrial) || updateVipStatus || customerServiceStatus" class="dt-text-tips">
                   免费用户支持查看最近30条招标动态,数据更新频率为每周1次,最近更新时间为${topProject.updateTime},您可
                   <!-- 免费用户 -->
-                  <span class="highlight-text" v-if="(isFree && !canFreeTrial)" @click="onDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
+                  <span class="highlight-text" v-if="(isFree && !canFreeTrial)" @click="onDtTextClick('buy')"  v-bound-phone="bindPhoneDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
                   <!-- 老版超级订阅用户、新版超级订阅(购买非全国)用户余额为0 -->
                   <span class="highlight-text" v-if="updateVipStatus" @click="onDtTextClick('update')">升级超级订阅实时查看更多数据</span>
                   <!-- 新版超级订阅(购买全国)用户余额为0、大会员自定义用户、商机管理用户 -->
@@ -414,7 +413,7 @@
           <!-- 免费用户采购单位全景分析提示 -->
         <div v-if="canFreeExp && isLogin" style="margin-top: .24rem; " class="free-give">
           <div class="highlight-text"> 免费赠送1次【企业中标分析】权益体验机会!</div>
-          <div class="go-btn" @click="goGiveAnalysis">去解锁</div>
+          <div class="go-btn" @click="goGiveAnalysis" v-bound-phone="bindPhoneGoGiveAnalysis()">去解锁</div>
         </div>
           <!-- 留完资的免费用户 已体验和未体验的展示去开通 -->
           <div v-if="freeWinnerOpen" class="banner-sticky" ref="bannerRef">
@@ -744,6 +743,7 @@
 {{include "/big-member/commonjs.html"}}
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/antiRes/js/mainHook.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/vip-dialog.js?v={{Msg "seo" "version"}}'>
 </script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/history-project.js?v={{Msg "seo" "version"}}'>

+ 4 - 0
src/jfw/modules/app/src/web/templates/big-member/page_ent_portrait_change.html

@@ -77,9 +77,13 @@
 <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/vip-dialog.js?v={{Msg "seo" "version"}}'></script>
 {{include "/big-member/commonjs.html"}}
 <script>
+try {
+  Vue.use(TestBindPhone)
+} catch (error) {}
 var vNode = {
     delimiters: ['${', '}'],
     el: '#ent-portrait-change',

+ 4 - 4
src/jfw/modules/app/src/web/templates/big-member/page_free_buyer_project_news.html

@@ -225,7 +225,7 @@
                             <span v-else @click="changeList">表格显示</span>
                         </div>
                         <div class="export">
-	                        <span @click="onExport">
+	                        <span @click="onExport" v-bound-phone="bindPhoneDataExport('采购单位画像-更多招标动态-数据导出')">
 	                            <i class="j-icon base-icon icon-download"></i>
 	                            <em id="mainSearch-selLable-dataExport">数据导出</em>
 	                        </span>
@@ -247,11 +247,10 @@
                             class="project-info-item bg-white border-line-b clickable"
                             :class="{ visited: item.visited }"
                             :immediate-check="false"
-                            @click="goToDetail(item)"
                             :key="item.id">
                             <div class="head-group">
-                              <div class="project-name visited-hd">${ item.title }</div>
-                              <span :data-id="item.id" class="icon" :class="idx.indexOf(item.id) >-1 ? 'shoucang' : 'weishoucang'" @click.stop="addKeepStatus(item)"></span>
+                              <div class="project-name visited-hd" @click="goToDetail(item)">${ item.title }</div>
+                              <span :data-id="item.id" class="icon" :class="idx.indexOf(item.id) >-1 ? 'shoucang' : 'weishoucang'" @click.stop="addKeepStatus(item)" v-bound-phone="bindPhoneAddKeepStatus(item, '采购单位画像-招标动态-收藏')"></span>
                             </div>
                             <div class="project-info">
                                 <span class="tags">
@@ -382,6 +381,7 @@
         platform: 'app'
     }
 </script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/popup-select-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/notice-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/area-mobile.js?v={{Msg "seo" "version"}}'></script>

+ 4 - 4
src/jfw/modules/app/src/web/templates/big-member/page_free_ent_project_news.html

@@ -93,7 +93,7 @@
                     <span v-else @click="changeList">表格显示</span>
                   </div>
                   <div class="export">
-                            <span @click="onExport">
+                            <span @click="onExport" v-bound-phone="bindPhoneDataExport('企业画像-中标动态-数据导出')">
                                 <i class="j-icon base-icon icon-download"></i>
                                 <em id="mainSearch-selLable-dataExport">数据导出</em>
                             </span>
@@ -115,12 +115,11 @@
                             class="project-info-item bg-white border-line-b clickable"
                             :class="{ visited: item.visited }"
                             :immediate-check="false"
-                            @click="goToDetail(item)"
                             :key="item.id">
 <!--                            <div class="project-name">${ item.title }</div>-->
                               <div class="head-group">
-                                <div class="project-name visited-hd">${ item.title }</div>
-                                <span class="icon weishoucang" :class="idx.indexOf(item.id) >-1 ? 'shoucang' : 'weishoucang'" @click.stop="addKeepStatus(item)"></span>
+                                <div class="project-name visited-hd" @click="goToDetail(item)">${ item.title }</div>
+                                <span class="icon weishoucang" :class="idx.indexOf(item.id) >-1 ? 'shoucang' : 'weishoucang'" @click.stop="addKeepStatus(item)" v-bound-phone="bindPhoneAddKeepStatus(item, '企业画像-中标动态-收藏')"></span>
                               </div>
                             <div class="project-info">
                                 <span class="tags">
@@ -243,6 +242,7 @@
         platform: 'app'
     }
 </script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/popup-select-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/notice-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/area-mobile.js?v={{Msg "seo" "version"}}'></script>

+ 33 - 7
src/jfw/modules/app/src/web/templates/big-member/page_landingPage.html

@@ -139,7 +139,7 @@
         <div style="font-size: 0;">
           <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/image/landpage_new/itemB_04.png'>
         </div>
-        <div class="btn_buy" id="btn_buy" @click="exper_fun('sj', 1)"  style="background-color:#1A1A2A;"><img data-need-bind-phone src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/image/landpage_new/itemB_05.jpg' alt="" class="btn_buy_img" id="btn_buy_img"></div>
+        <div class="btn_buy" id="btn_buy"  @click="exper_fun('sj', 1)" v-bound-phone="bindPhoneGoSee()"  style="background-color:#1A1A2A;"><img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/image/landpage_new/itemB_05.jpg' alt="" class="btn_buy_img" id="btn_buy_img"></div>
       </div>
       <!-- 为什么选择 -->
       <div class="insight" id="sj">
@@ -163,16 +163,16 @@
     <div class="j-footer " v-show="isCantrial" style="background-color: #1A1A2A;">
       <div class="j-button-group btbt">
         <div class="buy_btn" v-if="onlyBuy">
-          <div class="sevendays j-btn" @click="exper_fun()">
-            <div data-need-bind-phone class="xiugai" style="color: #FAE7CA">立即体验</div>
+          <div class="sevendays j-btn" @click="exper_fun()" v-bound-phone="bindPhoneGoSee()">
+            <div class="xiugai" style="color: #FAE7CA">立即体验</div>
           </div>
-          <div class="j-button-now j-btn" @click="linkBuy('sj',6)" >
-            <div data-need-bind-phone class="xiugai" style="color: #1A1A2A">点击购买</div>
+          <div class="j-button-now j-btn" @click="linkBuy('sj',6)" v-bound-phone="bindPhoneGoBuy('sj', 6)" >
+            <div class="xiugai" style="color: #1A1A2A">点击购买</div>
           </div>
         </div>
         <div class="buy_btn" v-else>
-          <div class="j-button-nowly j-btn" @click="linkBuy('sj',6)">
-            <div data-need-bind-phone>立即购买</div>
+          <div class="j-button-nowly j-btn" @click="linkBuy('sj',6)" v-bound-phone="bindPhoneGoBuy('sj', 6)">
+            <div>立即购买</div>
           </div>
         </div>
       </div>
@@ -184,6 +184,7 @@
   <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js> </script>
   <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js> </script>
   <script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js> </script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
   <script>
     {{$ss1:=(Ad "app-banner-data-info" -1 .Host (cookie "SESSIONID"))}}
     var headerImageList={{$ss1}}
@@ -226,6 +227,9 @@
     var config = {
         cdnHost: {{Cdns .Host "seo" "cdn"|SafeUrl}}
     }
+    try {
+      Vue.use(TestBindPhone)
+    } catch (error) {}
     var vNode = {
         delimiters: ['${', '}'],
         el: '#v-commit',
@@ -418,6 +422,28 @@
                 } catch (e) {
                     console.log('未初始化百度统计')
                 }
+            },
+            bindPhoneGoSee: function() {
+              var _this = this
+              return {
+                props: {
+                  name: '大会员落地页-立即体验'
+                },
+                next: function() {
+                  _this.exper_fun()
+                }
+              }
+            },
+            bindPhoneGoBuy: function(res, i) {
+              var _this = this
+              return {
+                props: {
+                  name: '大会员落地页-立即购买'
+                },
+                next: function() {
+                  _this.linkBuy(res, i)
+                }
+              }
             }
         }
     }

+ 7 - 7
src/jfw/modules/app/src/web/templates/big-member/page_unit_portrayal.html

@@ -6,7 +6,6 @@
 
   <!--引入公共资源头部-->
   {{include "/big-member/meta.html"}}
-
   <!--S-当前页必定需要预加载的资源-->
   <link rel="preload" as="style" href=//cdn-common.jianyu360.com/cdn/lib/reset-css/5.0.1/reset.min.css />
   <link rel="preload" as="style" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
@@ -199,7 +198,7 @@
             <!-- 免费用户采购单位全景分析提示 -->
             <div v-if="getfreeBuyerPort && isLogin" class="free-give">
               <div class="go-text"> 免费赠送1次【采购单位全景分析】权益体验机会!</div>
-              <div class="go-btn" @click="goGiveAnalysis">去解锁</div>
+              <div class="go-btn" @click="goGiveAnalysis" v-bound-phone="bindPhoneGoGiveAnalysis()">去解锁</div>
             </div>
             <div v-if="getStatus">
               <div class="vip_component"
@@ -224,7 +223,7 @@
                     <span class="module-title-num">${dt.total}</span>
                   </div>
                   <div class="action-group">
-                    <div class="action-button export" @click="onExport" v-if="dt.list.length">
+                    <div class="action-button export" @click="onExport" v-bound-phone="bindPhoneDataExport()" v-if="dt.list.length">
                         <i class="j-icon base-icon icon-download"></i>
                         <em id="mainSearch-selLable-dataExport" class="action-button-text">数据导出</em>
                     </div>
@@ -245,7 +244,7 @@
                       <div class="head-group">
                         <p class="i_title visited-hd">${item.title}</p>
                         <span class="icon weishoucang" :class="idx.indexOf(item.id) >-1 ? 'shoucang' : 'weishoucang'"
-                          @click.stop="addKeepStatus(item)"></span>
+                          @click.stop="addKeepStatus(item)" v-bound-phone="bindPhoneAddKeep(item)"></span>
                       </div>
                       <div class="i_info">
                         <p class="area_type">
@@ -264,7 +263,7 @@
                     <div v-if="getStatus" class="dt-text-tips light-bg">
                       免费用户支持查看最近30条招标动态,数据更新频率为每周1次,最近更新时间为${dt.updateTime},您可
                       <!-- 免费用户 -->
-                      <span class="highlight-text" v-if="userInfo.isFree" @click="onDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
+                      <span class="highlight-text" v-if="userInfo.isFree" @click="onDtTextClick('buy')" v-bound-phone="bindPhoneDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
                       <!-- 老版超级订阅用户、新版超级订阅(购买非全国)用户余额为0 -->
                       <span class="highlight-text" v-if="updateVipStatus" @click="onDtTextClick('update')">升级超级订阅实时查看更多数据</span>
                       <!-- 新版超级订阅(购买全国)用户余额为0、大会员自定义用户、商机管理用户 -->
@@ -287,7 +286,7 @@
                     <div v-if="getStatus" class="dt-text-tips">
                       免费用户支持查看最近30条招标动态,数据更新频率为每周1次,最近更新时间为${dt.updateTime},您可
                        <!-- 免费用户 -->
-                       <span class="highlight-text" v-if="userInfo.isFree" @click="onDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
+                       <span class="highlight-text" v-if="userInfo.isFree" @click="onDtTextClick('buy')" v-bound-phone="bindPhoneDtTextClick('buy')">开通超级订阅实时查看更多数据</span>
                        <!-- 老版超级订阅用户、新版超级订阅(购买非全国)用户余额为0 -->
                        <span class="highlight-text" v-if="updateVipStatus" @click="onDtTextClick('update')">升级超级订阅实时查看更多数据</span>
                        <!-- 新版超级订阅(购买全国)用户余额为0、大会员自定义用户、商机管理用户 -->
@@ -741,6 +740,7 @@
     src="//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js"></script>
   <link href="//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/theme-chalk/index.css" rel="stylesheet" />
   {{include "/big-member/commonjs.html"}}
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/echarts_option.js?v={{Msg "seo" "version"}}'>
   </script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/chart_options.js?v={{Msg "seo" "version"}}'>
@@ -758,7 +758,7 @@
   </script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/portrait/js/downloadpopup.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module//mobile-portrayal-footer/js/mobile-portrayal-footer.js?v={{Msg "seo" "version"}}'></script>
-  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/unit_portrayal.js?v={{Msg "seo" "version"}}11'>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/unit_portrayal.js?v={{Msg "seo" "version"}}'>
   </script>
   <script
     src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/keep-tags/keep-tags-template.js?v={{Msg "seo" "version"}}'>

+ 30 - 1
src/jfw/modules/app/src/web/templates/exhibition/index.html

@@ -24,6 +24,8 @@
   <link rel="stylesheet" href="{{Cdns .Host " seo" "cdn" |SafeUrl}}/common-module/exhibition/css/reset.css?v={{Msg "seo" "version" }}" />
   <link rel="stylesheet" href="{{Cdns .Host " seo" "cdn" |SafeUrl}}/common-module/exhibition/css/swiper.css?v={{Msg "seo" "version" }}" />
   <link rel="stylesheet" href="{{Cdns .Host " seo" "cdn" |SafeUrl}}/common-module/exhibition/css/index.css?v={{Msg "seo" "version" }}" />
+  <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+  <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
   <script src="https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js"></script>
   <style>
     .app-layout-header{
@@ -252,10 +254,13 @@
       </div>
       <!-- 移动底部-->
       <div class="footer pc_hide">
-        <div class="btn" onclick="goCustomerPage()">洽谈展会合作</div>
+        <div class="btn" v-bound-phone="bindPhoneGoCustomer()">洽谈展会合作</div>
       </div>
     </div>
   </div>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js> </script>
+  <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js> </script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
   <script src="{{Cdns .Host " seo" "cdn" |SafeUrl}}/common-module/exhibition/js/swiper.js?v={{Msg "seo" "version" }}"></script>
   <script src="{{Cdns .Host " seo" "cdn" |SafeUrl}}/jyapp/local/weui.min.js"></script>
   <!-- 本身逻辑js -->
@@ -291,6 +296,30 @@
       }
 
     }
+    try {
+      Vue.use(TestBindPhone)
+    } catch (error) {}
+    new Vue({
+      el: '#vm_exhibition',
+      delimiters: ['${', '}'],
+      methods: {
+        bindPhoneGoCustomer: function () {
+          var pass = !goTemplateData.params.loginFlag ? function () {
+            sessionStorage.setItem('status_login',true)
+            window.location.href = "/jyapp/free/login?url=" + encodeURIComponent('/jyapp/free/customer?auto=1')
+          } : null
+          return {
+            props: {
+              name: '行业展会-洽谈展会合作'
+            },
+            pass: pass,
+            next: function () {
+              go_kf()
+            }
+          }
+        }
+      }
+    })
   </script>
   <!--百度统计-->
   {{include "/common/baiducc.html"}}

+ 1 - 1
src/jfw/modules/app/src/web/templates/frontRouter/activity/free/202402.html

@@ -98,7 +98,7 @@
                                         <div class="r-l-i-c-line reward-text" v-text="item.rewardText"></div>
                                         <div class="r-l-i-c-line reward-desc" v-html="item.desc"></div>
                                         <div class="r-l-i-c-line receive-time" v-text="item.receiveTime"></div>
-                                        <button v-if="item.attribute > 0" class="reward-button reward-copy-button" @click.stop="copyCodeAndGo(item)">复制兑换码,去兑换</button>
+                                        <button v-if="item.attribute > 0" class="reward-button reward-copy-button" @click.stop="copyCodeAndGo(item)">${item.redeemCode ? '复制兑换码,去兑换': '去兑换'}</button>
                                     </div>
                                     <div class="r-l-i-action">
                                         <van-icon name="arrow" v-if="item.attribute <= 0"></van-icon>

+ 9 - 0
src/jfw/modules/app/src/web/templates/frontRouter/activity/free/register.html

@@ -97,11 +97,19 @@
       </div>
     </div>
 
+    <div id="slide-verify-node">
+      <van-popup v-model="popupShow" :lazy-render="false">
+        <div id="slide-wrap"></div>
+      </van-popup>
+    </div>
+
     <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js> </script>
     <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js> </script>
     <script src=//cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js> </script>
     <script src=//cdn-common.jianyu360.com/cdn/lib/moment/2.29.1/min/moment.min.js></script>
     <script src="//cdn-common.jianyu360.com/cdn/lib/number-auth-web-sdk/2.1.2/numberAuth-web-sdk.js"></script>
+    <link rel="stylesheet" href="https://cdn-common.jianyu360.com/cdn/lib/go-captcha-jslib/1.0.9/gocaptcha.global.css">
+    <script src="https://cdn-common.jianyu360.com/cdn/lib/go-captcha-jslib/1.0.9/gocaptcha.global.js"></script>
     {{include "/big-member/commonjs.html"}}
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "version"}}'></script>
     <script>
@@ -114,6 +122,7 @@
     <!-- <script src=//res2.wx.qq.com/open/js/jweixin-1.6.0.js></script> -->
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/wx-sdk-share.js?v={{Msg "seo" "version"}}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/app-share-sheet.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/account/js/slide-verify.js?v={{Msg "seo" "version" }}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/account/js/fast-login.js?v={{Msg "seo" "version" }}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/active/register/register.js?v={{Msg "seo" "version"}}'></script>
     {{include "/common/baiducc.html"}}

+ 3 - 2
src/jfw/modules/app/src/web/templates/frontRouter/bidedoc/free/index.html

@@ -27,7 +27,7 @@
           <!-- <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_04.jpg?v={{Msg "seo" "version"}}' alt=""> -->
           <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_05.jpg?v={{Msg "seo" "version"}}' alt="">
           <div class="contact-box">
-            <img @click="getPhone" src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_06.jpg?v={{Msg "seo" "version"}}' alt="">
+            <img @click="getPhone" src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_06.png?v={{Msg "seo" "version"}}' alt="">
             <!-- <img @click="getPhone" src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_07.jpg?v={{Msg "seo" "version"}}' alt=""> -->
             <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_08.jpg?v={{Msg "seo" "version"}}' alt="">
             <div class="qr-code-box">
@@ -37,7 +37,7 @@
           <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_09.jpg?v={{Msg "seo" "version"}}' alt="">
           <div class="btns-tips">
             <div class="btns">
-                <van-button type="primary" size="large" onclick="getMsgNew()">请留下您的手机号,专业老师将尽快和您联系</van-button>
+                <van-button type="primary" size="large" onclick="getMsgNew()" v-bound-phone="bindPhoneGetMsg()">请留下您的手机号,专业老师将尽快和您联系</van-button>
             </div>
           </div>
         </div>
@@ -51,6 +51,7 @@
   <!--E-当前页面的资源-->
   {{include "/big-member/commonjs.html"}}
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/js/index.js?v={{Msg "seo" "version"}}'></script>
   {{include "/common/baiducc.html"}}
   <script>

+ 3 - 2
src/jfw/modules/app/src/web/templates/frontRouter/bidedoc/sess/index.html

@@ -26,13 +26,13 @@
           <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_03.jpg?v={{Msg "seo" "version"}}' alt="">
           <!-- <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_04.jpg?v={{Msg "seo" "version"}}' alt=""> -->
           <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_05.jpg?v={{Msg "seo" "version"}}' alt="">
-          <img @click="getPhone" src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_06.jpg?v={{Msg "seo" "version"}}' alt="">
+          <img @click="getPhone" src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_06.png?v={{Msg "seo" "version"}}' alt="">
           <!-- <img @click="getPhone" src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_07.jpg?v={{Msg "seo" "version"}}' alt=""> -->
           <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_08.jpg?v={{Msg "seo" "version"}}' alt="">
           <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/image/B_09.jpg?v={{Msg "seo" "version"}}' alt="">
           <div class="btns-tips">
             <div class="btns">
-                <van-button type="primary" size="large" @touchstart="getMsg">请留下您的手机号,专业老师将尽快和您联系</van-button>
+                <van-button type="primary" size="large" v-bound-phone="bindPhoneGetMsg()">请留下您的手机号,专业老师将尽快和您联系</van-button>
             </div>
           </div>
         </div>
@@ -46,6 +46,7 @@
   <!--E-当前页面的资源-->
   {{include "/big-member/commonjs.html"}}
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "version"}}'></script>
+  <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
   <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/js/index.js?v={{Msg "seo" "version"}}'></script>
   {{include "/common/baiducc.html"}}
 </body>

+ 2 - 1
src/jfw/modules/app/src/web/templates/frontRouter/declaration/free/relationship.html

@@ -67,7 +67,7 @@
             <div class="fixed-bottom intro-leave-banner">
                 <div class="text-container">
                     <p class="intro-text">剑鱼可帮助您快速达成业绩倍增</p>
-                    <button class="intro-button button-blink" @click="applyToTrial">申请免费试用</button>
+                    <button class="intro-button button-blink" @click="applyToTrial" v-bound-phone="bindPhoneApplyToTrial()">申请免费试用</button>
                 </div>
                 <div class="img-container">
                     <img src="{{Msg "seo" "cdn"}}/common-module/bidedoc/image/relationship/bottom-banner-mask@2x.png?v={{Msg "seo" "version"}}" alt="" class="img-content">
@@ -82,6 +82,7 @@
     <script src=//cdn-common.jianyu360.com/cdn/lib/lodash/4.17.21/lodash.min.js></script>
     {{include "/big-member/commonjs.html"}}
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/bidedoc/js/relationship.js?v={{Msg "seo" "version"}}'></script>
     {{include "/common/baiducc.html"}}
 </body>

+ 29 - 1
src/jfw/modules/app/src/web/templates/frontRouter/partner/free/index.html

@@ -16,6 +16,8 @@
   <link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/css/base.css?v={{Msg "seo" "version"}}">
   <link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/css/weui.min.css?v={{Msg "seo" "version"}}">
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
+  <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+  <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/partner/css/partner.css?v={{Msg "seo" "version"}}">
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/partner/css/append.css?v={{Msg "seo" "version"}}">
   <style>
@@ -93,11 +95,14 @@
 			</div>
 		</div>
 		<div class="j-button-group">
-			<button dataHref="/jyapp/frontPage/bigmember/free/perfect_info_partner?source=partner_recruit_page"  class="j-button-confirm" id="j_confirm">申请加入</button>
+			<button v-bound-phone="bindPhoneJoin('/jyapp/frontPage/bigmember/free/perfect_info_partner?source=partner_recruit_page')" class="j-button-confirm" id="j_confirm">申请加入</button>
 		</div>
 	</div>
 </div>
 </body>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js> </script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js> </script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/jquery.min.js'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/weui.min.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/imageViewer.min.js'></script>
@@ -190,6 +195,29 @@
   function tel(phone){
     JyObj.callPhone(phone);
   }
+  try {
+    Vue.use(TestBindPhone)
+  } catch (error) {}
+  new Vue({
+    el: '#app',
+    delimiters: ['${', '}'],
+    methods: {
+      bindPhoneJoin: function(url) {
+        var pass = !loginFlag ? function () {
+          window.location.href = "/jyapp/free/login?url=" + encodeURIComponent(url)
+        } : null
+        return {
+          props: {
+            name: '渠道合作-申请加入'
+          },
+          pass: pass,
+          next: function () {
+            window.location.href = url
+          }
+        }
+      }
+    }
+  })
 </script>
 <!--百度统计end-->
 {{include "/common/baiducc.html"}}

+ 25 - 1
src/jfw/modules/app/src/web/templates/frontRouter/partner/sess/index.html

@@ -18,6 +18,8 @@
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/partner/css/partner.css?v={{Msg "seo" "version"}}">
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/partner/css/append.css?v={{Msg "seo" "version"}}">
+  <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
+  <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/icon/local.css />
   <style>
     .app-layout-header{
       border-bottom: 0px!important;
@@ -93,11 +95,14 @@
 			</div>
 		</div>
 		<div class="j-button-group">
-			<button onclick="location.href = '/jyapp/frontPage/bigmember/free/perfect_info_partner?source=partner_recruit_page'"  class="j-button-confirm" id="j_confirm">申请加入</button>
+			<button v-bound-phone="bindPhoneJoin()" class="j-button-confirm" id="j_confirm">申请加入</button>
 		</div>
 	</div>
 </div>
 </body>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js> </script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js> </script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/jquery.min.js'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/weui.min.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/imageViewer.min.js'></script>
@@ -181,6 +186,25 @@
   function tel(phone){
     JyObj.callPhone(phone);
   }
+  try {
+    Vue.use(TestBindPhone)
+  } catch (error) {}
+  new Vue({
+    el: '#app',
+    delimiters: ['${', '}'],
+    methods: {
+      bindPhoneJoin: function() {
+        return {
+          props: {
+            name: '渠道合作-申请加入'
+          },
+          next: function () {
+            window.location.href = '/jyapp/frontPage/bigmember/free/perfect_info_partner?source=partner_recruit_page'
+          }
+        }
+      }
+    }
+  })
 </script>
 <!--百度统计end-->
 {{include "/common/baiducc.html"}}

+ 6 - 4
src/jfw/modules/app/src/web/templates/frontRouter/solution/free/dataInterface.html

@@ -53,7 +53,7 @@
 </head>
 
 <body>
-    <div class="j-container app">
+    <div class="j-container app" id="app" v-cloak>
         <div class="j-header jy-app-header header-transparent">
           <span class="header-left">
             <span class="icon-back j-icon base-icon"></span>
@@ -62,7 +62,7 @@
           <span class="header-title">剑鱼数据接口</span>
           <span class="header-right"></span>
         </div>
-        <div class="j-main" id="main-app" v-cloak>
+        <div class="j-main" id="main-app">
             <div class="content-banner">
                 <img class="img-content" src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/solution/image/interface-header-top-banner@2x.png'>
             </div>
@@ -255,8 +255,8 @@
         </div>
         <div class="j-footer">
           <div class="j-button-group-new">
-            <button class="j-button-left customer-button">联系客服</button>
-            <button class="j-button-right api-button">接口申请</button>
+            <button class="j-button-left customer-button" v-bound-phone="bindPhoneCustomer()">联系客服</button>
+            <button class="j-button-right api-button" v-bound-phone="bindPhoneApply()">接口申请</button>
           </div>
         </div>
     </div>
@@ -270,7 +270,9 @@
     <script src=//cdn-common.jianyu360.com/cdn/lib/countup/2.0.8/dist/countUp.js></script>
     {{include "/big-member/commonjs.html"}}
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/solution/js/data-interface.js?v={{Msg "seo" "version"}}'></script>
+
     {{include "/common/baiducc.html"}}
 </body>
 

+ 55 - 18
src/jfw/modules/app/src/web/templates/frontRouter/solution/free/index.html

@@ -90,11 +90,11 @@
 			</div>
 		</div>
 		<div class="j-button-group">
-			<a dataHref="/jyapp/frontPage/bigmember/free/perfect_info_solution?source=telecom_solution" class="j-button-cancel" id="j_cancel">
+			<a v-bound-phone="bindPhoneLearnMore()" dataHref="/jyapp/frontPage/bigmember/free/perfect_info_solution?source=telecom_solution" class="j-button-cancel" id="j_cancel">
 				<!-- <span class="phone_icon"></span> -->
 				<span>了解详情</span>
 			</a>
-			<button dataHref="/jyapp/free/customer"  class="j-button-confirm" id="j_confirm">
+			<button v-bound-phone="bindPhoneCustomer()" dataHref="/jyapp/free/customer"  class="j-button-confirm" id="j_confirm">
 				<span class="icon_phone"></span>
 				<span>立即咨询</span>
 			</button>
@@ -105,10 +105,16 @@
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/jquery.min.js'></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 {{include "/common/js.html"}}
 <script>
+  var loginFlag = {{if .T.loginFlag}}{{.T.loginFlag}}{{else}}false{{end}}
+  try {
+    Vue.use(TestBindPhone)
+  } catch (error) {}
+
 	var vmSol = new Vue({
-    el: '#advantage',
+    el: '#app',
     data: {
       show: false,
       index: 0,
@@ -117,11 +123,43 @@
       ],
     },
     methods: {
+      bindPhoneLearnMore: function() {
+        var href = '/jyapp/frontPage/bigmember/free/perfect_info_solution?source=telecom_solution'
+        var pass = !loginFlag ? function() {
+          window.location.href= "/jyapp/free/login?url=" + href
+        } : null
+        return {
+          props: {
+            name: '行业解决方案-了解详情'
+          },
+          pass: pass,
+          next: function () {
+            window.location.href= href
+          }	
+        }
+      },
+      bindPhoneCustomer: function() {
+        var href = '/jyapp/free/customer'
+        var pass = !loginFlag? function() {
+          window.location.href= "/jyapp/free/login?url=" + href
+        } : null
+        return {
+          props: {
+            name: '行业解决方案-立即咨询'
+          },
+          pass: pass,
+          next: function () {
+            window.location.href= href
+          }
+        }
+      },
       imageView: function(index) {
         this.show = true
       }
     }
   })
+
+
 	// 监听页面滚动
 	var addEvent = (function(){
 		if(window.addEventListener){
@@ -148,23 +186,22 @@
 		}
 	});
 
-  var loginFlag = {{if .T.loginFlag}}{{.T.loginFlag}}{{else}}false{{end}}
   //咨询客服
-  $("#j_cancel").on('click',function(){
-    if(loginFlag){
-      window.location.href=$(this).attr('dataHref')
-    }else{
-      window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
-    }
-  })
+  // $("#j_cancel").on('click',function(){
+  //   if(loginFlag){
+  //     window.location.href=$(this).attr('dataHref')
+  //   }else{
+  //     window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
+  //   }
+  // })
   //获取样例
-  $("#j_confirm").on('click',function(){
-     if(loginFlag){
-      window.location.href=$(this).attr('dataHref')
-    }else{
-      window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
-    }
-  })
+  // $("#j_confirm").on('click',function(){
+  //    if(loginFlag){
+  //     window.location.href=$(this).attr('dataHref')
+  //   }else{
+  //     window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
+  //   }
+  // })
 
 	$('.fanhui').on('click', function() {
 		history.go(-1)

+ 29 - 3
src/jfw/modules/app/src/web/templates/frontRouter/solution/sess/index.html

@@ -90,11 +90,11 @@
 			</div>
 		</div>
 		<div class="j-button-group">
-			<a onclick="location.href = '/jyapp/frontPage/bigmember/free/perfect_info_solution?source=telecom_solution'" class="j-button-cancel" id="j_cancel">
+			<a v-bound-phone="bindPhoneLearnMore()" class="j-button-cancel" id="j_cancel">
 				<!-- <span class="phone_icon"></span> -->
 				<span>了解详情</span>
 			</a>
-			<button onclick="location.href = '/jyapp/free/customer'"  class="j-button-confirm" id="j_confirm">
+			<button  v-bound-phone="bindPhoneCustomer()" class="j-button-confirm" id="j_confirm">
 				<span class="icon_phone"></span>
 				<span>立即咨询</span>
 			</button>
@@ -105,10 +105,14 @@
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/jquery.min.js'></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
 <script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 {{include "/common/js.html"}}
 <script>
+  try {
+    Vue.use(TestBindPhone)
+  } catch (error) {}
 	var vmSol = new Vue({
-    el: '#advantage',
+    el: '#app',
     data: {
       show: false,
       index: 0,
@@ -119,6 +123,28 @@
     methods: {
       imageView: function(index) {
         this.show = true
+      },
+      bindPhoneLearnMore: function() {
+        var href = '/jyapp/frontPage/bigmember/free/perfect_info_solution?source=telecom_solution'
+        return {
+          props: {
+            name: '行业解决方案-了解详情'
+          },
+          next: function () {
+            window.location.href= href
+          }	
+        }
+      },
+      bindPhoneCustomer: function() {
+        var href = '/jyapp/free/customer'
+        return {
+          props: {
+            name: '行业解决方案-立即咨询'
+          },
+          next: function () {
+            window.location.href= href
+          }
+        }
       }
     }
   })

+ 1 - 1
src/jfw/modules/app/src/web/templates/me/account/phone_bind.html

@@ -194,7 +194,7 @@
                         <button class="j-button-confirm" @click="onSubmit" :disabled="confirmButtonDisabled">立即绑定</button>
                     </div>
                     <div class="fast-login-container" v-if="type === 'bind'" v-show="fastButton">
-                        <button class="fast-login-text fast-login-open-link highlight-text">本机号码一键绑定</a>
+                        <button class="fast-login-text fast-login-open-link highlight-text">本机号码一键绑定</button>
                     </div>
                     <div class="tip-text" v-if="showBottomTip">
                       根据《中华人民共和国网络安全法》要求,为避免非正常使用标讯信息,需完成手机号绑定, 保障账户安全和信息的正当使用。

+ 61 - 17
src/jfw/modules/app/src/web/templates/structeddata/marketing.html

@@ -17,6 +17,7 @@
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/css/weui.min.css?v={{Msg "seo" "version"}}">
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/iconfont/iconfont.css?v={{Msg "seo" "version"}}">
 	<link rel="stylesheet" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/css/marketing.css?v={{Msg "seo" "version"}}">
+  <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
   <style>
     .app-layout-header{
       border-bottom: 0px!important;
@@ -85,11 +86,11 @@
 			</div>
 		</div>
 		<div class="j-button-group">
-			<a dataHref="/jyapp/free/customer" class="j-button-cancel" id="j_cancel">
+			<a v-bound-phone="bindPhoneCustomer()" dataHref="/jyapp/free/customer" class="j-button-cancel" id="j_cancel">
 				<!-- <span class="phone_icon"></span> -->
 				<span>咨询客服</span>
 			</a>
-			<button dataHref="/jyapp/frontPage/bigmember/free/perfect_info_strud?source=structedData"  class="j-button-confirm" id="j_confirm">获取数据样例</button>
+			<button v-bound-phone="bindPhoneLearnMore()" dataHref="/jyapp/frontPage/bigmember/free/perfect_info_strud?source=structedData"  class="j-button-confirm" id="j_confirm">获取数据样例</button>
 		</div>
 	</div>
 </div>
@@ -97,6 +98,9 @@
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/jquery.min.js'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/weui.min.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/structuredata/js/imageViewer.min.js'></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 {{include "/common/js.html"}}
 <script>
 	// 监听页面滚动
@@ -164,21 +168,21 @@
 	})
   var loginFlag = {{if .T.loginFlag}}{{.T.loginFlag}}{{else}}false{{end}}
   //咨询客服
-  $("#j_cancel").on('click',function(){
-    if(loginFlag){
-      window.location.href=$(this).attr('dataHref')
-    }else{
-      window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
-    }
-  })
-  //获取样例
-  $("#j_confirm").on('click',function(){
-     if(loginFlag){
-      window.location.href=$(this).attr('dataHref')
-    }else{
-      window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
-    }
-  })
+  // $("#j_cancel").on('click',function(){
+  //   if(loginFlag){
+  //     window.location.href=$(this).attr('dataHref')
+  //   }else{
+  //     window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
+  //   }
+  // })
+  // //获取样例
+  // $("#j_confirm").on('click',function(){
+  //    if(loginFlag){
+  //     window.location.href=$(this).attr('dataHref')
+  //   }else{
+  //     window.location.href= "/jyapp/free/login?url="+$(this).attr('dataHref')
+  //   }
+  // })
 	function click_view(){
 		var loading = weui.loading('loading', {
 			className: 'custom-classname'
@@ -193,6 +197,46 @@
   function tel(phone){
     JyObj.callPhone(phone);
   }
+  try {
+    Vue.use(TestBindPhone)
+  } catch (error) {}
+
+	new Vue({
+    el: '#app',
+    data: {},
+    methods: {
+      bindPhoneLearnMore: function() {
+        var href = '/jyapp/frontPage/bigmember/free/perfect_info_strud?source=structedData'
+        var pass = !loginFlag ? function() {
+          window.location.href= "/jyapp/free/login?url=" + href
+        } : null
+        return {
+          props: {
+            name: '结构化数据-获取数据样例'
+          },
+          pass: pass,
+          next: function () {
+            window.location.href= href
+          }	
+        }
+      },
+      bindPhoneCustomer: function() {
+        var href = '/jyapp/free/customer'
+        var pass = !loginFlag? function() {
+          window.location.href= "/jyapp/free/login?url=" + href
+        } : null
+        return {
+          props: {
+            name: '结构化数据-咨询客服'
+          },
+          pass: pass,
+          next: function () {
+            window.location.href= href
+          }
+        }
+      }
+    }
+  })
 </script>
 <!--百度统计end-->
 {{include "/common/baiducc.html"}}

+ 149 - 33
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_introduce.html

@@ -19,6 +19,8 @@
     <link rel="stylesheet" type="text/css" href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.css' />
     <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/css/vip_introduce.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/css/font.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/css/vip-free-introduce-template.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" href=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/index.css />
         <style>
         .pop-tip-group.tip-box > div,
         .pop-tip-group.active > div{
@@ -66,7 +68,7 @@
             position: absolute;
             bottom: 0;
             left: 0;
-            background: transparent;
+            /* background: transparent; */
             height: auto !important;
         }
         .vip_introduce .main {
@@ -76,37 +78,87 @@
 </head>
 <body>
 <div class="j-container" id="vip-intro-container">
-    <div class="j-header jy-app-header transparent-header">
+    <div class="j-header jy-app-header">
       <span class="app-back jyapp-icon jyapp-icon-zuojiantou header-left"></span>
       <span class="header-title">超级订阅</span>
       <span class="header-right hide"></span>
     </div>
     <div class="j-main vip_introduce vip-body" id="vip-body">
-        <div class="main">
-                <img src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/cut_01.jpg?v={{Msg "seo" "version"}}">
-                <img id="cut-2" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/cut_02.jpg?v={{Msg "seo" "version"}}">
-                <img src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/cut_03.jpg?v={{Msg "seo" "version"}}">
-                <img src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/vip_vs.png?v={{Msg "seo" "version"}}">
-                <img id="cut-6" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/cut_06.jpg?v={{Msg "seo" "version"}}">
-                <img src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/cut_07.jpg?v={{Msg "seo" "version"}}">
+        <div class="landing-banner">
+          <img id="cut-2" src='' />
+          <div class="statistic-info">
+            <div class="statistic-item">
+              <h3 class="item-count day-update-count"></h3>
+              <p>每日招采信息新增</p>
+            </div>
+            <div class="statistic-item">
+              <h3 class="item-count purchase-partyA-count"></h3>
+              <p>覆盖省市镇招采甲方</p>
+            </div>
+            <div class="statistic-item">
+              <h3 class="item-count purchase-project-count"></h3>
+              <p>覆盖全行业招采项目</p>
+            </div>
+          </div>
         </div>
-    </div>
-        <div class="j-footer j-button-group popup-bottom-group">
-            <div class="adbottom" style="width:375px;height: 40px;text-align: center;" id="bottomad">
-<!--              <div class="pop-tip-group tip-box">-->
-<!--                <div>每天一块钱,立刻拥有全网商机!</div>-->
-<!--              </div>-->
+        <div class="cooperate-container">
+          <div class="cooperate-header">
+            <h2 class="cooperate-header-title"></h2>
+            <p class="line-flex cooperate-header-subtitle">
+              <span class="split-box--before"></span>
+              <span class="split-box--text">定向推送!覆盖全网全类招采项目</span>
+              <span class="split-box--after"></span>
+            </p>
+          </div>
+          <div class="cooperate-main">
+            <div class="cooperate-list">
+              <div class="cooperate-item">
+                <div class="cooperate-item-icon cooperate-item-icon-1"></div>
+                <p class="cooperate-item-text">建筑工程</p>
+              </div>
+              <div class="cooperate-item">
+                <div class="cooperate-item-icon cooperate-item-icon-2"></div>
+                <p class="cooperate-item-text">弱电安防</p>
+              </div>
+              <div class="cooperate-item">
+                <div class="cooperate-item-icon cooperate-item-icon-3"></div>
+                <p class="cooperate-item-text">信息技术</p>
+              </div>
+              <div class="cooperate-item">
+                <div class="cooperate-item-icon cooperate-item-icon-4"></div>
+                <p class="cooperate-item-text">医疗卫生</p>
+              </div>
+              <div class="cooperate-item">
+                <div class="cooperate-item-icon cooperate-item-icon-5"></div>
+                <p class="cooperate-item-text">服务采购</p>
+              </div>
+              <div class="cooperate-item">
+                <div class="cooperate-item-icon cooperate-item-icon-6"></div>
+                <p class="cooperate-item-text">机械设备</p>
+              </div>
             </div>
-        <div class="pop-tip-group active" style="display: none">
-                <div>买1年送1年</div>
+            <div class="cooperate-footer" data-href="/jy_mobile/search/middle/bidding">
+              <div class="cooperate-item-icon cooperate-item-icon-7"></div>
+              <p class="cooperate-item-text">更多行业</p>
+            </div>
+          </div>
         </div>
-        <div class="pop-button" data-need-bind-phone data-url="/jy_mobile/common/order/create/svip?type=buy{{if .T.disWord}}&disWord={{.T.disWord}}{{end}}"  id="vip-introduce">
-                <img data-name="default" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/btnBottom.png?v={{Msg "seo" "version"}}">
-                <img data-name="active" style="display: none"  src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/info/btnBottom1212.png?v={{Msg "seo" "version"}}">
+        <div class="vs-container">
+          <!-- <img src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/image/vs_new.png?v={{Msg "seo" "version"}}' alt="vs"> -->
+           <vip-free-introduce></vip-free-introduce>
         </div>
     </div>
+    <div class="j-footer j-button-group popup-bottom-group">
+        <div class="btn-customer" v-bound-phone="bindPhoneCustomer('/jyapp/free/customer')">咨询客服</div>
+        <div class="btn-buy" v-bound-phone="bindPhoneGoBuy('/jy_mobile/common/order/create/svip?type=buy{{if .T.disWord}}&disWord={{.T.disWord}}{{end}}')" id="vip-introduce">立即购买</div>
+    </div>
 </div>
 <script src='https://cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js'></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js> </script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/js/contrast_function.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/vipsubscribe/js/vip-free-introduce-template.js?v={{Msg "seo" "version"}}'></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/plugins/js/jy-bind-phone.umd.js?v={{Msg "seo" "version"}}'></script>
 <script>
     {{$ss1:=(Ad "app-banner-data-info" -1 .Host (cookie "SESSIONID"))}}
     var headerImageList={{$ss1}}
@@ -207,27 +259,91 @@
             window.history.back()
         })
         // 头部滚动事件
-        $('.j-main .main').on('scroll', function () {
-            var headerDOM = $('.j-header.jy-app-header')
-            var scrollTop = this.scrollTop
+        // $('.j-main .main').on('scroll', function () {
+        //     var headerDOM = $('.j-header.jy-app-header')
+        //     var scrollTop = this.scrollTop
 
-            // 是否有header-transparent这个类名
-            var hasClassT = headerDOM.hasClass('transparent-header')
+        //     // 是否有header-transparent这个类名
+        //     var hasClassT = headerDOM.hasClass('transparent-header')
 
-            if(scrollTop >= 75) {
-                if (!hasClassT) return
-                headerDOM.removeClass('transparent-header')
-            }else {
-                if (hasClassT) return
-                headerDOM.addClass('transparent-header')
-            }
-        })
+        //     if(scrollTop >= 75) {
+        //         if (!hasClassT) return
+        //         headerDOM.removeClass('transparent-header')
+        //     }else {
+        //         if (hasClassT) return
+        //         headerDOM.addClass('transparent-header')
+        //     }
+        // })
 
         // 清除超级订阅购买、续费、升级页面相关的优惠券、商品规格缓存
         sessionStorage.removeItem('vip-cur-select-coupon')
         sessionStorage.removeItem('$select-coupon')
         sessionStorage.removeItem('vip-cur-select-size')
+        function ajaxGetUpdateInfo () {
+          $.ajax({
+            type: 'POST',
+            url: '/jyapi/jybx/base/included',
+            success: function (res) {
+              if (res.data) {
+                var dataJSONObj = res.data
+              // 每日更新
+              $('.day-update-count').text(dataJSONObj.bidDayUpdate + dataJSONObj.bidDayUpdateUnit + dataJSONObj.bidDayUpdateUnitAppend)
+                // 招采甲方
+                $('.purchase-partyA-count').text(dataJSONObj.buyer + dataJSONObj.buyerUnit + dataJSONObj.buyerUnitAppend)
+                // 招采项目
+                $('.purchase-project-count').text(dataJSONObj.project + dataJSONObj.projectUnit + dataJSONObj.projectUnitAppend);
+              }
+            }
+          })
+      }
+      ajaxGetUpdateInfo()
+      var footerHeight = $('.j-footer').outerHeight()
+      $('.vip_introduce').css('padding-bottom', footerHeight)
+      $('.cooperate-footer[data-href]').click(function(){
+        location.href = $(this).attr('data-href')
+      })
     })
+
+  try {
+    Vue.use(TestBindPhone)
+  } catch (error) {}
+	new Vue({
+    el: '#vip-intro-container',
+    data: {},
+    components: {
+      vipFreeIntroduce: vipFreeIntroduceNode
+    },
+    methods: {
+      bindPhoneGoBuy: function(url) {
+        var pass = !loginFlag? function() {
+          window.location.href= "/jyapp/free/login?url=" + url
+        } : null
+        return {
+          props: {
+            name: '超级订阅落地页-立即购买'
+          },
+          pass: pass,
+          next: function () {
+            window.location.href= url
+          }
+        }
+      },
+      bindPhoneCustomer: function(url) {
+        var pass = !loginFlag? function() {
+          window.location.href= "/jyapp/free/login?url=" + url
+        } : null
+        return {
+          props: {
+            name: '超级订阅落地页-咨询客服'
+          },
+          pass: pass,
+          next: function () {
+            window.location.href= url
+          }
+        }
+      }
+    }
+  })
 </script>
 
 {{include "/common/baiducc.html"}}

+ 37 - 2
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_pay_success.html

@@ -35,7 +35,18 @@
     /* .active-tip-group img {
         display: block;
     } */
-
+    .giving-tip{
+      width: 4.22rem;
+      padding: .12rem 0;
+      margin: .36rem auto 0;
+      border: 1px solid#2ABED1;
+      border-radius: .32rem;
+      text-align: center;
+      font-size: .28rem;
+      line-height: .4rem;
+      background: #fff;
+      color: #2ABED1;
+    }
   </style>
 </head>
 <body>
@@ -53,6 +64,7 @@
                     &yen;
                     <em></em>
                 </p>
+                <div class="giving-tip" style="display: none;" onclick="location.href='/jy_mobile/giving/friend'">将超级订阅赠送给好友</div>
             </div>
             <div class="info_box">
                 <div class="pay_mode">
@@ -96,7 +108,8 @@
 
   var title = {{.T.title}}
   var orderCode = {{.T.orderCode}}
-  console.log(orderCode)
+  var positionType = {{.T.positionType}}
+  var vipType = {{.T.vipType}}
 //   if (title.indexOf('超级订阅') !== -1) {
 //     getActiveInfo()
 //   }
@@ -280,7 +293,29 @@
             var money = t.split('').reverse().join('') + point + right;
             return money;
         }
+        getVipGiftConfig()
   })
+  function getVipGiftConfig() {
+    $.ajax({
+      url: '/subscribepay/vip/gift/configuration',
+      type: 'POST',
+      success: function(res) {
+          if(res && res.data) {
+            var startTime = res.data.startTime
+            var endTime = res.data.endTime
+            var isValidPeriod = startTime && endTime && parseInt(startTime) < parseInt(endTime)
+            var nowTime = Math.floor(Date.now() / 1000)
+            var isNewBuy = vipType != 1 && vipType != 2
+            var vipGiftPeriod = isValidPeriod && nowTime >= parseInt(startTime) && nowTime <= parseInt(endTime) && positionType === '0' && isNewBuy
+            if (vipGiftPeriod) {
+              $('.giving-tip').show()
+            } else {
+              $('.giving-tip').hide()
+            }
+          }
+      }
+    })
+  }
 </script>
 {{include "/common/baiducc.html"}}
 </html>

+ 3 - 2
src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go

@@ -374,7 +374,7 @@ func (this *EntPortrait) WinnerMiniPortrait() {
 				entName := qutil.ObjToString(entInfo["entName"])
 				if entName != "" {
 					if contactList, err := cepm.GetContacts(entName, ContactEntTypeWinner); err == nil {
-						rData["contactCount"] = GetContactCount(contactList)
+						rData["contactCount"] = len(contactList)
 					} else {
 						rData["contactCount"] = 0
 					}
@@ -684,7 +684,7 @@ func (this *EntPortrait) BuyerMiniPortrait() {
 			rData["biddingCount"] = cepm.GetBuyerNewCount(entName)
 			//采购联系人数量
 			if contactList, err := cepm.GetContacts(entName, ContactEntTypeBuyer); err == nil {
-				rData["contactCount"] = GetContactCount(contactList)
+				rData["contactCount"] = len(contactList)
 			}
 			//
 			if config.Config.MiniPortraitCacheTime > 0 {
@@ -777,6 +777,7 @@ func (this *EntPortrait) NoLoginAssociatedInfo() {
 	this.ServeJson(NewResult(rData, nil))
 }
 
+// 已弃用  在p705版本调整为不去重
 // GetContactCount 联系方式去重后的数量 p406 根据联系方式去重
 func GetContactCount(contactList []interface{}) (count int) {
 	exists := map[string]struct{}{}

+ 16 - 0
src/jfw/modules/bigmember/src/service/use/use.go

@@ -8,6 +8,7 @@ import (
 	"jy/src/jfw/modules/bigmember/src/entity"
 	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
+	"regexp"
 	"strconv"
 	"strings"
 	"time"
@@ -204,6 +205,8 @@ func (u *Use) Add() {
 	u.ServeJson(r)
 }
 
+var rx = regexp.MustCompile("\n+")
+
 // 用户大会员信息
 func (u *Use) Info() {
 	r := func() Result {
@@ -268,7 +271,20 @@ func (u *Use) Info() {
 						tmp := qu.ObjToMap(v.(map[string]interface{}))
 						a_key, _ := (*tmp)["a_key"].([]interface{})
 						for _, n := range a_key {
+							var keywords []string
 							ntmp := qu.ObjToMap(n.(interface{}))
+							keyS := qu.ObjArrToStringArr((*ntmp)["key"].([]interface{}))
+							if len(keyS) > 0 {
+								for _, key := range keyS {
+									if key = strings.TrimSpace(rx.ReplaceAllString(key, " ")); key != "" {
+										keywords = append(keywords, key)
+									}
+								}
+							}
+							if len(keywords) == 0 {
+								continue
+							}
+							(*ntmp)["key"] = keywords
 							if (*ntmp)["appendkey"] != nil && (*ntmp)["updatetime"] == nil {
 								appendkey := qu.ObjArrToStringArr((*ntmp)["appendkey"].([]interface{}))
 								if len(appendkey) > 0 {

+ 19 - 11
src/jfw/modules/publicapply/src/activityday/config.json

@@ -19,25 +19,33 @@
       "328974233@qq.com",
       "18238182402@163.com"
     ],
-    "title": "%v,%s库存还剩%d个",
-    "content": "%v,%s库存还剩%d个,请注意",
+    "title": "%v,%s库存-设置库存还剩%d个,实际库存还剩%d",
+    "content": "%v,%s设置库存还剩%d个,实际库存还剩%d个,请注意",
     "reTry": 3
   },
   "webSiteParameter": {
-    "addr": "https://webdev-qmx_admin.jydev.jianyu360.com/api/admin/",
+    "addr": "https://web-qmx_admin.jydev.jianyu360.com/api/admin/",
     "action": "/message/sendMessageApi"
   },
   "siteMsg": {
     "callPlatform": "publicapply",
     "msgType": 13,
     "title": "%s已到账,立即兑换!",
-    "content": "恭喜您在“%s”获得%s,兑换码:%s。兑换截止日期:%s。点击链接<a style=\"color:blue\" href=\"%s\" target=\"_blank\">%s</a>进行兑换。#jy#%s#jy#兑换码%s。点击查看兑换地址。",
-    "link": "",
-    "androidUrl": "",
-    "iosUrl": "",
-    "weChatUrl": ""
+    "content": "恭喜您在“%s”获得%s,兑换码需在获取当天兑换,逾期不予补发。点击到兑换中心进行兑换。#jy#%s#jy#点击查看兑换地址。",
+    "link": "/page_workDesktop/work-bench/app/web-pc/equity/exchange?tab=2&select=1",
+    "androidUrl": "/jy_mobile/equitycenter/page?inside-jumps=1\u0026tab=other\u0026select=1",
+    "iosUrl": "/jy_mobile/equitycenter/page?inside-jumps=1\u0026tab=other\u0026select=1",
+    "weChatUrl": "/jy_mobile/equitycenter/page?inside-jumps=1\u0026tab=other\u0026select=1"
   },
-  "webhookURL": ["https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=78864582-d770-452f-a55d-e8d17c647f31"],
+  "webhookURL": [
+    "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=78864582-d770-452f-a55d-e8d17c647f31"
+  ],
   "drawNum": 20,
-  "firstAccessSwitch": true
-}
+  "firstAccessSwitch": true,
+  "internalSwitch": true,
+  "internalMsg": "当前用户在内部名单中,不能参与活动。",
+  "exchangeUrl": {
+    "pc": "/page_workDesktop/work-bench/app/web-pc/equity/exchange?tab=2&select=1",
+    "mobile": "/jy_mobile/equitycenter/page?inside-jumps=1\u0026tab=other\u0026select=1"
+  }
+}

+ 9 - 3
src/jfw/modules/publicapply/src/activityday/config/config.go

@@ -35,9 +35,15 @@ type config struct {
 		IosUrl       string `json:"iosUrl"`
 		WeChatUrl    string `json:"weChatUrl"`
 	} `json:"siteMsg"`
-	WebhookURL []string `json:"webhookURL"`
-	DrawNum    int      `json:"drawNum"`           //一次最大抽奖次数
-	FASwitch   bool     `json:"firstAccessSwitch"` //首次访问 是否赠送剑鱼币 开关
+	WebhookURL     []string `json:"webhookURL"`
+	DrawNum        int      `json:"drawNum"`           //一次最大抽奖次数
+	FASwitch       bool     `json:"firstAccessSwitch"` //首次访问 是否赠送剑鱼币 开关
+	InternalSwitch bool     `json:"internalSwitch"`    //内部员工抽奖兑换开关
+	InternalMsg    string   `json:"internalMsg"`       //提示信息
+	ExchangeUrl    struct {
+		Pc     string `json:"pc"`
+		Mobile string `json:"mobile"`
+	} `json:"exchangeUrl"`
 }
 
 var (

+ 2 - 1
src/jfw/modules/publicapply/src/activityday/consts/consts.go

@@ -73,5 +73,6 @@ var (
 	OrderErrMsg                       = "您当前条件不符合参与该抽奖活动!" //非常抱歉,您暂不满足抽奖条件!
 	ActivateRule                      = &sync.Map{}
 	ActivateName                      = &sync.Map{}
-	ErrUserMsg                        = "什么都没有抽到" // 异常用户抽不到
+	ErrUserMsg                        = "什么都没有抽到"                              // 异常用户抽不到
+	TableInsider                      = "data_analysis.dwd_f_userbase_insider" //内部员工信息
 )

+ 26 - 0
src/jfw/modules/publicapply/src/activityday/dao/InternalCheck.go

@@ -0,0 +1,26 @@
+package dao
+
+import (
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/activityday/config"
+	"jy/src/jfw/modules/publicapply/src/activityday/consts"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"strings"
+)
+
+func InternalCheck(sessVal map[string]interface{}) (msg string) {
+	mgoUserId := qutil.InterfaceToStr(sessVal["mgoUserId"])
+	phone := qutil.InterfaceToStr(sessVal["phone"])
+	insiderCondition := []string{"dfui.userid  = ? "}
+	params := []interface{}{mgoUserId}
+	if phone != "" {
+		insiderCondition = append(insiderCondition, "OR  dfui.mobile  = ?")
+		params = append(params, phone)
+	}
+	insiderSql := fmt.Sprintf(`SELECT COUNT(dfui.userid)  FROM %s dfui WHERE  %s`, consts.TableInsider, strings.Join(insiderCondition, ""))
+	if count := db.BaseMysql.CountBySql(insiderSql, params...); count > 0 {
+		msg = config.Config.InternalMsg
+	}
+	return
+}

+ 10 - 7
src/jfw/modules/publicapply/src/activityday/dao/dao.go

@@ -200,22 +200,18 @@ func GetLotteryUserAccount(positionId, activeId int64, platform string) *[]map[s
     pbi.attribute,
     pbi.url,
     pbi.notes,
-    a.create_time,
-    e.code,
-    e.ex_end_time
+    a.create_time
 FROM
     %s a
         LEFT JOIN
     %s b ON (a.active_id = b.active_id
         AND a.prize_id = b.id)
         LEFT JOIN %s pbi ON b.pb_id = pbi.id
-        LEFT JOIN
-    %s e ON (a.equity_id = e.id)
 WHERE
     a.position_id = ?
-    AND a.active_id = ?;`
+    AND a.active_id = ? order by a.create_time;`
 
-	query := fmt.Sprintf(q, consts.TableUserAccount, consts.TablePrizeInfo, consts.TablePrizeBaseInfo, consts.TableEquityInfo)
+	query := fmt.Sprintf(q, consts.TableUserAccount, consts.TablePrizeInfo, consts.TablePrizeBaseInfo)
 	rs := db.Mysql.SelectBySql(query, positionId, activeId)
 	if rs == nil || len(*rs) == 0 {
 		return &[]map[string]interface{}{}
@@ -227,6 +223,13 @@ WHERE
 		} else {
 			(*rs)[i]["url"] = ""
 		}
+		if common.IntAll((*rs)[i]["attribute"]) == 1 {
+			if platform == "pc" {
+				(*rs)[i]["url"] = config.Config.ExchangeUrl.Pc
+			} else {
+				(*rs)[i]["url"] = config.Config.ExchangeUrl.Mobile
+			}
+		}
 	}
 	return rs
 }

+ 32 - 38
src/jfw/modules/publicapply/src/activityday/dao/drawLottery.go

@@ -7,6 +7,7 @@ import (
 	"database/sql"
 	"encoding/json"
 	"fmt"
+	"jy/src/jfw/modules/publicapply/src/activityday/config"
 	"jy/src/jfw/modules/publicapply/src/activityday/consts"
 	au "jy/src/jfw/modules/publicapply/src/activityday/util"
 	"jy/src/jfw/modules/publicapply/src/db"
@@ -141,7 +142,7 @@ func (r *RaffleInfo) DistributePrize() (err error) {
 			updatePrizeInfo := fmt.Sprintf("UPDATE %s lpi SET lpi.inventory = lpi.inventory - 1 WHERE lpi.active_id = ? AND lpi.id = ?  AND lpi.state = 0;", consts.TablePrizeInfo)
 			if pi := db.BaseMysql.UpdateOrDeleteBySqlByTx(tx, updatePrizeInfo, r.Prize.ActiveId, r.Prize.Id); pi <= 0 {
 				r.Steps = consts.Steps1
-				err = fmt.Errorf(fmt.Sprintf("更新 %s 表-%s 奖品库存失败,奖品id:%r ,活动id:%r ", consts.TablePrizeInfo, r.Prize.Name, r.Prize.Id, r.Prize.ActiveId))
+				err = fmt.Errorf(fmt.Sprintf("更新 %s 表-%s 奖品库存失败,奖品id:%v ,活动id:%v ", consts.TablePrizeInfo, r.Prize.Name, r.Prize.Id, r.Prize.ActiveId))
 				return
 			}
 			switch r.Prize.Attribute { //奖品属性:默认0:剑鱼;>0:第三方权益
@@ -159,25 +160,13 @@ func (r *RaffleInfo) DistributePrize() (err error) {
 					}
 				}
 			default: //第三方权益
-				//TODO: 查询兑换码信息
-				nowStr := date.NowFormat(date.Date_Full_Layout)
-				redeemCodeSql := fmt.Sprintf("SELECT * FROM %s ei WHERE ei.active_id = ? AND ei.prize_id = ? AND ei.state = 0 and ei.ex_end_time>? LIMIT 1;", consts.TableEquityInfo)
-				equityInfos := db.BaseMysql.SelectBySqlByTx(tx, redeemCodeSql, r.Prize.ActiveId, r.Prize.Id, nowStr)
-				if equityInfos != nil && len(*equityInfos) > 0 {
-					equityInfo := (*equityInfos)[0]
-					r.Prize.RedeemId = common.Int64All(equityInfo["id"])
-					r.Prize.RedeemCode = common.ObjToString(equityInfo["code"])
-					r.Prize.RedeemDeadline = strings.Split(common.ObjToString(equityInfo["ex_end_time"]), " ")[0] //天
-					log.Println(equityInfo, "-第三方--奖品信息--:", r.Prize, r.UserInfo.Phone)
-				} else {
-					err = fmt.Errorf("未查到第三方权益码信息")
-					r.Steps = consts.Steps6
-				}
+				log.Println("抽到了第三方权益:", r.UserInfo.Phone, r.UserInfo.UserId, r.UserInfo.PositionId, r.Prize.ActiveId, r.Prize.Id)
 			}
 			if err != nil {
 				return
 			}
 			log.Println("orderCode:", orderCode)
+			// 计算过期时间
 			//TODO: 更新用户中奖记录表
 			insertUA := map[string]interface{}{
 				"active_id":   r.Prize.ActiveId,      //关联活动id
@@ -185,11 +174,11 @@ func (r *RaffleInfo) DistributePrize() (err error) {
 				"phone":       r.UserInfo.Phone,      //用户手机号
 				"position_id": r.UserInfo.PositionId, //用户职位id
 				"mgo_user_id": r.UserInfo.MgoUserId,  //用户mgo user id
-				"equity_id":   r.Prize.RedeemId,      //第三方奖品关联奖品内容表id(equity_info表)
 				"order_code":  orderCode,             //关联订单表code
 				"user_agent":  r.UA,
 				"ip":          r.Ip,
 				"create_time": date.FormatDate(&now, date.Date_Full_Layout), //中奖时间
+				"expires":     date.FormatDateByInt64(&r.DLai.ActiveEndTime, date.Date_Full_Layout),
 			}
 			// 如果是app端 把s_opushid 存到redis里面
 			if r.Platform == "app" {
@@ -208,21 +197,21 @@ func (r *RaffleInfo) DistributePrize() (err error) {
 				r.Steps = consts.Steps7
 				return
 			}
-			if r.Prize.Attribute > 0 {
-				//TODO 更新第三方权益码信息
-				if ok := db.BaseMysql.UpdateByTx(tx, consts.TableEquityInfo, map[string]interface{}{
-					"id": r.Prize.RedeemId,
-				}, map[string]interface{}{
-					"state":       1,
-					"order_code":  orderCode,
-					"update_time": time.Now().Format(date.Date_Full_Layout),
-				}); !ok {
-					err = fmt.Errorf("更新第三方权益码信息异常")
-					r.Steps = consts.Steps8
-					return
-				}
-
-			}
+			//if r.Prize.Attribute > 0 {
+			//	//TODO 更新第三方权益码信息
+			//	if ok := db.BaseMysql.UpdateByTx(tx, consts.TableEquityInfo, map[string]interface{}{
+			//		"id": r.Prize.RedeemId,
+			//	}, map[string]interface{}{
+			//		"state":       1,
+			//		"order_code":  orderCode,
+			//		"update_time": time.Now().Format(date.Date_Full_Layout),
+			//	}); !ok {
+			//		err = fmt.Errorf("更新第三方权益码信息异常")
+			//		r.Steps = consts.Steps8
+			//		return
+			//	}
+			//
+			//}
 			//TODO 更新中奖缓存信息
 			err = r.UpdateRedisCacheForWinningPrizePlus()
 			if err != nil {
@@ -241,7 +230,7 @@ func (r *RaffleInfo) UpdateRedisCacheForWinningPrizePlus() (err error) {
 	prizeKey := fmt.Sprintf(consts.PrizeKey, r.Prize.Name, r.Prize.Id, r.Prize.ActiveId, time.Now().Day())
 	if ok := redis.Put(consts.RedisCode, prizeKey, redis.GetInt(consts.RedisCode, prizeKey)+1, consts.OneDayTimeOut); !ok { //缓存1天
 		//通过企业微信发送给开发告警信息 redis缓存更新失败--------------------?
-		err = fmt.Errorf(fmt.Sprintf("redis缓存更新失败,奖品名称:%s,奖品id:%r,活动名称:%s,活动id:%r", r.Prize.Name, r.Prize.Id, r.DLai.Name, r.Prize.ActiveId))
+		err = fmt.Errorf(fmt.Sprintf("redis缓存更新失败,奖品名称:%s,奖品id:%v,活动名称:%s,活动id:%v", r.Prize.Name, r.Prize.Id, r.DLai.Name, r.Prize.ActiveId))
 	}
 	return
 }
@@ -251,7 +240,7 @@ func (r *RaffleInfo) UpdateRedisCacheForWinningPrizeMinus() (err error) {
 	prizeKey := fmt.Sprintf(consts.PrizeKey, r.Prize.Name, r.Prize.Id, r.Prize.ActiveId, time.Now().Day())
 	if ok := redis.Put(consts.RedisCode, prizeKey, redis.GetInt(consts.RedisCode, prizeKey)-1, consts.OneDayTimeOut); !ok { //缓存1天
 		//通过企业微信发送给开发告警信息 redis缓存更新失败--------------------?
-		err = fmt.Errorf(fmt.Sprintf("redis缓存更新失败,奖品名称:%s,奖品id:%r,活动名称:%s,活动id:%r", r.Prize.Name, r.Prize.Id, r.DLai.Name, r.Prize.ActiveId))
+		err = fmt.Errorf(fmt.Sprintf("redis缓存更新失败,奖品名称:%s,奖品id:%v,活动名称:%s,活动id:%v", r.Prize.Name, r.Prize.Id, r.DLai.Name, r.Prize.ActiveId))
 	}
 	return
 }
@@ -267,14 +256,12 @@ func (r *RaffleInfo) SendMsgInfo(errInfo error) (err error) {
 			PositionId:   strconv.FormatInt(r.UserInfo.PositionId, 10),
 			PrizeName:    r.Prize.Name,
 			ActivityName: r.DLai.Name,
-			Code:         r.Prize.RedeemCode,
-			ExEndTime:    r.Prize.RedeemDeadline,
 			Link:         r.Prize.Url,
 		})
 	}
-	//2、库存告警通知
-	if r.Prize.AlarmSwitch == 0 && r.Prize.Inventory-1 <= r.Prize.AlarmThreshold {
-		au.SendAlarmMail(r.DLai.Name, r.Prize.Name, r.Prize.Inventory-1)
+	////2、库存告警通知
+	if r.Prize.AlarmSwitch == 0 && r.Prize.Inventory-1 <= r.Prize.AlarmThreshold && r.Prize.Attribute < 1 {
+		au.SendAlarmMail(r.DLai.Name, r.Prize.Name, r.Prize.Inventory-1,r.Prize.Inventory-1)
 	}
 	//3、异常企业微信通知
 	if errInfo != nil {
@@ -302,6 +289,13 @@ func (r *RaffleInfo) GetPrizeInfo() (u string, s string) {
 			s = consts.WinnerPrizeMsg_VIP
 		case strings.Contains(r.Prize.Name, "剑鱼币"):
 			s = consts.WinnerPrizeMsg_Point
+		default:
+			if platform == "pc" {
+				u = config.Config.ExchangeUrl.Pc
+			} else {
+				u = config.Config.ExchangeUrl.Mobile
+			}
+			s = r.Prize.Notes
 		}
 	}
 	return

+ 149 - 18
src/jfw/modules/publicapply/src/activityday/dao/exchange.go

@@ -45,10 +45,47 @@ func (e *Ex) Redeem() (r entity.Redeem, msg string) {
 	defer RedeemLock.Unlock()
 	db.BaseMysql.ExecTx("兑换", func(tx *sql.Tx) bool {
 		msg = "当前会员库存不足,请选择其他会员获取兑换码."
+		if e.ActiveId != 6 {
+			msg = "库存不足,请联系客服"
+		}
 		positionId := common.Int64All(e.Sess["positionId"])
-		prizeInfoSql := fmt.Sprintf(`SELECT  pbi.name,pbi.url   ,lpi.inventory ,lpi.alarm_switch ,lpi.alarm_threshold   FROM %s  lpi LEFT JOIN %s pbi  ON lpi.pb_id  = pbi.id  WHERE lpi.active_id  = ? AND  lpi.id  = ?  AND  lpi.state  = 0 AND lpi.inventory >0  FOR UPDATE;`, consts.TablePrizeInfo, consts.TablePrizeBaseInfo)
+		// 校验有效性
+		accountSql := fmt.Sprintf(`SELECT lua.active_id,lua.prize_id, lua.order_code ,lua.phone,lua.product_info_id  FROM %s lua WHERE lua.id  = ? AND  lua.active_id  = ? AND  lua.position_id  = ? and lua.expires>now() and lua.equity_id is null FOR UPDATE;`, consts.TableUserAccount)
+		accountInfos := db.BaseMysql.SelectBySqlByTx(tx, accountSql, e.AccountId, e.ActiveId, positionId)
+		if accountInfos == nil || len(*accountInfos) == 0 {
+			log.Println("兑换无效")
+			return false
+		}
+		var orderCode string
+		av := (*accountInfos)[0]
+		if e.ActiveId == 6 {
+			orderCode = common.InterfaceToStr(av["order_code"])
+			phone := common.InterfaceToStr(av["phone"])
+			productInfoId := av["product_info_id"]
+			log.Println(orderCode, "--phone--", phone, "product_info_id--", productInfoId)
+			//校验prize_id 是当前规则可选的有
+			existSql := fmt.Sprintf("SELECT count(*) FROM %s where product_info_id=? and prize_id=? ", consts.TableProductRule)
+			existCount := db.BaseMysql.CountBySql(existSql, productInfoId, e.Id)
+			if existCount <= 0 {
+				log.Println("超级订阅 》 规则无效")
+				return false
+			}
+		} else {
+			prizeId := common.Int64All(av["prize_id"])
+			activeId := common.Int64All(av["active_id"])
+			if prizeId != e.Id || activeId != e.ActiveId {
+				log.Println(prizeId, "--prizeId--", e.Id, "--参数异常--", activeId, "activeId--", e.ActiveId)
+				return false
+			}
+		}
+		inventorySql := ""
+		if e.ActiveId == 6 {
+			inventorySql = " AND lpi.inventory >0 "
+		}
+		prizeInfoSql := fmt.Sprintf(`SELECT  pbi.name,pbi.url   ,lpi.inventory ,lpi.alarm_switch ,lpi.alarm_threshold   FROM %s  lpi LEFT JOIN %s pbi  ON lpi.pb_id  = pbi.id  WHERE lpi.active_id  = ? AND  lpi.id  = ?  AND  lpi.state  = 0 %s FOR UPDATE;`, consts.TablePrizeInfo, consts.TablePrizeBaseInfo, inventorySql)
 		prizeInfos := db.BaseMysql.SelectBySqlByTx(tx, prizeInfoSql, e.ActiveId, e.Id)
 		if prizeInfos == nil || len(*prizeInfos) == 0 {
+			log.Println("产品信息 异常")
 			return false
 		}
 		pv := (*prizeInfos)[0]
@@ -56,7 +93,8 @@ func (e *Ex) Redeem() (r entity.Redeem, msg string) {
 		inventory := common.IntAll(pv["inventory"])            //库存
 		alarmSwitch := common.IntAll(pv["alarm_switch"])       //告警开关0:打开;1:关闭
 		alarmThreshold := common.IntAll(pv["alarm_threshold"]) //奖品告警阈值
-		if inventory <= 0 {
+		if inventory <= 0 && e.ActiveId == 6 {
+			log.Println("超级订阅 》 当前奖品库存不足")
 			return false
 		}
 		address := ""
@@ -66,46 +104,61 @@ func (e *Ex) Redeem() (r entity.Redeem, msg string) {
 				address = common.InterfaceToStr((*urlMap)[e.Platform])
 			}
 		}
-		//减少库存
-		updatePrizeInfoSql := fmt.Sprintf(`UPDATE %s lpi SET lpi.inventory = lpi.inventory -1 WHERE  lpi.id  =  ?`, consts.TablePrizeInfo)
-		if pid := db.BaseMysql.UpdateOrDeleteBySqlByTx(tx, updatePrizeInfoSql, e.Id); pid <= 0 {
-			return false
+		if e.ActiveId == 6 {
+			//减少库存
+			updatePrizeInfoSql := fmt.Sprintf(`UPDATE %s lpi SET lpi.inventory = lpi.inventory -1 WHERE  lpi.id  =  ?`, consts.TablePrizeInfo)
+			if pid := db.BaseMysql.UpdateOrDeleteBySqlByTx(tx, updatePrizeInfoSql, e.Id); pid <= 0 {
+				log.Println("超级订阅 》 当前奖品库存更新异常")
+				return false
+			}
 		}
 		//分发兑换码 第一步 获取兑换码
 		equitySql := fmt.Sprintf(`SELECT  ei.id ,ei.code ,ei.ex_end_time  FROM %s ei  WHERE ei.active_id  =? AND  ei.prize_id  = ? AND ei.state =0 AND  ei.ex_end_time  > NOW() ORDER BY ei.ex_end_time ASC LIMIT 1  FOR UPDATE;`, consts.TableEquityInfo)
 		equityInfos := db.BaseMysql.SelectBySqlByTx(tx, equitySql, e.ActiveId, e.Id)
 		if equityInfos == nil || len(*equityInfos) == 0 {
+			log.Println("分发兑换码 第一步 获取兑换码 异常")
 			return false
 		}
 		ev := (*equityInfos)[0]
 		equityId := common.Int64All(ev["id"])
 		equityCode := common.InterfaceToStr(ev["code"])
 		if equityCode == "" {
+			log.Println("获取兑换码 异常")
 			return false
 		}
 		//分发兑换码 第二步 更新账户表 奖品信息
-		accountSql := fmt.Sprintf(`SELECT lua.order_code ,lua.phone  FROM %s lua WHERE lua.id  = ? AND  lua.active_id  = ? AND  lua.position_id  = ? FOR UPDATE;`, consts.TableUserAccount)
-		accountInfos := db.BaseMysql.SelectBySqlByTx(tx, accountSql, e.AccountId, e.ActiveId, positionId)
-		if accountInfos == nil || len(*accountInfos) == 0 {
-			return false
-		}
-		av := (*accountInfos)[0]
-		orderCode := common.InterfaceToStr(av["order_code"])
-		phone := common.InterfaceToStr(av["phone"])
-		log.Println(orderCode, "--phone--", phone)
 		updateAccountSql := fmt.Sprintf(`UPDATE %s lua  SET lua.prize_id = ? ,lua.equity_id = ? , lua.update_time  =  NOW() WHERE lua.id  = ? `, consts.TableUserAccount)
 		if ai := db.BaseMysql.UpdateOrDeleteBySqlByTx(tx, updateAccountSql, e.Id, equityId, e.AccountId); ai <= 0 {
+			log.Println("分发兑换码 第二步 更新账户表 异常")
 			return false
 		}
 		//分发兑换码 第三步 更新兑换码 已被 使用
 		updateEquitySql := fmt.Sprintf(`UPDATE %s ei SET ei.state  = 1,ei.order_code = ?,ei.update_time  = NOW() WHERE ei.id  = ?`, consts.TableEquityInfo)
 		if ei := db.BaseMysql.UpdateOrDeleteBySqlByTx(tx, updateEquitySql, orderCode, equityId); ei <= 0 {
+			log.Println("分发兑换码 第三步 更新兑换码 已被 使用 异常")
+			return false
+		}
+		// 查询兑换码实际库存
+		codeCountSql := fmt.Sprintf("select count(*) from %s where state=0 and ex_end_time>now() and active_id=? and prize_id=?", consts.TableEquityInfo)
+		codeCount := db.BaseMysql.CountBySqlByTx(tx, codeCountSql, e.ActiveId, e.Id)
+		if codeCount < 0 {
+			log.Println("分发兑换码 查询实际库存异常")
 			return false
 		}
 		//告警
-		if alarmSwitch == 0 && inventory-1 <= alarmThreshold {
+		alarmName := "超级订阅赠送三方会员"
+		alarmCount := inventory - 1
+		if e.ActiveId != 6 {
+			alarmName = "抽奖活动"
+			nameRs := db.BaseMysql.SelectBySql(fmt.Sprintf("SELECT `name`  FROM %s where id=?;", consts.TableActivityInfo), e.ActiveId)
+			if nameRs != nil && len(*nameRs) > 0 {
+				alarmName = common.ObjToString((*nameRs)[0]["name"])
+			}
+			alarmCount = inventory
+		}
+		if alarmSwitch == 0 && int(codeCount) <= alarmThreshold {
 			name := func(activeId int64) (name string) {
-				name = "超级订阅赠送三方会员"
+				name = alarmName
 				value, ok := consts.ActivateName.Load(activeId)
 				log.Printf("库存告警日志:  name:%v, consts.ActivateName:%v, activeId: %v,value:%v,ok:%v \n", name, consts.ActivateName, activeId, value, ok)
 				if ok {
@@ -113,7 +166,7 @@ func (e *Ex) Redeem() (r entity.Redeem, msg string) {
 				}
 				return
 			}(e.ActiveId)
-			go au.SendAlarmMail(name, prizeName, inventory-1)
+			go au.SendAlarmMail(name, prizeName, alarmCount, int(codeCount))
 		}
 		msg = ""
 		r = entity.Redeem{
@@ -243,3 +296,81 @@ func (e *Ex) GetRecords() (ex *entity.ExchangeData) {
 	}
 	return
 }
+
+// GetDrawRecords 抽奖活动 中奖历史记录
+func (e *Ex) GetDrawRecords() (ex *entity.ExchangeData) {
+	positionId := common.Int64All(e.Sess["positionId"])
+	unionSql := fmt.Sprintf(`SELECT lua.id,lua.active_id,lua.prize_id,lua.create_time , lua.update_time  , lpi.pb_id ,pbi.name ,ei.code ,lua.expires ,pbi.url
+FROM  %s lua
+LEFT JOIN %s lpi ON lpi.id  = lua.prize_id AND  lpi.active_id  = lua.active_id
+LEFT JOIN %s pbi ON pbi.id  = lpi.pb_id
+LEFT JOIN %s ei ON ei.id  = lua.equity_id
+WHERE lua.position_id  =  ? AND pbi.attribute > 0 AND  lua.active_id  != 6 ORDER BY lua.update_time DESC `,
+		consts.TableUserAccount,
+		consts.TablePrizeInfo,
+		consts.TablePrizeBaseInfo,
+		consts.TableEquityInfo,
+	)
+	records := db.BaseMysql.SelectBySql(unionSql, positionId)
+	if records != nil && len(*records) > 0 {
+		ex = &entity.ExchangeData{
+			Pending:   []*entity.ExchangeList{},
+			Processed: []*entity.ExchangeList{},
+			Address:   "",
+		}
+		for _, rv := range *records {
+			urlMap := common.ObjToMap(rv["url"])
+			if ex.Address == "" && urlMap != nil && len(*urlMap) > 0 {
+				if urlMap != nil {
+					ex.Address = common.InterfaceToStr((*urlMap)[e.Platform])
+				}
+			}
+			activeId := encrypt.SE.EncodeString(common.InterfaceToStr(rv["active_id"]))
+			prizeId := encrypt.SE.EncodeString(common.InterfaceToStr(rv["prize_id"]))
+			accountId := encrypt.SE.EncodeString(common.InterfaceToStr(rv["id"]))
+			createDate := strings.ReplaceAll(strings.Split(common.InterfaceToStr(rv["create_time"]), " ")[0], "-", ".")
+			exDate := strings.ReplaceAll(strings.Split(common.InterfaceToStr(rv["update_time"]), " ")[0], "-", ".") //兑换时间
+			exCode := common.InterfaceToStr(rv["code"])
+			partyName := common.InterfaceToStr(rv["name"])
+			if exCode != "" { //已兑换
+				ex.Processed = append(ex.Processed, &entity.ExchangeList{
+					ActiveId:   activeId,
+					AccountId:  accountId,
+					CreateDate: createDate,
+					State:      1,
+					ExCode:     exCode,
+					PartyName:  partyName,
+					EXDate:     exDate,
+				})
+			} else { //未兑换
+				//判断是否已经过期
+				isExpires := func(expires string) bool {
+					expiresTime, err := time.ParseInLocation(date.Date_Full_Layout, expires, time.Local)
+					if err == nil && time.Now().After(expiresTime) {
+						return true
+					}
+					return false
+				}
+				if isExpires(common.InterfaceToStr(rv["expires"])) { //未兑换-已过期
+					ex.Processed = append(ex.Processed, &entity.ExchangeList{
+						ActiveId:   activeId,
+						AccountId:  accountId,
+						PartyName:  partyName,
+						CreateDate: createDate,
+						State:      -1,
+					})
+				} else { //未兑换-未过期
+					ex.Pending = append(ex.Pending, &entity.ExchangeList{
+						ActiveId:   activeId,
+						AccountId:  accountId,
+						PartyName:  partyName,
+						CreateDate: createDate,
+						State:      0,
+						PrizeId:    prizeId,
+					})
+				}
+			}
+		}
+	}
+	return
+}

+ 42 - 0
src/jfw/modules/publicapply/src/activityday/dao/history.go

@@ -0,0 +1,42 @@
+package dao
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/activityday/consts"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"time"
+)
+
+type SHistory struct {
+	Sess map[string]interface{}
+}
+
+func NewHistoryList(sess map[string]interface{}) *SHistory {
+	return &SHistory{Sess: sess}
+}
+
+type HistoryList struct {
+	Id     string //加密后的活动id
+	Name   string //活动名称
+	IsOver bool   //活动 是否已结束
+}
+
+func (s *SHistory) GetHistoryList() (hl []HistoryList) {
+	historySql := fmt.Sprintf(`SELECT  lua.phone,ai.name,ai.end_time,ai.id FROM %s lua  LEFT JOIN %s ai  ON lua.active_id  = ai.id WHERE  lua.position_id  = ? GROUP BY ai.id `, consts.TableUserAccount, consts.TableActivityInfo)
+	positionId := common.Int64All(s.Sess["positionId"])
+	data := db.BaseMysql.SelectBySql(historySql, positionId)
+	if data != nil && len(*data) > 0 {
+		for _, v := range *data {
+			et, _ := time.ParseInLocation(date.Date_Full_Layout, common.ObjToString(v["end_time"]), time.Local)
+			hl = append(hl, HistoryList{
+				Id:     encrypt.SE.EncodeString(fmt.Sprintf("%d", common.Int64All(v["id"]))),
+				Name:   common.InterfaceToStr(v["name"]),
+				IsOver: time.Now().After(et),
+			})
+		}
+	}
+	return
+}

+ 14 - 8
src/jfw/modules/publicapply/src/activityday/dao/raffle.go

@@ -110,7 +110,9 @@ func (r *RaffleInfo) Raffle() (int, error, entity.WinnerPrizeInfo) {
 			return
 		}
 		//redis加锁
-		client.AcquireLock()
+		if !client.AcquireLock() {
+			return
+		}
 		//redis 释放锁
 		defer client.ReleaseLock()
 		var (
@@ -194,7 +196,7 @@ func (r *RaffleInfo) Raffle() (int, error, entity.WinnerPrizeInfo) {
 		}
 		//抽奖--权重及有效奖品整理
 		r.WeightsAccumulated()
-		if len(*r.DLpi) == 0 || len(r.WeightList) == 0 {
+		if len(*r.DLpi) == 0 || len(r.WeightList) == 0 || r.TotalWeight == 0 {
 			//暂无库存
 			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_NoPreze, timeStr))
 			//是否是活动结束当天
@@ -389,13 +391,17 @@ func (r *RaffleInfo) UserAccountInfo() (ua *Lua, err error) {
 			)
 			//今日是否已中奖
 			if now.Format(date.Date_Short_Layout) == strings.Split(createTime, " ")[0] {
-				todayNum += 1
+				todayNum = 1
 			}
-			(*ua)[pk] = &entity.LotteryUserAccount{
-				ActiveId:   activeId,
-				PrizeId:    prizeInfoId,
-				CreateTime: createTime,
-				TodayNum:   todayNum,
+			if _, ok := (*ua)[pk]; ok {
+				(*ua)[pk].TodayNum += todayNum
+			} else {
+				(*ua)[pk] = &entity.LotteryUserAccount{
+					ActiveId:   activeId,
+					PrizeId:    prizeInfoId,
+					CreateTime: createTime,
+					TodayNum:   todayNum,
+				}
 			}
 			//此类奖品--中奖时间
 			r.PrizeTimesMap[pm] = append(r.PrizeTimesMap[pm], createTime)

+ 2 - 0
src/jfw/modules/publicapply/src/activityday/entity/exchange.go

@@ -10,6 +10,8 @@ type ExchangeList struct {
 	ExCode     string `json:"ex_code"`
 	PartyName  string `json:"party_name"`
 	EXDate     string `json:"ex_date"` //兑换时间
+	ActiveId   string `json:"active_id"`
+	PrizeId    string `json:"prize_id"` //
 }
 
 // 兑换列表返回结构体

+ 8 - 6
src/jfw/modules/publicapply/src/activityday/service/action.go

@@ -4,10 +4,12 @@ import "app.yhyue.com/moapp/jybase/go-xweb/xweb"
 
 type ActivityDay struct {
 	*xweb.Action
-	list    xweb.Mapper `xweb:"/activity/day/list"`   //我的奖品列表
-	info    xweb.Mapper `xweb:"/activity/day/info"`   //抽奖活动信息
-	raffle  xweb.Mapper `xweb:"/activity/day/raffle"` //抽奖
-	records xweb.Mapper `xweb:"/activity/records"`    //超级订阅下单三方会员兑换列表
-	parties xweb.Mapper `xweb:"/activity/parties"`    //超级订阅下单兑换三方会员列表
-	redeem  xweb.Mapper `xweb:"/activity/redeem"`     //超级订阅下单兑换接口
+	list        xweb.Mapper `xweb:"/activity/day/list"`    //我的奖品列表
+	info        xweb.Mapper `xweb:"/activity/day/info"`    //抽奖活动信息
+	raffle      xweb.Mapper `xweb:"/activity/day/raffle"`  //抽奖
+	records     xweb.Mapper `xweb:"/activity/records"`     //超级订阅下单三方会员兑换列表
+	parties     xweb.Mapper `xweb:"/activity/parties"`     //超级订阅下单兑换三方会员列表
+	redeem      xweb.Mapper `xweb:"/activity/redeem"`      //超级订阅下单兑换接口
+	history     xweb.Mapper `xweb:"/activity/history"`     //参与活动历史
+	drawRecords xweb.Mapper `xweb:"/activity/drawRecords"` //抽奖活动,奖品信息记录
 }

+ 26 - 1
src/jfw/modules/publicapply/src/activityday/service/exchange.go

@@ -4,12 +4,13 @@ import (
 	. "app.yhyue.com/moapp/jybase/api"
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
+	"jy/src/jfw/modules/publicapply/src/activityday/config"
 	"jy/src/jfw/modules/publicapply/src/activityday/dao"
 	autil "jy/src/jfw/modules/publicapply/src/activityday/util"
 	"strconv"
 )
 
-// Redeem 超级订阅下单兑换
+// Redeem 获取兑换码
 func (d *ActivityDay) Redeem() {
 	defer common.Catch()
 	r := func() Result {
@@ -40,6 +41,12 @@ func (d *ActivityDay) Redeem() {
 		if positionId == 0 {
 			return Result{Data: nil, Error_msg: Error_msg_1001}
 		}
+		// 内部员工 禁止抽奖
+		if config.Config.InternalSwitch {
+			if msg := dao.InternalCheck(sessVal); msg != "" {
+				return Result{Data: nil, Error_msg: msg}
+			}
+		}
 		//防止重复提交
 		if err := autil.RequestValidation(positionId); err != nil {
 			return Result{Data: nil, Error_msg: err.Error()}
@@ -118,3 +125,21 @@ func (d *ActivityDay) Records() {
 	}()
 	d.ServeJson(r)
 }
+
+// DrawRecords  抽奖获取三方会员兑换列表
+func (d *ActivityDay) DrawRecords() {
+	defer common.Catch()
+	r := func() Result {
+		if d.Method() != "POST" {
+			return Result{Data: nil, Error_msg: Error_msg_1005}
+		}
+		sessVal := d.Session().GetMultiple()
+		if common.Int64All(sessVal["positionId"]) == 0 {
+			return Result{Data: nil, Error_msg: Error_msg_1001}
+		}
+		platform := dao.GetPlatform(d.Request)
+		list := dao.NewEx(sessVal, platform, 0, 0, 0).GetDrawRecords()
+		return Result{Data: list}
+	}()
+	d.ServeJson(r)
+}

+ 24 - 0
src/jfw/modules/publicapply/src/activityday/service/history.go

@@ -0,0 +1,24 @@
+package service
+
+import (
+	. "app.yhyue.com/moapp/jybase/api"
+	"app.yhyue.com/moapp/jybase/common"
+	"jy/src/jfw/modules/publicapply/src/activityday/dao"
+)
+
+func (d *ActivityDay) History() {
+	defer common.Catch()
+	r := func() Result {
+		if d.Method() != "POST" {
+			return Result{Data: nil, Error_msg: Error_msg_1005}
+		}
+		sessVal := d.Session().GetMultiple()
+		positionId := common.Int64All(sessVal["positionId"])
+		if positionId == 0 {
+			return Result{Data: nil, Error_msg: Error_msg_1001}
+		}
+		data := dao.NewHistoryList(sessVal).GetHistoryList()
+		return Result{Data: data}
+	}()
+	d.ServeJson(r)
+}

+ 7 - 0
src/jfw/modules/publicapply/src/activityday/service/raffle.go

@@ -7,6 +7,7 @@ import (
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"fmt"
+	"jy/src/jfw/modules/publicapply/src/activityday/config"
 	"jy/src/jfw/modules/publicapply/src/activityday/consts"
 	"jy/src/jfw/modules/publicapply/src/activityday/dao"
 	"jy/src/jfw/modules/publicapply/src/activityday/entity"
@@ -95,6 +96,12 @@ func (this *ActivityDay) Raffle() {
 		if err := autil.RequestValidation(r.UserInfo.PositionId); err != nil {
 			return api.Result{Error_code: -1, Error_msg: err.Error()}
 		}
+		// 内部员工 禁止抽奖
+		if config.Config.InternalSwitch {
+			if msg := dao.InternalCheck(this.Session().GetMultiple()); msg != "" {
+				return api.Result{Error_code: -1, Error_msg: msg}
+			}
+		}
 		var (
 			err       error
 			wpi       entity.WinnerPrizeInfo

+ 4 - 4
src/jfw/modules/publicapply/src/activityday/util/send.go

@@ -12,15 +12,15 @@ import (
 )
 
 // 告警邮件
-func SendAlarmMail(activeName, name string, count int) {
+func SendAlarmMail(activeName, name string, count int, codeCount int) {
 	ma := config.Config.MailAlarm
 	if len(ma.To) == 0 {
 		log.Println("未配置活动库存告警邮箱")
 		return
 	}
 	to := strings.Join(ma.To, ",")
-	title := fmt.Sprintf(ma.Title, activeName, name, count)
-	content := fmt.Sprintf(ma.Content, activeName, name, count)
+	title := fmt.Sprintf(ma.Title, activeName, name, count, codeCount)
+	content := fmt.Sprintf(ma.Content, activeName, name, count, codeCount)
 	util.SendRetryMailMany(ma.ReTry, to, title, content, "", "", config.GmailAuth)
 }
 
@@ -42,7 +42,7 @@ func Send(e *SendParams) {
 		UserIds:     e.MgoId,
 		PositionIds: e.PositionId,
 		Title:       fmt.Sprintf(siteMsg.Title, e.PrizeName),
-		Content:     fmt.Sprintf(siteMsg.Content, e.ActivityName, e.PrizeName, e.Code, e.ExEndTime, e.Link, e.Link, e.ActivityName, e.Code),
+		Content:     fmt.Sprintf(siteMsg.Content, e.ActivityName, e.PrizeName, e.ActivityName),
 		MsgType:     siteMsg.MsgType,
 		SendMode:    2,
 		Link:        siteMsg.Link,

+ 2 - 1
src/jfw/modules/publicapply/src/config.json

@@ -92,5 +92,6 @@
   },
   "frequentContinuous": 2,
   "screenNumb": 2,
-  "stayTime ": 5
+  "stayTime ": 5,
+  "maxDetailLength": 50
 }

+ 1 - 0
src/jfw/modules/publicapply/src/config.yaml

@@ -7,3 +7,4 @@ entManageApplication: "entmanageapplication.rpc" #企业管理中台
 jyPointKey: "integral.rpc" #积分中台
 resourceCenterKey: "resource.rpc" #资源中台
 smswxswitch: true
+miniDetailLimit: 1

+ 19 - 1
src/jfw/modules/publicapply/src/detail/config.json

@@ -162,5 +162,23 @@
     "code": "zc_cgxx"
   },
   "originalTime": 1733241600,
-  "maxDetailLength": 50
+  "detailNeedMosaic": {
+    "signendtime": "time",
+    "bidopentime": "time",
+    "bidendtime": "time",
+    "signaturedate": "time",
+    "buyerperson": "string",
+    "buyertel": "string",
+    "winnerorder": "string",
+    "winner": "string",
+    "s_winner": "string",
+    "winnerperson": "string",
+    "winnertel": "string",
+    "agencyperson": "string",
+    "agencytel": "string",
+    "projectcode": "string"
+  },
+  "detailMosaicDetail": "***",
+  "strMosaicLen": 2,
+  "dataMosaicLenFormat": ["2006-01-02", "2006-1-2", "2006年01月02", "2006年1月2"]
 }

+ 2 - 3
src/jfw/modules/publicapply/src/detail/config/config.go

@@ -1,7 +1,7 @@
 package config
 
 import (
-	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/common"
 	"jy/src/jfw/modules/publicapply/src/detail/entity"
 	"jy/src/jfw/modules/publicapply/src/detail/restriction"
 	"log"
@@ -13,7 +13,7 @@ var (
 
 func init() {
 	log.Println("初始化 config 配置")
-	util.ReadConfig("./detail/config.json", &Config)
+	common.ReadConfig("./detail/config.json", &Config)
 	if Config.RestrictionSwitch && Config.Restrictions != nil {
 		for k, v := range Config.Restrictions {
 			//创建执行池 等待池
@@ -31,5 +31,4 @@ func init() {
 			}
 		}
 	}
-
 }

+ 7 - 0
src/jfw/modules/publicapply/src/detail/consts/consts.go

@@ -41,6 +41,7 @@ var (
 		"bdcontent":       true,
 		"indexcontent":    true, //老首页 seo入口 供爬虫使用
 		"advancedProject": true,
+		Mini:              true, //小程序
 	}
 	AboutUrl            = "/swordfish/about"
 	AboutUrlApp         = "/jyapp/free/swordfish/about"
@@ -94,7 +95,13 @@ var (
 		"bdcontent":       false,
 		"indexcontent":    true, //老首页 seo入口 供爬虫使用
 		"advancedProject": false,
+		Mini:              true, //小程序
 	}
+	Mini    = "mini"
+	MiniMap = map[string]string{
+		Mini: "content",
+	}
+	MiniCode       = "mini_no_login"
 	FirstTypeCheck = map[string]bool{
 		"yyszb": true, //运营商专版
 	}

+ 99 - 49
src/jfw/modules/publicapply/src/detail/dao/baseInfo.go

@@ -9,12 +9,15 @@ import (
 	"app.yhyue.com/moapp/jypkg/public"
 	"encoding/json"
 	"fmt"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gctx"
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
 	dc "jy/src/jfw/modules/publicapply/src/detail/config"
 	"jy/src/jfw/modules/publicapply/src/detail/consts"
 	"jy/src/jfw/modules/publicapply/src/detail/entity"
 	rest "jy/src/jfw/modules/publicapply/src/detail/restriction"
+	"jy/src/jfw/modules/publicapply/src/detail/timetask"
 	"jy/src/jfw/modules/publicapply/src/detail/util"
 	"log"
 	"net/http"
@@ -68,53 +71,67 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 		BindPhone: false,
 		Next:      true, //是否有权限获取进阶信息
 	}
-	resResp := config.Middleground.ResourceCenter.Haspowers(b.UserInfo.AccountId, b.UserInfo.EntAccountId, b.UserInfo.EntId, b.UserInfo.EntUserId)
-	if resResp != nil && len(resResp.Powers) > 0 {
-		for _, pv := range resResp.Powers {
-			switch strings.TrimSpace(pv) {
-			case "bi_yx_topnet": //拓普
-				bi.Topnet = true
-			case "ygzc_cgxx": //阳光采购
-				bi.Purchase = true
-			case "bi_sj_yyszs": //运营商专版
-				bi.Operator = true
-			}
-		}
-	}
-	//if b.PageType == "yyszb" { //运营商专版详情页
-	//	bi.Next = false
-	//}
-	//招标数据基本信息并发过滤
-	if dc.Config.RestrictionSwitch {
-		if err = rest.ReqCheck("baseInfo"); err != nil {
-			return
-		}
-	}
-	//未登录用户 会考虑用户是否在白名单中 ipTrue;登录用户不考虑
 	//注意三端不同  pageType类型不同的处理
 	var (
-		userPower     = jy.GetBigVipUserBaseMsg(b.Sess, *config.Middleground)
-		isOldVip      = userPower.VipStartDate < dc.Config.ContextOldVipLimit
-		isVip         = userPower.VipStatus > 0                                                      //超级订阅
-		isMember      = userPower.Status > 0                                                         //大会员
-		isEntniche    = userPower.EntnicheStatus > 0                                                 //商机管理
-		isEntnicheNew = userPower.EntIsNew                                                           //新版商机管理
-		privateData   = userPower.PrivateGD                                                          //广东移动DICT 用户
-		isEntService  = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
+		isLogin       = b.UserInfo.MgoUserId != ""
+		userPower     *jy.BigVipBaseMsg
+		isOldVip      bool
+		isVip         bool //超级订阅
+		isMember      bool //大会员
+		isEntniche    bool //商机管理
+		isEntnicheNew bool //新版商机管理
+		privateData   bool //广东移动DICT 用户
+		isEntService  bool //商机管理服务
+		isPay         bool
+		ipTrue        bool
 		pageTypeCheck = consts.PageTypeCheck
-		isPay         = isVip || isMember || isEntniche
 		routeKey      = fmt.Sprintf("%s%s", b.FirstType, b.PageType)
 	)
+	if isLogin {
+		userPower = jy.GetBigVipUserBaseMsg(b.Sess, *config.Middleground)
+		isOldVip = userPower.VipStartDate < dc.Config.ContextOldVipLimit
+		isVip = userPower.VipStatus > 0                                                             //超级订阅
+		isMember = userPower.Status > 0                                                             //大会员
+		isEntniche = userPower.EntnicheStatus > 0                                                   //商机管理
+		isEntnicheNew = userPower.EntIsNew                                                          //新版商机管理
+		privateData = userPower.PrivateGD                                                           //广东移动DICT 用户
+		isEntService = userPower.Data.Ent.PowerSource > 0 && userPower.Data.Entniche.IsEntPower > 0 //商机管理服务
+		isPay = isVip || isMember || isEntniche
 
-	//企业级商机管理权限判断
-	entId := int(b.UserInfo.EntId)
-	if entId > 0 && userPower.EntInfo[entId] != nil {
-		isEntniche = userPower.EntInfo[entId].Status == 1 && userPower.EntInfo[entId].IsPower
-		isEntnicheNew = userPower.EntInfo[entId].IsNew && isEntniche
-		if isEntService = userPower.EntInfo[entId].IsService && userPower.EntInfo[entId].IsPower; isEntService {
-			isEntnicheNew = false
-			isEntniche = false
+		resResp := config.Middleground.ResourceCenter.Haspowers(b.UserInfo.AccountId, b.UserInfo.EntAccountId, b.UserInfo.EntId, b.UserInfo.EntUserId)
+		if resResp != nil && len(resResp.Powers) > 0 {
+			for _, pv := range resResp.Powers {
+				switch strings.TrimSpace(pv) {
+				case "bi_yx_topnet": //拓普
+					bi.Topnet = true
+				case "ygzc_cgxx": //阳光采购
+					bi.Purchase = true
+				case "bi_sj_yyszs": //运营商专版
+					bi.Operator = true
+				}
+			}
 		}
+		//招标数据基本信息并发过滤
+		if dc.Config.RestrictionSwitch {
+			if err = rest.ReqCheck("baseInfo"); err != nil {
+				return
+			}
+		}
+		//企业级商机管理权限判断
+		entId := int(b.UserInfo.EntId)
+		if entId > 0 && userPower.EntInfo[entId] != nil {
+			isEntniche = userPower.EntInfo[entId].Status == 1 && userPower.EntInfo[entId].IsPower
+			isEntnicheNew = userPower.EntInfo[entId].IsNew && isEntniche
+			if isEntService = userPower.EntInfo[entId].IsService && userPower.EntInfo[entId].IsPower; isEntService {
+				isEntnicheNew = false
+				isEntniche = false
+			}
+		}
+	}
+	//未登录用户 会考虑用户是否在白名单中 ipTrue;登录用户不考虑
+	ips := strings.Split(common.GetIp(b.R), ",")
+	if len(ips) > 0 {
+		ipTrue = timetask.IpList.Match(ips[0])
 	}
 	log.Println(isEntnicheNew, ":--ent--:", isEntniche)
 	//超前项目权限 判断
@@ -123,21 +140,22 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 	} else if b.PageType == "indexcontent" {
 		b.PageType = "content"
 	}
+	bi.CanRead = true
 	//redis 缓存数据
 	var detailKey = func() string {
-		if bi.Topnet || bi.Purchase || bi.Operator {
-			bi.CanRead = true
+		if !isLogin && consts.MiniMap[b.PageType] != "" {
+			bi.CanRead = false
+			return "mini_no_login" //小程序  未登录(标题|地区|信息类型|发布时间|id|正文
+		} else if bi.Topnet || bi.Purchase || bi.Operator {
 			return "pay" //可以看全部
 		} else if (isVip && isOldVip) || isMember || isEntniche || pageTypeCheck[b.PageType] || privateData {
-			bi.CanRead = true
 			return "pay" //可以看全部
 		} else if isVip && !isOldVip {
-			bi.CanRead = true
 			return "new_vip_pay" //新版超级订阅不能看 采购意向 和 拟建
 		} else if SeeDetailLimit(b.UserInfo, b.Id) {
-			bi.CanRead = true
 			return "saleLeads_free" //未留资 三篇非采购意向信息;留资后同pay
 		} else {
+			bi.CanRead = false
 			return "free" //已经免费查看三篇招标信息,且未留资。任何信息都不能看 有遮罩
 		}
 	}()
@@ -170,9 +188,41 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 		return
 	}
 	var BidInfoFormat = func() error {
-		subtype, obj, err := GetBidInfo()
-		if err != nil {
-			return err
+		subtype, obj, bErr := GetBidInfo()
+		if bErr != nil {
+			return bErr
+		}
+		//小程序 阳光采购 : 无权限用户 首次访问阳光采购 信息 有权限获取详情数据
+		if isLogin && strings.Contains(b.R.UserAgent(), "miniProgram") {
+			if !bi.Purchase {
+				var (
+					cacheKey   = fmt.Sprintf("mini_program_%s_%d", b.UserInfo.Phone, b.UserInfo.PositionId)
+					biddingIds = redis.GetStr(consts.RedisLimitation, cacheKey)
+					splitStr   = "#"
+					ids        []string
+				)
+				if biddingIds != "" {
+					ids = strings.Split(biddingIds, splitStr)
+				}
+				if len(ids) > 0 {
+					for _, id := range ids {
+						if id == b.Id {
+							bi.CanRead = true
+							bi.Purchase = true
+							break
+						}
+					}
+				}
+				if !bi.Purchase && len(ids) < g.Cfg().MustGet(gctx.New(), "miniDetailLimit").Int() {
+					ids = append(ids, b.Id)
+					if saveBool := redis.Put(consts.RedisLimitation, cacheKey, strings.Join(ids, splitStr), -1); !saveBool {
+						log.Println(fmt.Sprintf("%s redis %s save false", cacheKey, strings.Join(ids, splitStr)))
+					} else {
+						bi.CanRead = true
+						bi.Purchase = true
+					}
+				}
+			}
 		}
 		//权限判断 处理
 		if !bi.Topnet && (detailKey == "new_vip_pay" || detailKey == "saleLeads_free") { //新版超级订阅||免费用户   不能看采购意向和拟建
@@ -214,7 +264,7 @@ func (b *BaseInfo) BidBaseInfo() (bi *BidInfo, err error) {
 				}
 			}
 		} else {
-			bi.BiddingDataFormatNoPower(obj, b.Id)
+			bi.BiddingDataFormatNoPower(obj, b.Id, detailKey, ipTrue)
 		}
 		if b.UserInfo.OpenId != "" {
 			bi.BaseInfo.UcbsId = encrypt.EncodeArticleId2ByCheck("ucbs#" + b.UserInfo.OpenId + "#" + b.Id)

+ 71 - 1
src/jfw/modules/publicapply/src/detail/dao/bidding.go

@@ -239,9 +239,12 @@ func SeeDetailLimit(sessUser util.SessUserInfo, sid string) bool {
 }
 
 // 没有权限招标信息处理
-func (bi *BidInfo) BiddingDataFormatNoPower(obj map[string]interface{}, id string) {
+func (bi *BidInfo) BiddingDataFormatNoPower(obj map[string]interface{}, id, detailKey string, ipTrue bool) {
 	//基本信息
 	bi.BaseInfo.Id = encrypt.EncodeArticleId2ByCheck(id)
+	if bId := common.InterfaceToStr(obj["bid"]); bId != "" {
+		bi.BaseInfo.BId = encrypt.EncodeArticleId2ByCheck(bId)
+	}
 	industry := common.ObjToString(obj["s_subscopeclass"])
 	if industry != "" {
 		industry = strings.Replace(industry, "它", "他", -1)
@@ -257,6 +260,69 @@ func (bi *BidInfo) BiddingDataFormatNoPower(obj map[string]interface{}, id strin
 	bi.BaseInfo.Area = common.ObjToString(obj["area"])
 	bi.BaseInfo.City = common.ObjToString(obj["city"])
 	bi.BaseInfo.BuyerClass = common.ObjToString(obj["buyerclass"])
+	bi.BaseInfo.PublicType = common.InterfaceToStr(obj["public_type"])
+	switch detailKey {
+	case consts.MiniCode: // 未登录  小程序
+		bi.BaseInfo.District = common.ObjToString(obj["district"])
+		bi.BaseInfo.Purchasing = common.ObjToString(obj["purchasing"])
+		bi.BaseInfo.PublishTime = common.Int64All(obj["publishtime"])
+		bi.BaseInfo.BuyerSeoId = EsSeoId(false, common.InterfaceToStr(obj["buyer"]))
+		if !ipTrue { //非白名单 关键数据打码
+			obj = util.FieldFilter(obj) //数据过滤
+		}
+		bi.Detail.Detail = common.ObjToString(obj["detail"])
+		bi.BaseInfo.InfoAttribute = common.InterfaceToStr(obj["infoattribute"])
+		if bi.BaseInfo.InfoAttribute == dc.Config.PurchaseInfo.Code {
+			bi.BaseInfo.IsPay = bi.BaseInfo.PublicType == "平台发布" && common.IntAll(obj["is_yg_new"]) == 1 || bi.BaseInfo.PublicType == "用户发布"
+		}
+		bi.Next = false
+		if bi.BaseInfo.IsPay {
+			var subStr = "****"
+			bi.BaseInfo.PublicType = fmt.Sprintf("%s%s", dc.Config.PurchaseInfo.Name, bi.BaseInfo.PublicType)
+			bi.Abstract.Default = &entity.Default{}
+			bi.Abstract.Default.SignEndTime = common.Int64All(obj["signendtime"]) //报名截止时间
+			bi.Abstract.Default.Buyer = subStr
+			bi.Abstract.Default.BuyerPerson = subStr
+			bi.Abstract.Default.BuyerTel = subStr
+			bi.Abstract.Default.BuyerPortraitShow = false
+			bi.Abstract.Default.DeliverArea = subStr
+			bi.Abstract.Default.DeliverCity = subStr
+			bi.Abstract.Default.DeliverDistrict = subStr
+			bi.Abstract.Default.DeliverDetail = subStr
+		}
+		if obj["purchasinglist"] != nil {
+			purchasingList := common.ObjArrToMapArr(obj["purchasinglist"].([]interface{}))
+			b, err := json.Marshal(purchasingList)
+			if err == nil && len(b) > 0 {
+				var pls []entity.Purchasing
+				err = json.Unmarshal(b, &pls)
+				if err == nil && len(pls) > 0 {
+					for _, v := range pls {
+						if strings.TrimSpace(v.ItemName) == "" {
+							continue
+						}
+						bi.Abstract.Default.PurchasingList = append(bi.Abstract.Default.PurchasingList, entity.PurchasingList{
+							Number:      v.Number,   //
+							Table:       v.Table,    //
+							ItemName:    v.ItemName, //
+							Model:       v.Model,
+							UnitPrice:   v.UnitPrice,
+							Root:        v.Root,
+							TotalPrice:  v.TotalPrice,
+							Score:       v.Score,
+							BrandName:   v.BrandName,
+							UnitName:    v.UnitName,
+							Code:        v.Code,
+							Reliability: v.Reliability,
+						})
+					}
+				}
+			}
+			if err != nil {
+				log.Println("purchasinglist json  err:", err.Error())
+			}
+		}
+	}
 }
 
 // wx pc obj字段统一处理
@@ -344,6 +410,7 @@ func (bi *BidInfo) BiddingDataFormat(obj map[string]interface{}, b *BaseInfo) {
 		var isPurchase bool
 		if bi.BaseInfo.InfoAttribute == dc.Config.PurchaseInfo.Code {
 			isPurchase = true
+			bi.BaseInfo.IsPay = bi.BaseInfo.PublicType == "平台发布" && common.IntAll(obj["is_yg_new"]) == 1 || bi.BaseInfo.PublicType == "用户发布"
 			if bi.BaseInfo.PublicType == "平台发布" && common.IntAll(obj["is_yg_new"]) != 1 {
 				isPurchase = false
 				bi.BaseInfo.InfoAttribute = "" //bidding 详情页
@@ -371,6 +438,9 @@ func (bi *BidInfo) BiddingDataFormat(obj map[string]interface{}, b *BaseInfo) {
 					err = json.Unmarshal(b, &pls)
 					if err == nil && len(pls) > 0 {
 						for _, v := range pls {
+							if strings.TrimSpace(v.ItemName) == "" {
+								continue
+							}
 							bi.Abstract.Default.PurchasingList = append(bi.Abstract.Default.PurchasingList, entity.PurchasingList{
 								Number:      v.Number,
 								Table:       v.Table,

+ 16 - 0
src/jfw/modules/publicapply/src/detail/dao/preAgent.go

@@ -62,6 +62,22 @@ func NewPreAgentReq(ui util.SessUserInfo, sess *httpsession.Session, r *http.Req
 		req.Url = refer
 		req.Id, req.FirstType, req.PageType = util.BiddingIdHandle(req.Url)
 	}
+	//兼容剑鱼招标网小程序
+	if req.FirstType == "" {
+		req.FirstType = r.Header.Get("firstType")
+	}
+	if req.PageType == "" {
+		req.PageType = r.Header.Get("pageType")
+	}
+	if req.Id == "" {
+		req.Id = r.Header.Get("id")
+		if req.Id != "" && req.PageType != "" {
+			req.Id = encrypt.CommonDecodeArticle(util.GetPageType(req.PageType), req.Id)[0]
+		}
+		if req.Url == "" {
+			req.Url = req.Id
+		}
+	}
 	params, err := util.GetParamsByUrl(r)
 	if err != nil {
 		return req

+ 5 - 1
src/jfw/modules/publicapply/src/detail/entity/config.go

@@ -19,7 +19,11 @@ type Config struct {
 		Name string `json:"name"`
 		Code string `json:"code"`
 	} `json:"purchaseInfo"`
-	OriginalTime int64 `json:"originalTime"`
+	OriginalTime        int64             `json:"originalTime"`
+	DetailNeedMosaic    map[string]string `json:"detailNeedMosaic"`
+	DetailMosaicDetail  string            `json:"detailMosaicDetail"`
+	StrMosaicLen        int               `json:"strMosaicLen"`
+	DataMosaicLenFormat []string          `json:"dataMosaicLenFormat"`
 }
 
 type reqLimit struct {

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

@@ -44,6 +44,7 @@ type BidBaseInfo struct {
 	RecommendedService int    `json:"recommendedService"` //业主发布 排名考前,默认0
 	InfoAttribute      string `json:"infoAttribute"`      //zc_cgxx --- 采购信息
 	PublicType         string `json:"publicType"`         //发布方式:个人发布 or 平台发布
+	IsPay              bool   `json:"isPay"`              //是否是付费数据
 }
 type Purchasing struct {
 	Number      float64     `json:"number"`      //数量

+ 1 - 0
src/jfw/modules/publicapply/src/detail/init.go

@@ -3,6 +3,7 @@ package detail
 import (
     _ "jy/src/jfw/modules/publicapply/src/detail/config"
     "jy/src/jfw/modules/publicapply/src/detail/service"
+    _ "jy/src/jfw/modules/publicapply/src/detail/timetask"
 
     "app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )

+ 69 - 0
src/jfw/modules/publicapply/src/detail/timetask/task.go

@@ -0,0 +1,69 @@
+package timetask
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/ipmatch"
+	"app.yhyue.com/moapp/jypkg/public"
+	"log"
+	"strings"
+	"sync"
+	"time"
+)
+
+var (
+	IpList     *ipmatch.WhiteIp
+	IpInitLock sync.RWMutex //锁
+)
+
+func init() {
+	go UpdateWhiteIp()
+}
+
+// 定时更新 白名单 信息
+func UpdateWhiteIp() {
+	crontab(true, "01:00", func() {
+		defer common.Catch()
+		log.Println("定时更新 白名单 信息-开始")
+		now := time.Now()
+		IpInitLock.Lock()
+		defer IpInitLock.Unlock()
+		data := public.BaseMysql.Find("black_White", map[string]interface{}{"is_white": 1}, "ip,ip_type,is_white", "", -1, -1)
+		if data != nil && len(*data) > 0 {
+			var ips []ipmatch.IpParameter
+			for _, v := range *data {
+				var ipData ipmatch.IpParameter
+				ipData.Ip = common.InterfaceToStr(v["ip"])
+				ipData.IpType = common.IntAll(v["ip_type"])
+				ipData.IsWhite = common.IntAll(v["is_white"])
+				ips = append(ips, ipData)
+			}
+			IpList = ipmatch.NewRb(ips)
+			return
+		}
+		IpList = ipmatch.NewRb(nil)
+		log.Println("定时更新 白名单 信息-结束:", now.Unix())
+	})
+}
+
+func crontab(flag bool, c string, f func()) {
+	array := strings.Split(c, ":")
+	if len(array) != 2 {
+		log.Fatalln("定时任务参数错误!", c)
+	}
+	if flag {
+		go f()
+	}
+	now := time.Now()
+	t := time.Date(now.Year(), now.Month(), now.Day(), common.IntAll(array[0]), common.IntAll(array[1]), 0, 0, time.Local)
+	if t.Before(now) {
+		t = t.AddDate(0, 0, 1)
+	}
+	timer := time.NewTimer(t.Sub(now))
+	for {
+		select {
+		case <-timer.C:
+			go f()
+			timer.Reset(24 * time.Hour)
+		}
+	}
+}

+ 66 - 0
src/jfw/modules/publicapply/src/detail/util/match.go

@@ -0,0 +1,66 @@
+package util
+
+import (
+	"fmt"
+	dc "jy/src/jfw/modules/publicapply/src/detail/config"
+	"strings"
+)
+
+// TrieNode represents each node in the Trie
+type TrieNode struct {
+	children map[rune]*TrieNode
+	isEnd    bool
+}
+
+// NewTrieNode creates a new TrieNode
+func NewTrieNode() *TrieNode {
+	return &TrieNode{
+		children: make(map[rune]*TrieNode),
+		isEnd:    false,
+	}
+}
+
+// 批量追加词
+func (n *TrieNode) Insert(words ...string) {
+	for _, word := range words {
+		node := n
+		for _, char := range word {
+			if _, ok := node.children[char]; !ok {
+				node.children[char] = NewTrieNode()
+			}
+			node = node.children[char]
+		}
+		node.isEnd = true
+	}
+}
+
+// 前缀树替换所有
+func (n *TrieNode) ReplaceAll(text string) string {
+	var rs = []rune(text)
+	var sb = new(strings.Builder)
+	var lastPos = 0
+	for i := 0; i < len(rs); i++ {
+		node := n
+		for j := i; j < len(rs); j++ {
+			char := rs[j]
+			if _, ok := node.children[char]; !ok {
+				break
+			}
+			node = node.children[char]
+			if node.isEnd {
+				//前部分
+				sb.WriteString(string(rs[lastPos:i]))
+				sb.WriteString(fmt.Sprintf(" %s ", dc.Config.DetailMosaicDetail))
+				lastPos = j + 1
+				i = j
+				break
+			}
+		}
+	}
+	if lastPos == 0 { //修正全文未匹配情况
+		return text
+	} else if lastPos < len(rs) { //修正最后截取尾巴部分
+		sb.WriteString(string(rs[lastPos:]))
+	}
+	return sb.String()
+}

+ 32 - 0
src/jfw/modules/publicapply/src/detail/util/util.go

@@ -7,6 +7,8 @@ import (
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"encoding/json"
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	dc "jy/src/jfw/modules/publicapply/src/detail/config"
 	"jy/src/jfw/modules/publicapply/src/detail/consts"
 	"net/http"
 	"net/url"
@@ -15,6 +17,7 @@ import (
 	"strconv"
 	"strings"
 	"time"
+	"unicode/utf8"
 )
 
 // SessUserInfo 从session获取用户基本信息
@@ -190,3 +193,32 @@ func BiddingIdHandle(href string) (id, firstType, pageType string) {
 	}
 	return
 }
+
+func GetPageType(pageType string) string {
+	if pt := consts.MiniMap[pageType]; pt != "" {
+		return pt
+	}
+	return pageType
+}
+
+// 未登录用户进行数据过滤 name 配置文件
+func FieldFilter(obj map[string]interface{}) map[string]interface{} {
+	detail := fmt.Sprint(obj["detail"])
+	if dc.Config.DetailNeedMosaic == nil || len(detail) == 0 {
+		return obj
+	}
+	trie := NewTrieNode()
+	for dk, dvc := range dc.Config.DetailNeedMosaic {
+		if value := gconv.String(obj[dk]); value != "" && utf8.RuneCountInString(value) > dc.Config.StrMosaicLen { //过滤掉短字符
+			if dvc == "time" {
+				dataParam := time.Unix(gconv.Int64(obj[dk]), 0)
+				for _, formatData := range dc.Config.DataMosaicLenFormat {
+					trie.Insert(dataParam.Format(formatData))
+				}
+			}
+			trie.Insert(value)
+		}
+	}
+	obj["detail"] = trie.ReplaceAll(detail)
+	return obj
+}

+ 7 - 4
src/jfw/modules/publicapply/src/enterpriseSearch/entity/entQuery.go

@@ -3,7 +3,9 @@ package entity
 import (
 	"encoding/json"
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
 	"jy/src/jfw/modules/publicapply/src/config"
+	"math"
 	"strconv"
 	"strings"
 	"time"
@@ -36,7 +38,7 @@ type EnterpriseSearch struct {
 }
 
 const (
-	searchMaxLimit    = 100 //最大查询数量限制
+	searchMaxLimit    = 150 //最大查询数量限制
 	freeSearchNum     = 4   //免费查询数量限制
 	entSearchCacheDB  = "other"
 	entSearchCacheKey = "entSearchIndexCache_%v"
@@ -78,7 +80,8 @@ func (es *EnterpriseSearch) Check() (*EnterpriseSearch, error) {
 	if es.PageSize == 0 { //默认十条
 		es.PageSize = 10
 	}
-	if (es.PageNum+1)*es.PageSize > searchMaxLimit {
+	maxPageSize := math.Ceil(gconv.Float64(config.Config.EntSearchLimit) / gconv.Float64(es.PageSize))
+	if es.PageNum > gconv.Int(maxPageSize) {
 		return nil, fmt.Errorf("超出查询数量限制")
 	}
 	//注册资本[min-max]
@@ -466,7 +469,7 @@ func GetEntIndexShow(isFree bool) (list *[]map[string]interface{}) {
 		}
 	}
 	var thisRow entIds
-	entSql := fmt.Sprintf(`{"query": {"bool": {"must": []}},"aggs": {"entids": {"terms": {"field": "entidlist","size": 100,"exclude": ["-",""]}}},"size": 0}`)
+	entSql := fmt.Sprintf(`{"query": {"bool": {"must": []}},"aggs": {"entids": {"terms": {"field": "entidlist","size": %d,"exclude": ["-",""]}}},"size": 0}`, config.Config.EntSearchLimit)
 	entAggs, _, _ := elastic.GetAggs("projectset", "projectset", entSql)
 	if entAggs != nil {
 		for name, object := range entAggs {
@@ -486,7 +489,7 @@ func GetEntIndexShow(isFree bool) (list *[]map[string]interface{}) {
 		ids = append(ids, v.Key)
 	}
 	sql := fmt.Sprintf(entQuery, fmt.Sprintf(`{"terms":{"_id":["%s"]}}`, strings.Join(ids, "\",\"")), "")
-	sql = sql[:len(sql)-1] + fmt.Sprintf(`,"from":%d,"size":%d}`, 0, 100)
+	sql = sql[:len(sql)-1] + fmt.Sprintf(`,"from":%d,"size":%d}`, 0, config.Config.EntSearchLimit)
 	listTmp := elastic.Get(index, itype, sql)
 	if listTmp != nil && len(*listTmp) > 0 {
 		list = formatData(listTmp, isFree)

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

@@ -24,5 +24,15 @@ func (ci *CookieInfo) Do(w http.ResponseWriter, req *http.Request) bool {
 			}
 		}
 	}
+	//体验-绑定-标识
+	//host := req.Host
+	//if !strings.HasPrefix(host, ".") {
+	//	host = "." + host
+	//}
+	//phone, _ := getSession["phone"].(string)
+	//log.Println(phone, "--host:", host)
+	//if phone == "" && qu.Int64All(getSession["experience_binding"]) == 1 {
+	//	jy.SetCookie(w, req, jy.ExperienceSign, "experiencing", host, 8*60*60)
+	//}
 	return true
 }

+ 7 - 1
src/jfw/modules/publicapply/src/go.mod

@@ -5,7 +5,7 @@ go 1.20
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20250227020441-2a6731d90553
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.32.3
+	app.yhyue.com/moapp/jypkg v1.33.5
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20241213060113-ac41966a58ec
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.21
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
@@ -16,6 +16,7 @@ require (
 	github.com/alibabacloud-go/tea-utils/v2 v2.0.4
 	github.com/go-redis/redis v6.15.9+incompatible
 	github.com/gogf/gf/v2 v2.7.0
+	github.com/levigross/grequests v0.0.0-20231203190023-9c307ef1f48d
 	github.com/olivere/elastic/v7 v7.0.22
 	github.com/zeromicro/go-zero v1.6.4
 	go.mongodb.org/mongo-driver v1.14.0
@@ -31,6 +32,7 @@ require (
 	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.1.3 // indirect
 	filippo.io/edwards25519 v1.1.0 // indirect
 	github.com/BurntSushi/toml v1.2.0 // indirect
+	github.com/RoaringBitmap/roaring v1.5.0 // indirect
 	github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
 	github.com/alibabacloud-go/debug v1.0.0 // indirect
 	github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
@@ -39,6 +41,7 @@ require (
 	github.com/alibabacloud-go/tea-xml v1.1.3 // indirect
 	github.com/aliyun/credentials-go v1.3.1 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/bits-and-blooms/bitset v1.2.0 // indirect
 	github.com/cenkalti/backoff/v4 v4.2.1 // indirect
 	github.com/cespare/xxhash/v2 v2.2.0 // indirect
 	github.com/clbanning/mxj/v2 v2.7.0 // indirect
@@ -65,6 +68,7 @@ require (
 	github.com/gomodule/redigo v2.0.0+incompatible // indirect
 	github.com/google/gnostic-models v0.6.8 // indirect
 	github.com/google/go-cmp v0.6.0 // indirect
+	github.com/google/go-querystring v1.1.0 // indirect
 	github.com/google/gofuzz v1.2.0 // indirect
 	github.com/google/uuid v1.6.0 // indirect
 	github.com/gorilla/websocket v1.5.0 // indirect
@@ -87,6 +91,7 @@ require (
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
+	github.com/mschoch/smat v0.2.0 // indirect
 	github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
 	github.com/nsqio/go-nsq v1.1.0 // indirect
 	github.com/olekukonko/tablewriter v0.0.5 // indirect
@@ -119,6 +124,7 @@ require (
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.2 // indirect
 	github.com/xdg-go/stringprep v1.0.4 // indirect
+	github.com/yl2chen/cidranger v1.0.2 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
 	github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // indirect
 	go.etcd.io/etcd/api/v3 v3.5.13 // indirect

+ 6 - 7
src/jfw/modules/publicapply/src/go.sum

@@ -20,13 +20,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20250227020441-2a6731d90553/go.mod h1:/HT/UZ4d
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 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=
-<<<<<<< HEAD
-app.yhyue.com/moapp/jypkg v1.22.2 h1:JGACT09PXN/DEjDgBSwC7veHiNrSRZH73mAc9MUV5w8=
-app.yhyue.com/moapp/jypkg v1.22.2/go.mod h1:FylaC4MJ4G36WndktgeZfc8jTq3uvBGWIwbk02xfdQI=
-=======
-app.yhyue.com/moapp/jypkg v1.32.3 h1:84pjfCkhTfQ3fKeZyNOCpagp3M9hLDDBnoKsoNcef+E=
-app.yhyue.com/moapp/jypkg v1.32.3/go.mod h1:m/OMjugcf4XK5c/2mErxnXEyAZ+WNya8HP0x8jFGw4U=
->>>>>>> 1d05dd6262954c08c90ca8bb8d8dbdba825b697e
+app.yhyue.com/moapp/jypkg v1.33.5 h1:XVzoi4POBZ8Tprr9Sk/HSC0CB3WcbPFwMpuu0o3B4jI=
+app.yhyue.com/moapp/jypkg v1.33.5/go.mod h1:m/OMjugcf4XK5c/2mErxnXEyAZ+WNya8HP0x8jFGw4U=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -837,6 +832,7 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0
 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/RoaringBitmap/roaring v1.5.0 h1:V0VCSiHjroItEYCM3guC8T83ehi5QMt3oM9EefTTOms=
 github.com/RoaringBitmap/roaring v1.5.0/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE=
 github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67 h1:x98/gnpyNAiuvg/gX3KgdfKxnZj3t9pIl3BCVJg3qwg=
 github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67/go.mod h1:g1VZ0nbzBvfsWw22gNVOxWxJxpBR+CBiFNK2n2ogeUo=
@@ -913,6 +909,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA=
 github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
 github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
 github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff/go.mod h1:+RTT1BOk5P97fT2CiHkbFQwkK3mjsFAP6zCYV2aXtjw=
@@ -1535,6 +1532,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
 github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
 github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
+github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
 github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
 github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
@@ -1799,6 +1797,7 @@ github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhe
 github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
 github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4=
 github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
+github.com/yl2chen/cidranger v1.0.2 h1:lbOWZVCG1tCRX4u24kuM1Tb4nHqWkDxwLdoS+SevawU=
 github.com/yl2chen/cidranger v1.0.2/go.mod h1:9U1yz7WPYDwf0vpNWFaeRh0bjwz5RVgRy/9UEQfHl0g=
 github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
 github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk=

+ 1 - 1
src/jfw/modules/publicapply/src/npsValue/service/action.go

@@ -152,7 +152,7 @@ func CloudWord(w, p string, attr int) []string {
 		npswords = append(npswords, w)
 	} else if len(w) >= 10 {
 		words := jy.HttpEs(w, "ik_smart", db.DbConf.Elasticsearch.Main.Address)
-		npswords = strings.Split(jy.KeywordsProcessing(words, "+"), "+")
+		npswords = strings.Split(jy.KeywordsProcessing(words, w, "+"), "+")
 		for idx, val := range hotwords {
 			exit := strings.Contains(w, val)
 			if exit {

+ 2 - 1
src/jfw/modules/publicapply/src/oneclick/entity/entity.go

@@ -429,7 +429,8 @@ func (o *OneClickInfo) phoneLogin(phone string) (map[string]interface{}, error)
 					}()
 				}
 				userInfo["isNewUser"] = true
-				go jy.SaveUserLog(db.Mgo_Log, _id, phone, "phone", isAndroidOrIOS(client), platform, "", "", gconv.String(data["s_rsource"]), o.R.Proto, isAndroidOrIOS(client), gconv.String(common.If(isAndroidOrIOS(client) == "jyzbw", "jyzbw", "jybx")), "")
+				referer := o.R.Referer()
+				go jy.SaveUserLog(db.Mgo_Log, _id, phone, "phone", isAndroidOrIOS(client), platform, "", "", gconv.String(data["s_rsource"]), o.R.Proto, isAndroidOrIOS(client), gconv.String(common.If(isAndroidOrIOS(client) == "jyzbw", "jyzbw", "jybx")), "", referer)
 				//用户中台同步
 				func(userid string) {
 					if ok := jy.AddUser(db.Mgo, userid, pb.UserAddReq{

+ 22 - 9
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -15,6 +15,7 @@ import (
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
 	"log"
+	"regexp"
 	"time"
 
 	// "reflect"
@@ -37,10 +38,11 @@ var stringArr = []string{}
 type ParamInfo struct {
 	UserId  string
 	Session *httpsession.Session
+	Rx      *regexp.Regexp
 }
 
 func NewParamInfo(userId string, session *httpsession.Session) *ParamInfo {
-	return &ParamInfo{userId, session}
+	return &ParamInfo{userId, session, regexp.MustCompile("\n+")}
 }
 
 // dev4.6.3.21 暂不调用
@@ -437,20 +439,31 @@ func (pi *ParamInfo) GetSubMsg() UserSubMsg {
 		a_key, _ := o_jy["a_key"].([]interface{})
 		if len(a_key) > 0 {
 			for _, v := range a_key {
+				var keywords []string
 				keyMap, _ := v.(map[string]interface{})
-				key := qutil.ObjArrToStringArr(keyMap["key"].([]interface{}))
-				appendkey := stringArr
+				keyS := qutil.ObjArrToStringArr(keyMap["key"].([]interface{}))
+				if len(keyS) > 0 {
+					for _, key := range keyS {
+						if key = strings.TrimSpace(pi.Rx.ReplaceAllString(key, " ")); key != "" {
+							keywords = append(keywords, key)
+						}
+					}
+				}
+				if len(keywords) == 0 {
+					continue
+				}
+				appendKey := stringArr
 				if keyMap["appendkey"] != nil {
-					appendkey = qutil.ObjArrToStringArr(keyMap["appendkey"].([]interface{}))
+					appendKey = qutil.ObjArrToStringArr(keyMap["appendkey"].([]interface{}))
 				}
-				notkey := stringArr
+				notKey := stringArr
 				if keyMap["notkey"] != nil {
-					notkey = qutil.ObjArrToStringArr(keyMap["notkey"].([]interface{}))
+					notKey = qutil.ObjArrToStringArr(keyMap["notkey"].([]interface{}))
 				}
 				res.Keys = append(res.Keys, ViewKeyWord{
-					Keyword:  key,
-					Appended: appendkey,
-					Exclude:  notkey,
+					Keyword:  keywords,
+					Appended: appendKey,
+					Exclude:  notKey,
 					MatchWay: 0,
 				})
 			}

+ 4 - 6
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -296,7 +296,7 @@ func AddKeyWords(types, userId, classIndex, className, keywordsIndex, keywordNam
 	saveData := map[string]interface{}{}
 	if data != nil && len(*data) > 0 {
 		ojy, _ := (*data)[types].(map[string]interface{})
-		a_items, errs := ojy["a_items"].([]interface{})
+		aItems, errs := ojy["a_items"].([]interface{})
 		if !errs {
 			config.Compatible.Update(userId, map[string]interface{}{
 				"$set": map[string]interface{}{
@@ -328,8 +328,8 @@ func AddKeyWords(types, userId, classIndex, className, keywordsIndex, keywordNam
 		}
 		var _kws []string //关键词
 		for _, kn := range strings.Split(keywordName, " ") {
-			if kn != "" {
-				_kws = append(_kws, kn)
+			if strings.TrimSpace(kn) != "" {
+				_kws = append(_kws, strings.TrimSpace(kn))
 			}
 		}
 		var _key = make(map[string]interface{})
@@ -338,7 +338,7 @@ func AddKeyWords(types, userId, classIndex, className, keywordsIndex, keywordNam
 		_key["appendkey"] = append(appendKeyword, _kws[1:]...)
 		_key["notkey"] = notKeyword
 		_key["matchway"] = matchWay //matchway 0:精准匹配 1:模糊匹配
-		if KeyWordsRepeat(_key, a_items) {
+		if KeyWordsRepeat(_key, aItems) {
 			return map[string]interface{}{"flag": false, "msg": "关键词已存在"}
 		} else {
 			//修改关键词
@@ -350,14 +350,12 @@ func AddKeyWords(types, userId, classIndex, className, keywordsIndex, keywordNam
 			saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
 		}
 	}
-
 	if len(saveData) > 0 {
 		flag = config.Compatible.Update(userId, map[string]interface{}{
 			"$set": saveData,
 		})
 		SetLog(userId, types, positionType, session)
 		//判断是新增
-
 		if (keywordCount == "" || keywordCount == "0") || (keywordCount == keywordsIndex || qutil.Int64All(keywordCount) == qutil.Int64All(keywordsIndex)+1) {
 			//设置关键词送积分
 			jy.Publish(db.Mgo_Log, config.Config.Nsq, config.Config.NsqTopic, "task", qutil.ObjToString(session.Get("mgoUserId")), jy.Jywx_node1, map[string]interface{}{

+ 34 - 23
src/jfw/modules/publicapply/src/subscribePush/service/subscribe.go

@@ -4,6 +4,7 @@ import (
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/subscribePush/entity"
 	"log"
+	"regexp"
 	"strings"
 
 	qutil "app.yhyue.com/moapp/jybase/common"
@@ -45,6 +46,10 @@ func (s *Subscribe) Update() {
 	s.ServeJson(r.Format())
 }
 
+var (
+	Rx = regexp.MustCompile("\n+")
+)
+
 // 关键词、关键词匹配方式、信息类型、项目匹配
 func (s *Subscribe) SetUserInfo() {
 	r := map[string]interface{}{}
@@ -57,31 +62,37 @@ func (s *Subscribe) SetUserInfo() {
 	}
 	if pageType := s.GetString("pageType"); pageType == "keyWords" {
 		//
-		match_way, _ := s.GetInteger("match_way")
-        matchmode := s.GetString("matchmode")
-        sub := &entity.KeyWordsSet{
-            ClassifyIndex: s.GetString("classify_index"),
-            ClassifyName:  strings.Trim(s.GetString("classify_name"), ""),
-            KeyWordIndex:  s.GetString("kws_index"),
-            KeyWordName:   strings.Trim(s.GetString("kws_name"), ""),
-            ActionType:    s.GetString("actionType"),
-            AppendKeyWord: s.GetSlice("addition_kws"),
-            NotKeyWord:    s.GetSlice("not_kws"),
-            MatchWay:      match_way,
-            Matchmode:     matchmode,
-            KeyWordsCount: s.GetString("kwscount"),
-            Type:          vSwitch,
-            UserId:        userId,
-            DeleteKey:     s.GetString("delete_key"),
-            EntUserId:     entUserId,
-            EntId:         entId,
-            Session:       s.Session(),
-        }
+		matchWay, _ := s.GetInteger("match_way")
+		matchMode := s.GetString("matchMode")
+		classifyName := strings.Trim(s.GetString("classify_name"), "")
+		kwsName := Rx.ReplaceAllString(strings.TrimSpace(s.GetString("kws_name")), " ")
+		if strings.TrimSpace(kwsName) == "" && s.GetString("actionType") == "SK" {
+			s.ServeJson(map[string]interface{}{"flag": false, "msg": "请录入正确关键词"})
+			return
+		}
+		sub := &entity.KeyWordsSet{
+			ClassifyIndex: s.GetString("classify_index"),
+			ClassifyName:  classifyName,
+			KeyWordIndex:  s.GetString("kws_index"),
+			KeyWordName:   strings.TrimSpace(kwsName),
+			ActionType:    s.GetString("actionType"),
+			AppendKeyWord: s.GetSlice("addition_kws"),
+			NotKeyWord:    s.GetSlice("not_kws"),
+			MatchWay:      matchWay,
+			Matchmode:     matchMode,
+			KeyWordsCount: s.GetString("kwscount"),
+			Type:          vSwitch,
+			UserId:        userId,
+			DeleteKey:     s.GetString("delete_key"),
+			EntUserId:     entUserId,
+			EntId:         entId,
+			Session:       s.Session(),
+		}
 		r = sub.UpdateKeyWords()
 	} else {
-        pmindex, _ := s.GetInteger("pmindex")
-        matchtype := s.GetString("matchtype")
-        other, _ := s.GetInteger("other")
+		pmindex, _ := s.GetInteger("pmindex")
+		matchtype := s.GetString("matchtype")
+		other, _ := s.GetInteger("other")
 		uo := &entity.UpdateOther{
 			PageType:        s.GetString("pageType"),
 			Pmindex:         pmindex,

+ 57 - 21
src/jfw/modules/publicapply/src/util/send.go

@@ -2,12 +2,9 @@ package util
 
 import (
 	"app.yhyue.com/moapp/jybase/date"
-	"encoding/json"
 	"fmt"
-	"io/ioutil"
+	"github.com/levigross/grequests"
 	"log"
-	"net/http"
-	"net/url"
 )
 
 type StationMessage struct {
@@ -44,33 +41,72 @@ func NewStationMessage(addr string, action string, callPlatform string) *Station
 	}
 }
 
+//	func (s *StationMessage) SendStationMessages(p MessageParam) {
+//		var (
+//			ret  MessageRet
+//			cont []byte
+//		)
+//		parms := fmt.Sprintf("_action=%s&userIds=%s&msgType=%v&title=%s&content=%s&link=%s&sendMode=2&sendTime=%s&androidUrl=%s&iosUrl=%s&weChatUrl=%s&_token=12311&reqSource=1&callPlatform=%s&positionIds=%s&menuname=message",
+//			s.Action, p.UserIds, p.MsgType, p.Title, p.Content, p.Link, date.NowFormat(date.Date_Short_Layout), p.AndroidUrl, p.IosUrl, p.WeChatUrl, s.CallPlatform, p.PositionIds)
+//		paramsEncode := url.PathEscape(parms)
+//		url2 := fmt.Sprintf("%s?%s", s.Addr, paramsEncode)
+//		resp, err := http.Get(url2)
+//		if err != nil {
+//			log.Println("发送消息失败:", err)
+//			return
+//		}
+//		defer resp.Body.Close()
+//		cont, err = ioutil.ReadAll(resp.Body)
+//		if err != nil {
+//			log.Println("发送消息错误信息:", string(cont), err)
+//			return
+//		}
+//		err = json.Unmarshal(cont, &ret)
+//		if err != nil {
+//			log.Println("发送消息反序列化错误信息:", err)
+//			return
+//		}
+//		if ret.Data.Status != 1 {
+//			log.Println("发送消息失败:Status != 1", ret)
+//		}
+//
+// }
 func (s *StationMessage) SendStationMessages(p MessageParam) {
 	var (
-		ret  MessageRet
-		cont []byte
+		ret MessageRet
 	)
-	parms := fmt.Sprintf("_action=%s&userIds=%s&msgType=%v&title=%s&content=%s&link=%s&sendMode=2&sendTime=%s&androidUrl=%s&iosUrl=%s&weChatUrl=%s&_token=12311&reqSource=1&callPlatform=%s&positionIds=%s&menuname=message",
-		s.Action, p.UserIds, p.MsgType, p.Title, p.Content, p.Link, date.NowFormat(date.Date_Short_Layout), p.AndroidUrl, p.IosUrl, p.WeChatUrl, s.CallPlatform, p.PositionIds)
-	paramsEncode := url.PathEscape(parms)
-	url2 := fmt.Sprintf("%s?%s", s.Addr, paramsEncode)
-	resp, err := http.Get(url2)
-	if err != nil {
-		log.Println("发送消息失败:", err)
-		return
+	data := map[string]string{
+		"userIds":      p.UserIds,
+		"msgType":      fmt.Sprint(p.MsgType),
+		"title":        p.Title,
+		"content":      p.Content,
+		"link":         p.Link,
+		"sendMode":     "2",
+		"sendTime":     date.NowFormat(date.Date_Short_Layout),
+		"androidUrl":   p.AndroidUrl,
+		"iosUrl":       p.IosUrl,
+		"weChatUrl":    p.WeChatUrl,
+		"reqSource":    "1",
+		"callPlatform": s.CallPlatform,
+		"positionIds":  p.PositionIds,
+		"menuname":     "message",
 	}
-	defer resp.Body.Close()
-	cont, err = ioutil.ReadAll(resp.Body)
-	if err != nil {
-		log.Println("发送消息错误信息:", string(cont), err)
+	geq := &grequests.RequestOptions{
+		Data: data,
+	}
+	url := fmt.Sprintf("%s?_action=%s&_token=12311", s.Addr, s.Action)
+	resp, err := grequests.Post(url, geq)
+
+	if err != nil || resp == nil {
+		log.Println("发送消息错误信息:", resp, err)
 		return
 	}
-	err = json.Unmarshal(cont, &ret)
+	err = resp.JSON(&ret)
 	if err != nil {
-		log.Println("发送消息反序列化错误信息:", err)
+		log.Println("发送消息错误信息:", resp, err)
 		return
 	}
 	if ret.Data.Status != 1 {
 		log.Println("发送消息失败:Status != 1", ret)
 	}
-
 }

+ 31 - 29
src/jfw/modules/publicapply/src/util/userInfo.go

@@ -1,45 +1,47 @@
 package util
 
 import (
-    "app.yhyue.com/moapp/jybase/common"
-    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
-    "jy/src/jfw/modules/publicapply/src/db"
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"jy/src/jfw/modules/publicapply/src/db"
 )
 
 // SessUserInfo 从session获取用户基本信息
 type SessUserInfo struct {
-    BaseUserId   int64
-    AccountId    int64
-    EntId        int64
-    PositionType int64
-    PositionId   int64
-    EntUserId    int64
-    Phone        string
-    MgoUserId    string
-    UserId       string
+	BaseUserId   int64
+	AccountId    int64
+	EntId        int64
+	PositionType int64
+	PositionId   int64
+	EntUserId    int64
+	Phone        string
+	MgoUserId    string
+	UserId       string
 }
 
 // GetUserBaseInfo 获取用户基本信息从session
 func GetUserBaseInfo(sess *httpsession.Session) SessUserInfo {
-    getSession := sess.GetMultiple()
-    return SessUserInfo{
-        MgoUserId:    common.ObjToString(getSession["mgoUserId"]),
-        BaseUserId:   common.Int64All(getSession["base_user_id"]),
-        AccountId:    common.Int64All(getSession["accountId"]),
-        EntId:        common.Int64All(getSession["entId"]),
-        PositionType: common.Int64All(getSession["positionType"]),
-        PositionId:   common.Int64All(getSession["positionId"]),
-        Phone:        common.ObjToString(getSession["phone"]),
-        UserId:       common.ObjToString(getSession["userId"]),
-        EntUserId:    common.Int64All(getSession["entUserId"]),
-    }
+	getSession := sess.GetMultiple()
+	return SessUserInfo{
+		MgoUserId:    common.ObjToString(getSession["mgoUserId"]),
+		BaseUserId:   common.Int64All(getSession["base_user_id"]),
+		AccountId:    common.Int64All(getSession["accountId"]),
+		EntId:        common.Int64All(getSession["entId"]),
+		PositionType: common.Int64All(getSession["positionType"]),
+		PositionId:   common.Int64All(getSession["positionId"]),
+		Phone:        common.ObjToString(getSession["phone"]),
+		UserId:       common.ObjToString(getSession["userId"]),
+		EntUserId:    common.Int64All(getSession["entUserId"]),
+	}
 }
 
 // 手机号用户是否存在
 func UserIsExists(phoneNum string) bool {
-    query := map[string]interface{}{
-        "s_phone": phoneNum,
-        "i_appid": 2,
-    }
-    return db.Mgo.Count("user", query) > 0
+	query := map[string]interface{}{
+		"$or": []map[string]interface{}{
+			{"s_phone": phoneNum},
+			{"s_m_phone": phoneNum}},
+		"i_appid": 2,
+	}
+	return db.Mgo.Count("user", query) > 0
 }

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

@@ -1,62 +1,62 @@
 package util
 
 import (
-    elastic "app.yhyue.com/moapp/jybase/es"
-    "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
-    "bytes"
-    "crypto/md5"
-    "encoding/hex"
-    "encoding/json"
-    "fmt"
-    "jy/src/jfw/modules/publicapply/src/config"
-    "jy/src/jfw/modules/publicapply/src/db"
-    "log"
-    "net/http"
-    "regexp"
-    "strconv"
-    "strings"
-    "time"
+	elastic "app.yhyue.com/moapp/jybase/es"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"bytes"
+	"crypto/md5"
+	"encoding/hex"
+	"encoding/json"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/config"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"log"
+	"net/http"
+	"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("<[^>]*>")
 var (
-    queryBoolShould         = `{"bool":{"should":[%s],"minimum_should_match": 1}}`
-    queryBoolMustBoolShould = `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
-    queryBase               = `{"query":{"bool":{"must":[%s]}},"_source":["_id"],"from":0,"size":%d}`
-    gte                     = `"gte": %s`
-    lte                     = `"lte": %s`
-    queryBoolMust           = `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`
-    multiMatch              = `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
-    idTerms                 = `{"terms":{"_id":["%s"]}}`
-    topTypeMap              = map[string]string{
-        "招标预告":   "预告",
-        "招标公告":   "招标",
-        "招标结果":   "结果",
-        "招标信用信息": "其它",
-        "拟建项目":   "拟建",
-        "采购意向":   "采购意向",
-    }
+	queryBoolShould         = `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	queryBoolMustBoolShould = `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
+	queryBase               = `{"query":{"bool":{"must":[%s]}},"_source":["_id"],"from":0,"size":%d}`
+	gte                     = `"gte": %s`
+	lte                     = `"lte": %s`
+	queryBoolMust           = `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`
+	multiMatch              = `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
+	idTerms                 = `{"terms":{"_id":["%s"]}}`
+	topTypeMap              = map[string]string{
+		"招标预告":   "预告",
+		"招标公告":   "招标",
+		"招标结果":   "结果",
+		"招标信用信息": "其它",
+		"拟建项目":   "拟建",
+		"采购意向":   "采购意向",
+	}
 )
 
 // 加密
 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]
 }
 
 //收藏列表
@@ -68,566 +68,566 @@ 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  string `json:"buyerTel"`    //是否需要采购单位联系方式 y:需要
-    WinnerPhone string `json:"winnerTel"`   //是否需要中标单位联系方式 y:需要
-    Pagesize    int    `json:"pagesize"`    //每页展示数量
-    KeyWords    string `json:"keyWords"`    // 匹配标题正文  到es里面查
-    PublishTime string `json:"publishTime"` // 发布时间  到es里面查
-    TopType     string `json:"topType"`     // 信息类型-一级分类 到es里面查
-    Subtype     string `json:"subtype"`     // 信息类型-二级分类 到es里面查
-    Province    string `json:"province"`    // 项目地区_省份 到es里面查
-    City        string `json:"city"`        // 项目地区_城市 到es里面查
-    District    string `json:"district"`    // 项目地区_区县 到es里面查
-    Price       string `json:"price"`       // 金额区间 到es里面查
-    Industry    string `json:"industry"`    // 行业分类 到es里面查
+	Pagenum     int    `json:"pagenum"`     //页数
+	Label       string `json:"label"`       //标签 用,分隔开
+	SelectTime  string `json:"selectTime"`  //收藏时间
+	Buyerclass  string `json:"buyerclass"`  //采购单位 用,分隔开
+	BuyerPhone  string `json:"buyerTel"`    //是否需要采购单位联系方式 y:需要
+	WinnerPhone string `json:"winnerTel"`   //是否需要中标单位联系方式 y:需要
+	Pagesize    int    `json:"pagesize"`    //每页展示数量
+	KeyWords    string `json:"keyWords"`    // 匹配标题正文  到es里面查
+	PublishTime string `json:"publishTime"` // 发布时间  到es里面查
+	TopType     string `json:"topType"`     // 信息类型-一级分类 到es里面查
+	Subtype     string `json:"subtype"`     // 信息类型-二级分类 到es里面查
+	Province    string `json:"province"`    // 项目地区_省份 到es里面查
+	City        string `json:"city"`        // 项目地区_城市 到es里面查
+	District    string `json:"district"`    // 项目地区_区县 到es里面查
+	Price       string `json:"price"`       // 金额区间 到es里面查
+	Industry    string `json:"industry"`    // 行业分类 到es里面查
 }
 
 // 搜藏列表-tidb 查询条件 个人标签、收藏时间、采购单位、采购单位联系方式、中标单位联系方式
 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 == "y" {
-            sql += ` and buyerinfo = 1`
-        } //else if c.BuyerPhone == -1 {
-        //sql += ` and buyerinfo = 0`
-        //}
-        //是否存在中标单位电话
-        if c.WinnerPhone == "y" { // p480二期参数调整
-            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 == "y" {
+			sql += ` and buyerinfo = 1`
+		} //else if c.BuyerPhone == -1 {
+		//sql += ` and buyerinfo = 0`
+		//}
+		//是否存在中标单位电话
+		if c.WinnerPhone == "y" { // p480二期参数调整
+			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
 }
 
 // CollListESQuery 收藏列表es查询条件  匹配标题正 发布时间 信息类型 项目地区 金额区间
 func CollListESQuery(c *CollList, idmapList []map[string]interface{}) (qstr string, idList []string, keyMustStr string) {
-    m := map[string]struct{}{}
-    musts := []string{}
-    for _, v := range idmapList {
-        if _, ok := m[qutil.ObjToString(v["bid"])]; ok {
-            continue
-        }
-        m[qutil.ObjToString(v["bid"])] = struct{}{}
-        idList = append(idList, qutil.ObjToString(v["bid"]))
-    }
-    musts = append(musts, fmt.Sprintf(idTerms, strings.Join(idList, `","`)))
-    query := ``
-    //省份
-    area := c.Province
-    if area != "" {
-        query += `{"terms":{"area":[`
-        for k, v := range strings.Split(area, ",") {
-            if k > 0 {
-                query += `,`
-            }
-            query += `"` + v + `"`
-        }
-        query += `]}}`
-    }
-    //市--
-    city := c.City
-    if city != "" {
-        if len(query) > 0 {
-            query += ","
-        }
-        query += `{"terms":{"city":[`
-        for k, v := range strings.Split(city, ",") {
-            if k > 0 {
-                query += `,`
-            }
-            query += `"` + v + `"`
-        }
-        query += `]}}`
-    }
-    district := c.District
-    if district != "" {
-        if len(query) > 0 {
-            query += ","
-        }
-        for k, v := range strings.Split(district, ",") {
-            if k > 0 {
-                query += `,`
-            }
-            cityName := strings.Split(v, "_")[0]
-            districtName := strings.Split(v, "_")[1]
-            queryBoolMustAndDistrict := `{"bool":{"must":[{"terms":{"city":["%s"]}},{"terms":{"district":["%s"]}}]}}`
-            query += fmt.Sprintf(queryBoolMustAndDistrict, cityName, districtName)
-        }
+	m := map[string]struct{}{}
+	musts := []string{}
+	for _, v := range idmapList {
+		if _, ok := m[qutil.ObjToString(v["bid"])]; ok {
+			continue
+		}
+		m[qutil.ObjToString(v["bid"])] = struct{}{}
+		idList = append(idList, qutil.ObjToString(v["bid"]))
+	}
+	musts = append(musts, fmt.Sprintf(idTerms, strings.Join(idList, `","`)))
+	query := ``
+	//省份
+	area := c.Province
+	if area != "" {
+		query += `{"terms":{"area":[`
+		for k, v := range strings.Split(area, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	//市--
+	city := c.City
+	if city != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"city":[`
+		for k, v := range strings.Split(city, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	district := c.District
+	if district != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		for k, v := range strings.Split(district, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			cityName := strings.Split(v, "_")[0]
+			districtName := strings.Split(v, "_")[1]
+			queryBoolMustAndDistrict := `{"bool":{"must":[{"terms":{"city":["%s"]}},{"terms":{"district":["%s"]}}]}}`
+			query += fmt.Sprintf(queryBoolMustAndDistrict, cityName, districtName)
+		}
 
-    }
-    if query != "" {
-        query = fmt.Sprintf(queryBoolShould, query)
-    }
-    //发布时间
-    publishTime := c.PublishTime
-    if publishTime != "" {
-        startTime, endTime := "", ""
-        now := time.Now()
-        switch publishTime {
-        case "lately-7":
-            startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
-        case "lately-30":
-            startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
-        case "thisyear":
-            startTime = fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
-            endTime = fmt.Sprint(now.Unix())
-        case "threeyear":
-            startTime = fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
-            endTime = fmt.Sprint(now.Unix())
-        case "fiveyear":
-            startTime = fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
-            endTime = fmt.Sprint(now.Unix())
-        default:
-            if len(strings.Split(publishTime, "-")) > 1 {
-                startTime = strings.Split(publishTime, "-")[0]
-                endTime = strings.Split(publishTime, "-")[1]
-                //电脑端 时间选择 开始时间当天和结束时间当天相同
-                if startTime == endTime {
-                    et, _ := strconv.ParseInt(endTime, 0, 64)
-                    etTime := time.Unix(et, 0)
-                    endTime = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Unix())
-                }
-            }
-        }
-        if startTime != "" || endTime != "" {
-            if len(query) > 0 {
-                query += ","
-            }
-            query += `{"range":{"publishtime":{`
-            if startTime != "" {
-                query += `"gte":` + startTime
-            }
-            if startTime != "" && endTime != "" {
-                query += `,`
-            }
-            if endTime != "" {
-                query += `"lt":` + endTime
-            }
-            query += `}}}`
-        }
-    }
-    //信息类型-二级
-    subtype := c.Subtype
-    topType := qutil.If(c.TopType != "", strings.Split(c.TopType, ","), []string{}).([]string)
-    allType := ``
-    //二级分类
-    if subtype != "" {
-        var typeInt = 0
-        allType += `{"terms":{"subtype":[`
-        for k, v := range strings.Split(subtype, ",") {
-            if tType := qutil.If(topTypeMap[v] != "" && c.TopType == "", topTypeMap[v], "").(string); tType != "" {
-                topType = append(topType, tType)
-                typeInt += 1
-                continue
-            }
-            if k > typeInt {
-                allType += `,`
-            }
-            allType += `"` + v + `"`
-        }
-        allType += `]}}`
-        if typeInt == len(strings.Split(subtype, ",")) {
-            allType = ``
-        }
-    }
-    //信息类型  一级分类
-    log.Println("topType:", topType)
-    if len(topType) > 0 {
-        if allType != "" {
-            allType += ","
-        }
-        allType += `{"terms":{"toptype":[`
-        for k, v := range topType {
-            if k > 0 {
-                allType += `,`
-            }
-            allType += `"` + v + `"`
-        }
-        allType += `]}}`
-    }
+	}
+	if query != "" {
+		query = fmt.Sprintf(queryBoolShould, query)
+	}
+	//发布时间
+	publishTime := c.PublishTime
+	if publishTime != "" {
+		startTime, endTime := "", ""
+		now := time.Now()
+		switch publishTime {
+		case "lately-7":
+			startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+		case "lately-30":
+			startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+		case "thisyear":
+			startTime = fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		case "threeyear":
+			startTime = fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		case "fiveyear":
+			startTime = fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		default:
+			if len(strings.Split(publishTime, "-")) > 1 {
+				startTime = strings.Split(publishTime, "-")[0]
+				endTime = strings.Split(publishTime, "-")[1]
+				//电脑端 时间选择 开始时间当天和结束时间当天相同
+				if startTime == endTime {
+					et, _ := strconv.ParseInt(endTime, 0, 64)
+					etTime := time.Unix(et, 0)
+					endTime = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Unix())
+				}
+			}
+		}
+		if startTime != "" || endTime != "" {
+			if len(query) > 0 {
+				query += ","
+			}
+			query += `{"range":{"publishtime":{`
+			if startTime != "" {
+				query += `"gte":` + startTime
+			}
+			if startTime != "" && endTime != "" {
+				query += `,`
+			}
+			if endTime != "" {
+				query += `"lt":` + endTime
+			}
+			query += `}}}`
+		}
+	}
+	//信息类型-二级
+	subtype := c.Subtype
+	topType := qutil.If(c.TopType != "", strings.Split(c.TopType, ","), []string{}).([]string)
+	allType := ``
+	//二级分类
+	if subtype != "" {
+		var typeInt = 0
+		allType += `{"terms":{"subtype":[`
+		for k, v := range strings.Split(subtype, ",") {
+			if tType := qutil.If(topTypeMap[v] != "" && c.TopType == "", topTypeMap[v], "").(string); tType != "" {
+				topType = append(topType, tType)
+				typeInt += 1
+				continue
+			}
+			if k > typeInt {
+				allType += `,`
+			}
+			allType += `"` + v + `"`
+		}
+		allType += `]}}`
+		if typeInt == len(strings.Split(subtype, ",")) {
+			allType = ``
+		}
+	}
+	//信息类型  一级分类
+	log.Println("topType:", topType)
+	if len(topType) > 0 {
+		if allType != "" {
+			allType += ","
+		}
+		allType += `{"terms":{"toptype":[`
+		for k, v := range topType {
+			if k > 0 {
+				allType += `,`
+			}
+			allType += `"` + v + `"`
+		}
+		allType += `]}}`
+	}
 
-    if allType != "" {
-        if query != "" {
-            query += ","
-        }
-        query += fmt.Sprintf(queryBoolShould, allType)
-    }
-    if query != "" {
-        musts = append(musts, query)
-    }
-    if c.KeyWords != "" {
-        var (
-            keyWordsMusts, wordsMusts []string
-        )
-        for _, v := range strings.Split(c.KeyWords, " ") {
-            if elastic.ReplaceYH(v) == "" {
-                continue
-            }
-            keyWordsMusts = append(keyWordsMusts, fmt.Sprintf(fmt.Sprintf(multiMatch, "%s", `"title","detail"`), elastic.ReplaceYH(v)))
-        }
-        //包含所有
-        wordsMusts = append(wordsMusts, keyWordsMusts...)
-        if len(wordsMusts) > 0 {
-            keyMustStr = fmt.Sprintf(elastic.NgramMust, strings.Join(wordsMusts, ","))
-            musts = append(musts, keyMustStr)
-        }
-    }
-    //行业
-    if c.Industry != "" {
-        musts = append(musts, fmt.Sprintf(queryBoolMust, `"`+strings.ReplaceAll(c.Industry, ",", `","`)+`"`))
-    }
-    //价格
-    if c.Price != "" && len(strings.Split(c.Price, "-")) > 1 {
-        minPrice, maxPrice := strings.Split(c.Price, "-")[0], strings.Split(c.Price, "-")[1]
-        if minPrice != "" || maxPrice != "" {
-            sq := ``
-            if minPrice != "" {
-                min, _ := strconv.ParseFloat(minPrice, 64)
-                minPrice = fmt.Sprintf("%.0f", min*10000)
-                if minPrice == "0" {
-                    minPrice = ""
-                }
-            }
-            if maxPrice != "" {
-                max, _ := strconv.ParseFloat(maxPrice, 64)
-                maxPrice = fmt.Sprintf("%.0f", max*10000)
-                if maxPrice == "0" {
-                    maxPrice = ""
-                }
-            }
-            if minPrice != "" {
-                sq += fmt.Sprintf(gte, minPrice)
-            }
-            if minPrice != "" && maxPrice != "" {
-                sq += `,`
-            }
-            if maxPrice != "" {
-                sq += fmt.Sprintf(lte, maxPrice)
-            }
-            if minPrice != "" || maxPrice != "" {
-                query_price := fmt.Sprintf(queryBoolShould, fmt.Sprintf(queryBoolMustBoolShould, sq, sq))
-                musts = append(musts, query_price)
-            }
-        }
-    }
-    qstr = fmt.Sprintf(queryBase, strings.Join(musts, ","), len(idList))
-    log.Println("qstr:", qstr)
-    return
+	if allType != "" {
+		if query != "" {
+			query += ","
+		}
+		query += fmt.Sprintf(queryBoolShould, allType)
+	}
+	if query != "" {
+		musts = append(musts, query)
+	}
+	if c.KeyWords != "" {
+		var (
+			keyWordsMusts, wordsMusts []string
+		)
+		for _, v := range strings.Split(c.KeyWords, " ") {
+			if elastic.ReplaceYH(v) == "" {
+				continue
+			}
+			keyWordsMusts = append(keyWordsMusts, fmt.Sprintf(fmt.Sprintf(multiMatch, "%s", `"title","detail"`), elastic.ReplaceYH(v)))
+		}
+		//包含所有
+		wordsMusts = append(wordsMusts, keyWordsMusts...)
+		if len(wordsMusts) > 0 {
+			keyMustStr = fmt.Sprintf(elastic.NgramMust, strings.Join(wordsMusts, ","))
+			musts = append(musts, keyMustStr)
+		}
+	}
+	//行业
+	if c.Industry != "" {
+		musts = append(musts, fmt.Sprintf(queryBoolMust, `"`+strings.ReplaceAll(c.Industry, ",", `","`)+`"`))
+	}
+	//价格
+	if c.Price != "" && len(strings.Split(c.Price, "-")) > 1 {
+		minPrice, maxPrice := strings.Split(c.Price, "-")[0], strings.Split(c.Price, "-")[1]
+		if minPrice != "" || maxPrice != "" {
+			sq := ``
+			if minPrice != "" {
+				min, _ := strconv.ParseFloat(minPrice, 64)
+				minPrice = fmt.Sprintf("%.0f", min*10000)
+				if minPrice == "0" {
+					minPrice = ""
+				}
+			}
+			if maxPrice != "" {
+				max, _ := strconv.ParseFloat(maxPrice, 64)
+				maxPrice = fmt.Sprintf("%.0f", max*10000)
+				if maxPrice == "0" {
+					maxPrice = ""
+				}
+			}
+			if minPrice != "" {
+				sq += fmt.Sprintf(gte, minPrice)
+			}
+			if minPrice != "" && maxPrice != "" {
+				sq += `,`
+			}
+			if maxPrice != "" {
+				sq += fmt.Sprintf(lte, maxPrice)
+			}
+			if minPrice != "" || maxPrice != "" {
+				query_price := fmt.Sprintf(queryBoolShould, fmt.Sprintf(queryBoolMustBoolShould, sq, sq))
+				musts = append(musts, query_price)
+			}
+		}
+	}
+	qstr = fmt.Sprintf(queryBase, strings.Join(musts, ","), len(idList))
+	log.Println("qstr:", qstr)
+	return
 }
 
 // es里面的筛选条件再过滤一次id
 func GetEsCollListId(esQuery string, idList []string) (ids []map[string]interface{}) {
-    //idList 是为了最后处理有序
-    // 查询
-    rs := elastic.Get("bidding", "bidding", esQuery)
-    if rs == nil {
-        log.Println("未获取到数据")
-        return
-    }
-    idMap := map[string]struct{}{}
-    if rs != nil {
-        for _, v := range *rs {
-            _id := qutil.ObjToString(v["_id"])
-            if _, ok := idMap[_id]; !ok {
-                idMap[_id] = struct{}{}
-            }
-        }
-    }
+	//idList 是为了最后处理有序
+	// 查询
+	rs := elastic.Get("bidding", "bidding", esQuery)
+	if rs == nil {
+		log.Println("未获取到数据")
+		return
+	}
+	idMap := map[string]struct{}{}
+	if rs != nil {
+		for _, v := range *rs {
+			_id := qutil.ObjToString(v["_id"])
+			if _, ok := idMap[_id]; !ok {
+				idMap[_id] = struct{}{}
+			}
+		}
+	}
 
-    // 获取有序数组
-    for i := 0; i < len(idList); i++ {
-        if _, ok := idMap[idList[i]]; ok {
-            ids = append(ids, map[string]interface{}{
-                "bid": idList[i],
-            })
-        }
+	// 获取有序数组
+	for i := 0; i < len(idList); i++ {
+		if _, ok := idMap[idList[i]]; ok {
+			ids = append(ids, map[string]interface{}{
+				"bid": idList[i],
+			})
+		}
 
-    }
-    return
+	}
+	return
 }
 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相等方法
 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":每天三点;
 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 func(d int) (string, bool, int) {
-                //周末不显示
-                mi := ConvertWeekday(time.Now().Weekday().String())
-                now := time.Now()
-                isWeekday := mi < d
-                expireTime := 0
-                if isWeekday {
-                    expireTime = int(time.Date(now.Year(), now.Month(), now.Day()+d-mi, 0, 0, 0, 0, now.Location()).Unix() - now.Unix())
-                }
-                return fmt.Sprintf("nps_%d", d), isWeekday, expireTime
-            }(d)
-        }
-    }
-    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 func(d int) (string, bool, int) {
+				//周末不显示
+				mi := ConvertWeekday(time.Now().Weekday().String())
+				now := time.Now()
+				isWeekday := mi < d
+				expireTime := 0
+				if isWeekday {
+					expireTime = int(time.Date(now.Year(), now.Month(), now.Day()+d-mi, 0, 0, 0, 0, now.Location()).Unix() - now.Unix())
+				}
+				return fmt.Sprintf("nps_%d", d), isWeekday, expireTime
+			}(d)
+		}
+	}
+	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转结构体
 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
 }
 
 // 获取当天剩余时间
 var (
-    timeOut int64 = 24 * 60 * 60
+	timeOut int64 = 24 * 60 * 60
 )
 
 func GetLastTime() int64 {
-    t := time.Now()
-    midnight := time.Date(t.Year(), t.Month(), t.Day()+1, 0, 0, 0, 0, t.Location())
-    if midnight.After(t) {
-        return midnight.Unix() - t.Unix()
-    }
-    return timeOut
+	t := time.Now()
+	midnight := time.Date(t.Year(), t.Month(), t.Day()+1, 0, 0, 0, 0, t.Location())
+	if midnight.After(t) {
+		return midnight.Unix() - t.Unix()
+	}
+	return timeOut
 }
 
 func GetMD5(data string) string {
-    hash := md5.Sum([]byte(data))
-    encryptedData := hex.EncodeToString(hash[:])
-    return encryptedData
+	hash := md5.Sum([]byte(data))
+	encryptedData := hex.EncodeToString(hash[:])
+	return encryptedData
 }
 
 // 创建订单号
 func GetOrderCode() string {
-    return <-jy.VarOrderCode.Pool
+	return <-jy.VarOrderCode.Pool
 }
 
 // ClearCookie 清楚前端cookie 缓存
 func ClearCookie(w http.ResponseWriter, name string) {
-    if name == "" {
-        return
-    }
-    for _, nk := range strings.Split(name, ",") {
-        if nk != "" {
-            http.SetCookie(w, &http.Cookie{
-                Name:     nk,
-                Value:    "",
-                Path:     "/",
-                HttpOnly: false,
-                MaxAge:   -1,
-                Expires:  time.Now().Add(-1),
-                Domain:   httpsession.Domain,
-            })
-        }
-    }
+	if name == "" {
+		return
+	}
+	for _, nk := range strings.Split(name, ",") {
+		if nk != "" {
+			http.SetCookie(w, &http.Cookie{
+				Name:     nk,
+				Value:    "",
+				Path:     "/",
+				HttpOnly: false,
+				MaxAge:   -1,
+				Expires:  time.Now().Add(-1),
+				Domain:   httpsession.Domain,
+			})
+		}
+	}
 }
 
 func SendBot(webhookURL, msg string) (b bool) {
-    // 构造请求体
-    payload := map[string]interface{}{
-        "msgtype": "text",
-        "text": map[string]string{
-            "content": msg,
-        },
-    }
-    // 转换为 JSON 字符串
-    payloadBytes, err := json.Marshal(payload)
-    if err != nil {
-        log.Println("Error :", err.Error())
-        return
-    }
-    // 发送 POST 请求
-    resp, err := http.Post(webhookURL, "application/json", bytes.NewReader(payloadBytes))
-    if err != nil {
-        log.Println("Error :", err.Error())
-        return
-    }
-    defer resp.Body.Close()
-    b = true
-    return
+	// 构造请求体
+	payload := map[string]interface{}{
+		"msgtype": "text",
+		"text": map[string]string{
+			"content": msg,
+		},
+	}
+	// 转换为 JSON 字符串
+	payloadBytes, err := json.Marshal(payload)
+	if err != nil {
+		log.Println("Error :", err.Error())
+		return
+	}
+	// 发送 POST 请求
+	resp, err := http.Post(webhookURL, "application/json", bytes.NewReader(payloadBytes))
+	if err != nil {
+		log.Println("Error :", err.Error())
+		return
+	}
+	defer resp.Body.Close()
+	b = true
+	return
 }

+ 2 - 0
src/jfw/modules/subscribepay/src/a/init.go

@@ -89,4 +89,6 @@ func init() {
 	//人脉通
 	xweb.AddRouter("/subscribepay", &service.Network{})
 	xweb.AddRouter("/subscribepay", &service.DocMember{})
+	//超级订阅赠送
+	xweb.AddRouter("/subscribepay", &service.VipGift{})
 }

+ 4 - 2
src/jfw/modules/subscribepay/src/config.json

@@ -169,7 +169,7 @@
       "callPlatform": "subscribepay",
       "msgType": 13,
       "title": "赠送三方会员已到账,戳我解锁!",
-      "content": "购买%s产品赠送三方会员已到账。兑换截止日期:%s。请在剑鱼标讯平台兑换中心获取兑换码进行兑换。#jy#购买%s赠送三方会员#jy#请前往剑鱼标讯平台进行兑换解锁福利。",
+      "content": "购买%s产品赠送三方会员已到账请在剑鱼标讯平台兑换中心获取兑换码进行兑换。#jy#购买%s赠送三方会员#jy#请前往剑鱼标讯平台进行兑换解锁福利。",
       "link": "",
       "androidUrl": "",
       "iosUrl": "",
@@ -231,5 +231,7 @@
   },
   "wxProceduresMoney": 0.54,
   "aliProceduresMoney": 0.6,
-  "corporateProceduresMoney": 0
+  "corporateProceduresMoney": 0,
+  "vipGiftStartTime": 1709827200,
+  "vipGiftEndTime":1709827200
 }

+ 2 - 0
src/jfw/modules/subscribepay/src/config/config.go

@@ -159,6 +159,8 @@ type config struct {
 	WxProceduresMoney        float64           `json:"wxProceduresMoney"`
 	AliProceduresMoney       float64           `json:"aliProceduresMoney"`
 	CorporateProceduresMoney float64           `json:"corporateProceduresMoney"`
+	VipGiftEndTime           int64             `json:"vipGiftEndTime"`
+	VipGiftStartTime         int64             `json:"vipGiftStartTime"`
 }
 
 type SiteMsgStruct struct {

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