From cbe8f7d00ff415932e92282f8eb136cbe36c4d92 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 18 Jul 2019 14:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E5=AE=A3=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 692330a2..cbcd825b 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -129,16 +129,21 @@ <% end %> <% end %> - if (window.localStorage) { - var uid = localStorage.getItem('competition_uid'); - } else { - var uid = false - } - if(!uid){ - var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; - pop_box_new(htmlvalue, 500, 380); + var begin_time = new Date(); + var end_time = new Date("2019-10-10"); + if (begin_time < end_time) { + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if (!uid) { + var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; + pop_box_new(htmlvalue, 500, 380); + } } + <% notice = SystemUpdateNotice.last %> <% if @noticed_update || ((User.current.certification == 1 || params[:controller] != "welcome") && notice.present? && notice.end_time > Time.now && notice.start_time >= (Time.now - 21600) && User.current.user_system_notices.where(:notice_type => notice.notice_type).count == 0) %> var htmlvalue = "<%= escape_javascript(render :partial => 'account/user_update_notice', :locals => {:notice => notice})%>";