Эх сурвалжийг харах

feat:订阅设置切换大会员超级订阅

fuwencai 2 жил өмнө
parent
commit
04c6db8a78

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

@@ -134,10 +134,18 @@ func (s *Subscribepay) ToSetInfoTypePage() {
 //订阅设置
 func (s *Subscribepay) ToSetPage() error {
 	userid := util.ObjToString(s.GetSession("userId"))
+	vSwitch := s.GetString("vSwitch")
+	if vSwitch != "" {
+		if vSwitch == jy.SwitchService.Vip {
+			s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Vip)
+		} else if vSwitch == jy.SwitchService.Member {
+			s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Member)
+		}
+	}
 	vipMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
 	if vipMsg.VipStatus <= 0 && vipMsg.Status <= 0 && isInTSguide(userid) { //仅免费用户跳转向导页面
 		return s.Redirect("/front/tenderSubscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
-	} else if vipMsg.VipStatus <= 0 && !vipMsg.IsUpgrade {
+	} else if (vSwitch == "" || vSwitch == "v") && vipMsg.VipStatus <= 0 && !vipMsg.IsUpgrade {
 		if s.GetString("advertcode") != "" {
 			return s.Redirect("/wxkeyset/keyset/index?advertcode=" + s.GetString("advertcode"))
 		}

+ 273 - 278
src/jfw/modules/app/src/app/front/vipsubscribe.go

@@ -1,376 +1,371 @@
 package front
 
 import (
-    jyutil "app/jyutil"
-    "encoding/hex"
-    "jfw/public"
-    "net/url"
-    "qfw/util"
-    "qfw/util/jy"
-    "regexp"
-    "strings"
-    "time"
-
-    "github.com/go-xweb/xweb"
+	jyutil "app/jyutil"
+	"encoding/hex"
+	"jfw/public"
+	"net/url"
+	"qfw/util"
+	"qfw/util/jy"
+	"strings"
+	"time"
+
+	"github.com/go-xweb/xweb"
 )
 
 type Subscribepay struct {
-    *xweb.Action
-    introduce         xweb.Mapper `xweb:"/jyapp/vipsubscribe/introducePage"`     //订阅收费介绍页
-    trialInfo         xweb.Mapper `xweb:"/jyapp/vipsubscribe/trialInfo"`         //vip订阅服务-用户信息录入页面
-    toPurchasePage    xweb.Mapper `xweb:"/jyapp/vipsubscribe/vipsubscribe_(.*)"` //订阅收费购买页面(试用用户)
-    toChooseArea      xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChooseArea"`      //订阅收费地区筛选
-    toChooseIndustry  xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChooseIndustry"`  //订阅收费行业筛选
-    toOrderDetailPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toOrderDetailPage"` //订阅收费支付订单详情页面
-    toSetKeyWordPage  xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetKeyWordPage"`  //订阅收费设置关键词
-
-    //toSetPageOld         xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetPage"`         //订阅收费设置
-    toSetInfoTypePage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetInfoTypePage"` //订阅收费设置信息类型
-    toSetOtherKwsPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSet(.*)Page"`     //订阅收费附加词和排除词设置
-    toVIPViewPage     xweb.Mapper `xweb:"/jyapp/vipsubscribe/toVIPViewPage"`     //订阅收费预览
-
-    upgradeDetail xweb.Mapper `xweb:"/jyapp/vipsubscribe/upgradeDetail"` //新超级订阅介绍页
-    upgradePage   xweb.Mapper `xweb:"/jyapp/vipsubscribe/upgradePage"`   //升级页面
-
-    //修改升级
-    toSetPage        xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSubVipSetPage"`  //订阅收费设置
-    toChangeArea     xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChangeArea"`     //修改区域
-    toChangeIndustry xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChangeIndustry"` //修改行业
-    toChangeTime     xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChangeTime"`     //修改时间
-    toSetPushSetPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetPushSetPage"` //订阅收费推送设置
-    //续费
-    renewPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/renewPage/(.*)"` //订阅到期(will:即将到期,exprie:已到期)
-
-    //发票
-    openInvoice xweb.Mapper `xweb:"/jyapp/vipsubscribe/openInvoice/(\\w+)"` //开发票
-
-    //订阅付费消息提醒中转
-    msgremind xweb.Mapper `xweb:"/jyapp/vipsubscribe/msgremind"`
-
-    //超级订阅企业搜索
-    entSearch   xweb.Mapper `xweb:"/jyapp/vipsubscribe/entSearch"`   //企业搜索
-    entPortrait xweb.Mapper `xweb:"/jyapp/vipsubscribe/entPortrait"` //超级订阅企业画像
-
-    //超级订阅公共url
-    pageManager xweb.Mapper `xweb:"/jyapp/vipsubscribe/page/(.*)"`
+	*xweb.Action
+	introduce         xweb.Mapper `xweb:"/jyapp/vipsubscribe/introducePage"`     //订阅收费介绍页
+	trialInfo         xweb.Mapper `xweb:"/jyapp/vipsubscribe/trialInfo"`         //vip订阅服务-用户信息录入页面
+	toPurchasePage    xweb.Mapper `xweb:"/jyapp/vipsubscribe/vipsubscribe_(.*)"` //订阅收费购买页面(试用用户)
+	toChooseArea      xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChooseArea"`      //订阅收费地区筛选
+	toChooseIndustry  xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChooseIndustry"`  //订阅收费行业筛选
+	toOrderDetailPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toOrderDetailPage"` //订阅收费支付订单详情页面
+	toSetKeyWordPage  xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetKeyWordPage"`  //订阅收费设置关键词
+
+	//toSetPageOld         xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetPage"`         //订阅收费设置
+	toSetInfoTypePage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetInfoTypePage"` //订阅收费设置信息类型
+	toSetOtherKwsPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSet(.*)Page"`     //订阅收费附加词和排除词设置
+	toVIPViewPage     xweb.Mapper `xweb:"/jyapp/vipsubscribe/toVIPViewPage"`     //订阅收费预览
+
+	upgradeDetail xweb.Mapper `xweb:"/jyapp/vipsubscribe/upgradeDetail"` //新超级订阅介绍页
+	upgradePage   xweb.Mapper `xweb:"/jyapp/vipsubscribe/upgradePage"`   //升级页面
+
+	//修改升级
+	toSetPage        xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSubVipSetPage"`  //订阅收费设置
+	toChangeArea     xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChangeArea"`     //修改区域
+	toChangeIndustry xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChangeIndustry"` //修改行业
+	toChangeTime     xweb.Mapper `xweb:"/jyapp/vipsubscribe/toChangeTime"`     //修改时间
+	toSetPushSetPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/toSetPushSetPage"` //订阅收费推送设置
+	//续费
+	renewPage xweb.Mapper `xweb:"/jyapp/vipsubscribe/renewPage/(.*)"` //订阅到期(will:即将到期,exprie:已到期)
+
+	//发票
+	openInvoice xweb.Mapper `xweb:"/jyapp/vipsubscribe/openInvoice/(\\w+)"` //开发票
+
+	//订阅付费消息提醒中转
+	msgremind xweb.Mapper `xweb:"/jyapp/vipsubscribe/msgremind"`
+
+	//超级订阅企业搜索
+	entSearch   xweb.Mapper `xweb:"/jyapp/vipsubscribe/entSearch"`   //企业搜索
+	entPortrait xweb.Mapper `xweb:"/jyapp/vipsubscribe/entPortrait"` //超级订阅企业画像
+
+	//超级订阅公共url
+	pageManager xweb.Mapper `xweb:"/jyapp/vipsubscribe/page/(.*)"`
 }
 
-var mobileReg = regexp.MustCompile("(?i)(Android|Mobile|Phone)")
-
 func init() {
-    xweb.AddAction(&Subscribepay{})
+	xweb.AddAction(&Subscribepay{})
 }
 
 //超级订阅企业画像
 func (s *Subscribepay) EntPortrait() {
-    s.Render("/vipsubscribe/vip_entPortrait.html")
+	s.Render("/vipsubscribe/vip_entPortrait.html")
 }
 
 //企业搜索
 func (s *Subscribepay) EntSearch() {
-    s.Render("/vipsubscribe/vip_entSearch.html")
+	s.Render("/vipsubscribe/vip_entSearch.html")
 }
 
 func (s *Subscribepay) UpgradeDetail() {
-    s.Render("/vipsubscribe/vip_UpgradeDetail.html")
+	s.Render("/vipsubscribe/vip_UpgradeDetail.html")
 }
 
 func (s *Subscribepay) UpgradePage() {
-    s.Render("/vipsubscribe/vip_UpgradePage.html")
+	s.Render("/vipsubscribe/vip_UpgradePage.html")
 }
 
 //推送设置
 func (s *Subscribepay) ToVIPViewPage() {
-    s.Render("/vipsubscribe/vip_viewPage.html")
+	s.Render("/vipsubscribe/vip_viewPage.html")
 }
 
 //附加词|排除词
 func (s *Subscribepay) ToSetOtherKwsPage(page string) {
-    s.Render("/vipsubscribe/" + page + "Word.html")
+	s.Render("/vipsubscribe/" + page + "Word.html")
 }
 
 //推送设置
 func (s *Subscribepay) ToSetPushSetPage() {
-    s.Render("/vipsubscribe/vip_seniorset.html")
+	s.Render("/vipsubscribe/vip_seniorset.html")
 }
 
 //信息类型
 func (s *Subscribepay) ToSetInfoTypePage() {
-    s.Render("/vipsubscribe/messageType.html")
+	s.Render("/vipsubscribe/messageType.html")
 }
 
 //订阅设置
 func (s *Subscribepay) ToSetPage() {
-    userid, _ := s.GetSession("userId").(string)
-    vSwitch := s.GetString("vSwitch")
-    if strings.Contains(s.Refer(), "/jyapp/jylab/index") {
-        vSwitch = jy.SwitchService.Vip
-    }
-    if vSwitch != "" {
-        if vSwitch == jy.SwitchService.Vip {
-            s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Vip)
-        } else if vSwitch == jy.SwitchService.Member {
-            s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Member)
-        }
-    }
-    vSwitch = jy.SwitchService.GetEntniche(s.Session(), public.MQFW, public.Mysql) //v:vip m:member
-    bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
-    if (vSwitch == "" || vSwitch == "v") && bigBaseMsg.VipStatus <= 0 && !bigBaseMsg.IsUpgrade {
-        s.Redirect("/jyapp/wxkeyset/keyset/index")
-    }
-    client := s.Header("User-Agent")
-    bm := mobileReg.MatchString(client) // 判断是不是微信端 微信端首次使用,不展示大会员使用向导,直接进入大会员订阅管理页面
-    //如果没有首次使用
-    if vSwitch == "m" && bigBaseMsg.Status > 0 && !bigBaseMsg.Used && !bm {
-        s.Redirect("/jyapp/big/page/init") //跳转至首次初始化页面
-        return
-    }
-    //仅免费用户跳转向导页面
-    if bigBaseMsg.Status <= 0 && bigBaseMsg.VipStatus <= 0 && isInTSguide(userid) {
-        s.Redirect("/jyapp/tenderSubscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
-    }
-    s.Render("/vipsubscribe/vip_index_new.html")
+	userid, _ := s.GetSession("userId").(string)
+	vSwitch := s.GetString("vSwitch")
+	if strings.Contains(s.Refer(), "/jyapp/jylab/index") {
+		vSwitch = jy.SwitchService.Vip
+	}
+	if vSwitch != "" {
+		if vSwitch == jy.SwitchService.Vip {
+			s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Vip)
+		} else if vSwitch == jy.SwitchService.Member {
+			s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Member)
+		}
+	}
+	vSwitch = jy.SwitchService.GetEntniche(s.Session(), public.MQFW, public.Mysql) //v:vip m:member
+	bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
+	if (vSwitch == "" || vSwitch == "v") && bigBaseMsg.VipStatus <= 0 && !bigBaseMsg.IsUpgrade {
+		s.Redirect("/jyapp/wxkeyset/keyset/index")
+	}
+	//如果没有首次使用
+	if vSwitch == "m" && bigBaseMsg.Status > 0 && !bigBaseMsg.Used {
+		s.Redirect("/jyapp/big/page/init") //跳转至首次初始化页面
+		return
+	}
+	//仅免费用户跳转向导页面
+	if bigBaseMsg.Status <= 0 && bigBaseMsg.VipStatus <= 0 && isInTSguide(userid) {
+		s.Redirect("/jyapp/tenderSubscribe/guide?url=" + url.QueryEscape(s.Request.RequestURI))
+	}
+	s.Render("/vipsubscribe/vip_index_new.html")
 }
 
 //修改升级 选择地区
 func (s *Subscribepay) ToChangeArea() {
-    s.Render("/vipsubscribe/change_area.html")
+	s.Render("/vipsubscribe/change_area.html")
 }
 
 //修改升级 选择行业
 func (s *Subscribepay) ToChangeIndustry() {
-    s.Render("/vipsubscribe/change_industry.html")
+	s.Render("/vipsubscribe/change_industry.html")
 }
 
 //修改升级 选择时间
 func (s *Subscribepay) ToChangeTime() {
-    s.Render("/vipsubscribe/change_time.html")
+	s.Render("/vipsubscribe/change_time.html")
 }
 
 //vip订阅介绍页
 func (s *Subscribepay) Introduce() error {
-    s.T["disWord"] = s.GetString("disWord")
-    s.T["isIosExam"], s.T["isIosExamPhone"], _, _ = jyutil.IosExamInfo(s.Action, false, false)
-    userId := util.ObjToString(s.GetSession("userId"))
-    if userId == "" {
-        return s.Render("/vipsubscribe/vip_introduce.html")
-    }
-    m, _ := public.MQFW.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1}`)
-    if len(*m) == 0 {
-        return s.Redirect("/jyapp/login")
-    }
-    from := s.GetString("type") //双十一活动 接受参数renew 跳转到介绍页(续费)
-    if util.IntAll((*m)["i_vip_status"]) > 0 && from != "renew" {
-        if s.GetString("disWord") != "" {
-            //分销识别 直接VIP续费
-            if util.IntAll((*m)["i_vip_status"]) == 1 { //试用用户
-                return s.Redirect("/jy_mobile/common/order/create/svip?type=buy&disWord=" + s.GetString("disWord"))
-            } else {
-                return s.Redirect("/jy_mobile/common/order/create/svip?type=renew/jy_mobile/common/order/create/svip?type=renew&disWord=" + s.GetString("disWord"))
-            }
-        }
-        return s.Redirect("/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v")
-    }
-    obj := util.ObjToMap((*m)["o_vipjy"])
-    s.T["notShowTrial"] = util.IntAll((*obj)["i_trial"]) == -1 || (*m)["i_vip_status"] != nil
-    s.T["loginFlag"] = true
-    return s.Render("/vipsubscribe/vip_introduce.html")
+	s.T["disWord"] = s.GetString("disWord")
+	s.T["isIosExam"], s.T["isIosExamPhone"], _, _ = jyutil.IosExamInfo(s.Action, false, false)
+	userId := util.ObjToString(s.GetSession("userId"))
+	if userId == "" {
+		return s.Render("/vipsubscribe/vip_introduce.html")
+	}
+	m, _ := public.MQFW.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1}`)
+	if len(*m) == 0 {
+		return s.Redirect("/jyapp/login")
+	}
+	from := s.GetString("type") //双十一活动 接受参数renew 跳转到介绍页(续费)
+	if util.IntAll((*m)["i_vip_status"]) > 0 && from != "renew" {
+		if s.GetString("disWord") != "" {
+			//分销识别 直接VIP续费
+			if util.IntAll((*m)["i_vip_status"]) == 1 { //试用用户
+				return s.Redirect("/jy_mobile/common/order/create/svip?type=buy&disWord=" + s.GetString("disWord"))
+			} else {
+				return s.Redirect("/jy_mobile/common/order/create/svip?type=renew/jy_mobile/common/order/create/svip?type=renew&disWord=" + s.GetString("disWord"))
+			}
+		}
+		return s.Redirect("/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v")
+	}
+	obj := util.ObjToMap((*m)["o_vipjy"])
+	s.T["notShowTrial"] = util.IntAll((*obj)["i_trial"]) == -1 || (*m)["i_vip_status"] != nil
+	s.T["loginFlag"] = true
+	return s.Render("/vipsubscribe/vip_introduce.html")
 }
 
 //试用完善信息
 func (s *Subscribepay) TrialInfo() error {
-    userId := util.ObjToString(s.GetSession("userId"))
-    if userId == "" {
-        return s.Redirect("/jyapp/login")
-    }
-    m, ok := public.MQFW.FindById("user", userId, `{"o_vipjy":1}`)
-    if !ok || len(*m) == 0 {
-        return s.Redirect("/jyapp/login")
-    }
-    obj := util.ObjToMap((*m)["o_vipjy"])
-    s.T["trialSign"] = util.IntAll((*obj)["i_trial"]) == 1
-    return s.Render("/vipsubscribe/trial_info.html", &s.T)
+	userId := util.ObjToString(s.GetSession("userId"))
+	if userId == "" {
+		return s.Redirect("/jyapp/login")
+	}
+	m, ok := public.MQFW.FindById("user", userId, `{"o_vipjy":1}`)
+	if !ok || len(*m) == 0 {
+		return s.Redirect("/jyapp/login")
+	}
+	obj := util.ObjToMap((*m)["o_vipjy"])
+	s.T["trialSign"] = util.IntAll((*obj)["i_trial"]) == 1
+	return s.Render("/vipsubscribe/trial_info.html", &s.T)
 }
 
 //订阅收费购买页面
 func (s *Subscribepay) ToPurchasePage(flag string) {
-    //直播活动
-    if flag == "trial" { //试用
-        s.T["isTrial"] = true
-        s.T["orderType"] = -1
-    } else { //付费
-        userId := util.ObjToString(s.GetSession("userId"))
-        if userId == "" {
-            s.Redirect("/jyapp/login")
-            return
-        }
-        m, ok := public.MQFW.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1}`)
-        if !ok {
-            s.Redirect("/jyapp/login")
-            return
-        }
-        if util.IntAll((*m)["i_vip_status"]) > 0 || flag == "renew" {
-            s.Render("/vipsubscribe/vip_renew.html")
-            return
-        }
-        s.T["orderType"] = 1
-        if s.GetString("orderCode") != "" && s.GetString("orderCode") != "undefined" {
-            s.T["again"] = 1 //再次购买
-        }
-    }
-    s.Render("/vipsubscribe/vip_purchase.html")
+	//直播活动
+	if flag == "trial" { //试用
+		s.T["isTrial"] = true
+		s.T["orderType"] = -1
+	} else { //付费
+		userId := util.ObjToString(s.GetSession("userId"))
+		if userId == "" {
+			s.Redirect("/jyapp/login")
+			return
+		}
+		m, ok := public.MQFW.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1}`)
+		if !ok {
+			s.Redirect("/jyapp/login")
+			return
+		}
+		if util.IntAll((*m)["i_vip_status"]) > 0 || flag == "renew" {
+			s.Render("/vipsubscribe/vip_renew.html")
+			return
+		}
+		s.T["orderType"] = 1
+		if s.GetString("orderCode") != "" && s.GetString("orderCode") != "undefined" {
+			s.T["again"] = 1 //再次购买
+		}
+	}
+	s.Render("/vipsubscribe/vip_purchase.html")
 }
 
 //订阅收费地区筛选
 func (s *Subscribepay) ToChooseArea() {
-    s.Render("/vipsubscribe/choose_area.html", &s.T)
+	s.Render("/vipsubscribe/choose_area.html", &s.T)
 }
 
 //订阅收费地区筛选
 func (s *Subscribepay) ToChooseIndustry() {
-    s.Render("/vipsubscribe/choose_industry.html", &s.T)
+	s.Render("/vipsubscribe/choose_industry.html", &s.T)
 }
 
 //订阅收费支付订单详情页面
 func (s *Subscribepay) ToOrderDetailPage() {
-    s.Render("/vipsubscribe/vip_order_detail.html")
+	s.Render("/vipsubscribe/vip_order_detail.html")
 }
 
 //订阅收费设置关键词
 func (s *Subscribepay) ToSetKeyWordPage() {
-    userid, _ := s.GetSession("userId").(string)
-    vSwitch := s.GetString("vSwitch")
-    if strings.Contains(s.Refer(), "/jyapp/jylab/index") {
-        vSwitch = jy.SwitchService.Vip
-    }
-    if vSwitch != "" {
-        if vSwitch == jy.SwitchService.Vip {
-            s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Vip)
-        } else if vSwitch == jy.SwitchService.Member {
-            s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Member)
-        }
-    }
-    vSwitch = jy.SwitchService.GetEntniche(s.Session(), public.MQFW, public.Mysql) //v:vip m:member
-    bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
-    //如果没有首次使用
-    if vSwitch == "m" && bigBaseMsg.Status > 0 && !bigBaseMsg.Used {
-        s.Redirect("/jyapp/big/page/init") //跳转至首次初始化页面
-        return
-    }
-    s.Render("/vipsubscribe/keyWord.html")
+	userid, _ := s.GetSession("userId").(string)
+	vSwitch := s.GetString("vSwitch")
+	if strings.Contains(s.Refer(), "/jyapp/jylab/index") {
+		vSwitch = jy.SwitchService.Vip
+	}
+	if vSwitch != "" {
+		if vSwitch == jy.SwitchService.Vip {
+			s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Vip)
+		} else if vSwitch == jy.SwitchService.Member {
+			s.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Member)
+		}
+	}
+	vSwitch = jy.SwitchService.GetEntniche(s.Session(), public.MQFW, public.Mysql) //v:vip m:member
+	bigBaseMsg := jy.GetBigVipUserBaseMsg(userid, public.Mysql, public.MQFW)
+	//如果没有首次使用
+	if vSwitch == "m" && bigBaseMsg.Status > 0 && !bigBaseMsg.Used {
+		s.Redirect("/jyapp/big/page/init") //跳转至首次初始化页面
+		return
+	}
+	s.Render("/vipsubscribe/keyWord.html")
 }
 
 //服务续费(will:即将到期,exprie:已到期)
 func (s *Subscribepay) RenewPage(sign string) {
-    startTime := util.Int64All(s.GetString("startTime"))
-    endTime := util.Int64All(s.GetString("endTime"))
-    orderId := s.GetString("orderId")
-    startTimes := time.Unix(startTime, 0).Format("2006-01-02")
-    endTimes := time.Unix(endTime, 0).Format("2006-01-02")
-    s.T["orderId"] = orderId
-    s.T["startTime"] = startTimes
-    s.T["endTime"] = endTimes
-    s.T["exprie"] = sign //是否已到期
-    s.Render("/vipsubscribe/renew_notice.html", &s.T)
+	startTime := util.Int64All(s.GetString("startTime"))
+	endTime := util.Int64All(s.GetString("endTime"))
+	orderId := s.GetString("orderId")
+	startTimes := time.Unix(startTime, 0).Format("2006-01-02")
+	endTimes := time.Unix(endTime, 0).Format("2006-01-02")
+	s.T["orderId"] = orderId
+	s.T["startTime"] = startTimes
+	s.T["endTime"] = endTimes
+	s.T["exprie"] = sign //是否已到期
+	s.Render("/vipsubscribe/renew_notice.html", &s.T)
 }
 
 //开发票
 func (s *Subscribepay) OpenInvoice(order_code string) {
-    s.T["order_code"] = order_code
-    s.Render("/dataExport/dataExport_applyInvoice.html", &s.T)
+	s.T["order_code"] = order_code
+	s.Render("/dataExport/dataExport_applyInvoice.html", &s.T)
 }
 
 func (f *Subscribepay) Msgremind() error {
-    param := map[string]string{}
-    if array := strings.Split(f.Url(), "?"); len(array) == 2 {
-        decode, _ := hex.DecodeString(array[1])
-        for _, v := range strings.Split(string(decode), "&") {
-            if vv := strings.Split(v, "="); len(vv) == 2 {
-                param[vv[0]] = vv[1]
-            }
-        }
-    }
-    t := param["type"]
-    if t == "unpaid" { //未支付 已支付
-        return f.Redirect("/jyapp/vipsubscribe/toOrderDetailPage?orderCode=" + param["ordercode"])
-    } else if t == "bigmember_unpaid" {
-        return f.Redirect("/jyapp/big/page/orderdetail_member?order_code=" + param["ordercode"])
-    } else if t == "unknow_unpaid" {
-        return f.Redirect("/jyapp/front/myOrder/toMyOrder")
-    }
-    userId, _ := f.GetSession("userId").(string)
-    if userId == "" {
-        return f.Render("_error.html")
-    }
-    user, ok := public.MQFW.FindById("user", userId, `{"i_vip_status":1,"l_vip_endtime":1,"i_member_status":1,"i_member_endtime":1}`)
-    if !ok || user == nil || len(*user) == 0 {
-        return f.Render("_error.html")
-    }
-    myLastOrderCode := func(user_id string) string {
-        order := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
-            "user_id":      user_id,
-            "order_status": 1,
-            "product_type": "VIP订阅",
-        }, "id,order_code", "pay_time desc")
-        if order != nil && len(*order) > 0 {
-            return util.ObjToString((*order)["order_code"])
-        } else {
-            return ""
-        }
-    }
-    i_vip_status := util.IntAll((*user)["i_vip_status"])
-    if t == "bigmember_soonexprie" || t == "bigmember_expried" { //大会员即将到期、已到期
-        now_unix := time.Now().Unix()
-        i_member_endtime := util.Int64All((*user)["i_member_endtime"])
-        if now_unix < i_member_endtime-259200 {
-            //已续费
-            return f.Redirect("/jyapp/big/page/main_root")
-        } else {
-            if now_unix > i_member_endtime {
-                //未续费已到期,跳转到再次购买页面
-                return f.Redirect("/jyapp/big/page/buy_commit?meal=sj&mid=")
-            } else {
-                //未续费未到期,跳转到续费页面
-                return f.Redirect("/jyapp/big/page/main_root")
-            }
-        }
-    } else if t == "paid" {
-        if i_vip_status > 0 {
-            return f.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
-        } else {
-            return f.Redirect("/jy_mobile/common/order/create/svip?type=buy&orderCode=" + myLastOrderCode(userId))
-        }
-    } else if t == "bigmember_paid" {
-        if util.IntAll((*user)["i_member_status"]) > 0 {
-            return f.Redirect("/jyapp/big/page/main_root")
-        } else {
-            return f.Redirect("/jyapp/big/page/buy_commit?meal=sj&mid=")
-        }
-    } else if t == "soonexprie" || t == "expried" { //即将到期 已到期
-        now_unix := time.Now().Unix()
-        l_vip_endtime := util.Int64All((*user)["l_vip_endtime"])
-        if now_unix < l_vip_endtime-259200 {
-            //已续费
-            return f.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
-        } else {
-            if now_unix > l_vip_endtime {
-                //未续费已到期,跳转到再次购买页面
-                return f.Redirect("/jy_mobile/common/order/create/svip?type=buy&orderCode=" + myLastOrderCode(userId))
-            } else {
-                //未续费未到期,跳转到续费页面
-                return f.Redirect("/jy_mobile/common/order/create/svip?type=renew")
-            }
-        }
-    } else if t == "ontrial_soonexprie" || t == "ontrial_expried" { //试用即将到期 试用已到期
-        if i_vip_status == 2 {
-            return f.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
-        } else {
-            return f.Redirect("/jy_mobile/common/order/create/svip?type=buy")
-        }
-    }
-    return f.Render("_error.html")
+	param := map[string]string{}
+	if array := strings.Split(f.Url(), "?"); len(array) == 2 {
+		decode, _ := hex.DecodeString(array[1])
+		for _, v := range strings.Split(string(decode), "&") {
+			if vv := strings.Split(v, "="); len(vv) == 2 {
+				param[vv[0]] = vv[1]
+			}
+		}
+	}
+	t := param["type"]
+	if t == "unpaid" { //未支付 已支付
+		return f.Redirect("/jyapp/vipsubscribe/toOrderDetailPage?orderCode=" + param["ordercode"])
+	} else if t == "bigmember_unpaid" {
+		return f.Redirect("/jyapp/big/page/orderdetail_member?order_code=" + param["ordercode"])
+	} else if t == "unknow_unpaid" {
+		return f.Redirect("/jyapp/front/myOrder/toMyOrder")
+	}
+	userId, _ := f.GetSession("userId").(string)
+	if userId == "" {
+		return f.Render("_error.html")
+	}
+	user, ok := public.MQFW.FindById("user", userId, `{"i_vip_status":1,"l_vip_endtime":1,"i_member_status":1,"i_member_endtime":1}`)
+	if !ok || user == nil || len(*user) == 0 {
+		return f.Render("_error.html")
+	}
+	myLastOrderCode := func(user_id string) string {
+		order := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
+			"user_id":      user_id,
+			"order_status": 1,
+			"product_type": "VIP订阅",
+		}, "id,order_code", "pay_time desc")
+		if order != nil && len(*order) > 0 {
+			return util.ObjToString((*order)["order_code"])
+		} else {
+			return ""
+		}
+	}
+	i_vip_status := util.IntAll((*user)["i_vip_status"])
+	if t == "bigmember_soonexprie" || t == "bigmember_expried" { //大会员即将到期、已到期
+		now_unix := time.Now().Unix()
+		i_member_endtime := util.Int64All((*user)["i_member_endtime"])
+		if now_unix < i_member_endtime-259200 {
+			//已续费
+			return f.Redirect("/jyapp/big/page/main_root")
+		} else {
+			if now_unix > i_member_endtime {
+				//未续费已到期,跳转到再次购买页面
+				return f.Redirect("/jyapp/big/page/buy_commit?meal=sj&mid=")
+			} else {
+				//未续费未到期,跳转到续费页面
+				return f.Redirect("/jyapp/big/page/main_root")
+			}
+		}
+	} else if t == "paid" {
+		if i_vip_status > 0 {
+			return f.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
+		} else {
+			return f.Redirect("/jy_mobile/common/order/create/svip?type=buy&orderCode=" + myLastOrderCode(userId))
+		}
+	} else if t == "bigmember_paid" {
+		if util.IntAll((*user)["i_member_status"]) > 0 {
+			return f.Redirect("/jyapp/big/page/main_root")
+		} else {
+			return f.Redirect("/jyapp/big/page/buy_commit?meal=sj&mid=")
+		}
+	} else if t == "soonexprie" || t == "expried" { //即将到期 已到期
+		now_unix := time.Now().Unix()
+		l_vip_endtime := util.Int64All((*user)["l_vip_endtime"])
+		if now_unix < l_vip_endtime-259200 {
+			//已续费
+			return f.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
+		} else {
+			if now_unix > l_vip_endtime {
+				//未续费已到期,跳转到再次购买页面
+				return f.Redirect("/jy_mobile/common/order/create/svip?type=buy&orderCode=" + myLastOrderCode(userId))
+			} else {
+				//未续费未到期,跳转到续费页面
+				return f.Redirect("/jy_mobile/common/order/create/svip?type=renew")
+			}
+		}
+	} else if t == "ontrial_soonexprie" || t == "ontrial_expried" { //试用即将到期 试用已到期
+		if i_vip_status == 2 {
+			return f.Redirect("/jyapp/vipsubscribe/toSubVipSetPage")
+		} else {
+			return f.Redirect("/jy_mobile/common/order/create/svip?type=buy")
+		}
+	}
+	return f.Render("_error.html")
 }
 
 func (this *Subscribepay) PageManager(htmlName string) error {
-    return this.Render("/vipsubscribe/page_" + htmlName + ".html")
+	return this.Render("/vipsubscribe/page_" + htmlName + ".html")
 }