Commit fefa0b6f authored by haiyoucuv's avatar haiyoucuv

init

parent 0798113a
This diff is collapsed.
This diff is collapsed.
...@@ -12,15 +12,18 @@ export default class RulePanel extends Panel { ...@@ -12,15 +12,18 @@ export default class RulePanel extends Panel {
static bundle = "RulePanel"; static bundle = "RulePanel";
static skin = "RulePanel"; static skin = "RulePanel";
@property(Node) closeBtn: Node = null;
@property(Node) ruleNode: Node = null;
@property(Node) content: Node = null;
dom: HTMLDivElement; dom: HTMLDivElement;
async onLoad() { async onLoad() {
// await store.updateRule(); // await store.updateRule();
this.closeBtn.on(Button.EventType.CLICK, this.clickClose);
window["__clickRule__"] = this.clickClose;
}
protected onDestroy() {
window["__clickRule__"] = null;
this.dom && this.dom.remove();
this.dom = null;
} }
@render @render
...@@ -52,21 +55,31 @@ export default class RulePanel extends Panel { ...@@ -52,21 +55,31 @@ export default class RulePanel extends Panel {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
pointer-events: none;
"> ">
<div style=" <div style="
width: 8.35rem; width: 100%;
height: 4.55rem; height: 100%;
position: absolute; position: absolute;
top: 2rem; top: 0;
overflow: auto; overflow: auto;
pointer-events: auto;
"> ">
<img <img
src="${store.frontVariable.ruleImg}" src="${store.homeInfo.ruleImage}"
style="width: 100%;" style="width: 100%;"
> >
</div> </div>
<div style="
width: 0.65rem;
height: 0.65rem;
position: fixed;
left: 0.43rem;
top: 0.98rem;
background-image: url('//yun.duiba.com.cn/polaris/back.a1b432dc6caec8ef2ff6eaed85b5bdd03a38055a.png');
background-size: cover;
"
onclick="window.__clickRule__()"
></div>
</div> </div>
`; `;
......
...@@ -20,6 +20,7 @@ import { sendWebNet, WebNetName } from "db://assets/Scripts/Utils/WebNet/WebNet" ...@@ -20,6 +20,7 @@ import { sendWebNet, WebNetName } from "db://assets/Scripts/Utils/WebNet/WebNet"
import { BoxPanel } from "db://assets/Scripts/Panels/BoxPanel"; import { BoxPanel } from "db://assets/Scripts/Panels/BoxPanel";
import gameStore from "db://assets/Scripts/store/gameStore"; import gameStore from "db://assets/Scripts/store/gameStore";
import { GuideScene } from "db://assets/Scripts/Scenes/GuideScene"; import { GuideScene } from "db://assets/Scripts/Scenes/GuideScene";
import RulePanel from "db://assets/Scripts/Panels/RulePanel";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
...@@ -35,6 +36,10 @@ export class HomeScene extends Scene { ...@@ -35,6 +36,10 @@ export class HomeScene extends Scene {
@property(Node) startBtn: Node = null; @property(Node) startBtn: Node = null;
@property(Label) timesLabel: Label = null; @property(Label) timesLabel: Label = null;
@property(Node) ruleBtn: Node = null;
@property(Node) prizeBtn: Node = null;
@property(ProgressBar) progress: ProgressBar = null; @property(ProgressBar) progress: ProgressBar = null;
@property(Node) boxRoot: Node = null; @property(Node) boxRoot: Node = null;
...@@ -47,6 +52,8 @@ export class HomeScene extends Scene { ...@@ -47,6 +52,8 @@ export class HomeScene extends Scene {
onLoad() { onLoad() {
this.startBtn.on(Button.EventType.CLICK, this.clickStart, this); this.startBtn.on(Button.EventType.CLICK, this.clickStart, this);
this.ruleBtn.on(Button.EventType.CLICK, this.clickRule, this);
this.prizeBtn.on(Button.EventType.CLICK, this.clickPrize, this);
} }
async start() { async start() {
...@@ -55,6 +62,14 @@ export class HomeScene extends Scene { ...@@ -55,6 +62,14 @@ export class HomeScene extends Scene {
} }
} }
clickRule = () => {
showPanel(RulePanel);
};
clickPrize = () => {
// showPanel("PrizePanel");
}
@render @render
render() { render() {
const { const {
......
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