|
|
@@ -72,6 +72,7 @@ export default class BlessingBag extends cc.Component {
|
|
|
|
|
|
@property(cc.Node)
|
|
|
node_xiabiao: cc.Node = null;
|
|
|
+
|
|
|
@property(TableView)
|
|
|
tableview: TableView = null;
|
|
|
|
|
|
@@ -100,7 +101,8 @@ export default class BlessingBag extends cc.Component {
|
|
|
}
|
|
|
|
|
|
if (gData.blessingBag.init_openRb) {
|
|
|
- this.OpenRbPanel(gData.blessingBag.rbType, gData.blessingBag.rbNum);
|
|
|
+ //this.OpenRbPanel(gData.blessingBag.taskRbId, gData.blessingBag.rbNum);
|
|
|
+ gData.blessingBag.HttpCashTask();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -110,87 +112,27 @@ export default class BlessingBag extends cc.Component {
|
|
|
}
|
|
|
|
|
|
UpdateInfo() {
|
|
|
- // let data = gData.blessingBag.videoRbData;
|
|
|
- // if (!data) {
|
|
|
- // return
|
|
|
- // }
|
|
|
-
|
|
|
- // this.targetProgress = data.cumulativeAmount;
|
|
|
-
|
|
|
- // //this.txtBigDelta.node.active = data.showTask != 1;
|
|
|
- // //this.txtBigTask.node.active = data.showTask == 1;
|
|
|
- // this.txtTipAd.string = data.showTask == 1 ? "提现中..." : "<b>满<color=#FFE00C>" + data.requestAmount + "元</color>可提现</b>";
|
|
|
- // //this.txtBigDelta.string = "<outline color=#8C1010 width=4><b>每次视频额外奖励<color=#FFE00C>" + data.videoAmountPerTime + "元</color></b></outline>";
|
|
|
- // //this.txtBigTask.string = "<outline color=#8C1010 width=4>金额已达标,完成<color=#4EB7FF>观看视频</color>任务可到账"
|
|
|
- // + "\n观看视频次数:<color=#FFE00C>" + data.taskVideoWatchTime + "/" + data.taskVideoTime + "</color>,连续观看天数:<color=#FFE00C>" + data.taskVideoWatchDay + "/" + data.taskVideoDay + "</color></outline>"
|
|
|
-
|
|
|
- // this.txtRemaindAdNum.string = "<color=#FDFCF5>今日剩余次数:</c><color=#FFE533>" + data.videoTime + "</color>";
|
|
|
- // this.adIcon.active = data.needToWatchTheVideo == 1;
|
|
|
-
|
|
|
- // if (gData.blessingBag.isPlayAniUpdate) {
|
|
|
- // if (this.lastNum < data.cumulativeAmount) {
|
|
|
- // //let world_pos = this.btnCash.parent.convertToWorldSpaceAR(this.btnCash.getPosition());
|
|
|
- // // mk.fly.PlayCoinAnim(1, 10, this.btnAd, '', () => {
|
|
|
- // // this.aniBigAdBtn.setCurrentTime(0);
|
|
|
- // // this.aniBigAdBtn.play();
|
|
|
- // // });
|
|
|
- // this.txtAddEft.node.setPosition(cc.v2(0, 380));
|
|
|
- // this.txtAddEft.string = "+" + data.videoAmountPerTime + "元";
|
|
|
- // this.txtAddEft.node.stopAllActions();
|
|
|
- // this.txtAddEft.node.scale = 0;
|
|
|
- // this.txtAddEft.node.opacity = 255;
|
|
|
- // this.txtAddEft.node.active = true;
|
|
|
-
|
|
|
- // let a0 = cc.delayTime(0.8);
|
|
|
- // let a1t = cc.sequence(cc.scaleTo(0.15, 1.2), cc.scaleTo(0.15, 1));
|
|
|
- // let a1a = cc.spawn(cc.moveBy(0.3, cc.v2(0, 30)), a1t);
|
|
|
- // let a2 = cc.delayTime(0.5);
|
|
|
- // let a3 = cc.fadeOut(0.15);
|
|
|
- // let a4 = cc.callFunc(() => {
|
|
|
- // //this.txtBigNum.string = data.cumulativeAmount + "元";
|
|
|
- // this.PlayMoneyAni(0.2);
|
|
|
- // this.txtAddEft.node.active = false;
|
|
|
- // });
|
|
|
- // this.txtAddEft.node.runAction(cc.sequence(a0, a1a, a2, a3, a4));
|
|
|
-
|
|
|
- // } else {
|
|
|
- // this.txtBigNum.string = data.cumulativeAmount.toFixed(2) + "元";
|
|
|
- // this.lastNum = data.cumulativeAmount;
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.txtBigNum.string = data.cumulativeAmount.toFixed(2) + "元";
|
|
|
- // this.lastNum = data.cumulativeAmount;
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // if (this.adrbArray.length < 4) {
|
|
|
- // this.adrbArray = [];
|
|
|
-
|
|
|
- // for (let i = 0; i < data.redMonies.length; i++) {
|
|
|
- // let obj = {
|
|
|
- // data: data.redMonies[i],
|
|
|
- // isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
|
|
|
- // isPlayInitAni: this.isPlayInitAni
|
|
|
- // }
|
|
|
- // this.adrbArray.push(obj);
|
|
|
- // }
|
|
|
- // this.itemContent.emit('srollview-init', this.adrbArray);
|
|
|
- // } else
|
|
|
- {
|
|
|
- this.adrbArray = [{data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}, {data:1}];
|
|
|
-
|
|
|
- // for (let i = 0; i < data.redMonies.length; i++) {
|
|
|
- // let obj = {
|
|
|
- // data: data.redMonies[i],
|
|
|
- // isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
|
|
|
- // isPlayInitAni: this.isPlayInitAni
|
|
|
- // }
|
|
|
- // this.adrbArray.push(obj);
|
|
|
- // }
|
|
|
- //刷新
|
|
|
+ let data = gData.blessingBag.videoRbData;
|
|
|
+ if (!data) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.txtRemaindAdNum.string = "<color=#FDFCF5>今日剩余次数:</c><color=#FFE533>" + data.leftVideoTimes + "</color>";
|
|
|
+ this.adIcon.active = data.isVideo != 1;
|
|
|
+
|
|
|
+ if (this.adrbArray.length < 4) {
|
|
|
+ this.adrbArray = [];
|
|
|
+
|
|
|
+ for (let i = 0; i < data.welFareTaskList.length; i++) {
|
|
|
+ let obj = {
|
|
|
+ data: data.welFareTaskList[i],
|
|
|
+ isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
|
|
|
+ isPlayInitAni: this.isPlayInitAni
|
|
|
+ }
|
|
|
+ this.adrbArray.push(obj);
|
|
|
+ }
|
|
|
this.itemContent.emit('srollview-init', this.adrbArray);
|
|
|
|
|
|
-
|
|
|
cc.tween(this.node).delay(0.2).call(()=>{
|
|
|
let allItem = this.tableview.getFrontPositionItemByCount(5);
|
|
|
|
|
|
@@ -201,6 +143,19 @@ export default class BlessingBag extends cc.Component {
|
|
|
cc.tween(allItem[i]).delay(i*0.1).by(0.3, {y: 600}, cc.easeSineOut()).start();
|
|
|
}
|
|
|
}).start();
|
|
|
+ } else {
|
|
|
+ this.adrbArray = [];
|
|
|
+
|
|
|
+ for (let i = 0; i < data.welFareTaskList.length; i++) {
|
|
|
+ let obj = {
|
|
|
+ data: data.welFareTaskList[i],
|
|
|
+ isPlayAniUpdate: gData.blessingBag.isPlayAniUpdate,
|
|
|
+ isPlayInitAni: this.isPlayInitAni
|
|
|
+ }
|
|
|
+ this.adrbArray.push(obj);
|
|
|
+ }
|
|
|
+ //刷新
|
|
|
+ this.itemContent.emit('srollview-update', this.adrbArray);
|
|
|
}
|
|
|
|
|
|
this.isPlayInitAni = false;
|
|
|
@@ -255,16 +210,17 @@ export default class BlessingBag extends cc.Component {
|
|
|
JsbSystem.WxAuth();
|
|
|
return;
|
|
|
}
|
|
|
- if (gData.blessingBag.videoRbData.needToWatchTheVideo != 1) {
|
|
|
+ if (gData.blessingBag.videoRbData.isVideo == 1) {
|
|
|
//免费加进度
|
|
|
- gData.blessingBag.HttpNoAdProgress();
|
|
|
+ gData.blessingBag.addProgress();
|
|
|
} else {
|
|
|
- if (gData.blessingBag.videoRbData.videoTime > 0) {
|
|
|
+ if (gData.blessingBag.videoRbData.leftVideoTimes > 0) {
|
|
|
mk.ad.videoAdType = VideoAdType.Fudai;
|
|
|
mk.ad.watchAd((success: boolean) => {
|
|
|
mk.console.log("watchAD:" + success);
|
|
|
if (success) {
|
|
|
- gData.adData.watchVideo(AdFun.bigCash)
|
|
|
+ gData.blessingBag.addProgress();
|
|
|
+ //gData.adData.watchVideo(AdFun.bigCash)
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
@@ -282,7 +238,7 @@ export default class BlessingBag extends cc.Component {
|
|
|
* @param num 红包金额
|
|
|
*/
|
|
|
OpenRbPanel(type: number, num: number) {
|
|
|
- this.rbPanelType = type;
|
|
|
+ //this.rbPanelType = type;
|
|
|
// this.txtRbNum.string = num + "元";
|
|
|
// this.nodeRb.active = true;
|
|
|
// this.rbOpenBtn.active = true;
|