|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-03-20 17:53:50
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-04-24 17:21:52
|
|
|
+ * @LastEditTime: 2025-04-24 19:10:25
|
|
|
* @Description: 红包提现
|
|
|
*/
|
|
|
import { _decorator, Label, Node } from "cc";
|
|
|
@@ -32,10 +32,14 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
|
|
|
@property(Label)
|
|
|
lab_tips: Label = null!;
|
|
|
|
|
|
+ @property(Label)
|
|
|
+ lab_hbCoin: Label = null!;
|
|
|
+
|
|
|
+ @property(Label)
|
|
|
+ lab_wxCash: Label = null!;
|
|
|
+
|
|
|
data: any = {
|
|
|
tasklist: [],
|
|
|
- wxCash: 0,
|
|
|
- hbCoin: 0,
|
|
|
goldNum: 0
|
|
|
};
|
|
|
start() {
|
|
|
@@ -43,8 +47,10 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
|
|
|
this.addEvent();
|
|
|
DCHandler.inst.reportData(3000900);
|
|
|
this.data.taskList = smc.game.GameModel.taskList;
|
|
|
- this.data.wxCash = smc.game.GameModel.wxCash;
|
|
|
- this.data.hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
|
|
|
+ let wxCash = smc.game.GameModel.wxCash;
|
|
|
+ let hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
|
|
|
+ this.lab_wxCash.string = `${wxCash}`;
|
|
|
+ this.lab_hbCoin.string = `${hbCoin}`;
|
|
|
this.data.goldNum = smc.account.AccountModel.goldCoin;
|
|
|
if (this.data.taskList.length > 0) {
|
|
|
this.recordList.numItems = this.data.taskList.length;
|
|
|
@@ -58,7 +64,6 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
|
|
|
oops.message.on(GameEvent.updateHbAndWxCoin, this.updateCoin, this);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private onListRender(item: Node, idx: number) {
|
|
|
const itemView: RedPackeItemView | null = item.getComponent(RedPackeItemView);
|
|
|
if (itemView) {
|
|
|
@@ -68,11 +73,11 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
|
|
|
|
|
|
|
|
|
updateList() {
|
|
|
- // console.log("更新提现记录信息", this.data.wxCash);
|
|
|
this.data.taskList = smc.game.GameModel.taskList;
|
|
|
- this.data.wxCash = smc.game.GameModel.wxCash;
|
|
|
- const hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
|
|
|
- this.data.hbCoin = Number(hbCoin);
|
|
|
+ let wxCash = smc.game.GameModel.wxCash;
|
|
|
+ let hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
|
|
|
+ this.lab_wxCash.string = `${wxCash}`;
|
|
|
+ this.lab_hbCoin.string = `${hbCoin}`;
|
|
|
this.data.goldNum = smc.account.AccountModel.goldCoin;
|
|
|
this.recordList.numItems = 0;
|
|
|
if (this.data.taskList.length > 0) {
|
|
|
@@ -83,11 +88,13 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
|
|
|
}
|
|
|
|
|
|
updateCoin() {
|
|
|
- this.data.wxCash = smc.game.GameModel.wxCash;
|
|
|
- console.log("111111111111111111111")
|
|
|
- const hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
|
|
|
- console.log("22222222222222222")
|
|
|
- this.data.hbCoin = Number(hbCoin);
|
|
|
+ console.log("更新红包币和微信币")
|
|
|
+ let wxCash = smc.game.GameModel.wxCash;
|
|
|
+ console.log("wxCash", wxCash);
|
|
|
+ let hbCoin = Format.formatRedPacketCoin(smc.account.AccountModel.hbCoin);
|
|
|
+ console.log("hbCoin", hbCoin);
|
|
|
+ this.lab_wxCash.string = `${wxCash}`;
|
|
|
+ this.lab_hbCoin.string = `${hbCoin}`;
|
|
|
}
|
|
|
|
|
|
private btn_back() {
|
|
|
@@ -108,7 +115,7 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
|
|
|
|
|
|
private async btn_withdrawal() {
|
|
|
//全部提现
|
|
|
- if (this.data.wxCash >= 0.1) {
|
|
|
+ if (smc.game.GameModel.wxCash >= 0.1) {
|
|
|
ServerHandler.inst.HbReward();
|
|
|
DCHandler.inst.reportData(3000900, 1001);
|
|
|
} else {
|
|
|
@@ -127,4 +134,26 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ btn_text() {
|
|
|
+ const info = {
|
|
|
+ "ssid": "730596b822fe47b09d48be6bd41d085e",
|
|
|
+ "props": {
|
|
|
+ "1004": 44278,
|
|
|
+ "1005": 1837207,
|
|
|
+ "1006": 6,
|
|
|
+ "1007": 129,
|
|
|
+ "2001": 2,
|
|
|
+ "8001": 140,
|
|
|
+ "9001": 2
|
|
|
+ },
|
|
|
+ "changes": {
|
|
|
+ "1004": -500000,
|
|
|
+ "8001": 50
|
|
|
+ },
|
|
|
+ "money": 0.04
|
|
|
+ }
|
|
|
+
|
|
|
+ ServerHandler.inst.onHbReward(JSON.stringify(info));
|
|
|
+ }
|
|
|
+
|
|
|
}
|