Commit d6da2177 authored by haiyoucuv's avatar haiyoucuv

1

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