Browse Source

未购买大会员跳转大会员介绍页面

wangkaiyue 4 năm trước cách đây
mục cha
commit
eb95af9bf2
1 tập tin đã thay đổi với 33 bổ sung33 xóa
  1. 33 33
      src/jfw/front/frontRouter.go

+ 33 - 33
src/jfw/front/frontRouter.go

@@ -2,9 +2,10 @@ package front
 
 import (
 	"fmt"
-	"jfw/config"
-
 	"github.com/go-xweb/xweb"
+	"jfw/config"
+	"jfw/public"
+	"qfw/util/jy"
 )
 
 //前端通用路由
@@ -77,13 +78,12 @@ func (this *CommonRouter) PcCommonPage(folder, loginSign, htmlPage string) error
 
 //积分
 func (this *CommonRouter) IntegralIndex() error {
-	userid, _ := this.GetSession("userId").(string)
-	if userid == "" {
-		return this.Redirect("/notin/page")
-	}
-	return this.Render(fmt.Sprintf("/frontRouter/pc/integral/sess/index.html"))
+	return this.doIntegralPage()
 }
 func (this *CommonRouter) IntegralPage(htmlPage string) error {
+	return this.doIntegralPage()
+}
+func (this *CommonRouter) doIntegralPage() error {
 	userid, _ := this.GetSession("userId").(string)
 	if userid == "" {
 		return this.Redirect("/notin/page")
@@ -93,13 +93,12 @@ func (this *CommonRouter) IntegralPage(htmlPage string) error {
 
 //文库
 func (this *CommonRouter) DocsIndex() error {
-	userid, _ := this.GetSession("userId").(string)
-	if userid == "" {
-		return this.Redirect("/notin/page")
-	}
-	return this.Render(fmt.Sprintf("/frontRouter/pc/docs/sess/index.html"))
+	return this.doDocsPage()
 }
 func (this *CommonRouter) DocsPage(htmlPage string) error {
+	return this.doDocsPage()
+}
+func (this *CommonRouter) doDocsPage() error {
 	userid, _ := this.GetSession("userId").(string)
 	if userid == "" {
 		return this.Redirect("/notin/page")
@@ -109,13 +108,12 @@ func (this *CommonRouter) DocsPage(htmlPage string) error {
 
 //线上课程
 func (this *CommonRouter) XspcIndex() error {
-	userid, _ := this.GetSession("userId").(string)
-	if userid == "" {
-		return this.Redirect("/notin/page")
-	}
-	return this.Render(fmt.Sprintf("/frontRouter/pc/xspc/sess/index.html"))
+	return this.doXspcPage()
 }
 func (this *CommonRouter) XspcPage(htmlPage string) error {
+	return this.doXspcPage()
+}
+func (this *CommonRouter) doXspcPage() error {
 	userid, _ := this.GetSession("userId").(string)
 	if userid == "" {
 		return this.Redirect("/notin/page")
@@ -125,13 +123,12 @@ func (this *CommonRouter) XspcPage(htmlPage string) error {
 
 //商机管理
 func (this *CommonRouter) EntpcIndex() error {
-	userid, _ := this.GetSession("userId").(string)
-	if userid == "" {
-		return this.Redirect("/notin/page")
-	}
-	return this.Render(fmt.Sprintf("/frontRouter/pc/entpc/sess/index.html"))
+	return this.doEntpcPage()
 }
 func (this *CommonRouter) EntpcPage(htmlPage string) error {
+	return this.doEntpcPage()
+}
+func (this *CommonRouter) doEntpcPage() error {
 	userid, _ := this.GetSession("userId").(string)
 	if userid == "" {
 		return this.Redirect("/notin/page")
@@ -141,30 +138,33 @@ func (this *CommonRouter) EntpcPage(htmlPage string) error {
 
 //大会员
 func (this *CommonRouter) BigpcIndex() error {
-	userid, _ := this.GetSession("userId").(string)
-	if userid == "" {
-		return this.Redirect("/notin/page")
-	}
-	return this.Render(fmt.Sprintf("/frontRouter/pc/page_big_pc/sess/index.html"))
+	return this.doPcBigPage()
 }
 func (this *CommonRouter) BigpcPage(htmlPage string) error {
+	return this.doPcBigPage()
+}
+func (this *CommonRouter) doPcBigPage() error {
 	userid, _ := this.GetSession("userId").(string)
+	//没有登录跳转登录页面
 	if userid == "" {
 		return this.Redirect("/notin/page")
 	}
+	//没有购买大会员跳转大会员介绍页
+	bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
+	if bigBaseMsg.Status <= 0 {
+		return this.Redirect("/big/page/index")
+	}
 	return this.Render(fmt.Sprintf("/frontRouter/pc/page_big_pc/sess/index.html"))
 }
 
 //卡卷
 func (this *CommonRouter) CouponIndex() error {
-	userid, _ := this.GetSession("userId").(string)
-	if userid == "" {
-		return this.Redirect("/notin/page")
-	}
-	return this.Render(fmt.Sprintf("/frontRouter/pc/coupon/sess/index.html"))
+	return this.doCouponPage()
 }
-
 func (this *CommonRouter) CouponPage(htmlPage string) error {
+	return this.doCouponPage()
+}
+func (this *CommonRouter) doCouponPage() error {
 	userid, _ := this.GetSession("userId").(string)
 	if userid == "" {
 		return this.Redirect("/notin/page")