Selaa lähdekoodia

删除活动链接配置项

zhangxinlei1996 5 vuotta sitten
vanhempi
commit
547025b310

+ 26 - 0
src/jfw/front/vipsubscribe.go

@@ -6,6 +6,7 @@ import (
 	"jfw/jyutil"
 	"jfw/jyutil"
 	"jfw/public"
 	"jfw/public"
 	"jfw/wx"
 	"jfw/wx"
+	"log"
 	"net/url"
 	"net/url"
 	"qfw/util"
 	"qfw/util"
 	"time"
 	"time"
@@ -46,6 +47,9 @@ type Subscribepay struct {
 
 
 	//发票
 	//发票
 	openInvoice xweb.Mapper `xweb:"/front/vipsubscribe/openInvoice/(\\w+)"` //开发票
 	openInvoice xweb.Mapper `xweb:"/front/vipsubscribe/openInvoice/(\\w+)"` //开发票
+
+	//预热活动链接跳转
+	preheatPoster xweb.Mapper `xweb:"/front/preheat/poster"` //预热活动链接跳转
 }
 }
 
 
 func init() {
 func init() {
@@ -301,3 +305,25 @@ func (s *Subscribepay) OpenInvoice(order_code string) {
 	s.T["order_code"] = order_code
 	s.T["order_code"] = order_code
 	s.Render("/weixin/dataExport/dataExport_applyInvoice.html", &s.T)
 	s.Render("/weixin/dataExport/dataExport_applyInvoice.html", &s.T)
 }
 }
+
+//预热活动链接跳转
+func (s *Subscribepay) PreheatPoster() {
+	myopenid := util.ObjToString(s.GetSession("s_m_openid"))
+	mynickname, _ := s.Session().Get("s_nickname").(string)
+	myavatar, _ := s.Session().Get("s_avatar").(string)
+	s.T["nickname"] = mynickname
+	s.T["avatar"] = myavatar
+	s.T["signature"] = wx.SignJSSDK(s.Site() + s.Url())
+	s.T["openid"] = se.EncodeString(myopenid)
+	u, ok := public.MQFW.FindOne("user", `{"s_m_openid":"`+myopenid+`"}`)
+	log.Println(myopenid, "---", u, "--", ok)
+	if len(*u) > 0 && ok {
+		if util.Int64All((*u)["i_vip_status"]) == 1 || util.Int64All((*u)["i_vip_status"]) == 2 {
+			log.Println("VIP")
+			s.Redirect("/front/vipsubscribe/toSetPage")
+		} else {
+			log.Println("NO VIP")
+			s.Redirect("/front/vipsubscribe/introducePage")
+		}
+	}
+}

+ 1 - 7
src/jfw/modules/weixin/src/config.json

@@ -89,11 +89,5 @@
             "activeEnd": 1586185600,
             "activeEnd": 1586185600,
             "subSecondRP": "https://www.jianyu360.com/images/t3.jpg"
             "subSecondRP": "https://www.jianyu360.com/images/t3.jpg"
         }
         }
-    ],
-	"preheatingState":true,
-	"preheatingReply": {
-        "href_vip":"/front/vipsubscribe/toSetPage",
-        "href_notvip":"/front/vipsubscribe/introducePage",
-        "content":"<a href='%s'>剑鱼标讯VIP订阅新上线</a>"
-	}
+    ]
 }
 }

+ 15 - 13
src/jfw/modules/weixin/src/wx/wx.go

@@ -790,21 +790,23 @@ func Subscribe(w ResponseWriter, r *Request) {
 			Description: subscribeReply["description"].(string),
 			Description: subscribeReply["description"].(string),
 		}})
 		}})
 		//vip消息
 		//vip消息
-		preheatingState := config.Sysconfig["preheatingState"].(bool)
-		if preheatingState {
-			preheatingReply := config.Sysconfig["preheatingReply"].(map[string]interface{})
-			u, ok := tools.MQFW.FindOne("user", `{"s_m_openid":"`+openid+`"}`)
-			if len(*u) > 0 && ok {
-				if util.Int64All((*u)["i_vip_status"]) == 1 || util.Int64All((*u)["i_vip_status"]) == 2 {
-					preheatingReply["href"] = preheatingReply["href_vip"]
-				} else {
-					preheatingReply["href"] = preheatingReply["href_notvip"]
+		/*
+			preheatingState := config.Sysconfig["preheatingState"].(bool)
+			if preheatingState {
+				preheatingReply := config.Sysconfig["preheatingReply"].(map[string]interface{})
+				u, ok := tools.MQFW.FindOne("user", `{"s_m_openid":"`+openid+`"}`)
+				if len(*u) > 0 && ok {
+					if util.Int64All((*u)["i_vip_status"]) == 1 || util.Int64All((*u)["i_vip_status"]) == 2 {
+						preheatingReply["href"] = preheatingReply["href_vip"]
+					} else {
+						preheatingReply["href"] = preheatingReply["href_notvip"]
+					}
 				}
 				}
+				time.AfterFunc(time.Second/2, func() {
+					w.PostText(fmt.Sprintf(fmt.Sprint(preheatingReply["content"]), config.Sysconfig["webdomain"].(string)+preheatingReply["href"].(string)))
+				})
 			}
 			}
-			time.AfterFunc(time.Second/2, func() {
-				w.PostText(fmt.Sprintf(fmt.Sprint(preheatingReply["content"]), config.Sysconfig["webdomain"].(string)+preheatingReply["href"].(string)))
-			})
-		}
+		*/
 	}
 	}
 	if source != "" && len(source) > 5 {
 	if source != "" && len(source) > 5 {
 		go saveUserLog(source, openid, activeName, shareflag)
 		go saveUserLog(source, openid, activeName, shareflag)