|
@@ -15,6 +15,7 @@
|
|
<title>贝蒂斯厨房</title>
|
|
<title>贝蒂斯厨房</title>
|
|
<script src="./js/flexiable.js"></script>
|
|
<script src="./js/flexiable.js"></script>
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
|
|
|
|
+ <script src="https://tjs.sjs.sinajs.cn/open/thirdpart/js/jsapi/mobile.js" charset="utf-8"></script>
|
|
<link rel="stylesheet" type="text/css" href="./css/animate.min.css?v=1">
|
|
<link rel="stylesheet" type="text/css" href="./css/animate.min.css?v=1">
|
|
<link rel="stylesheet" type="text/css" href="./css/music.css?v=2">
|
|
<link rel="stylesheet" type="text/css" href="./css/music.css?v=2">
|
|
<link rel="stylesheet" type="text/css" href="./css/main.css?v=2">
|
|
<link rel="stylesheet" type="text/css" href="./css/main.css?v=2">
|
|
@@ -222,53 +223,18 @@
|
|
};
|
|
};
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
- $(function () {
|
|
|
|
- $.post("./user/getWxConfigParam?url=https://wx.ttkuaiban.com/minigame/index.html", {}, function(resp) {
|
|
|
|
- if (resp.code == 'error') {
|
|
|
|
- console.log(resp.code);
|
|
|
|
- }else{
|
|
|
|
- wx.config({
|
|
|
|
- debug: false,
|
|
|
|
- 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(){
|
|
|
|
- const share = {
|
|
|
|
- title: "一秒变大厨,为远方的朋友做道菜吧!",
|
|
|
|
- desc: "",
|
|
|
|
- imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
|
|
|
|
- link: "https://wx.ttkuaiban.com/minigame/index.html",
|
|
|
|
- success: function(res) {
|
|
|
|
- console.log(res)
|
|
|
|
- },
|
|
|
|
- cancel: function() {}
|
|
|
|
- };
|
|
|
|
- wx.onMenuShareAppMessage(share);
|
|
|
|
- wx.onMenuShareTimeline(share);
|
|
|
|
- wx.onMenuShareQQ(share);
|
|
|
|
- wx.onMenuShareQZone(share);
|
|
|
|
- wx.onMenuShareWeibo(share);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- wx.error(function(res){
|
|
|
|
- console.log(res);
|
|
|
|
- });
|
|
|
|
- };
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- //weibo
|
|
|
|
- $.post("./user/getWeiboConfigParam?url=https://wx.ttkuaiban.com/minigame/lottery.html", {}, function(resp) {
|
|
|
|
|
|
+
|
|
|
|
+ //通过微博进行分享的回调时事件
|
|
|
|
+ function shareWeibo(msg) {
|
|
|
|
+ var url = escape(window.location.href.split('#')[0]);
|
|
|
|
+ $.post("./user/getWeiboConfigParam?url=" + url, {}, function(resp) {
|
|
if (resp.code == 'error') {
|
|
if (resp.code == 'error') {
|
|
console.log(resp.code);
|
|
console.log(resp.code);
|
|
}else{
|
|
}else{
|
|
window.WeiboJS.init({
|
|
window.WeiboJS.init({
|
|
'appkey' : resp.data.appkey,
|
|
'appkey' : resp.data.appkey,
|
|
- 'debug': true,
|
|
|
|
- 'timestamp': resp.data.timestamp,
|
|
|
|
|
|
+ 'debug': false,
|
|
|
|
+ 'timestamp': parseInt(resp.data.timestamp),
|
|
'noncestr': resp.data.noncestr,
|
|
'noncestr': resp.data.noncestr,
|
|
'signature': resp.data.sign,
|
|
'signature': resp.data.sign,
|
|
'scope': [
|
|
'scope': [
|
|
@@ -278,6 +244,7 @@
|
|
'checkAvailability',
|
|
'checkAvailability',
|
|
'setBrowserTitle',
|
|
'setBrowserTitle',
|
|
'openMenu',
|
|
'openMenu',
|
|
|
|
+ 'menuItemAvailable',
|
|
'setMenuItems',
|
|
'setMenuItems',
|
|
'menuItemSelected',
|
|
'menuItemSelected',
|
|
'setSharingContent',
|
|
'setSharingContent',
|
|
@@ -289,19 +256,142 @@
|
|
'apiFromTheFuture'
|
|
'apiFromTheFuture'
|
|
]
|
|
]
|
|
}, function(ret){
|
|
}, function(ret){
|
|
- alert('init done\n' + JSON.stringify(ret));/*DEBUG*/
|
|
|
|
|
|
+ $("#cover").show();
|
|
|
|
+ var shareTitle = "一秒变大厨,为远方的朋友做道菜吧!";
|
|
|
|
+ var shareImg = "https://wx.ttkuaiban.com/minigame/images/share_picture.png";
|
|
|
|
+ WeiboJS.invoke("setSharingContent", {
|
|
|
|
+ title: shareTitle,
|
|
|
|
+ desc: msg,
|
|
|
|
+ icon: shareImg
|
|
|
|
+ }, function(e) {
|
|
|
|
+// alert("设置分享内容成功:" + JSON.stringify(e));
|
|
|
|
+ });
|
|
|
|
+// WeiboJS.invoke("setMenuItems", {
|
|
|
|
+// menus : ["shareToWeibo", "follow"],
|
|
|
|
+// content : "我是默认文案"
|
|
|
|
+// }, function(params){
|
|
|
|
+// // alert("setMenuItems 返回数据:" + JSON.stringify(params));
|
|
|
|
+// });
|
|
|
|
+ WeiboJS.on("menuItemSelected", function(params){
|
|
|
|
+// alert("menuItemSelected:" + JSON.stringify(params));
|
|
|
|
+ if (!params.hasOwnProperty("error")) {
|
|
|
|
+ window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+// WeiboJS.invoke("openMenu", {}, function(params){
|
|
|
|
+// alert("openMenu 返回数据:" + JSON.stringify(params));
|
|
|
|
+// });
|
|
});
|
|
});
|
|
-
|
|
|
|
- WeiboJS.invoke("setSharingContent", {
|
|
|
|
- title: "抽奖页面测试标题",
|
|
|
|
- desc: "抽奖页面测试描述",
|
|
|
|
- icon: "https://wx.ttkuaiban.com/minigame/images/share_picture.png"
|
|
|
|
- }, function(e) {
|
|
|
|
- alert("设置分享内容成功:" + JSON.stringify(e));
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $(function () {
|
|
|
|
+ var shareTitle = "一秒变大厨,为远方的朋友做道菜吧!";
|
|
|
|
+ var shareImg = "https://wx.ttkuaiban.com/minigame/images/share_picture.png";
|
|
|
|
+ var shareLink = "https://wx.ttkuaiban.com/minigame/index.html";
|
|
|
|
+ var ua = navigator.userAgent.toLowerCase();
|
|
|
|
+ if (ua.match(/microMessenger/i) == 'micromessenger') {
|
|
|
|
+ $.post("./user/getWxConfigParam?url=https://wx.ttkuaiban.com/minigame/index.html", {}, function(resp) {
|
|
|
|
+ if (resp.code == 'error') {
|
|
|
|
+ console.log(resp.code);
|
|
|
|
+ }else{
|
|
|
|
+ wx.config({
|
|
|
|
+ debug: false,
|
|
|
|
+ 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(){
|
|
|
|
+ const share = {
|
|
|
|
+ title: shareTitle,
|
|
|
|
+ desc: "",
|
|
|
|
+ imgUrl: shareImg,
|
|
|
|
+ link: shareLink,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ console.log(res)
|
|
|
|
+ },
|
|
|
|
+ cancel: function() {}
|
|
|
|
+ };
|
|
|
|
+ wx.onMenuShareAppMessage(share);
|
|
|
|
+ wx.onMenuShareTimeline(share);
|
|
|
|
+ wx.onMenuShareQQ(share);
|
|
|
|
+ wx.onMenuShareQZone(share);
|
|
|
|
+ wx.onMenuShareWeibo(share);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ wx.error(function(res){
|
|
|
|
+ console.log(res);
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ } else if (ua.match(/weibo/i) == 'weibo') {
|
|
|
|
+ //weibo
|
|
|
|
+ var url = escape(location.href);
|
|
|
|
+ $.post("./user/getWeiboConfigParam?url=" + url, {}, function(resp) {
|
|
|
|
+ if (resp.code == 'error') {
|
|
|
|
+ console.log(resp.code);
|
|
|
|
+ }else{
|
|
|
|
+ window.WeiboJS.init({
|
|
|
|
+ 'appkey' : resp.data.appkey,
|
|
|
|
+ 'debug': false,
|
|
|
|
+ 'timestamp': parseInt(resp.data.timestamp),
|
|
|
|
+ 'noncestr': resp.data.noncestr,
|
|
|
|
+ 'signature': resp.data.sign,
|
|
|
|
+ 'scope': [
|
|
|
|
+ 'getNetworkType',
|
|
|
|
+ 'networkTypeChanged',
|
|
|
|
+ 'getBrowserInfo',
|
|
|
|
+ 'checkAvailability',
|
|
|
|
+ 'setBrowserTitle',
|
|
|
|
+ 'openMenu',
|
|
|
|
+ 'menuItemAvailable',
|
|
|
|
+ 'setMenuItems',
|
|
|
|
+ 'menuItemSelected',
|
|
|
|
+ 'setSharingContent',-
|
|
|
|
+ 'openImage',
|
|
|
|
+ 'scanQRCode',
|
|
|
|
+ 'pickImage',
|
|
|
|
+ 'getLocation',
|
|
|
|
+ 'pickContact',
|
|
|
|
+ 'apiFromTheFuture'
|
|
|
|
+ ]
|
|
|
|
+ }, function(ret){
|
|
|
|
+ WeiboJS.invoke("setSharingContent", {
|
|
|
|
+ title: shareTitle,
|
|
|
|
+ desc: "",
|
|
|
|
+ icon: shareImg
|
|
|
|
+ }, function(e) {
|
|
|
|
+// alert("1-设置分享内容成功:" + JSON.stringify(e));
|
|
|
|
+ });
|
|
|
|
+// WeiboJS.invoke("setMenuItems", {
|
|
|
|
+// /**微博:1001好友圈:1002
|
|
|
|
+// 私信 :1003
|
|
|
|
+// 微信好友:1004
|
|
|
|
+// 朋友圈:1005
|
|
|
|
+// 来往动态:1009
|
|
|
|
+// QQ:1010
|
|
|
|
+// Qzone:1011
|
|
|
|
+// 短信:1101
|
|
|
|
+// 邮件:1102**/
|
|
|
|
+// menus : ["1001","1002", "1003", "1004","1005", "1010"],
|
|
|
|
+// content : shareTitle
|
|
|
|
+// }, function(params){
|
|
|
|
+// alert("setMenuItems 返回数据:" + JSON.stringify(params));
|
|
|
|
+// });
|
|
|
|
+ //"shareToWeibo", "follow", "shareToMessage", "shareToWeixin", "shareToPYQ", "shareToQQ", "shareToQzone", "openInBrowser", "copyURL"
|
|
|
|
+
|
|
|
|
+// WeiboJS.invoke("menuItemAvailable", {}, function(params){
|
|
|
|
+// alert("获取的菜单项:" + JSON.stringify(params));
|
|
|
|
+// });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+// alert('noooooo');
|
|
|
|
+ }
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|