qr_coed.html 3.96 KB

<style type="text/css">
        .qr-code-frame{
            width:100%;  height: 100%;  display: none;
        }
        .qr-code-frame .mc{
            position: fixed;
            top: 0rem;
            left: 0rem;
            width: 100%;
            height: 100%;
            z-index: 100;
            background: rgba(0,0,0,0.5);
        }
        .layer{
            width: 5.8rem;
            min-height:5.2rem;
            background: #fff;
            height: auto;
            padding-bottom: 0.1rem;
        }
    .layer .tiaoxin-frame{
            width: 95%;
            height: 20%;
            text-align: center;
            margin: auto;
            margin-top: 0.15rem;

        }
    .layer .tiaoxin-frame .img-code{
            width:100%;
            height:15%;
            margin-top:0.35rem;
        }
         .layer .tiaoxin-frame .tiaoxin-code{
            font-size:0.3rem;
            letter-spacing:0.04rem;
            height: 20%;
           margin-top: 0.07rem;
        }
         .layer .erweima-img{
            width: 3.2rem;
            height: 3.2rem;
            margin: auto;
            margin-top: 0.2rem;
        }
   .layer p{
            width: 100%;
        }
        .world{
            margin-top: 0.15rem;
            width: 100%;
            height: 0.2rem;
            font-size: 0.25rem;
        }
        #quan_div{ margin: 0.2rem 0;}
        .guanbi{
            border-radius: 50%;
            border: 0.01rem solid #fff;
            width: 0.6rem;
            height: 0.55rem;
            font-size: 0.55rem;
            color: #fff;
            z-index: 150;
            margin: auto;
            margin-top: 0.25rem;
            padding-bottom: 0.05rem;
        }
    .layer-frame{
        width: 5.8rem; height: auto; z-index: 2000;
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    </style>
<div class="qr-code-frame ">
    <div class="mc" onclick="mc_qr_code()"></div>
    <div class="layer-frame">
        <div class="layer t_c">
            <div class="tiaoxin-frame">
                <img  class="img-code"/>
                <div class="tiaoxin-code"></div>
            </div>
            <img class="erweima-img">
            <p class="t_c world" ></p>
            <div id="quan_div">
                 <p>有效时间: <font id="st_time"></font><font id="end_time"></font></p>
                 <p style="margin-top: 0.05rem;">使用说明:<font id="remark"></font></p>
            </div>

        </div>
        <div class="guanbi flex jc_center ai_center" onclick="guanbi()"></div>
    </div>
    </div>
<script type="text/javascript">
    function xc_text_qr_code(val,type,st_time,end_item,remark) {
        //--0为使用优惠券--
        if(type==0){
            $(".img-code").attr("src","/vendor/barcodegen/test_1D2.php?text="+val);
            $(".tiaoxin-code").html(val) ;
            $(".erweima-img").attr("src","/index.php?m=Home&c=Index&a=qr_code&data="+val);
            $(".world").text("请将二维码展示给核销员,抵券更快捷")
            $("#st_time").text(st_time);
            $("#end_time").text(end_item);

            if(remark) {
                remark="仅"+remark+"使用";
                $("#remark").text(remark);
            }
            else
                $("#remark").text('全场通用');
        }else{
            $(".erweima-img").attr("src","/index.php?m=Home&c=Index&a=qr_code&data="+val);
            $(".img-code").hide();
          /*  $(".erweima-img").css("margin-top","-0.2rem");*/
            $(".erweima-img").css("margin-bottom","0.15rem");
            $(".world").text("请将二维码展示给核销员,服务更快捷!")
            $("#quan").hide();
            $("#quan_div").hide();

            $(".erweima-img").css("margin-top","0.78rem");
        }
        $(".qr-code-frame").show();
    }
   function mc_qr_code() {
       $(".qr-code-frame").hide();
    }
  function guanbi(){
      $(".qr-code-frame").hide();
  }
</script>