import Common5 from "../../Platform/th/Common5"; import PrefabManage from "../PrefabManager/PrefabManage"; import GameBase from "./GameBase"; const { ccclass, property } = cc._decorator; @ccclass export default class Feedback extends GameBase { @property(cc.ToggleContainer) toggleContainer: cc.ToggleContainer = null; @property(cc.EditBox) editBox: cc.EditBox = null; protected start(): void { for (let index = 0; index < this.toggleContainer.toggleItems.length; index++) { let element = this.toggleContainer.toggleItems[index]; element.isChecked = false; } } onClickClose() { this.node.removeFromParent(); this.node.destroy(); } onClickConfirm() { const feedbackType = { toggle1: '数据丢失', toggle2: '宣传不符', toggle3: '游戏卡死', toggle4: '无法看广告' } let type: string = null; let text: string = this.editBox.string; for (let index = 0; index < this.toggleContainer.toggleItems.length; index++) { const element = this.toggleContainer.toggleItems[index]; if (element.isChecked) { type = feedbackType[element.node.name]; break; } } if (type == null) { PrefabManage.showTextTips('请选择反馈类型!'); return; } else if (text == '') { PrefabManage.showTextTips('请输入反馈内容!'); return; } let msg = `玩家反馈-${type}-${text}`; Common5.ReportDY("inLevel", msg); PrefabManage.showTextTips('反馈内容已发送!'); console.log(msg); this.node.removeFromParent(); this.node.destroy(); } }