|
|
@@ -1,25 +1,75 @@
|
|
|
-// Learn TypeScript:
|
|
|
-// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
|
|
-// Learn Attribute:
|
|
|
-// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
|
|
-// Learn life-cycle callbacks:
|
|
|
-// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
-
|
|
|
+/**
|
|
|
+ * 获取奖励界面-红包
|
|
|
+ * @author 薛鸿潇
|
|
|
+ */
|
|
|
@ccclass
|
|
|
-export default class reward extends cc.Component {
|
|
|
+export default class Reward extends cc.Component {
|
|
|
|
|
|
@property({ displayName: '领取按钮', type: cc.Button })
|
|
|
private btn_receive: cc.Button = null;
|
|
|
|
|
|
+ @property({ displayName: '幸运红包', type: cc.Node })
|
|
|
+ private node_luck: cc.Node = null;
|
|
|
+ @property({ displayName: '通关红包', type: cc.Node })
|
|
|
+ private node_mission: cc.Node = null;
|
|
|
+
|
|
|
+ @property({ displayName: 'spr提现进度', type: cc.Sprite })
|
|
|
+ private spr_cash_out: cc.Sprite = null;
|
|
|
+ @property({ displayName: 'lbl提现进度', type: cc.Label })
|
|
|
+ private lbl_cash_out: cc.Label = null;
|
|
|
+ @property({ displayName: '提现金额', type: cc.Label })
|
|
|
+ private lbl_cash: cc.Label = null;
|
|
|
+
|
|
|
onLoad() {
|
|
|
|
|
|
}
|
|
|
|
|
|
start() {
|
|
|
+ /** 盖子 */
|
|
|
+ this.initLid();
|
|
|
+ }
|
|
|
+
|
|
|
+ update(dt) {
|
|
|
+ if (gData.reward.init_luck_style) {
|
|
|
+ gData.reward.init_luck_style = false;
|
|
|
+ this.initLid();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初始化封面样式
|
|
|
+ */
|
|
|
+ private initLid() {
|
|
|
+ if (gData.reward.is_luck) {
|
|
|
+ this.node_luck.active = true;
|
|
|
+ this.node_mission.active = false;
|
|
|
+ } else {
|
|
|
+ this.node_luck.active = false;
|
|
|
+ this.node_mission.active = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得奖励
|
|
|
+ */
|
|
|
+ private clickGetReward() {
|
|
|
+ cc.log('获取奖励:', gData.reward.data);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 提现操作
|
|
|
+ */
|
|
|
+ private clickCashOut() {
|
|
|
+ cc.log('提现:');
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下一关操作
|
|
|
+ */
|
|
|
+ private clickNextMission() {
|
|
|
|
|
|
}
|
|
|
|
|
|
- // update (dt) {}
|
|
|
}
|