|
|
@@ -36,9 +36,46 @@ export default class RedBagCashItem extends cc.Component {
|
|
|
public async setItemData(item_data) {
|
|
|
await this.initStyle(item_data);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初始化样式
|
|
|
+ * @param item_data 条目数据
|
|
|
+ */
|
|
|
private initStyle(item_data) {
|
|
|
this.item_data = item_data;
|
|
|
- // this.item_data.
|
|
|
+ this.lbl_red_value.string = `${this.item_data.type_value}`;
|
|
|
+ this.lbl_rmb_value.string = this.item_data.money + '元';
|
|
|
+
|
|
|
+ if (this.item_data.index <= gData.redBagCash.cash_bar) {
|
|
|
+ // 已提现
|
|
|
+ this.node_none.active = true;
|
|
|
+ this.node_lock.active = false;
|
|
|
+ this.node_unlock.active = false;
|
|
|
+ } else {
|
|
|
+ // 可提现
|
|
|
+ if (gData.gameData.gameData.redMoney >= this.item_data.type_value) {
|
|
|
+ this.node_none.active = false;
|
|
|
+ this.node_lock.active = false;
|
|
|
+ this.node_unlock.active = true;
|
|
|
+ } else {
|
|
|
+ // 未达成
|
|
|
+ this.node_none.active = false;
|
|
|
+ this.node_lock.active = true;
|
|
|
+ this.node_unlock.active = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 提现操作
|
|
|
+ */
|
|
|
+ private clickCashOP() {
|
|
|
+ // if (!gData.redBagCash.cash_enable) return;
|
|
|
+ if (this.item_data.index > gData.redBagCash.cash_bar) {
|
|
|
+ mk.tip.pop('请按顺序提现');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ gData.redBagCash.cashOP();
|
|
|
}
|
|
|
|
|
|
}
|