123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- const DWTool = require("./DWTool");
- class AlertManager {
- // 显示培养弹窗
- static showTrainAlert(targetUid, zIndex = 0) {
- DWTool.loadResPrefab("./prefabs/artist_train")
- .then((result) => {
- let artistTrain = cc.instantiate(result);
- artistTrain.zIndex = zIndex;
- artistTrain.getComponent('ArtistTrain').init(targetUid);
- let canvas = cc.find("Canvas");
- canvas.addChild(artistTrain);
- });
- };
- // 显示充值弹窗
- static showRechargeAlert(zIndex = 0) {
- DWTool.loadResPrefab("./prefabs/artist_train_alert")
- .then((result) => {
- let alert = cc.instantiate(result);
- alert.zIndex = zIndex;
- let canvas = cc.find("Canvas");
- canvas.addChild(alert);
- });
- };
- // 显示星探界面
- static showTalentAlert() {
- DWTool.loadResPrefab("./prefabs/share_dialog")
- .then((result) => {
- let talent = cc.instantiate(result);
- let canvas = cc.find("Canvas");
- canvas.addChild(talent);
- });
- };
- // 显示培养成功界面
- static showArtistTrainCompletion(data, zIndex = 0) {
-
- DWTool.loadResPrefab("./prefabs/artist_train_completion")
- .then((result) => {
-
- let alert = cc.instantiate(result);
- alert.zIndex = zIndex;
- let canvas = cc.find("Canvas");
- canvas.addChild(alert);
- alert.getComponent('ArtistTrainCompletion').init(data);
- });
- };
- // 艺人没有职业时弹窗提示
- static showArtistTrainNoJob(cb, zIndex = 0) {
- DWTool.loadResPrefab("./prefabs/artist_train_no_job")
- .then((result) => {
-
- let alert = cc.instantiate(result);
- alert.zIndex = zIndex;
- let canvas = cc.find("Canvas");
- canvas.addChild(alert);
- alert.getComponent('ArtistTrainNoJob').init(cb);
- });
- }
- // 召回艺人/举报艺人
- static showArtistOperationAlert() {
- DWTool.loadResPrefab("./prefabs/artist_operation_alert")
- .then((result) => {
- let alert = cc.instantiate(result);
- let canvas = cc.find("Canvas");
- canvas.addChild(alert);
- });
- }
- // 显示选择驻场艺人
- static showArtistResident() {
- DWTool.loadResPrefab("./prefabs/artist_resident")
- .then((result) => {
- let artistResident = cc.instantiate(result);
- let canvas = cc.find("Canvas");
- canvas.addChild(artistResident);
- });
- }
- static showNoticePopup() {
- DWTool.loadResPrefab("./prefabs/notice_popup")
- .then((result) => {
- let alert = cc.instantiate(result);
- let canvas = cc.find("Canvas");
- canvas.addChild(alert);
- });
- }
- }
- module.exports = AlertManager;
|