|
|
@@ -1,18 +1,23 @@
|
|
|
+import { Fun } from "../data/GData";
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
|
|
@ccclass
|
|
|
export default class FunBtns extends cc.Component {
|
|
|
- @property({ type: cc.Node, displayName: "存钱罐" })
|
|
|
+ @property({ type: cc.Node, displayName: "互推" })
|
|
|
btn1: cc.Node = null;
|
|
|
@property({ type: cc.Node, displayName: "转盘" })
|
|
|
btn2: cc.Node = null;
|
|
|
- @property({ type: cc.Node, displayName: "签到" })
|
|
|
+ @property({ type: cc.Node, displayName: "裂变" })
|
|
|
btn3: cc.Node = null;
|
|
|
- @property({ type: cc.Node, displayName: "提现" })
|
|
|
+ @property({ type: cc.Node, displayName: "存钱罐" })
|
|
|
btn4: cc.Node = null;
|
|
|
- @property({ type: cc.Node, displayName: "互推" })
|
|
|
+ @property({ type: cc.Node, displayName: "福袋" })
|
|
|
btn5: cc.Node = null;
|
|
|
+ @property({ type: cc.Node, displayName: "签到" })
|
|
|
+ btn6: cc.Node = null;
|
|
|
+ @property({ type: cc.Node, displayName: "常规提现" })
|
|
|
+ btn7: cc.Node = null;
|
|
|
|
|
|
onLoad() {
|
|
|
|
|
|
@@ -24,24 +29,25 @@ export default class FunBtns extends cc.Component {
|
|
|
}
|
|
|
|
|
|
init() {
|
|
|
- // data功能开启
|
|
|
- let data = [1, 1, 1, 1, 1];
|
|
|
+ let data = gData.gameData.funOpenData;
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
- if (data[i] == 0) {
|
|
|
- this['btn' + (i + 1)].active = data[i] == 1;
|
|
|
+ if (data[i] == '0') {
|
|
|
+ this['btn' + (i + 1)].active = data[i] == "1";
|
|
|
}
|
|
|
}
|
|
|
+ this.updateRedeem();
|
|
|
+ }
|
|
|
+
|
|
|
+ private updateRedeem() {
|
|
|
+ this.btn1.active = gData.redeem.showBtn;
|
|
|
}
|
|
|
|
|
|
|
|
|
update() {
|
|
|
if (gData.redeem.init_btnChange) {
|
|
|
- gData.redeem.showBtn
|
|
|
+ this.updateRedeem();
|
|
|
+ gData.redeem.init_btnChange = false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- lateUpdate() {
|
|
|
- gData.redeem.init_btnChange = false;
|
|
|
- }
|
|
|
}
|
|
|
|