import { Data } from "../../../mk/data/Data"; /** * 红包提现数据 * @author 薛鸿潇 */ export class CashNormalData extends Data { public init() { // this.initTestData();// 假数据 // 提现记录数据 this.getRecord() } public async getRecord() { let response = await mk.http.sendData('getCashRecord', {}); if (response.errcode != 0) { return; } console.log(response.data); if (response.data) { response.data.forEach(item_data => { for (const key in item_data) { item_data[key] = parseInt(item_data[key]); } }); this.list_data = response.data; this.initReceipTotalRMB(); } } /** 数据列表 */ public list_data: Array = []; /** * 标志位 - 是否刷新样式 */ public init_rmb_style = true; private _receip_total_rmb: number = 0; /** * 到账毛币总数 * - 单位 分 */ set receip_total_rmb(value: number) { this._receip_total_rmb = value; this.init_rmb_style = true; } get receip_total_rmb() { return this._receip_total_rmb; } /** * 初始化提现总数 */ private initReceipTotalRMB() { let temp_total_count = 0; const count = this.list_data.length; for (let i = 0; i < count; i++) { temp_total_count += this.list_data[i].amount; } this.receip_total_rmb = temp_total_count; } /** 客户端造 假数据 */ private initTestData() { for (let i = 0; i < 30; i++) { const id = i + 1; let obj = { /** 档位 */ cashType: mk.math.random(1, 10), applyTime: 1623399160, amount: i * 10, remain: i * 1000, CashMode: i % 2, /** 红包码 */ withdrawalCode: 'AABBC' + i, } this.list_data.push(obj); } } /** * 获取存在红包码的 数据列表 */ public getListDataHavCode() { let new_list_data = []; const l_count = this.list_data.length; for (let i = 0; i < l_count; i++) { if (this.list_data[i].withdrawalCode) { new_list_data.push(this.list_data[i]); } } return new_list_data; } // public cash_type = ['', 'BOSS提现', '每日提现', '夺宝提现', '钱庄提现', '招募任务提现', '每日招募提现', '累计招募提现', '', '彩蛋提现', '福袋提现', '福袋提现']; /** 提现类型 */ public cash_type = { 1: '红包提现',// 常规提现 2: '每日提现', 3: '夺宝提现', 4: '富翁银行提现', 5: '裂变任务提现', 6: '裂变每日提现', 7: '裂变累计提现', 8: '彩蛋任务提现', 9: '常规彩蛋任务提现', 10: '福袋提现',// 视频红包提现 11: '大额福袋',// 视频红包提现(公众号) 12: '存钱罐提现', 13: '签到提现',// 现金提现 } } /** * 提现记录类型 */ export type TCashList = { /** * 提现类型 */ cashType: number, /** 提现时间 */ applyTime: number, /** 提现金额,单位分 */ amount: number, /** 剩余红包币,1元===10000红包币 */ remain: number, /** 2:有红包码,其他无红包码 */ CashMode: number, /** 红包码 */ withdrawalCode: string, }