|
@@ -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)
|
|
|
+}
|