qr_code.html 3.24 KB
<!DOCTYPE html >
<html>
<head>
<meta charset="UTF-8">
<title>我的二维码</title>
    <meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="applicable-device" content="mobile">
    <script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
    <link rel="stylesheet" href="__STATIC__/css/public.css?v=__CSSVERSION__">
    <link rel="stylesheet" href="__STATIC__/css/user.css?v=__CSSVERSION__">
    <style>
        #qrcode_share_id img{max-width: 100%;}
        .tip{ text-align: center; color: #fff}
.codebox{
    position: fixed;
    background-image: linear-gradient(-225deg,#F8C9CF,#F76275);
    width: 100%;
    max-width: 720px;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    margin-left:auto;
    margin-right:auto;
}
.codeImg{ border:#fff solid 1px; background-color: #fff}
        .bigname{ font-size: 18px; margin-bottom: 20px;}

    </style>
<body >
<div id="tbh5v0" class="codebox">



<if condition="$ShareLink neq null">

    <div class="Wallet" style="text-align:center;margin: 20px; background-color:#FBDEE2" id="qrcode_share_id">
    	<div class="codeimg">
    		<a class="imgbox" href="{:U('Mobile/User/userinfo',array('stoid'=>$Think.request.stoid))}">
                {$imgsrc}
    		</a>
    		<div>{$user[nickname]}<br>{$user[mobile]}</div>
    		
    	</div>
        <div class="bigname">邀请您一起加入</div>
        <img class="codeImg" alt="扫码推广" src="/index.php?m=Home&c=Index&a=qr_code&data={$ShareLink}"/>
        <p class="codeTxt">长按识别二维码</p>

    </div>

    <div class="tip">
        【分享方式】<br>
        1、长按图片,发送给好友<br>
        2、长按保存图片,发送朋友圈
    </div>
<else />
    <div class="endorse_hend">
        <p>你还不是分销商</p>
    </div>
    <div class="Wallet" style="text-align:center;">
	      <img alt="扫码推广" src="__STATIC__/images/sorry.jpg" style="width:190px;"/>	      
    </div>
  </if>	


</div>
<include file="public/footer_nav"/>
</body>
</html>

<script src="__STATIC__/teamstyle/js/html2canvas.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function convertCanvasToImage(canvas) {
        var image = new Image();
        image.src = canvas.toDataURL("image/png");
        return image;
    }
    function lookshare() {
        var canvas = document.querySelector("canvas");
        html2canvas(document.getElementById("qrcode_share_id")).then(function (canvas) {
            document.getElementById("qrcode_share_id").appendChild(canvas);
            $("canvas").hide();
            $("#qrcode_share_id").html('');
            $("#qrcode_share_id").show();
            document.getElementById("qrcode_share_id").appendChild(convertCanvasToImage(canvas));
        });
    }
    lookshare();
</script>