wangchuanjin 5 жил өмнө
parent
commit
bcb6afa5de

+ 16 - 2
src/jfw/front/front.go

@@ -141,6 +141,8 @@ type Front struct {
 	msgremind xweb.Mapper `xweb:"/front/vipsubscribe/msgremind"`
 	//获取打赏标语
 	rewardText xweb.Mapper `xweb:"/front/rewardText"`
+	//生成二维码
+	qr xweb.Mapper `xweb:"/qr"`
 }
 
 var sewx util.SimpleEncrypt //微信的加密方法
@@ -177,6 +179,19 @@ func (f *Front) Hp() error {
 	return f.Redirect("/")
 }
 
+//二维码图片
+func (f *Front) Qr() error {
+	w := f.ResponseWriter
+	w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
+	w.Header().Set("Pragma", "no-cache")
+	w.Header().Set("Expires", "0")
+	w.Header().Set("Content-Type", "image/png")
+	r, _ := qr.Encode(config.Sysconfig["webdomain"].(string)+f.GetString("url"), qr.M)
+	pngdat := r.PNG()
+	_, err := w.Write(pngdat)
+	return err
+}
+
 //二维码图片
 func (f *Front) Hpshare() error {
 	w := f.ResponseWriter
@@ -184,8 +199,7 @@ func (f *Front) Hpshare() error {
 	w.Header().Set("Pragma", "no-cache")
 	w.Header().Set("Expires", "0")
 	w.Header().Set("Content-Type", "image/png")
-	data := config.Sysconfig["webdomain"].(string)
-	r, _ := qr.Encode(data, qr.M)
+	r, _ := qr.Encode(config.Sysconfig["webdomain"].(string), qr.M)
 	pngdat := r.PNG()
 	_, err := w.Write(pngdat)
 	return err

+ 2 - 8
src/jfw/front/swordfish.go

@@ -119,14 +119,8 @@ func (m *Front) NewSordfish() error {
 		if ret := redis.Get("other", "jypcindex"); ret != nil {
 			return m.SetBody([]byte(ret.(string)))
 		} else {
-			m.DisableHttpCache()
-			lastBids := elastic.GetPage("bidding", "bidding", "{}", bidSearch_sort, bidSearch_field_1, 0, 18)
-			if lastBids != nil && len(*lastBids) > 0 {
-				public.BidListConvert("", lastBids)
-				lbnHtml, olHtml := structureLastBidsHtml(lastBids)
-				m.T["lbnHtml"] = lbnHtml
-				m.T["olHtml"] = olHtml
-			}
+			m.T["live_Preheat_Start"] = config.ActiveConfig.Live_Preheat_Start
+			m.T["live_Preheat_End"] = config.ActiveConfig.Live_Preheat_End
 			content, _ := m.Render4Cache("/pc/index.html", &m.T)
 			redis.Put("other", "jypcindex", string(content), 60*60*2)
 			return m.SetBody(content)

+ 40 - 0
src/web/staticres/css/pc.css

@@ -4496,4 +4496,44 @@ h6 {
 
 .is-stop {
   cursor: not-allowed;
+}
+/*直播活动*/
+.live_preheat{
+	position: fixed;
+	left: 0px;
+	right: 0px;
+	bottom: 0px;
+	top: 0px;
+	background-color: rgba(0,0,0,.5);
+	z-index: 99;
+	display: none;
+}
+.live_preheat>div{
+	position: fixed;
+	left: 50%;
+	top: 50%;
+    background: url(/images/pc/live_preheat.png) no-repeat;
+    background-size: 100% 100%;
+    width: 296px;
+    height: 370px;
+    margin-left: -148px;
+    margin-top: -185px;
+	display: none;
+}
+.live_preheat .live_preheat_close{
+	position: absolute;
+	bottom: -46px;
+	width: 28px;
+	height: 28px;
+	left: 50%;
+	margin-left: -14px;
+	cursor: pointer;
+}
+.live_preheat .live_preheat_qr{
+	width: 136px;
+    position: relative;
+    left: 50%;
+    margin-left: -68px;
+    top: 165px;
+    border-radius: 10px;
 }

+ 68 - 34
src/web/templates/pc/index.html

@@ -193,45 +193,79 @@
 			<img src="/images/pc/close2x.png" id="close2x">
 		</div>
 		<div class="tans"></div>
+    <div class="live_preheat">
+      <div>
+        <img src="/qr?url=%2factive%2flivePage%2findex" class="live_preheat_qr"/>
+        <img src="{{Msg "seo" "cdn"}}/images/pc/live_preheat_close.png" class="live_preheat_close"/>
+      </div>
+    </div>
 	</body>
 <script>
 // 弹窗
 var times = new Date().getTime();
-var show = times - localStorage.tc;
-if(localStorage.tc === undefined){
-	$(".tc").css("display","block");
-	$("#close2x").css("display","block");
-	$(".tans").css("display","block");
-}else{
-	if(show >= 2592000000){
-		$(".tc").css("display","block");
-		$("#close2x").css("display","block");
-		$(".tans").css("display","block");
-	}else{
-		$(".tc").css("display","none");
-		$("#close2x").css("display","none");
-		$(".tans").css("display","none");
-	}
+var live_Preheat_Start = {{.T.live_Preheat_Start}};
+var live_Preheat_End = {{.T.live_Preheat_End}};
+var live_preheat_day_count = localStorage.live_preheat_day_count;
+var day = new Date().getDay();
+var live_preheat_day = day;
+var live_preheat_count = 0;
+if(live_preheat_day_count!=null&&live_preheat_day_count!=undefined){
+  var l_p_d = parseInt(live_preheat_day_count.split("_")[0]);
+  if(l_p_d==day){
+    live_preheat_day = l_p_d;
+    live_preheat_count = parseInt(live_preheat_day_count.split("_")[1]);
+  }
+}
+if(sessionStorage.live_preheat_flag!="1"){
+  if(live_preheat_count<2&&times>=live_Preheat_Start*1000&&times<=live_Preheat_End*1000){
+    sessionStorage.live_preheat_flag = "1";
+    localStorage.live_preheat_day_count = day+"_"+(live_preheat_count+1);
+    $(".live_preheat").fadeIn("normal",function(){
+      $(".live_preheat>div").slideDown();
+    });
+    $(".live_preheat_close").click(function(){
+      $(".live_preheat>div").slideUp("normal",function(){
+        $(".live_preheat").fadeOut();
+      });
+    });
+  }else{
+    var show = times - localStorage.tc;
+    if(localStorage.tc === undefined){
+    	$(".tc").css("display","block");
+    	$("#close2x").css("display","block");
+    	$(".tans").css("display","block");
+    }else{
+    	if(show >= 2592000000){
+    		$(".tc").css("display","block");
+    		$("#close2x").css("display","block");
+    		$(".tans").css("display","block");
+    	}else{
+    		$(".tc").css("display","none");
+    		$("#close2x").css("display","none");
+    		$(".tans").css("display","none");
+    	}
+    }
+    $("#close2x").click(function () {
+    	$(".tc").animate({
+    		opacity: "hide"
+    	}, "slow");
+    	$("#close2x").animate({
+    		opacity: "hide"
+    	}, "slow");
+    	$(".tans").animate({
+    		opacity: "hide"
+    	}, "slow");
+    	var time = new Date().getTime();
+    	localStorage.setItem("tc", time)
+    });
+    //
+    $(".tc").on("click", function () {
+    	window.location.href="front/dataExport/toSieve";
+    	var time = new Date().getTime();
+    	localStorage.setItem("tc", time)
+    });
+  }
 }
-$("#close2x").click(function () {
-	$(".tc").animate({
-		opacity: "hide"
-	}, "slow");
-	$("#close2x").animate({
-		opacity: "hide"
-	}, "slow");
-	$(".tans").animate({
-		opacity: "hide"
-	}, "slow");
-	var time = new Date().getTime();
-	localStorage.setItem("tc", time)
-});
-//
-$(".tc").on("click", function () {
-	window.location.href="front/dataExport/toSieve";
-	var time = new Date().getTime();
-	localStorage.setItem("tc", time)
-});
 //
 var localhref = location.href;
 window._bd_share_config = {