Browse Source

feat:底部广告位隐藏

fuwencai 1 year ago
parent
commit
84f2812a90
2 changed files with 12 additions and 0 deletions
  1. 10 0
      src/jfw/front/pcIndex.go
  2. 2 0
      src/web/templates/pc/index.html

+ 10 - 0
src/jfw/front/pcIndex.go

@@ -91,10 +91,20 @@ func (m *PcIndex) NewSordfish(flag string) error {
 	m.T["shareid"] = se.EncodeString(shareid)
 	m.T["activestart"] = config.ActiveConfig.DoubleEleven.Active_Start
 	m.T["activeend"] = config.ActiveConfig.DoubleEleven.Active_End
+	m.T["userCard"] = "f"
 	regex, _ := regexp.Compile("(Android|Mobile)")
 	var isLogin bool
 	if util.ObjToString(m.GetSession("userId")) != "" {
 		isLogin = true
+		userPower := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
+		switch {
+		case userPower.Status > 0:
+			m.T["userCard"] = "m"
+		case userPower.VipStatus > 0:
+			m.T["userCard"] = "v"
+		case userPower.EntnicheStatus > 0:
+			m.T["userCard"] = "e"
+		}
 	}
 	if ispc == 0 && len(regex.FindAllString(m.Header("User-Agent"), -1)) > 0 {
 		m.T["s_m_openid"] = util.ObjToString(m.GetSession("s_m_openid"))

+ 2 - 0
src/web/templates/pc/index.html

@@ -596,10 +596,12 @@
           <div class="app-btn" id="app-btn">立即预约演示</div>
         </div>
       </div>
+      {{ if ne .T.userCard "m"}}
       <!-- 底部广告位 -->
       <div class="pc-index-bottom">
         <img class="bottom-member-ad" adv_name="PC首页广告位-底部" src="" alt="底部广告位">
       </div>
+      {{ end }}
       {{include "/common/friend-link.html"}}
       {{include "/common/pcbottom.html"}}
 		</section>