68 lines
2.2 KiB
Plaintext
68 lines
2.2 KiB
Plaintext
@model Senparc.Weixin.MP.Helpers.JsSdkUiPackage
|
|
@{
|
|
ViewData["Title"] = "每日一称";
|
|
Layout = "~/Views/Shared/_LayoutQr1.cshtml";
|
|
var data = ViewData["orderinfo"] as YBDevice.Entity.OrderInfo;
|
|
}
|
|
<div class="content">
|
|
@if (data.type == YBDevice.Entity.OrderType.Mini)
|
|
{
|
|
<div style="width:100%;text-align:center;">
|
|
<div>
|
|
<img src="~/images/logo.png" class="logo" />
|
|
</div>
|
|
@*<div class="name">每日一称</div>*@
|
|
</div>
|
|
<div>
|
|
<wx-open-launch-weapp id="launch-btn"
|
|
username="@data.appid"
|
|
path="@data.content"
|
|
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>
|
|
}
|
|
else
|
|
{
|
|
<div style="width:100%;text-align:center;">
|
|
<div>
|
|
<img src="@data.content" class="logo" />
|
|
</div>
|
|
</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>
|
|
} |