如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
<code class=""><script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
wx.config({
appId: '{$signPackage["appId"]}',
timestamp: '{$signPackage["timestamp"]}',
nonceStr: '{$signPackage["nonceStr"]}',
signature: '{$signPackage["signature"]}',
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'openLocation'
]
});
wx.ready(function () {
// 1 判断当前版本是否支持指定 JS 接口,支持批量判断
wx.checkJsApi({
jsApiList: [
'getNetworkType',
'previewImage',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo'
],
});
var shareData = {
//标题
title: '***',
//摘要
desc: '',
//链接,可以换主页
link: '{$signPackage["url"]}',
//缩略图
imgUrl: 'http://{$site_url}template/default/images/bg2.jpg',
};
wx.onMenuShareAppMessage(shareData);
wx.onMenuShareTimeline(shareData);
wx.onMenuShareQQ(shareData);
wx.onMenuShareWeibo(shareData);
});
$('.daohang').click(function () {
wx.openLocation({
latitude: "{$content['wd']}", // 纬度,浮点数,范围为90 ~ -90
longitude: "{$content['jd']}", // 经度,浮点数,范围为180 ~ -180。
name: "{$content['title']}", // 位置名
address: "{$content['title']}", // 地址详情说明
scale: 10, // 地图缩放级别,整形值,范围从1~28。默认为最大
});
})
</script>
require_once "./module/jssdkMod.class.php";
$jssdk = new JSSDK("******", "ca5b81123123132136e3257e5cdde");
$signPackage = $jssdk->GetSignPackage();
</code>