56 lines
1.9 KiB
Plaintext
56 lines
1.9 KiB
Plaintext
@model Senparc.Weixin.MP.Helpers.JsSdkUiPackage
|
|
@{
|
|
ViewData["Title"] = ViewData["nickname"];
|
|
Layout = "~/Views/Shared/_LayoutQr1.cshtml";
|
|
}
|
|
<div class="content">
|
|
<div style="width:100%;text-align:center;">
|
|
<div>
|
|
<img src="@ViewData["headimg"]" class="logo" />
|
|
</div>
|
|
@*<div class="name">@ViewData["nickname"]</div>*@
|
|
</div>
|
|
<div>
|
|
<wx-open-launch-weapp id="launch-btn"
|
|
username="@ViewData["username"]"
|
|
path="@ViewData["page"]"
|
|
style="top:30%;right:15px; bottom: 0; left: 15px; z-index: 10; overflow: hidden; position: absolute">
|
|
<script type="text/wxtag-template">
|
|
<button style="width:100%;height:38px;border:none;color:#fff;line-height: 38px;background:#04BE02;border-radius: 5px;margin-top: 100px;">查看测量结果</button>
|
|
</script>
|
|
</wx-open-launch-weapp>
|
|
</div>
|
|
</div>
|
|
@section css
|
|
{
|
|
<style>
|
|
body{
|
|
background-color:#fff;
|
|
}
|
|
</style>
|
|
}
|
|
@section Scripts
|
|
{
|
|
<script type="text/javascript">
|
|
wx.config({
|
|
debug: false,
|
|
appId: '@Model.AppId',
|
|
timestamp: '@Model.Timestamp', // 必填,生成签名的时间戳
|
|
nonceStr: '@Model.NonceStr', // 必填,生成签名的随机串
|
|
signature: '@Model.Signature',// 必填,签名
|
|
jsApiList: ['getNetworkType'],
|
|
openTagList: ['wx-open-launch-weapp']
|
|
});
|
|
wx.error(function (res) {
|
|
console.log(res);
|
|
alert('验证失败');
|
|
});
|
|
var btn = document.getElementById('launch-btn');
|
|
btn.addEventListener('launch', function (e) {
|
|
console.log('success');
|
|
});
|
|
btn.addEventListener('error', function (e) {
|
|
console.log('fail', e.detail);
|
|
});
|
|
</script>
|
|
} |