const DrawApi = require("../net/DrawApi"); const WeChat = require('../net/WeChat'); cc.Class({ extends: cc.Component, properties: { item: cc.Node, moneyTileRichText: cc.RichText, content: cc.Node, }, // LIFE-CYCLE CALLBACKS: onLoad () { /// 获取红包记录数据 this.moneyTileRichText.string = `余额:¥${(GameGlobal.userData.hb / 100).toFixed(2)}`; DrawApi.getDrawHbs((respondData) => { let reds = respondData.list; /// 如果有红包记录 if (reds != undefined || reds.length > 0) { for (let i = 0; i < reds.length; ++ i) { let contentItem = cc.instantiate(this.item); this.content.addChild(contentItem); contentItem.getComponent('DrawRedRecordItem').init(reds[i]); } } }, (err, code) => { console.log(err, code); }) }, start () { }, /// 点我提现 drawAction() { WeChat.jumpCustomerServices(true); }, closeAction() { this.node.destroy(); }, // update (dt) {}, });