44fa1ecc-7d51-4cf6-8c85-6b51e158d85d.js
6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
"use strict";
cc._RF.push(module, '44fa17MfVFM9oyFa1HhWNhd', 'DiscoverViewPresenter');
// script/game/ui/presenter/DiscoverViewPresenter.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const simba_sdk_1 = require("simba-sdk");
const AVG_1 = require("../../../avg/AVG");
const PresenterBase_1 = require("../../../common/classbase/PresenterBase");
const UIManager_1 = require("../../../common/gameplay/managers/UIManager");
const GameModelManager_1 = require("../../model/GameModelManager");
const PresenterCCViewFactory_1 = require("../PresenterCCViewFactory");
const DiscoverView_1 = require("../view/type/DiscoverView");
const DiscoverSettingViewPresenter_1 = require("./discover/DiscoverSettingViewPresenter");
const GameTextData_1 = require("../../../common/gameplay/gamedata/GameTextData");
const Enums_1 = require("../../Enums");
const QRCodeViewPresenter_1 = require("./QRCodeViewPresenter");
const GameDotMgr_1 = require("../../GameDotMgr");
const ProductionTeamViewPresenter_1 = require("./discover/ProductionTeamViewPresenter");
let DiscoverViewPresenter = /** @class */ (() => {
let DiscoverViewPresenter = class DiscoverViewPresenter extends PresenterBase_1.Presenter {
constructor() {
super();
this.itemClickCallBack = (itemType) => {
switch (itemType) {
case Enums_1.DiscoverItemType.Settings:
this.hideGameClubBtn();
UIManager_1.UIManager.pushPresenter(DiscoverSettingViewPresenter_1.DiscoverSettingViewPresenter, undefined);
break;
case Enums_1.DiscoverItemType.Forum:
break;
case Enums_1.DiscoverItemType.CustomerService:
this.hideGameClubBtn();
//点击二维码打点
GameDotMgr_1.default.getInstance().dotClickUI("CustomerService");
UIManager_1.UIManager.pushPresenter(QRCodeViewPresenter_1.default, undefined);
break;
case Enums_1.DiscoverItemType.ProductionTeam:
this.hideGameClubBtn();
//点击二维码打点
UIManager_1.UIManager.pushPresenter(ProductionTeamViewPresenter_1.default, undefined);
break;
default:
UIManager_1.UIManager.showToast(GameModelManager_1.GameModelManager.getLanguageTxt(GameTextData_1.GameTextData.GAME_TEXT_DEVELOPING_VALUE));
break;
}
};
this.onCopyInfo = async () => {
await simba_sdk_1.SDK.setClipboardData(this._viewProps.manId);
UIManager_1.UIManager.showToast("用户ID:" + this._viewProps.manId);
};
this.onForceEnterDiscoverSubView = (itemType) => {
this.itemClickCallBack(itemType);
};
this.onPlayerOptionSkin = () => {
this.initViewProps();
this.initItemConfig();
this._view.updateProps(this._viewProps);
};
}
static isShowRedDot() {
return false;
}
initViewProps() {
this._viewProps = {
manName: "",
manId: "",
manIcon: "",
onCopyInfo: this.onCopyInfo,
onItemClick: this.itemClickCallBack
};
}
initItemConfig() {
var _a, _b;
this._viewProps.manName = AVG_1.GameRecord.globalVariables.playerName;
if ((_a = simba_sdk_1.SDK.getLoginInfo()) === null || _a === void 0 ? void 0 : _a.playerId) {
this._viewProps.manId = (_b = simba_sdk_1.SDK.getLoginInfo()) === null || _b === void 0 ? void 0 : _b.playerId;
}
let player = GameModelManager_1.GameModelManager.getPlayerData();
this._viewProps.manName = player.getConfig().name;
this._viewProps.manIcon = player.getHeadIcon();
}
onOpen() {
super.onOpen(undefined);
this._disposable.add(GameModelManager_1.GameModelManager.PlayerOptionSkin.on(this.onPlayerOptionSkin));
this._disposable.add(GameModelManager_1.GameModelManager.ForceEnterDiscoverSubView.on(this.onForceEnterDiscoverSubView));
this.onShow();
}
onShow() {
super.onShow();
this.initViewProps();
this.initItemConfig();
this.view.setProps(this._viewProps);
this.view.createGameClubBtn();
this.showGameClubBtn();
}
onEnterBackground() {
super.onEnterBackground();
this.hideGameClubBtn();
}
onEnterForeground() {
super.onEnterForeground();
this.showGameClubBtn();
}
onHide() {
super.onHide();
simba_sdk_1.SDK.destroyGameClubButton();
}
showGameClubBtn() {
simba_sdk_1.SDK.showGameClubButton();
}
hideGameClubBtn() {
simba_sdk_1.SDK.hideGameClubButton();
}
};
DiscoverViewPresenter.uuid = "DiscoverViewPresenter";
DiscoverViewPresenter = __decorate([
PresenterCCViewFactory_1.RegPresenter(DiscoverView_1.DiscoverViewType)
], DiscoverViewPresenter);
return DiscoverViewPresenter;
})();
exports.default = DiscoverViewPresenter;
cc._RF.pop();