Browse Source

Merge branch 'dev2.8.5' of http://192.168.3.207:10080/qmx/jy into dev2.8.5

xuzhiheng 5 years ago
parent
commit
b217ca68c0

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

@@ -6,6 +6,7 @@ import (
 	"jfw/jyutil"
 	"jfw/public"
 	"jfw/wx"
+	"log"
 	"net/url"
 	"qfw/util"
 	"time"
@@ -46,6 +47,9 @@ type Subscribepay struct {
 
 	//发票
 	openInvoice xweb.Mapper `xweb:"/front/vipsubscribe/openInvoice/(\\w+)"` //开发票
+
+	//预热活动链接跳转
+	preheatPoster xweb.Mapper `xweb:"/front/preheat/poster"` //预热活动链接跳转
 }
 
 func init() {
@@ -301,3 +305,25 @@ func (s *Subscribepay) OpenInvoice(order_code string) {
 	s.T["order_code"] = order_code
 	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,
             "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),
 		}})
 		//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 {
 		go saveUserLog(source, openid, activeName, shareflag)

+ 2 - 0
src/jfw/public/historypush.go

@@ -488,6 +488,8 @@ func (h *historyPush) MakeHistoryDatas(userId, field string) (bool, []*resultDat
 		myInsert["area"] = area_check
 		myInsert["city"] = city_check
 		myInsert["type"] = 0
+		myInsert["subtype"] = util.ObjToString(v["subtype"])
+		myInsert["toptype"] = util.ObjToString(v["toptype"])
 		myInsert["isvisit"] = 0
 		myInsert["isvip"] = 0
 		myInsert["buyerclass"] = v["buyerclass"]

+ 1 - 0
src/web/staticres/css/wx/home.css

@@ -24,6 +24,7 @@
 .home .top .home_search .home_search_left {
   display: flex;
   align-items: center;
+width: 100%;
 }
 
 .home .top .home_search .home_search_left span {

+ 2 - 7
src/web/templates/weixin/vipsubscribe/vip_introduce.html

@@ -127,20 +127,15 @@
         </div>
         <div class="menu">
             {{if not .T.notShowTrial }}
-            <a onclick="window.location.href='/front/vipsubscribe/trialInfo'" class="try_btn">试用7天</a>
+            <a onclick="window.location.replace('/front/vipsubscribe/trialInfo')" class="try_btn">试用7天</a>
             {{end}}
-            <a onclick="window.location.href='/weixin/pay/vipsubscribe_new'"  class="subscribe_btn">去订阅</a>
+            <a onclick="window.location.replace('/weixin/pay/vipsubscribe_new')"  class="subscribe_btn">去订阅</a>
         </div>
     </div>
     {{include "/common/weixin.html"}}
     <script src="/vipsubscribe/js/share.js?v={{Msg "seo" "version"}}"></script>
     <script>
       initShare({{.T.signature}});
-      window.onpageshow = function(event) {
-        if (event.persisted) {
-          window.location.reload()
-        }
-      };
     </script>
 </body>
 </html>