hotime/example/tpt/share.html
2022-04-21 02:20:27 +08:00

100 lines
2.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>