|
@@ -151,15 +151,15 @@
|
|
|
<script src="./js/wechat.js"></script>
|
|
|
<script src="./assets.js?v=2"></script>
|
|
|
<script src="./js/music.js?v=1"></script>
|
|
|
-<script src="./js/main.js?v=9"></script>
|
|
|
+<script src="./js/main.js?v=7"></script>
|
|
|
<script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
|
|
|
<!-- 必须加在微信api资源 -->
|
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
|
|
|
<script>
|
|
|
- //解决IOS下分享签名失败问题
|
|
|
- if (navigator.userAgent.indexOf('iPhone') !== -1) {
|
|
|
- window.wechaturl = window.location + '';
|
|
|
- }
|
|
|
+ //解决IOS下分享签名失败问题
|
|
|
+ if (navigator.userAgent.indexOf('iPhone') !== -1) {
|
|
|
+ window.wechaturl = window.location + '';
|
|
|
+ }
|
|
|
//一般情况下,这样就可以自动播放了,但是一些奇葩iPhone机不可以
|
|
|
var music = document.getElementById('music').play();
|
|
|
music.volume = 0.1;
|
|
@@ -169,53 +169,58 @@
|
|
|
music.volume = 0.1;
|
|
|
}, false);
|
|
|
|
|
|
- function shareWeixin(msg) {
|
|
|
- let wechaturl = window.location.href.split('#')[0];
|
|
|
- var shareUrl = wechaturl;
|
|
|
- if (window.wechaturl !== undefined) {
|
|
|
- wechaturl = window.wechaturl;
|
|
|
+ function shareWeixin(msg) {
|
|
|
+ let wechaturl = window.location.href.split('#')[0];
|
|
|
+ var shareUrl = wechaturl;
|
|
|
+ if (window.wechaturl !== undefined) {
|
|
|
+ wechaturl = window.wechaturl;
|
|
|
+ }
|
|
|
+ alert('shareUrl='+shareUrl);
|
|
|
+// var url = window.location.href.split('#')[0];
|
|
|
+// var plainUrl = url;
|
|
|
+// var href="https://wx.ttkuaiban.com/minigame/index.html";
|
|
|
+ url = escape(originUrl);
|
|
|
+// alert(url)
|
|
|
+ $.post("./user/getWxConfigParam?url="+wechaturl, {}, function(resp) {
|
|
|
+ if (resp.code == 'error') {
|
|
|
+ console.log(resp.code);
|
|
|
+ }else{
|
|
|
+ wx.config({
|
|
|
+ debug: true,
|
|
|
+ appId: 'wx749c84daac654e1e',
|
|
|
+ timestamp: resp.data.timestamp,
|
|
|
+ nonceStr: resp.data.noncestr,
|
|
|
+ signature: resp.data.sign,
|
|
|
+ jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
|
|
|
+ });
|
|
|
+ wx.ready(function(){
|
|
|
+ $("#cover").show();
|
|
|
+ const share = {
|
|
|
+ title: "我为你精心准备的美味,快享用吧!",
|
|
|
+ desc: msg,
|
|
|
+ imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
|
|
|
+ link: shareUrl,
|
|
|
+ success: function() {
|
|
|
+ alert("分享成功")
|
|
|
+ window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
|
|
|
+ },
|
|
|
+ cancel: function() {
|
|
|
+ alert("分享失败")
|
|
|
+ }
|
|
|
+ };
|
|
|
+ wx.onMenuShareAppMessage(share);
|
|
|
+ wx.onMenuShareTimeline(share);
|
|
|
+ wx.onMenuShareQQ(share);
|
|
|
+ wx.onMenuShareQZone(share);
|
|
|
+ wx.onMenuShareWeibo(share);
|
|
|
+ });
|
|
|
+ wx.error(function(res){
|
|
|
+ alert("分享失败")
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
- var url = escape(wechaturl);
|
|
|
- $.post("./user/getWxConfigParam?url="+url, {}, function(resp) {
|
|
|
- if (resp.code == 'error') {
|
|
|
- console.log(resp.code);
|
|
|
- }else{
|
|
|
- wx.config({
|
|
|
- debug: true,
|
|
|
- appId: 'wx749c84daac654e1e',
|
|
|
- timestamp: resp.data.timestamp,
|
|
|
- nonceStr: resp.data.noncestr,
|
|
|
- signature: resp.data.sign,
|
|
|
- jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
|
|
|
- });
|
|
|
- wx.ready(function(){
|
|
|
- $("#cover").show();
|
|
|
- const share = {
|
|
|
- title: "我为你精心准备的美味,快享用吧!",
|
|
|
- desc: msg,
|
|
|
- imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
|
|
|
- link: shareUrl,
|
|
|
- success: function() {
|
|
|
-// alert("分享成功")
|
|
|
- window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
|
|
|
- },
|
|
|
- cancel: function() {
|
|
|
-// alert("分享失败")
|
|
|
- }
|
|
|
- };
|
|
|
- wx.onMenuShareAppMessage(share);
|
|
|
- wx.onMenuShareTimeline(share);
|
|
|
- wx.onMenuShareQQ(share);
|
|
|
- wx.onMenuShareQZone(share);
|
|
|
- wx.onMenuShareWeibo(share);
|
|
|
- });
|
|
|
- wx.error(function(res){
|
|
|
- alert("分享失败")
|
|
|
- console.log(res);
|
|
|
- });
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
-</script>
|
|
|
+ </script>
|
|
|
</body>
|
|
|
</html>
|