qr_code.html
3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!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>