首页 技术 正文
技术 2022年11月15日
0 收藏 784 点赞 4,757 浏览 1633 个字

微信企业号JS SDK

<?php
define('CorpID', "wx82e2c31215d9a5a7");
define('CorpSecret', ""); //设置->功能设置->权限管理->系统管理组->深圳管理(新建的管理组)->Secret
define('AgentID', "24"); //应用IDrequire_once('wxqiye.class.php');
$weixin = new class_wxqiye();
$signPackage = $weixin->GetSignPackage();?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<title>微信企业JSSDK</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
<link rel="stylesheet" href="http://demo.open.weixin.qq.com/jssdk/css/style.css" rel="external nofollow" >
</head>
<body ontouchstart="">
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<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"];?>',
// url:'<?php echo $signPackage["url"];?>',
jsApiList: [
// 所有要调用的 API 都要加到这个列表中
'checkJsApi',
'openLocation',
'getLocation',
]
});
</script><script>
wx.ready(function () { //自动执行的
wx.checkJsApi({
jsApiList: [
'getLocation',
],
success: function (res) {
alert(JSON.stringify(res));
}
}); wx.hideOptionMenu(); //如果不支持则不会执行
wx.getLocation({
success: function (res) {
alert(JSON.stringify(res));
// alert('经度' + res.longitude);
// alert('纬度' + res.latitude);
// window.location.href = "location.php?longitude=" + res.longitude + "&latitude=" + res.latitude;
},
cancel: function (res) {
alert('用户拒绝授权获取地理位置');
}
}); }); wx.error(function (res) {
alert(res.errMsg);
});
</script>
</html>

  

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,031
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,520
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,368
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,148
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,781
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,859