2022-08-31 21:35:37 +08:00

55 lines
2.8 KiB
PHP

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>微信网页授权测试</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="__ROOT__/static/theme/css/mobile.css">
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
</head>
<body>
{if empty($fans.fansinfo)}
<fieldset style="width:80%;margin:1rem auto">
<legend style="padding:0.2rem 0.3rem;font-size:0.9rem;color:#666">操作失败</legend>
<div style="padding-top:0.4rem">
<p style="font-size:0.6rem;margin-bottom:0.8rem">通过网页授权获取用户资料失败,请检查权限再试!</p>
<p style="font-size:0.6rem;margin-bottom:0.8rem">
<a style="cursor:pointer" onclick="location.reload()">重新获取(刷新)</a>
</p>
</div>
</fieldset>
{else}
<div class="header" style="padding:1rem 0 0.6rem 0;text-align:center">
<img alt="img" style='width:132px;height:132px;border-radius:50%;border:0.6rem solid rgba(150,40,40,0.6)' src="{$fans.fansinfo.headimgurl}">
<h1>{$fans.fansinfo.nickname}</h1>
</div>
<fieldset style="width:80%;margin:0.6rem auto">
<legend style="padding:0.2rem 0.3rem;font-size:0.9rem;color:#666">用户标识</legend>
<div style="padding-top:0.4rem">
<div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">OPENID</div>
<p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.openid}</p>
<div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">UNIONID</div>
<p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.unionid|default='未获取到'}</p>
</div>
</fieldset>
<fieldset style="width:80%;margin:0.6rem auto">
<legend style="padding:0.2rem 0.3rem;font-size:0.9rem;color:#666">详细资料</legend>
<div style="padding-top:0.4rem">
<div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">性别</div>
<p style="font-size:0.6rem;margin-bottom:0.8rem">{:[1=>'男',2=>'女'][$fans.fansinfo.sex]??'未知'}</p>
<div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">系统语言</div>
<p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.language}</p>
<div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">所在区域</div>
<p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.country} - {$fans.fansinfo.province} - {$fans.fansinfo.city}</p>
{if isset($fans.fansinfo.privilege.0)}
<div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">设备网络</div>
<p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.privilege.0|default='未获取到网络信息'}</p>
{/if}
</div>
</fieldset>
{/if}
</body>
</html>