123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- 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 = `<b><color=#613f16>余额:¥${(Global.userData.hb / 100).toFixed(2)}</c></b>`;
-
- 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) {},
- });
|