Procházet zdrojové kódy

修改app点击跳转问题

wangkaiyue před 5 roky
rodič
revize
0dcad0d371

+ 10 - 1
src/jfw/modules/app/src/app/active/active_zb.go

@@ -31,11 +31,11 @@ func init() {
 
 func (this *active_zb) LivePage() error {
 	now := time.Now().Unix()
+	userid := util.ObjToString(this.GetSession("userId"))
 	if now > appconfig.Active_zb.Live_Preheat_Start &&
 		now < appconfig.Active_zb.Live_Preheat_End {
 		//预约
 		//是否已预约查询
-		userid := util.ObjToString(this.GetSession("userId"))
 		if userid == "" {
 			return this.Redirect("/jyapp/free/swordfish/about", 302)
 		}
@@ -55,6 +55,15 @@ func (this *active_zb) LivePage() error {
 			now < appconfig.Active_zb.Live_Ing_End {
 			isLiving = true
 		}
+		//是否是vip用户
+		isVip := false
+		r, _ := public.MQFW.FindById("user", userid, `{"i_vip_status":1}`)
+		if r != nil && len(*r) != 0 {
+			if util.IntAll((*r)["i_vip_status"]) == 2 {
+				isVip = true
+			}
+		}
+		this.T["isVip"] = isVip
 		this.T["isLiving"] = isLiving
 		this.T["buyNum"] = util.Int64All(redis.Get("other", "liveactiveRTB"))
 		return this.Render("/active/livePage/online.html", &this.T)

+ 5 - 1
src/jfw/modules/app/src/web/templates/active/livePage/online.html

@@ -58,7 +58,7 @@
                 </div>
                 <p class="last-tips">7月7日20:00-7月14日20:00</p>
             </div>
-            <div class="understand">了解VIP订阅</div>
+            <div class="understand" onclick="window.location.href='/jyapp/vipsubscribe/introducePage'">了解VIP订阅</div>
             {{if .T.isLiving}}
             <div class="decode">
                 <p class="d-time">今晚<em>20:00</em><span>(7月7日)</span></p>
@@ -109,7 +109,11 @@
         </div>
         <div class="j-footer">
             <div class="j-button-group">
+              {{if .T.isVip}}
+                <a href="/jyapp/vipsubscribe/vipsubscribe_renew" class="j-button-confirm j-button-1">立即抢购</a>
+              {{else}}
                 <a href="/jyapp/vipsubscribe/introducePage" class="j-button-confirm j-button-1">立即抢购</a>
+              {{end}}
             </div>
         </div>
     </div>