Commit d6da2177 authored by haiyoucuv's avatar haiyoucuv

1

parent a3a92a7f
...@@ -44,53 +44,72 @@ ...@@ -44,53 +44,72 @@
<script src="scripts/svga.egret.min2.js"></script> <script src="scripts/svga.egret.min2.js"></script>
<script src="libs/physics.min.js"></script> <script src="libs/physics.min.js"></script>
<script src="output.js"></script> <script src="output.js"></script>
<!--<script src="https://yun.duiba.com.cn/db_games/debug/vconsole.min.js"></script>--> <script src="https://yun.duiba.com.cn/db_games/debug/vconsole.min.js"></script>
<!--<script>--> <script>
<!-- // init vConsole--> // init vConsole
<!-- var vConsole = new VConsole();--> var vConsole = new VConsole();
<!-- console.log('Hello world');--> console.log('Hello world');
<!--</script>--> </script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="//statics-web.iqiyi.com/common/jssdk/iqiyiJsBridge-v2-min.js"></script> <script src="//statics-web.iqiyi.com/common/jssdk/iqiyiJsBridge.min.js.js"></script>
<script> <script>
window['hbRainTime'] = 1; window['hbRainTime'] = 1;
window['hbTips'] = 88.8; window['hbTips'] = 88.8;
// function iqiyiShare() {
// return new Promise((resolve, reject) => {
// // resolve({kShareChannel:111});
// iqiyi && iqiyi.share({
// title: '尖叫之夜门票、现金红包限时抢,手慢无!',//标题
// desc: '立即参与',//描述
// link: 'http://activity.m.duibatest.com.cn/hdtool/index?id=23282&appKey=jlg88lyxz7siqtmr&openBs=openbs'+'&signEnt='+ encodeURIComponent(5),//链接
// success: function (res) {
// resolve(res);
// },
// fail: function () {
// reject('分享失败');
// },
// cancel: function () {
// reject('分享取消');
// }
// });
// });
// }
function iqiyiShare() { function iqiyiShare() {
return new Promise((resolve, reject) => { // resolve({kShareChannel:111});
resolve({kShareChannel:111});
iqiyi && iqiyi.share({ iqiyi && iqiyi.share({
title: '尖叫之夜门票、现金红包限时抢,手慢无!',//标题 title: '尖叫之夜门票、现金红包限时抢,手慢无!',//标题
desc: '立即参与',//描述 desc: '立即参与',//描述
link: 'http://activity.m.duibatest.com.cn/hdtool/index?id=23282&appKey=jlg88lyxz7siqtmr&openBs=openbs'+'&signEnt='+ encodeURIComponent(5),//链接 link: 'http://activity.m.duibatest.com.cn/hdtool/index?id=23282&appKey=jlg88lyxz7siqtmr&openBs=openbs'+'&signEnt='+ encodeURIComponent(5),//链接
dialogTitle: 'onShare 分享选择浮层在这里',
success: function (res) { success: function (res) {
resolve(res); console.log({kShareChannel:111});
}, },
fail: function () { fail: function () {
reject('分享失败'); console.log("fail")
}, },
cancel: function () { cancel: function () {
reject('分享取消'); console.log('分享取消');
} }
}); });
});
} }
iqiyi.onShare({ // iqiyi.onShare({
title: '尖叫之夜门票、现金红包限时抢,手慢无!', // title: '尖叫之夜门票、现金红包限时抢,手慢无!',
desc: '立即参与', // desc: '立即参与',
link: 'http://activity.m.duibatest.com.cn/hdtool/index?id=23282&appKey=jlg88lyxz7siqtmr&openBs=openbs'+'&signEnt='+ encodeURIComponent(5), // link: 'http://activity.m.duibatest.com.cn/hdtool/index?id=23282&appKey=jlg88lyxz7siqtmr&openBs=openbs'+'&signEnt='+ encodeURIComponent(5),
dialogTitle: 'onShare 分享选择浮层在这里', // dialogTitle: 'onShare 分享选择浮层在这里',
success: function () { // success: function () {
setResult('分享成功'); // setResult('分享成功');
}, // },
fail: function () { // fail: function () {
setResult('分享失败'); // setResult('分享失败');
}, // },
cancel: function () { // cancel: function () {
setResult('分享取消'); // setResult('分享取消');
} // }
}); // });
</script> </script>
<script> <script>
// 网鱼网咖图标额外奖励插件 // 网鱼网咖图标额外奖励插件
......
This diff is collapsed.
...@@ -39,6 +39,21 @@ export default class HbNoPrize extends Panel { ...@@ -39,6 +39,21 @@ export default class HbNoPrize extends Panel {
this.shareTips.visible = true; this.shareTips.visible = true;
this.ok_btn.x = 102; this.ok_btn.x = 102;
} }
let that = this;
window['addTime'] = function(res) {
NetManager.ins.iqiyiHbRainAddTime((success, res) => {
if(res.kShareChannel == 'copyURL') { // 如果是复制链接,则不算分享成功
return;
}
that.onTouchClose();
if(!success) {
showToast('分享次数达到上限');
return;
}
// showToast('分享成功,获得一次红包雨开抢机会');
});
}
} }
private onTouchTap(e: egret.TouchEvent) { private onTouchTap(e: egret.TouchEvent) {
...@@ -49,24 +64,25 @@ export default class HbNoPrize extends Panel { ...@@ -49,24 +64,25 @@ export default class HbNoPrize extends Panel {
this.onTouchClose(); this.onTouchClose();
break; break;
case this.share_btn: // 爱奇艺主动分享 case this.share_btn: // 爱奇艺主动分享
window['iqiyiShare']().then( window['iqiyiShare']();
(res) => { // .then(
console.log(res.kShareChannel); // (res) => {
if(res.kShareChannel != 'copyURL') { // 如果是复制链接,则不算分享成功 // console.log(res.kShareChannel);
NetManager.ins.iqiyiHbRainAddTime((success, res) => { // if(res.kShareChannel != 'copyURL') { // 如果是复制链接,则不算分享成功
this.onTouchClose(); // NetManager.ins.iqiyiHbRainAddTime((success, res) => {
if(!success) { // this.onTouchClose();
showToast('分享次数达到上限'); // if(!success) {
return; // showToast('分享次数达到上限');
} // return;
// showToast('分享成功,获得一次红包雨开抢机会'); // }
}); // // showToast('分享成功,获得一次红包雨开抢机会');
} // });
}, // }
(err) => { // },
console.log(err); // (err) => {
} // console.log(err);
); // }
// );
break; break;
default: default:
...@@ -94,4 +110,11 @@ export default class HbNoPrize extends Panel { ...@@ -94,4 +110,11 @@ export default class HbNoPrize extends Panel {
get groupName() { get groupName() {
return "hbNoPrize"; return "hbNoPrize";
} }
destroy() {
super.destroy();
window['addTime'] = (res)=>{
}
}
} }
...@@ -46,6 +46,21 @@ export default class HbPrize extends Panel { ...@@ -46,6 +46,21 @@ export default class HbPrize extends Panel {
// console.log(this.data); // console.log(this.data);
this.prizeImg.source = this.data.imgUrl; this.prizeImg.source = this.data.imgUrl;
this.prizeName.text = `恭喜你获得${this.data.title}`; this.prizeName.text = `恭喜你获得${this.data.title}`;
let that = this;
window['addTime'] = function(res) {
NetManager.ins.iqiyiHbRainAddTime((success, res) => {
if(res.kShareChannel == 'copyURL') { // 如果是复制链接,则不算分享成功
return;
}
that.onTouchClose();
if(!success) {
showToast('分享次数达到上限');
return;
}
// showToast('分享成功,获得一次红包雨开抢机会');
});
}
} }
private onTouchTap(e: egret.TouchEvent) { private onTouchTap(e: egret.TouchEvent) {
...@@ -56,27 +71,28 @@ export default class HbPrize extends Panel { ...@@ -56,27 +71,28 @@ export default class HbPrize extends Panel {
window.location.href = gotoRecord(); window.location.href = gotoRecord();
break; break;
case this.share_btn: // 爱奇艺主动分享 case this.share_btn: // 爱奇艺主动分享
window['iqiyiShare']().then( window['iqiyiShare']();
(res) => { // .then(
console.log(res.kShareChannel); // (res) => {
if(res.kShareChannel != 'copyURL') { // 如果是复制链接,则不算分享成功 // console.log(res.kShareChannel);
NetManager.ins.iqiyiHbRainAddTime((success, res) => { // if(res.kShareChannel != 'copyURL') { // 如果是复制链接,则不算分享成功
this.onTouchClose(); // NetManager.ins.iqiyiHbRainAddTime((success, res) => {
if(!success) { // this.onTouchClose();
showToast('分享次数达到上限'); // if(!success) {
return; // showToast('分享次数达到上限');
} // return;
// let iqiyiAjaxData = DataManager.ins.getData(NetName.IQIYI_ELEMENT).data; // }
// if(iqiyiAjaxData && iqiyiAjaxData.extra && !iqiyiAjaxData.extra.shared){ // 没有分享过 // // let iqiyiAjaxData = DataManager.ins.getData(NetName.IQIYI_ELEMENT).data;
// showToast('分享成功,获得一次红包雨开抢机会'); // // if(iqiyiAjaxData && iqiyiAjaxData.extra && !iqiyiAjaxData.extra.shared){ // 没有分享过
// } // // showToast('分享成功,获得一次红包雨开抢机会');
}); // // }
} // });
}, // }
(err) => { // },
showToast(err); // (err) => {
} // showToast(err);
); // }
// );
break; break;
default: default:
...@@ -98,6 +114,9 @@ export default class HbPrize extends Panel { ...@@ -98,6 +114,9 @@ export default class HbPrize extends Panel {
destroy() { destroy() {
super.destroy(); super.destroy();
window['addTime'] = function(res) {
}
} }
get skinKey() { get skinKey() {
...@@ -107,6 +126,8 @@ export default class HbPrize extends Panel { ...@@ -107,6 +126,8 @@ export default class HbPrize extends Panel {
get groupName() { get groupName() {
return "hbPrize"; return "hbPrize";
} }
}; };
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
......
...@@ -62,24 +62,25 @@ export default class IndexScene extends Scene { ...@@ -62,24 +62,25 @@ export default class IndexScene extends Scene {
this.btn.touchEnabled = true; this.btn.touchEnabled = true;
break; break;
case this.shareBtn: case this.shareBtn:
window['iqiyiShare']().then( window['iqiyiShare']();
(res) => { // .then(
console.log(res.kShareChannel); // (res) => {
if(res.kShareChannel != 'copyURL') { // 如果是复制链接,则不算分享成功 // console.log(res.kShareChannel);
NetManager.ins.iqiyiHbRainAddTime((success, res) => { // if(res.kShareChannel != 'copyURL') { // 如果是复制链接,则不算分享成功
if(!success) { // NetManager.ins.iqiyiHbRainAddTime((success, res) => {
showToast('分享次数达到上限'); // if(!success) {
return; // showToast('分享次数达到上限');
} // return;
// showToast('分享成功,获得一次红包雨开抢机会'); // }
this.ajaxElement(); // showToast('分享成功,获得一次红包雨开抢机会');
}); // this.ajaxElement();
} // });
}, // }
(err) => { // },
showToast(err); // (err) => {
} // showToast(err);
); // }
// );
break; break;
case this.rule_btn: // 规则按钮 case this.rule_btn: // 规则按钮
PanelCtrl.instance.show(ModuleTypes.RULE_PANEL); PanelCtrl.instance.show(ModuleTypes.RULE_PANEL);
...@@ -119,7 +120,19 @@ export default class IndexScene extends Scene { ...@@ -119,7 +120,19 @@ export default class IndexScene extends Scene {
}; };
document.addEventListener("visibilitychange", () => { document.addEventListener("visibilitychange", () => {
this.documentEvent(); this.documentEvent();
}) });
window['addTime'] = function(res) {
NetManager.ins.iqiyiHbRainAddTime((success, res) => {
if(res.kShareChannel == 'copyURL') { // 如果是复制链接,则不算分享成功
return;
}
if(!success) {
showToast('分享次数达到上限');
return;
}
// showToast('分享成功,获得一次红包雨开抢机会');
});
}
} }
private setMidGroup() { private setMidGroup() {
...@@ -287,6 +300,9 @@ export default class IndexScene extends Scene { ...@@ -287,6 +300,9 @@ export default class IndexScene extends Scene {
document.removeEventListener("visibilitychange", () => { document.removeEventListener("visibilitychange", () => {
this.documentEvent(); this.documentEvent();
}) })
window['addTime'] = function(res) {
}
} }
protected async preLoadRes() { protected async preLoadRes() {
......
{ {
"success": false, "success": true,
"code": "1000000000", "code": "1000000000",
"desc": "请勿重复分享", "desc": "请勿重复分享",
"timestamp": 1574157200000, "timestamp": 1574157200000,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment