const DWTool = require("../utils/DWTool"); const WeChat = require('../net/WeChat'); const GameModule = require("../utils/GameModule"); cc.Class({ extends: cc.Component, properties: { titleSprite: cc.Sprite, starIconSprite: cc.Sprite, descLabel: cc.Label, }, // LIFE-CYCLE CALLBACKS: // onLoad () {}, start () { }, init(giftIndex, giftData) { let imageId = 50000 + giftData.starId; DWTool.loadResSpriteFrame(`./textures/star_stand/stand_${imageId}`) .then((spriteFrame) => { this.starIconSprite.spriteFrame = spriteFrame; }).catch((err) => { console.log(err); }); let path = './textures/store/800' + 4; DWTool.loadResSpriteFrame(path + giftIndex + 3).then((spriteFrame) => { this.titleSprite.spriteFrame = spriteFrame; }).catch((msg) => { console.log(msg); }); this.descLabel.string = giftData.desc; }, buyAction() { GameModule.audioMng.playClickButton(); WeChat.jumpCustomerServices(); }, closeAction() { GameModule.audioMng.playClickButton(); this.node.destroy(); }, // update (dt) {}, });