|
|
@@ -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);
|
|
|
}
|
|
|
}
|
|
|
@@ -200,7 +199,7 @@ export default class Game extends cc.Component {
|
|
|
mk.data.sendDataEvent(DataEventId.loading, 'loading结束');
|
|
|
}
|
|
|
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
gData.safeDepositBoxData.deleteJGTags();
|
|
|
}, 1000)
|
|
|
}
|
|
|
@@ -486,17 +485,16 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
/** 点击福利 */
|
|
|
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");
|
|
|
|
|
|
let isClickIcon = mk.storage.getStorage("clickBlessIcon")
|
|
|
- if(!isClickIcon){
|
|
|
+ if (!isClickIcon) {
|
|
|
JsbSystem.addJGTags("点击过福利icon");
|
|
|
mk.storage.setStorage("clickBlessIcon", 1);
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
mk.tip.pop(`订单提现${gData.gameData.welfareOpenLimit}次后开启`);
|
|
|
}
|
|
|
}
|
|
|
@@ -1053,8 +1051,8 @@ export default class Game extends cc.Component {
|
|
|
this.node_getOrderReward.getComponent(cc.Animation).stop();
|
|
|
this.node_orderHand.active = false;
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public clickGetOrderRewardBtn() {
|
|
|
@@ -1086,8 +1084,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, "提现触发上限");
|
|
|
}
|
|
|
@@ -1101,13 +1098,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;
|
|
|
@@ -1116,22 +1113,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;
|
|
|
@@ -1146,19 +1140,17 @@ export default class Game extends cc.Component {
|
|
|
gData.safeDepositBoxData.updateQipao();
|
|
|
gData.cashNormal.getRecord();
|
|
|
|
|
|
- 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;
|
|
|
}
|
|
|
@@ -1232,13 +1224,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);
|
|
|
@@ -1257,8 +1248,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) {
|
|
|
@@ -1305,13 +1295,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("订单已完成,快提现吧");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -1356,14 +1345,32 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
//富翁银行
|
|
|
/** 点击富翁银行 */
|
|
|
- public onClickSafeDepositBox() {
|
|
|
- mk.data.sendDataEvent(DataEventId.button_click, "富翁银行icon");
|
|
|
+ public async onClickSafeDepositBox() {
|
|
|
+ mk.audio.playEffect('button');
|
|
|
+ console.log(`currentRichBankCashTaskIndex 22======== ${gData.safeDepositBoxData.currentRichBankCashTaskIndex}`);
|
|
|
+ if (gData.safeDepositBoxData.currentRichBankCashTaskIndex) {
|
|
|
+ mk.ui.openPanel("module/safeDepositBox/SafeDepositBox");
|
|
|
+ mk.data.sendDataEvent(DataEventId.button_click, "富翁银行icon");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- public setJGTags(){
|
|
|
+ isAdd = true;
|
|
|
+ public setJGTags() {
|
|
|
//JsbSystem.addJGTags("富翁银行任务");
|
|
|
- let curDes = `<color=8A4312>再生产${23}次,就可以收获\n啦,完成订单立即<color=ff0000>提现</color>!</color>`;
|
|
|
- mk.guide.open(11, curDes);
|
|
|
+ //let curDes = `<color=8A4312>再生产${23}次,就可以收获\n啦,完成订单立即<color=ff0000>提现</color>!</color>`;
|
|
|
+ //mk.guide.open(11, curDes);
|
|
|
+
|
|
|
+ if (this.isAdd) {
|
|
|
+ this.isAdd = false;
|
|
|
+ JsbSystem.addJGTags("开玩笑");
|
|
|
+ } else {
|
|
|
+ this.isAdd = true;
|
|
|
+ JsbSystem.deleteTags("开玩笑");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public getAllTags() {
|
|
|
+ JsbSystem.getAllTags();
|
|
|
}
|
|
|
}
|
|
|
|