|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-03-21 10:17:49
|
|
* @Date: 2025-03-21 10:17:49
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-04-08 11:18:17
|
|
|
|
|
|
|
+ * @LastEditTime: 2025-04-09 18:42:05
|
|
|
* @Description: 提现记录
|
|
* @Description: 提现记录
|
|
|
*/
|
|
*/
|
|
|
import { _decorator, Node } from "cc";
|
|
import { _decorator, Node } from "cc";
|
|
@@ -12,6 +12,8 @@ import List from "../ui/List";
|
|
|
import { Label } from "cc";
|
|
import { Label } from "cc";
|
|
|
import { oops } from "db://oops-framework/core/Oops";
|
|
import { oops } from "db://oops-framework/core/Oops";
|
|
|
import { UIID } from "../../common/config/GameUIConfig";
|
|
import { UIID } from "../../common/config/GameUIConfig";
|
|
|
|
|
+import { DeviceUtil } from "db://oops-framework/core/utils/DeviceUtil";
|
|
|
|
|
+import { smc } from "../../common/SingletonModuleComp";
|
|
|
|
|
|
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
|
@@ -24,25 +26,39 @@ export class WithdrawalRecordViewComp extends CCComp {
|
|
|
recordList: List = null!;
|
|
recordList: List = null!;
|
|
|
|
|
|
|
|
data: any[] = [];
|
|
data: any[] = [];
|
|
|
|
|
+ @property(Node)
|
|
|
|
|
+ noRecord: Node = null!;
|
|
|
|
|
|
|
|
- start() {
|
|
|
|
|
-
|
|
|
|
|
- const data = {
|
|
|
|
|
- state: "提现成功",
|
|
|
|
|
- time: "2025-03-20 17:30",
|
|
|
|
|
- money: 0.1,
|
|
|
|
|
- status: oops.random.getRandomInt(0, 3, 3)
|
|
|
|
|
|
|
+ @property(Node)
|
|
|
|
|
+ content: Node = null!;
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ start() {
|
|
|
|
|
+ this.setButton();
|
|
|
|
|
|
|
|
- for (let i = 0; i < 20; i++) {
|
|
|
|
|
- data.money = i;
|
|
|
|
|
- this.data.push(data);
|
|
|
|
|
- }
|
|
|
|
|
- this.recordList.numItems = this.data.length;
|
|
|
|
|
|
|
|
|
|
- this.setButton();
|
|
|
|
|
// const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
|
// const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
|
|
|
|
+ if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
|
|
|
|
|
+ const count = smc.account.AccountModel.recordList.length;
|
|
|
|
|
+ this.noRecord.active = count <= 0;
|
|
|
|
|
+ this.content.active = count > 0;
|
|
|
|
|
+ if (count > 0) {
|
|
|
|
|
+ this.data = smc.account.AccountModel.recordList;
|
|
|
|
|
+ this.recordList.numItems = this.data.length;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ amount: 0.01,
|
|
|
|
|
+ payMethod: 1, //1支付宝 2微信
|
|
|
|
|
+ createTime: "2025-04-09 18:09:09",
|
|
|
|
|
+ successTime: "2025-04-09 18:09:09",
|
|
|
|
|
+ status: oops.random.getRandomInt(0, 4)
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let i = 0; i < 20; i++) {
|
|
|
|
|
+ data.amount = i;
|
|
|
|
|
+ this.data.push(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.recordList.numItems = this.data.length;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -50,23 +66,35 @@ export class WithdrawalRecordViewComp extends CCComp {
|
|
|
private onListRender(item: Node, idx: number) {
|
|
private onListRender(item: Node, idx: number) {
|
|
|
// item.getComponentInChildren(Label)!.string = this.data[idx] + '';
|
|
// item.getComponentInChildren(Label)!.string = this.data[idx] + '';
|
|
|
const data = this.data[idx];
|
|
const data = this.data[idx];
|
|
|
|
|
+ let str: string = ""
|
|
|
|
|
+ switch (data.status) {
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ str = "待审核"
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ str = "提现成功"
|
|
|
|
|
+ break
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ str = "提现失败"
|
|
|
|
|
+ break
|
|
|
|
|
+ case 4:
|
|
|
|
|
+ str = "已拒绝"
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const stateLabel = item.getChildByName("lab_state")?.getComponent(Label);
|
|
const stateLabel = item.getChildByName("lab_state")?.getComponent(Label);
|
|
|
- if (stateLabel) stateLabel.string = data.state;
|
|
|
|
|
|
|
+ if (stateLabel) stateLabel.string = str;
|
|
|
|
|
|
|
|
const timeLabel = item.getChildByName("lab_time")?.getComponent(Label);
|
|
const timeLabel = item.getChildByName("lab_time")?.getComponent(Label);
|
|
|
- if (timeLabel) timeLabel.string = data.time;
|
|
|
|
|
|
|
+ if (timeLabel) timeLabel.string = data.createTime;
|
|
|
|
|
|
|
|
const moneyLabel = item.getChildByName("lab_money")?.getComponent(Label);
|
|
const moneyLabel = item.getChildByName("lab_money")?.getComponent(Label);
|
|
|
- if (moneyLabel) moneyLabel.string = data.money + "元";
|
|
|
|
|
- //TS原生随机数0 或者1
|
|
|
|
|
- const randomNum = Math.random() > 0.5 ? 0 : 1;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (moneyLabel) moneyLabel.string = data.amount + "元";
|
|
|
|
|
+ //TS原生随机数0 或者1
|
|
|
const statusNode1 = item.getChildByName("record_state1");
|
|
const statusNode1 = item.getChildByName("record_state1");
|
|
|
- if (statusNode1) statusNode1.active = randomNum == 0;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (statusNode1) statusNode1.active = data.status == 2;
|
|
|
const statusNode2 = item.getChildByName("record_state2");
|
|
const statusNode2 = item.getChildByName("record_state2");
|
|
|
- if (statusNode2) statusNode2.active = randomNum == 1;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (statusNode2) statusNode2.active = data.status != 2;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|