90 lines
2.3 KiB
HTML
90 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Insert title here</title>
|
|
<script type="text/javascript" src="script/jquery-1.11.1.js"></script>
|
|
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
|
<script type="text/javascript">
|
|
wx.config({
|
|
debug: true,
|
|
appId: 'wx6d73c08771432e3f',
|
|
timestamp: '',
|
|
nonceStr: '',
|
|
signature: '',
|
|
jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ']
|
|
|
|
});
|
|
var TitleData = {
|
|
title : "分享测试",
|
|
desc : "分享的描述",
|
|
link : window.location.href,
|
|
imgUrl : window.location.origin+"/3eapi/image/shareHeading.png "
|
|
}
|
|
wx.ready(function(){
|
|
wx.onMenuShareAppMessage({
|
|
title: TitleData.title,
|
|
desc: TitleData.desc,
|
|
link: TitleData.link,
|
|
imgUrl: TitleData.imgUrl,
|
|
type: 'link',
|
|
success: function () {
|
|
},
|
|
cancel: function () {
|
|
}
|
|
});
|
|
wx.onMenuShareTimeline({
|
|
title: TitleData.title, // 分享标题
|
|
link: TitleData.link,
|
|
imgUrl: TitleData.imgUrl, // 分享图标
|
|
success: function () {
|
|
},
|
|
cancel: function () {
|
|
}
|
|
});
|
|
wx.onMenuShareQQ({
|
|
title: TitleData.title,
|
|
desc: TitleData.desc,
|
|
link: TitleData.link,
|
|
imgUrl: TitleData.imgUrl, // 分享图标
|
|
success: function () {
|
|
},
|
|
cancel: function () {
|
|
}
|
|
});
|
|
});
|
|
|
|
function testweixinpay(){
|
|
var path = window.origin;
|
|
console.log(path);
|
|
var sign = "";
|
|
$.ajax({
|
|
url: "http://localhost:8080/3eapi/test/testPay/v1",
|
|
dataType: "json",
|
|
type:"post",
|
|
data:"",
|
|
async: false,
|
|
success: function(data) {
|
|
console.log(data);
|
|
return sign = data;
|
|
}
|
|
});
|
|
console.log(sign);
|
|
$.ajax({
|
|
url: "https://apitest.mch.weixin.qq.com/sandboxnew/pay/getsignkey",
|
|
dataType: "xml",
|
|
type:"post",
|
|
data:"<mch_id>wx8cc38e5d9a0263fb</mch_id><nonce_str>12u3I4d</nonce_str><sign>"+sign+"</sign>",
|
|
success: function(data) {
|
|
console.log(data);
|
|
alert(data);
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div style="background-color: green;width: 200px;height: 300px;">测试定时任务:
|
|
<input type="button" onclick="testweixinpay();"></div>
|
|
</body>
|
|
</html> |