xuzhiheng 5 years ago
parent
commit
5776fe9844

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

@@ -8,6 +8,7 @@ import (
 	"jfw/wx"
 	"net/url"
 	"qfw/util"
+	"strconv"
 	"time"
 
 	"github.com/go-xweb/xweb"
@@ -112,6 +113,12 @@ func (s *Subscribepay) ToSetInfoTypePage() {
 
 //订阅设置
 func (s *Subscribepay) ToSetPage() {
+	nowTime := time.Now().Unix()
+	startTime, _ := strconv.ParseInt(config.Seoconfig["liveActiveStartTime"].(string), 10, 64)
+	endTime, _ := strconv.ParseInt(config.Seoconfig["liveActiveEndTime"].(string), 10, 64)
+	if nowTime >= startTime && nowTime < endTime {
+		s.T["isLiveActive"] = true
+	}
 	myopenid := util.ObjToString(s.GetSession("s_m_openid"))
 	mynickname, _ := s.Session().Get("s_nickname").(string)
 	myavatar, _ := s.Session().Get("s_avatar").(string)
@@ -176,6 +183,12 @@ func (s *Subscribepay) Introduce() error {
 	if !ok {
 		return s.Redirect("/swordfish/about")
 	}
+	nowTime := time.Now().Unix()
+	startTime, _ := strconv.ParseInt(config.Seoconfig["liveActiveStartTime"].(string), 10, 64)
+	endTime, _ := strconv.ParseInt(config.Seoconfig["liveActiveEndTime"].(string), 10, 64)
+	if nowTime >= startTime && nowTime < endTime {
+		s.T["isLiveActive"] = true
+	}
 	obj := util.ObjToMap((*m)["o_vipjy"])
 	if util.IntAll((*m)["i_vip_status"]) > 0 {
 		return s.Redirect("/weixin/pay/toSubVipSetPage")
@@ -203,6 +216,16 @@ func (s *Subscribepay) TrialInfo() error {
 
 //订阅收费购买页面
 func (s *Subscribepay) ToPurchasePage(flag string) {
+	//直播活动
+	nowTime := time.Now().Unix()
+	startTime, _ := strconv.ParseInt(config.Seoconfig["liveActiveStartTime"].(string), 10, 64)
+	endTime, _ := strconv.ParseInt(config.Seoconfig["liveActiveEndTime"].(string), 10, 64)
+	if nowTime >= startTime && nowTime < endTime {
+		s.T["isLiveActive"] = true
+		//虚拟人数
+		buyCount := (nowTime - startTime) / 13
+		s.T["buyCount"] = buyCount
+	}
 	if flag == "trial" { //试用
 		s.T["isTrial"] = true
 		s.T["orderType"] = -1

+ 5 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_renew.html

@@ -41,7 +41,11 @@
     VIP订阅续费
 </div>
 <div class="app-layout-content-b">
-    <div class="vip-renew live-20200707">
+	{{if not .T.isLiveActive}}
+	<div class="vip-renew">
+	{{else}}
+	<div class="vip-renew live-20200707">
+	{{end}}
         <div class="vip-header">
             <span class="header-left">提示:</span>
             <span class="header-right">您的VIP订阅服务即将到期,为不影响您的使用。请立即续费</span>