Commit b3a3076d authored by haiyoucuv's avatar haiyoucuv

更改

parent 933605a2
import { sendWebNet, sendWebNetWithToken, WebNetName } from "./Utils/WebNet/WebNet";
import { hideWaiting, showWaiting } from "db://assets/Module/UIFast";
import { AESDecrypt, AESEncrypt } from "./Utils/Crypto";
import store from "../store/store";
// const en = AESEncrypt(JSON.stringify({
// recordId: 232323,
......@@ -34,6 +35,7 @@ export default class GameMgr {
*/
async start() {
const {success, data} = await sendWebNetWithToken(WebNetName.start);
store.updateIndex();
if (!success) {
return false;
}
......
import Panel from "../../Module/Panel";
import { _decorator, Button, Label, Node } from "cc";
import { changeScene } from "db://assets/Module/UIFast";
import { changeScene, showToast } from "db://assets/Module/UIFast";
import { HomeScene } from "db://assets/Scripts/Scenes/HomeScene";
import GameMgr from "../GameMgr";
import store from "../../store/store";
import { MainGame } from "../Scenes/MainGame/MainGame";
const {ccclass, property} = _decorator;
......@@ -15,11 +18,11 @@ export default class NoPrizePanel extends Panel {
close: Node = null!;
@property(Node)
cancel: Node = null!;
again: Node = null!;
async start() {
this.close.on(Button.EventType.CLICK, this.onClose, this);
this.cancel.on(Button.EventType.CLICK, this.onClose, this);
this.again.on(Button.EventType.CLICK, this.clickAgain, this);
}
/**
......@@ -30,4 +33,14 @@ export default class NoPrizePanel extends Panel {
this.hidePanel();
}
clickAgain = async () => {
this.hidePanel();
if (store.homeInfo.leftTimes <= 0) {
showToast("没次数啦,明天再来吧!");
} else {
await GameMgr.ins.start();
changeScene(MainGame);
}
}
}
......@@ -25,7 +25,6 @@ export default class PrizePanel extends Panel {
img: Sprite = null!;
async start() {
console.log(123123)
this.close.on(Button.EventType.CLICK, this.onClose, this);
this.get.on(Button.EventType.CLICK, this.onClose, this);
......
......@@ -246,7 +246,7 @@
},
{
"__type__": "cc.Node",
"_name": "cancel",
"_name": "again",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
......@@ -757,7 +757,7 @@
"close": {
"__id__": 20
},
"cancel": {
"again": {
"__id__": 10
},
"_id": ""
......
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