9a23ef30-372d-4009-a04f-9b41a7c3944c.js
4.86 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
"use strict";
cc._RF.push(module, '9a23e8wNy1ACaBPm0Gnw5RM', 'PlotStopViewPresenter');
// script/game/ui/presenter/PlotStopViewPresenter.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 });
// import { DailyQuestType } from "../../../avg/EditorEnums";
const PresenterBase_1 = require("../../../common/classbase/PresenterBase");
const GameEnumData_1 = require("../../../common/gameplay/gamedata/GameEnumData");
const GameTextData_1 = require("../../../common/gameplay/gamedata/GameTextData");
const UIManager_1 = require("../../../common/gameplay/managers/UIManager");
const Enums_1 = require("../../Enums");
const GameDotMgr_1 = require("../../GameDotMgr");
const GameModelManager_1 = require("../../model/GameModelManager");
const PresenterCCViewFactory_1 = require("../PresenterCCViewFactory");
const PlotStopView_1 = require("../view/type/PlotStopView");
let PlotStopViewPresenter = /** @class */ (() => {
let PlotStopViewPresenter = class PlotStopViewPresenter extends PresenterBase_1.Presenter {
constructor() {
super();
this.unlockPlotCallbackFunc = () => {
};
this.onAdBtnOption = (optionType, adType, ret) => {
let location = Enums_1.CommonLocation.Nextplot;
if (adType === "share") {
GameDotMgr_1.default.getInstance().dotShare(optionType, Enums_1.ShowLocationType.Share + location);
}
if (adType === "video") {
GameDotMgr_1.default.getInstance().dotVideo(optionType, Enums_1.ShowLocationType.Video + location);
}
if (optionType === Enums_1.ShowType.FINISH && ret && adType === "video") {
// GameModelManager.addDailyTasks(DailyQuestType.Dq_AdsWatch, 1);
}
};
this.onAddRes = (type) => {
if (type === "video") {
GameModelManager_1.GameModelManager.dealBlockedPlot(true);
}
else {
if (cc.sys.browserType == cc.sys.BROWSER_TYPE_CHROME) {
GameModelManager_1.GameModelManager.dealBlockedPlot(true);
}
else {
UIManager_1.UIManager.showToast(GameModelManager_1.GameModelManager.getLanguageTxt(GameTextData_1.GameTextData.GAME_TEXT_DEAL_BLOCKED_PLOT_FAIL));
}
}
this.view.closeView();
};
}
initViewProps() {
this._viewProps = {
unlockPlotCallbackFunc: this.unlockPlotCallbackFunc,
onAdBtnOption: this.onAdBtnOption,
onAddRes: this.onAddRes,
onCancelAdCallback: this.onCancelAdCallback,
};
}
onOpen() {
super.onOpen(undefined);
this.onShow();
}
onShow() {
super.onShow();
this.initViewProps();
this._view.setProps(this._viewProps);
this.view.adButton.loadSVConfig();
let t = this.view.getSvBtnType();
if (t && t === "share" || t === "video") {
this.onAdBtnOption(Enums_1.ShowType.SHOW, t);
}
}
onClose() {
super.onClose();
}
onEnterForeground() {
super.onEnterForeground();
}
onEnterBackground() {
super.onEnterBackground();
}
onHide() {
}
onCancelAdCallback(type) {
let content = "";
if (type == GameEnumData_1.GetRewardType.Ad) {
content = GameModelManager_1.GameModelManager.getLanguageTxt(GameTextData_1.GameTextData.GAME_TEXT_MALL_GIFT_ADFAILED_VALUE);
}
else {
content = GameModelManager_1.GameModelManager.getLanguageTxt(GameTextData_1.GameTextData.GAME_TEXT_MALL_GIFT_SHAREFAILED_VALUE);
}
UIManager_1.UIManager.showToast(content);
this.view.closeView();
}
};
PlotStopViewPresenter.uuid = "PlotStopViewPresenter";
PlotStopViewPresenter = __decorate([
PresenterCCViewFactory_1.RegPresenter(PlotStopView_1.PlotStopViewType)
], PlotStopViewPresenter);
return PlotStopViewPresenter;
})();
exports.default = PlotStopViewPresenter;
cc._RF.pop();