// header("location:https://open.weixin.qq.com/connect/oauth2/authorize?appid=".WxApi::appId."&redirect_uri=http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."&response_type=code&scope=snsapi_base&state=1#wechat_redirect");
//}
//else{
// $CODE = $_GET['code'];
// $Info = $wx->wxOauthAccessToken($CODE);
//print_r($Info);
// $openId = $Info['openid'];
//}
////////////////////////////////////////////
$signPackage = $wx->wxJsapiPackage();
//print_r($signPackage);
$kqInfo = $wx->wxCardPackage("");
$listInfo = $wx->wxCardListPackage();
?>
<html>
<head>
<title>JSAPI接口测试</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>
<body>
<div>
<input type="button" id="batchAddCard" name="batchAddCard" value="添加卡券" /><br />
<input type="button" id="openCard" name="openCard" value="拉起卡券库" /><br />
<input type="button" id="ShareTimeLine" name="ShareTimeLine" value="分享朋友圈" /><br />
<div id="showInfo">
</div>
</div>
<script>
wx.config({
debug: false,
appId: '<?php echo $signPackage["appId"];?>',
timestamp: <?php echo $signPackage["timestamp"];?>,
nonceStr: '<?php echo $signPackage["nonceStr"];?>',
signature: '<?php echo $signPackage["signature"];?>',
jsApiList: [
// 所有要调用的 API 都要加到这个列表中
'onMenuShareTimeline',
'onMenuShareAppMessage',
'addCard',
'openCard'
]
});
wx.ready(function () {
// 在这里调用 API
wx.onMenuShareAppMessage({
title: '互联网之子',