|
|
@@ -1,4 +1,5 @@
|
|
|
-import { RewardState } from "../../../data/GameData";
|
|
|
+import { RewardState, RewardType } from "../../../data/GameData";
|
|
|
+import { CSignType } from "../../../data/module/SignData";
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
/**
|
|
|
@@ -18,19 +19,18 @@ export default class SignIconItem extends cc.Component {
|
|
|
|
|
|
@property({ displayName: '天数', type: cc.Label })
|
|
|
private lbl_day: cc.Label = null!;
|
|
|
- @property({ type: cc.Node, displayName: '蒙版' })
|
|
|
+ @property({ displayName: '蒙版', type: cc.Node })
|
|
|
private node_mask: cc.Node = null!;
|
|
|
- @property({ type: cc.Node, displayName: '勾' })
|
|
|
+ @property({ displayName: '勾', type: cc.Node })
|
|
|
private node_gou: cc.Node = null!;
|
|
|
|
|
|
/** 数据 */
|
|
|
- private icon_data = {
|
|
|
+ private icon_data: CSignType = {
|
|
|
id: 0,
|
|
|
- reward_type: 0,
|
|
|
- count: 0,
|
|
|
- login_day: 0,
|
|
|
- video_limit: 0,
|
|
|
- state: RewardState.none,
|
|
|
+ rewardType: 0,
|
|
|
+ rewardNum: 0,
|
|
|
+ loginDay: 0,
|
|
|
+ videoNum: 0
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -45,12 +45,13 @@ export default class SignIconItem extends cc.Component {
|
|
|
* @param icon_data 数据
|
|
|
*/
|
|
|
private initIcon(icon_data) {
|
|
|
- if (!icon_data) {
|
|
|
+ this.icon_data = icon_data;
|
|
|
+ if (!this.icon_data) {
|
|
|
this.node.active = false;
|
|
|
return
|
|
|
}
|
|
|
- this.lbl_day.string = '第' + icon_data.login_day + '天';
|
|
|
- if (icon_data.reward_type) {
|
|
|
+ this.lbl_day.string = '第' + this.icon_data.loginDay + '天';
|
|
|
+ if (this.icon_data.rewardType == RewardType.rmb || this.icon_data.rewardType == RewardType.pigRmb) {
|
|
|
this.node_cash.active = true;
|
|
|
this.node_redbag.active = false;
|
|
|
this.lbl_day.node.getComponent(cc.LabelOutline).color = cc.color(DayOutLineColor.cash);
|
|
|
@@ -59,10 +60,9 @@ export default class SignIconItem extends cc.Component {
|
|
|
this.node_redbag.active = true;
|
|
|
this.lbl_day.node.getComponent(cc.LabelOutline).color = cc.color(DayOutLineColor.red_bag);
|
|
|
}
|
|
|
- this.icon_data = icon_data;
|
|
|
|
|
|
// 状态样式
|
|
|
- let state = gData.sign.getStateByDay(icon_data.login_day);
|
|
|
+ let state = gData.sign.getStateByDay(this.icon_data.loginDay);
|
|
|
if (state == RewardState.none) {
|
|
|
this.node_mask.active = true;
|
|
|
this.node_gou.active = true;
|