100 lines
2.8 KiB
HTML
100 lines
2.8 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
<meta charset="UTF-8">
|
|||
|
<script src="js/hotime.js" type="text/javascript"></script>
|
|||
|
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
|
|||
|
|
|||
|
<title>测试分享</title>
|
|||
|
<style>
|
|||
|
|
|||
|
</style>
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
测试分享页
|
|||
|
</body>
|
|||
|
|
|||
|
<script>
|
|||
|
|
|||
|
|
|||
|
var Weixin={
|
|||
|
create:function () {
|
|||
|
|
|||
|
H.post("app/wechat/sign",{"sign_url":window.location.href},function (res) {
|
|||
|
Weixin.config(res);
|
|||
|
});
|
|||
|
},
|
|||
|
|
|||
|
isClose:false,
|
|||
|
config:function (res) {
|
|||
|
Weixin['data']={
|
|||
|
title:'测试分享',
|
|||
|
link:"https://"+location.host+"/wx/code.html?sn=12321",
|
|||
|
desc: '政策通——通达所有政策',
|
|||
|
imgUrl:"https://"+location.host+"/img/logo.jpg",
|
|||
|
}
|
|||
|
wx.ready(function(){
|
|||
|
wx.onMenuShareAppMessage(Weixin.data);
|
|||
|
wx.onMenuShareQQ(Weixin.data);
|
|||
|
wx.onMenuShareTimeline(Weixin.data);
|
|||
|
wx.getLocation({
|
|||
|
type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
|||
|
success: function (res) {
|
|||
|
Index.lat= res.latitude; // 纬度,浮点数,范围为90 ~ -90
|
|||
|
Index.lng = res.longitude; // 经度,浮点数,范围为180 ~ -180。
|
|||
|
}
|
|||
|
});
|
|||
|
});
|
|||
|
|
|||
|
res.result.jsApiList=[
|
|||
|
|
|||
|
'checkJsApi',
|
|||
|
'onMenuShareTimeline',
|
|||
|
'onMenuShareAppMessage',
|
|||
|
'onMenuShareQQ',
|
|||
|
'onMenuShareWeibo',
|
|||
|
'hideMenuItems',
|
|||
|
'showMenuItems',
|
|||
|
'hideAllNonBaseMenuItem',
|
|||
|
'showAllNonBaseMenuItem',
|
|||
|
'translateVoice',
|
|||
|
'startRecord',
|
|||
|
'stopRecord',
|
|||
|
'onRecordEnd',
|
|||
|
'playVoice',
|
|||
|
'pauseVoice',
|
|||
|
'stopVoice',
|
|||
|
'uploadVoice',
|
|||
|
'downloadVoice',
|
|||
|
'chooseImage',
|
|||
|
'previewImage',
|
|||
|
'uploadImage',
|
|||
|
'downloadImage',
|
|||
|
'getNetworkType',
|
|||
|
'openLocation',
|
|||
|
'getLocation',
|
|||
|
'hideOptionMenu',
|
|||
|
'showOptionMenu',
|
|||
|
'closeWindow',
|
|||
|
'scanQRCode',
|
|||
|
'chooseWXPay',
|
|||
|
'openProductSpecificView',
|
|||
|
'addCard',
|
|||
|
'chooseCard',
|
|||
|
'openCard'
|
|||
|
|
|||
|
];
|
|||
|
wx.config(res.result);
|
|||
|
},
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
Weixin.create();
|
|||
|
|
|||
|
|
|||
|
</script>
|
|||
|
|
|||
|
</html>
|