Files
fc/dev/project/library/imports/2c/2c46d047-b70a-48e8-961d-ae6be7da3c30.js
T

75 lines
1.7 KiB
JavaScript
Raw Normal View History

2026-05-24 10:21:26 +08:00
"use strict";
cc._RF.push(module, '2c46dBHtwpI6JYdrmvn2jww', 'cmp.bug.report.wnd');
// Scripts/mod/setting/cmps/cmp.bug.report.wnd.js
"use strict";
/******************************************************************
*
* BUG反馈界面
*
******************************************************************/
var BridgeWindow = require("bridge.window");
var MIN_WORDS = 20;
// 问题类型
var ReportTypes = {
Question: 1,
// 提问
Suggestion: 2,
// 游戏建议
Bug: 3,
// bug反馈
Append: 4 // 追问
};
cc.Class({
"extends": BridgeWindow,
properties: {
edtTitle: {
"default": null,
type: cc.EditBox
},
edtDetail: {
"default": null,
type: cc.EditBox
},
nodTypes: {
"default": null,
type: cc.Node
}
},
// 显示
onEnable: function onEnable() {
this.onTogType(ReportTypes.Bug);
},
// 关闭
onDisable: function onDisable() {},
// 类型切换
onTogType: function onTogType(_key) {
this.ctype = parseInt(_key) || 1;
var chds = this.nodTypes.children;
for (var i = 0; i < chds.length; ++i) {
var tp = chds[i];
var on = tp.name == "t" + this.ctype;
nx.gui.setActive(tp, "icon/on", on);
nx.gui.setActive(tp, "icon/off", !on);
}
},
// 点击提交
onTouchCommit: function onTouchCommit() {
var _this = this;
var title = this.edtTitle.string;
var detail = this.edtDetail.string;
if (nx.dt.strBytes(title) < MIN_WORDS || nx.dt.strBytes(detail) < MIN_WORDS) {
nx.tbox("BugReportTooShort");
return;
}
nx.bridge.game.reqCommitIssue(this.ctype, title, detail, function (_ret, _data) {
_this.close();
});
}
});
cc._RF.pop();