99 lines
4.6 KiB
Plaintext
99 lines
4.6 KiB
Plaintext
|
||
@{
|
||
ViewBag.Title = "微信在线缴费";
|
||
Layout = "~/Views/Shared/_WXLayout.cshtml";
|
||
}
|
||
|
||
<header class="demos-header">
|
||
<h1 class="demos-title">在线自助缴费</h1>
|
||
|
||
</header>
|
||
<br />
|
||
体检缴费请扫描指引单上的条码进行缴费,疫苗缴费请扫描疫苗登记本上的条码或者疫苗注射小票上的二维码。
|
||
<br />
|
||
<br />
|
||
<input type="button" class="weui-btn weui-btn_primary" style="margin-bottom: 10px" value="体检缴费" id="tjjf" />
|
||
<input type="button" class="weui-btn weui-btn_primary" style="margin-bottom: 10px" value="疫苗缴费" id="ymjf" />
|
||
<br />
|
||
<br />
|
||
<br />
|
||
<br />
|
||
@section scripts{
|
||
<script>
|
||
|
||
wx.config({
|
||
debug: false, //是否调试,true,会弹窗
|
||
appId: '@dccdc.Common.Global.AppId', //得到这个东西,首先必须有一个公众号,或者企业号,如果已经拥有了,你可以就知道AppId在哪里了。
|
||
timestamp: '@ViewBag.timeStamp',//生成签名的时间戳,随机数,之后会用这个生成一个签名
|
||
nonceStr: '@ViewBag.nonceStr',//生成签名的随机串,随机串,之后会用这个生成一个签名
|
||
signature: '@ViewBag.signature',//这个就是签名了,在步骤4,我会详细讲解
|
||
jsApiList: [
|
||
'scanQRCode' //开启扫一扫功能,这里还可以添加更多的功能,比如微信支付
|
||
]
|
||
});
|
||
wx.ready(function () {
|
||
//点击按钮,出现扫描界面
|
||
$("#tjjf").bind("click", function () {
|
||
wx.scanQRCode({
|
||
desc: '请扫描体检条码',
|
||
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
||
scanType: ["barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
||
success: function (res) {
|
||
//var url = res.resultStr;
|
||
//var tempArray = url.split(',');
|
||
//$('#hidqyxx').val(url);
|
||
//document.getElementById("qyxx").innerHTML = url;
|
||
//var tempNum = tempArray[1];//这个就是扫描后返回值扫描值
|
||
//weui.alert(res.resultStr);
|
||
var l = weui.loading("正在查询");
|
||
$.ajax({
|
||
url: "@Url.Action("checktjjf")", type: "post", dataType: "json", data: { tm: res.resultStr,lx:"tj"},
|
||
success: function (data) {
|
||
l.hide();
|
||
if(data.State==1)
|
||
{
|
||
window.location.href = "@Url.Action("tjjf")?id=" + data.Message;
|
||
}
|
||
else
|
||
{
|
||
weui.alert(data.Message);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#ymjf").bind("click", function () {
|
||
wx.scanQRCode({
|
||
desc: '请扫描疫苗接种条码',
|
||
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
||
scanType: ["barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
||
success: function (res) {
|
||
//var url = res.resultStr;
|
||
//var tempArray = url.split(',');
|
||
//$('#hidqyxx').val(url);
|
||
//document.getElementById("qyxx").innerHTML = url;
|
||
//var tempNum = tempArray[1];//这个就是扫描后返回值扫描值
|
||
//weui.alert(res.resultStr);
|
||
var l = weui.loading("正在查询");
|
||
$.ajax({
|
||
url: "@Url.Action("checktjjf")", type: "post", dataType: "json", data: { tm: res.resultStr,lx:"ym" },
|
||
success: function (data) {
|
||
l.hide();
|
||
if(data.State==1)
|
||
{
|
||
window.location.href = "@Url.Action("ymjf")?id=" + data.Message;
|
||
}
|
||
else
|
||
{
|
||
weui.alert(data.Message);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
});
|
||
});
|
||
});
|
||
</script>
|
||
} |