Browse Source

卡卷pc端广告路由

wangshan 4 years ago
parent
commit
bbdbb23cd7
2 changed files with 25 additions and 3 deletions
  1. 1 1
      src/jfw/front/front.go
  2. 24 2
      src/jfw/front/frontRouter.go

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

@@ -496,7 +496,7 @@ func (f *Front) Notin() error {
 	f.T["ref"] = refer
 	var shareid = f.GetString("id")
 	if len(shareid) == 0 {
-		shareid = "10" //fmt.Sprintf("%s%d", config.Seoconfig["jysskzy"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[7:14], rand.Intn(9))
+		shareid = "10"
 	}
 	f.T["logid"] = config.Seoconfig["jysskzy"].(string)
 	f.T["shareid"] = se.EncodeString(shareid)

+ 24 - 2
src/jfw/front/frontRouter.go

@@ -2,6 +2,7 @@ package front
 
 import (
 	"fmt"
+	"jfw/config"
 
 	"github.com/go-xweb/xweb"
 )
@@ -26,8 +27,9 @@ type CommonRouter struct {
 	xspcPage  xweb.Mapper `xweb:"/jyxspc/(.*)"`
 
 	//卡卷页面路由
-	couponIndex xweb.Mapper `xweb:"/swordfish/coupon/"`
-	couponPage  xweb.Mapper `xweb:"/swordfish/coupon/(.*)"`
+	couponIndex  xweb.Mapper `xweb:"/swordfish/coupon/"`
+	couponPage   xweb.Mapper `xweb:"/swordfish/coupon/(.*)"`
+	couponActive xweb.Mapper `xweb:"/swordfish/CA"`
 }
 
 func init() {
@@ -115,3 +117,23 @@ func (this *CommonRouter) CouponPage(htmlPage string) error {
 	}
 	return this.Render(fmt.Sprintf("/frontRouter/pc/coupon/sess/index.html"))
 }
+
+//卡卷活动中转页
+func (this *CommonRouter) CouponActive() error {
+	var url = "/"
+	if this.GetString("url") != "" {
+		url = this.GetString("url")
+	}
+	userid, _ := this.GetSession("userId").(string)
+	if userid == "" {
+		this.T["ref"] = url
+		var shareid = this.GetString("id")
+		if len(shareid) == 0 {
+			shareid = "10"
+		}
+		this.T["logid"] = config.Seoconfig["jysskzy"].(string)
+		this.T["shareid"] = se.EncodeString(shareid)
+		return this.Render("/pc/notin.html", &this.T)
+	}
+	return this.Redirect(url)
+}