|
|
@@ -160,10 +160,9 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
this.initRefreshEvent();
|
|
|
|
|
|
- if(gData.gameData.playerProp.orderData)
|
|
|
- {
|
|
|
+ if (gData.gameData.playerProp.orderData) {
|
|
|
this.initOrderUI();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
mk.event.register("initOrderUi", this.initOrderUI.bind(this), this);
|
|
|
}
|
|
|
}
|
|
|
@@ -478,15 +477,15 @@ export default class Game extends cc.Component {
|
|
|
/** 点击互推 */
|
|
|
public onClickHuTui() {
|
|
|
mk.data.sendDataEvent(DataEventId.button_click, "互推icon");
|
|
|
+ gData.moreGame.userBehaveLog(4, gData.moreGame.placement_id, gData.moreGame.nebulaAppId);
|
|
|
}
|
|
|
|
|
|
/** 点击福利 */
|
|
|
public onClickFuli() {
|
|
|
- if(gData.gameData.playerProp.orderData && gData.gameData.playerProp.orderData.overTimes >= gData.gameData.welfareOpenLimit)
|
|
|
- {
|
|
|
+ if (gData.gameData.playerProp.orderData && gData.gameData.playerProp.orderData.overTimes >= gData.gameData.welfareOpenLimit) {
|
|
|
mk.ui.openPanel('module/blessingBag/blessingBag');
|
|
|
mk.data.sendDataEvent(DataEventId.button_click, "福利icon");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
mk.tip.pop(`订单提现${gData.gameData.welfareOpenLimit}次后开启`);
|
|
|
}
|
|
|
}
|
|
|
@@ -1042,8 +1041,8 @@ export default class Game extends cc.Component {
|
|
|
this.node_getOrderReward.getComponent(cc.Animation).stop();
|
|
|
this.node_orderHand.active = false;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public clickGetOrderRewardBtn() {
|
|
|
@@ -1075,8 +1074,7 @@ export default class Game extends cc.Component {
|
|
|
let data = {};
|
|
|
let response = await mk.http.sendData('orderTask/receiveRewardCash', data);
|
|
|
if (response.errcode != 0) {
|
|
|
- if(response.errcode == 405)
|
|
|
- {
|
|
|
+ if (response.errcode == 405) {
|
|
|
mk.tip.pop("今日提现额度已到上限,请明天再提现");
|
|
|
mk.data.sendDataEvent(DataEventId.cashLimit, "提现触发上限");
|
|
|
}
|
|
|
@@ -1090,13 +1088,13 @@ export default class Game extends cc.Component {
|
|
|
// gData.reward.adData = { videoRedMoney: { videoRewardList: null } };
|
|
|
// gData.reward.adData.videoRedMoney.videoRewardList = [{ rewardType: 1, rewardNum: addMoney }]
|
|
|
// mk.ui.openPanel('module/reward/reward');
|
|
|
-
|
|
|
+
|
|
|
//处理提现逻辑
|
|
|
gData.cashPro.callBack = this.getRewardCallBack.bind(this);
|
|
|
gData.receiptNotice.receip_rmb = addMoney;
|
|
|
mk.ui.openPanel('module/newNotice/newNotice');
|
|
|
|
|
|
- this.node_crop.forEach((v)=>{
|
|
|
+ this.node_crop.forEach((v) => {
|
|
|
v.active = false;
|
|
|
})
|
|
|
this.node_orderHbIcon.active = false;
|
|
|
@@ -1105,22 +1103,19 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
//停止农民产红包币
|
|
|
isStopFarm = false;
|
|
|
- public getRewardCallBack()
|
|
|
- {
|
|
|
+ public getRewardCallBack() {
|
|
|
this.node_extraOrderUi.active = true;
|
|
|
this.node_bgUi.scale = 0;
|
|
|
- cc.tween(this.node_bgUi).to(0.4, {scale: 1.4}).start();
|
|
|
+ cc.tween(this.node_bgUi).to(0.4, { scale: 1.4 }).start();
|
|
|
|
|
|
- if(gData.gameData.funOpenData[1] == '1')
|
|
|
- {
|
|
|
+ if (gData.gameData.funOpenData[1] == '1') {
|
|
|
gData.gameData.funOpenData[1] = "0";
|
|
|
this.isStopFarm = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public showRefreshLogic()
|
|
|
- {
|
|
|
- this.node_crop.forEach((v)=>{
|
|
|
+ public showRefreshLogic() {
|
|
|
+ this.node_crop.forEach((v) => {
|
|
|
v.active = true;
|
|
|
})
|
|
|
this.node_orderHbIcon.active = true;
|
|
|
@@ -1132,19 +1127,17 @@ export default class Game extends cc.Component {
|
|
|
gData.gameData.checkTaskFinishUnLock();
|
|
|
gData.safeDepositBoxData.updateQipao();
|
|
|
|
|
|
- if(this.isStopFarm)
|
|
|
- {
|
|
|
+ if (this.isStopFarm) {
|
|
|
this.isStopFarm = false;
|
|
|
gData.gameData.funOpenData[1] = '1';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- showTips()
|
|
|
- {
|
|
|
+ showTips() {
|
|
|
mk.tip.pop("提现成功,订单已刷新");
|
|
|
}
|
|
|
|
|
|
- async doCropFlyLogic(plantId: number, farmNode: cc.Node = null, parentNode: cc.Node = null,isNzw = false) {
|
|
|
+ async doCropFlyLogic(plantId: number, farmNode: cc.Node = null, parentNode: cc.Node = null, isNzw = false) {
|
|
|
if (gData.gameData.funOpenData[11] == "0" || !gData.gameData.playerProp.orderData) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -1218,13 +1211,12 @@ export default class Game extends cc.Component {
|
|
|
mk.tip.pop("订单已完成,快提现吧!");
|
|
|
}
|
|
|
}
|
|
|
- if(parentNode)
|
|
|
- {
|
|
|
+ if (parentNode) {
|
|
|
let pos = this.node_orderHb.parent.convertToWorldSpaceAR(this.node_orderHb.getPosition());
|
|
|
mk.fly.PlayCoinAnim(1, 5, parentNode, pos, () => {
|
|
|
//this.refreshOrderUI(index);
|
|
|
}, 0.8);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
let pos = this.node_orderHb.parent.convertToWorldSpaceAR(this.node_orderHb.getPosition());
|
|
|
mk.fly.PlayCoinAnim(1, 5, this.btn_product, pos, () => {
|
|
|
//this.refreshOrderUI(index);
|
|
|
@@ -1243,8 +1235,7 @@ export default class Game extends cc.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public refreshOrderUI(index)
|
|
|
- {
|
|
|
+ public refreshOrderUI(index) {
|
|
|
let orderData = gData.gameData.playerProp.orderData;
|
|
|
let dataE = orderData.orderTaskList[index];
|
|
|
if (dataE) {
|
|
|
@@ -1291,13 +1282,12 @@ export default class Game extends cc.Component {
|
|
|
// mk.guide.curDes = `<color=8A4312><color=ff0000>继续生产${leftTimes}次</c>,很快就\n可以完成订单了!</color>`;
|
|
|
// }
|
|
|
} else {
|
|
|
- if(this.isGray)
|
|
|
- {
|
|
|
+ if (this.isGray) {
|
|
|
mk.tip.pop("完成订单即可提现");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
mk.tip.pop("订单已完成,快提现吧");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|