瀏覽代碼

VIP用户跳转

wangshan 5 年之前
父節點
當前提交
2f4b7f06c4

+ 15 - 0
src/jfw/active/live.go

@@ -84,7 +84,14 @@ func (this *Active) SubStatus() error {
 	if userId != "" {
 		openId, _ := this.Session().Get("s_m_openid").(string)
 		if CheckUserIsSubscribe(openId) {
+			//是否是vip用户
 			res["userId"] = util.SE.EncodeString(userId)
+			if this.GetString("pageName") == "A" {
+				data, ok := public.MQFW.FindById("user", userId, nil)
+				if ok && data != nil && *data != nil {
+					res["isVip"] = util.IntAll((*data)["i_vip_status"]) > 0
+				}
+			}
 		}
 		var query = map[string]interface{}{
 			"s_userid":   userId,
@@ -145,6 +152,14 @@ func (this *Active) LivePage() error {
 		this.T["LIVEEND"] = true
 		return this.Render("/active/livePage/live_online_wx.html", &this.T)
 	} else if now.Unix() > config.ActiveConfig.Live_Active_Start { //直播活动进行中
+		if checkIsSubscribeFlag {
+			//是否是vip用户
+			userId, _ := this.Session().Get("userId").(string)
+			data, ok := public.MQFW.FindById("user", userId, nil)
+			if ok && data != nil && *data != nil {
+				this.T["isVip"] = util.IntAll((*data)["i_vip_status"]) > 0
+			}
+		}
 		//是否直播进行中
 		if config.ActiveConfig.Live_Ing_End > time.Now().Unix() && time.Now().Unix() > config.ActiveConfig.Live_Ing_Start {
 			this.T["LIVEING"] = true

+ 13 - 4
src/web/templates/active/livePage/live_online_wx.html

@@ -147,6 +147,7 @@
       });
       var timer = null;
       var isLiving = {{.T.LIVEING}}; //是否直播中
+      var isVip = {{.T.isVip}};//是否是VIP
       var isSub = {{.T.checkIsSubscribeFlag}}; //是否关注公众号
       var live_Active_End = {{.T.Live_Active_End}}; //活动开始时间
       if (live_Active_End==null||live_Active_End==""){
@@ -159,7 +160,7 @@
         $.ajax({
     			type: "post",
     			url: "/active/livePage/status?v="+new Date().getTime(),
-    			data: {},
+    			data: {"pageName":"A"},
     			dataType: "json",
     			success: function(data){
     				if(data.userId!=undefined&&data.userId!=""){
@@ -167,6 +168,9 @@
             }else{
               isSub=false;
             }
+            if (data.isVip!=undefined){
+              isVip = data.isVip;
+            }
             //购买人数
             if(data.liveactiveRTB){
               $('.intro .i-subtext span').text(data.liveactiveRTB);
@@ -188,7 +192,7 @@
               },
               //抢购
               subHandle: function () {
-                //点击立即抢购
+                //点击了解VIP订阅
                 $('.understand').on('click', function () {
                     if (isSub){
                       window.location.href="/front/vipsubscribe/introducePage"
@@ -199,10 +203,15 @@
                       });
                     }
                 })
-                //点击了解VIP订阅
+                //点击立即抢购
                 $(".j-button-confirm").on('click',function(){
                   if (isSub){
-                    window.location.href="/front/vipsubscribe/introducePage"
+                    //是否VIP 跳到付费页面  免费用户跳到购买页面
+                    if(isVip){
+                      window.location.href="/weixin/pay/vipsubscribe_renew"
+                    }else{
+                      window.location.href="/front/vipsubscribe/introducePage"
+                    }
                   } else {
                     $androidActionSheet.fadeIn(200);
                     $androidMask.on('click', function () {

+ 1 - 1
src/web/templates/active/livePage/live_preheat_wx.html

@@ -168,7 +168,7 @@
         $.ajax({
     			type: "post",
     			url: "/active/livePage/status?v="+new Date().getTime(),
-    			data: {},
+    			data: {"pageName":"H"},
     			dataType: "json",
     			success: function(data){
     				if(data.userId!=undefined&&data.userId!=""){