Commit 3e9518a3 authored by 邱旭's avatar 邱旭

m

parent 8a60835d
......@@ -5,7 +5,9 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/output.js" beforeDir="false" afterPath="$PROJECT_DIR$/output.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/output.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/output.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/LoadingScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/LoadingScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TaoBaoNet.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/TaoBaoNet.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/LotteryPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/LotteryPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/SuccessPrizePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/SuccessPrizePanel.ts" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -136,7 +138,7 @@
<workItem from="1612576979459" duration="13000" />
<workItem from="1612577003915" duration="21094000" />
<workItem from="1612662929222" duration="40609000" />
<workItem from="1613698993022" duration="11686000" />
<workItem from="1613698993022" duration="14621000" />
</task>
<task id="LOCAL-00001" summary="斐乐消消乐">
<created>1612581213298</created>
......@@ -285,7 +287,14 @@
<option name="project" value="LOCAL" />
<updated>1613715814506</updated>
</task>
<option name="localTasksCounter" value="22" />
<task id="LOCAL-00022" summary="m">
<created>1613716046739</created>
<option name="number" value="00022" />
<option name="presentableId" value="LOCAL-00022" />
<option name="project" value="LOCAL" />
<updated>1613716046739</updated>
</task>
<option name="localTasksCounter" value="23" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......
......@@ -7822,7 +7822,7 @@ var Main_1 = __webpack_require__(/*! ./Main */ "./src/Main.ts");
var TbNetName;
(function (TbNetName) {
TbNetName["addStats"] = "feile.addStats";
TbNetName["receiveEnamePrize"] = "babycare.receiveEnamePrize";
TbNetName["receiveEnamePrize"] = "feile.receiveEnamePrize";
TbNetName["getActivityBaseInfoById"] = "feile.getActivityBaseInfoById";
TbNetName["getToolsInfo"] = "feile.getToolsInfo";
TbNetName["consumerTools"] = "feile.consumerTools";
......@@ -11233,8 +11233,7 @@ var LotteryPanel = (function (_super) {
.addEventListener(FYGE.MouseEvent.CLICK, this.lottery, this);
this.lotBtn.position.set((750 - RES_1.RES.getRes("lotteryBtn.png").width) / 2, 1170);
this.useBtn = this.addChild(new FYGE.Button(RES_1.RES.getRes("老虎机领取奖励.png")))
.addEventListener(FYGE.MouseEvent.CLICK, function () {
}, this);
.addEventListener(FYGE.MouseEvent.CLICK, this.getPrize, this);
this.useBtn.position.set((750 - RES_1.RES.getRes("老虎机领取奖励.png").width) / 2, 1170);
this.useBtn.visible = false;
this.thanksBtn = this.addChild(new FYGE.Button(RES_1.RES.getRes("老虎机好的.png")))
......@@ -11249,6 +11248,42 @@ var LotteryPanel = (function (_super) {
.position.set(0, 250);
this.updatePrizes();
};
LotteryPanel.prototype.getPrize = function (e) {
var _this = this;
this.btnDelay(e.target);
var _a = this.prizeData, type = _a.type, _id = _a._id;
switch (type) {
case 1:
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.receiveEnamePrize, { _id: _id }, function (success, res) {
if (!success || !res) {
ctrls_1.showToast('奖品发放失败\n请前往我的奖品处进行处理');
_this.hidePanel();
return;
}
if (res.data && res.data.drawStatus == 3) {
ctrls_1.showToast('奖品发放成功\n请前往我的奖品处查看');
}
else {
ctrls_1.showToast('奖品发放失败\n请前往我的奖品处进行处理');
}
_this.hidePanel();
}, true);
break;
case 3:
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserAddress, { prizeId: _id }, function (success, res) {
if (!success) {
return;
}
ctrls_1.showToast('奖品发放成功\n请前往我的奖品处查看');
_this.hidePanel();
}, true);
break;
case 2:
case 5:
this.hidePanel();
break;
}
};
LotteryPanel.prototype.updatePrizes = function () {
return __awaiter(this, void 0, void 0, function () {
var prizeList, list, p;
......@@ -11259,7 +11294,9 @@ var LotteryPanel = (function (_super) {
return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getTopLevelPrizes)];
case 1:
prizeList = (_a.sent()).data;
list = prizeList.slice().filter(function (e) { return e.type != 5; });
list = prizeList.slice().filter(function (e) {
return e.type != 5;
});
p = [91, 731];
this.lotScroll = this.addChild(new LotteryScroll(list));
this.lotScroll.position.set(p[0], p[1]);
......@@ -11282,6 +11319,7 @@ var LotteryPanel = (function (_super) {
id = res.data.prizeId;
_this.enableMouseEvt(false);
console.log(id);
_this.prizeData = res.data;
_this.lotScroll.lot(id, function () {
_this.enableMouseEvt(true);
_this.lotBtn.visible = false;
......@@ -12056,6 +12094,7 @@ var ctrls_1 = __webpack_require__(/*! ../../module/ctrls */ "./module/ctrls/inde
var MapScene_1 = __webpack_require__(/*! ../scene/map/MapScene */ "./src/scene/map/MapScene.ts");
var Tools_1 = __webpack_require__(/*! ../Tools */ "./src/Tools.ts");
var PropType_1 = __webpack_require__(/*! ../something/enum/PropType */ "./src/something/enum/PropType.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ../TaoBaoNet */ "./src/TaoBaoNet.ts");
var Tween = FYGE.Tween;
var Ease = FYGE.Ease;
var MouseEvent = FYGE.MouseEvent;
......@@ -12155,7 +12194,41 @@ var SuccessPrizePanel = (function (_super) {
}
_super.prototype.hidePanel.call(this);
};
SuccessPrizePanel.prototype.getPrize = function () {
SuccessPrizePanel.prototype.getPrize = function (e) {
var _this = this;
this.btnDelay(e.target);
var _a = this.data.prize, name = _a.name, _id = _a._id, image = _a.image, type = _a.type, toolType = _a.toolType;
switch (this.data.prize.type) {
case 1:
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.receiveEnamePrize, { _id: _id }, function (success, res) {
if (!success || !res) {
ctrls_1.showToast('奖品发放失败\n请前往我的奖品处进行处理');
_this.hidePanel();
return;
}
if (res.data && res.data.drawStatus == 3) {
ctrls_1.showToast('奖品发放成功\n请前往我的奖品处查看');
}
else {
ctrls_1.showToast('奖品发放失败\n请前往我的奖品处进行处理');
}
_this.hidePanel();
}, true);
break;
case 3:
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserAddress, { prizeId: _id }, function (success, res) {
if (!success) {
return;
}
ctrls_1.showToast('奖品发放成功\n请前往我的奖品处查看');
_this.hidePanel();
}, true);
break;
case 2:
case 5:
this.hidePanel();
break;
}
};
SuccessPrizePanel.prototype.hidePanel = function () {
ctrls_1.changeScene(MapScene_1.MapScene);
......@@ -12310,6 +12383,7 @@ var layers_1 = __webpack_require__(/*! ../../module/views/layers */ "./module/vi
var ctrls_1 = __webpack_require__(/*! ../../module/ctrls */ "./module/ctrls/index.ts");
var TEXT_ALIGN = FYGE.TEXT_ALIGN;
var Tween = FYGE.Tween;
var MapScene_1 = __webpack_require__(/*! ./map/MapScene */ "./src/scene/map/MapScene.ts");
var LoadingScene = (function (_super) {
__extends(LoadingScene, _super);
function LoadingScene() {
......@@ -12386,6 +12460,7 @@ var LoadingScene = (function (_super) {
.call(function () {
if (pro >= 1) {
_this.removeEventListener(FYGE.Event.PROGRESS, _this.progressEvent, _this);
ctrls_1.changeScene(MapScene_1.MapScene, { from: "loading" });
}
});
};
This diff is collapsed.
......@@ -12,7 +12,7 @@ export enum TbNetName {
addStats = "feile.addStats",
// 领取权益奖励
receiveEnamePrize = "babycare.receiveEnamePrize",
receiveEnamePrize = "feile.receiveEnamePrize",
/**
* 活动基本信息
......
import { Scene } from "../../module/views/Scene";
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import { Tools } from "../Tools";
import { showWaiting, wait, hideWaiting, showPanel, changeScene } from "../../module/ctrls";
import { changeScene, hideWaiting, showToast, showWaiting, wait } from "../../module/ctrls";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
import { GTool } from "../../module/tools/GTool";
// import { MapScene } from "./map/MapScene";
......@@ -31,18 +28,17 @@ export class LotteryPanel extends Panel {
//抽奖按钮
this.lotBtn = this.addChild(new FYGE.Button(RES.getRes("lotteryBtn.png")))
.addEventListener(FYGE.MouseEvent.CLICK, this.lottery, this)
this.lotBtn.position.set((750 - RES.getRes("lotteryBtn.png").width) / 2, 1170/*1234*/);
this.lotBtn.position.set((750 - RES.getRes("lotteryBtn.png").width) / 2, 1170);
//领取奖励按钮
this.useBtn = this.addChild(new FYGE.Button(RES.getRes("老虎机领取奖励.png")))
.addEventListener(FYGE.MouseEvent.CLICK, () => {
//TODO领奖流程
}, this)
this.useBtn.position.set((750 - RES.getRes("老虎机领取奖励.png").width) / 2, 1170/*1234*/);
.addEventListener(FYGE.MouseEvent.CLICK, this.getPrize, this);
this.useBtn.position.set((750 - RES.getRes("老虎机领取奖励.png").width) / 2, 1170);
this.useBtn.visible = false;
//谢谢参与关闭按钮
this.thanksBtn = this.addChild(new FYGE.Button(RES.getRes("老虎机好的.png")))
.addEventListener(FYGE.MouseEvent.CLICK, this.hidePanel, this)
this.thanksBtn.position.set((750 - RES.getRes("老虎机好的.png").width) / 2, 1170/*1234*/);
this.thanksBtn.position.set((750 - RES.getRes("老虎机好的.png").width) / 2, 1170);
this.thanksBtn.visible = false;
//返回按钮,回到地图页
this.addChild(new FYGE.Sprite(RES.getRes("lotteryReturnBtn.png")))
......@@ -54,11 +50,57 @@ export class LotteryPanel extends Panel {
//刷新奖品列表和摇奖列表
this.updatePrizes();
}
prizeData;
getPrize(e) {
this.btnDelay(e.target);
const { type, _id } = this.prizeData;
switch (type) {
case 1: // 权益
sendTbNet(TbNetName.receiveEnamePrize, { _id: _id },
(success, res) => {
if (!success || !res) {
showToast('奖品发放失败\n请前往我的奖品处进行处理');
this.hidePanel();
return;
}
if (res.data && res.data.drawStatus == 3) {
showToast('奖品发放成功\n请前往我的奖品处查看');
} else {
showToast('奖品发放失败\n请前往我的奖品处进行处理');
}
this.hidePanel();
}, true
);
break;
case 3: // 实物
sendTbNet(TbNetName.getUserAddress, { prizeId: _id },
(success, res) => {
if (!success) {
// showToast('奖品发放失败\n请前往我的奖品处进行处理');
return;
}
showToast('奖品发放成功\n请前往我的奖品处查看');
this.hidePanel();
}, true
);
break;
case 2: // 积分
case 5: // 谢谢参与
this.hidePanel();
break;
}
}
async updatePrizes() {
showWaiting();
const { data: prizeList } = await sendTbNet(TbNetName.getTopLevelPrizes/*, { level: this.data.level }*/);
//去掉type为5的谢谢参与
var list = prizeList.slice().filter((e) => { return e.type != 5 });
var list = prizeList.slice().filter((e) => {
return e.type != 5
});
//滚动列表
// var scroll = this.addChild(new FYGE.ScrollList(PrizeItem, 122, 140, 345, 152, false))
// scroll.position.set(195, 1013);
......@@ -80,6 +122,7 @@ export class LotteryPanel extends Panel {
if (res.data && res.data.prizeId) id = res.data.prizeId;
this.enableMouseEvt(false);
console.log(id)
this.prizeData = res.data;
this.lotScroll.lot(id, () => {
this.enableMouseEvt(true)
//
......
import { Panel } from "../../module/views/Panel";
import { SuccessStarGroup } from "./SuccessNoPrizePanel";
import { RES } from "../../module/RES";
import { changeScene } from "../../module/ctrls";
import { changeScene, showToast } from "../../module/ctrls";
import { MapScene } from "../scene/map/MapScene";
import { Tools } from "../Tools";
import { PropType } from "../something/enum/PropType";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
import Tween = FYGE.Tween;
import Ease = FYGE.Ease;
import MouseEvent = FYGE.MouseEvent;
......@@ -118,8 +119,46 @@ export class SuccessPrizePanel extends Panel {
/**
* 领奖
*/
public getPrize() {
/// TODO 领奖
public getPrize(e) {
this.btnDelay(e.target);
const { name, _id, image, type, toolType } = this.data.prize;
switch (this.data.prize.type) {
case 1: // 权益
sendTbNet(TbNetName.receiveEnamePrize, { _id: _id },
(success, res) => {
if (!success || !res) {
showToast('奖品发放失败\n请前往我的奖品处进行处理');
this.hidePanel();
return;
}
if (res.data && res.data.drawStatus == 3) {
showToast('奖品发放成功\n请前往我的奖品处查看');
} else {
showToast('奖品发放失败\n请前往我的奖品处进行处理');
}
this.hidePanel();
}, true
);
break;
case 3: // 实物
sendTbNet(TbNetName.getUserAddress, { prizeId: _id },
(success, res) => {
if (!success) {
// showToast('奖品发放失败\n请前往我的奖品处进行处理');
return;
}
showToast('奖品发放成功\n请前往我的奖品处查看');
this.hidePanel();
}, true
);
break;
case 2: // 积分
case 5: // 谢谢参与
this.hidePanel();
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment