Commit 7f61c84e authored by wjf's avatar wjf

l

parent a1d2fb41
...@@ -15,17 +15,45 @@ ...@@ -15,17 +15,45 @@
"startTime": "", "startTime": "",
"id": "", "id": "",
"stock": "", "stock": "",
"image": "https://img.alicdn.com/imgextra/i4/2275046294/O1CN01avEmL01wMhS5Wxd63_!!2275046294-2-miniprogram.png",
"properiodto": 0,
"amount": "",
"level": 3,
"probability": "0",
"prizeType": 10,
"updateTime": 1596093227570,
"ename": "",
"createTime": 1596014583758,
"name": "实物11",
"useStock": 0,
"_id": "5f213ff7738989c8b3f46f4d",
"endTime": ""
},
{
"switchStock": 1,
"isBackUp": false,
"openId": "AAEaCvE-ALiIWXQsJuac30pr",
"type": 3,
"properiodfrom": 1,
"activityId": "5f213ff79897b44ce1d2925d",
"lockStatus": 1,
"credits": "",
"deleteStatus": 1,
"rank": "",
"startTime": "",
"id": "",
"stock": 10,
"image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01Zzj1FL1wMhS845iJp_!!2275046294-2-miniprogram.png", "image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01Zzj1FL1wMhS845iJp_!!2275046294-2-miniprogram.png",
"properiodto": 5000, "properiodto": 0,
"amount": "", "amount": "",
"level": 1, "level": 1,
"probability": "50", "probability": "0",
"prizeType": 10, "prizeType": 10,
"updateTime": 1596078351399, "updateTime": 1596093227546,
"ename": "", "ename": "",
"createTime": 1596014583758, "createTime": 1596014583758,
"name": "实物1实物1实物1实", "name": "实物1实物1实物1实",
"useStock": 0, "useStock": 1,
"_id": "5f213ff7738989c8b3f46f4b", "_id": "5f213ff7738989c8b3f46f4b",
"endTime": "" "endTime": ""
}, },
...@@ -34,7 +62,7 @@ ...@@ -34,7 +62,7 @@
"isBackUp": false, "isBackUp": false,
"openId": "AAEaCvE-ALiIWXQsJuac30pr", "openId": "AAEaCvE-ALiIWXQsJuac30pr",
"type": 1, "type": 1,
"properiodfrom": 5001, "properiodfrom": 1,
"activityId": "5f213ff79897b44ce1d2925d", "activityId": "5f213ff79897b44ce1d2925d",
"lockStatus": 1, "lockStatus": 1,
"credits": "", "credits": "",
...@@ -45,11 +73,11 @@ ...@@ -45,11 +73,11 @@
"stock": "", "stock": "",
"image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01fcO2aS1wMhS2wKUZO_!!2275046294-0-miniprogram.jpg", "image": "https://img.alicdn.com/imgextra/i2/2275046294/O1CN01fcO2aS1wMhS2wKUZO_!!2275046294-0-miniprogram.jpg",
"amount": "1", "amount": "1",
"properiodto": 10000, "properiodto": 0,
"level": 2, "level": 2,
"probability": "50", "probability": "0",
"prizeType": 10, "prizeType": 10,
"updateTime": 1596078351410, "updateTime": 1596093227558,
"ename": "18c738e4b1de4de3b481885b0d5e0936", "ename": "18c738e4b1de4de3b481885b0d5e0936",
"createTime": 1596014583758, "createTime": 1596014583758,
"name": "优惠券1", "name": "优惠券1",
...@@ -60,9 +88,8 @@ ...@@ -60,9 +88,8 @@
{ {
"switchStock": 2, "switchStock": 2,
"isBackUp": false, "isBackUp": false,
"openId": "AAEaCvE-ALiIWXQsJuac30pr",
"type": 3, "type": 3,
"properiodfrom": 10001, "properiodfrom": 1,
"activityId": "5f213ff79897b44ce1d2925d", "activityId": "5f213ff79897b44ce1d2925d",
"lockStatus": 1, "lockStatus": 1,
"credits": "", "credits": "",
...@@ -71,48 +98,42 @@ ...@@ -71,48 +98,42 @@
"startTime": "", "startTime": "",
"id": "", "id": "",
"stock": "", "stock": "",
"image": "https://img.alicdn.com/imgextra/i4/2275046294/O1CN01avEmL01wMhS5Wxd63_!!2275046294-2-miniprogram.png", "image": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01KWxBt41wMhS7Oiham_!!2275046294-2-miniprogram.png",
"properiodto": 10000, "properiodto": 0,
"amount": "", "amount": "",
"level": 3, "level": 4,
"probability": "0", "probability": "0",
"prizeType": 10, "prizeType": 10,
"updateTime": 1596078351423, "updateTime": 1596093227581,
"ename": "", "ename": "",
"createTime": 1596014583758, "createTime": 1596078351428,
"name": "实物11", "name": "实物测试名称过长的啦",
"useStock": 0, "useStock": 0,
"_id": "5f213ff7738989c8b3f46f4d", "_id": "5f22390fe5c0d7361f1e6b59",
"endTime": "" "endTime": ""
}, },
{ {
"switchStock": 2, "isBackUp": true,
"isBackUp": false,
"type": 3,
"properiodfrom": 10001,
"activityId": "5f213ff79897b44ce1d2925d",
"lockStatus": 1,
"credits": "",
"deleteStatus": 1,
"rank": "",
"startTime": "",
"id": "",
"stock": "",
"image": "https://img.alicdn.com/imgextra/i3/2275046294/O1CN01KWxBt41wMhS7Oiham_!!2275046294-2-miniprogram.png",
"properiodto": 10000, "properiodto": 10000,
"amount": "", "amount": "",
"level": 4, "level": 5,
"probability": "0", "probability": "100",
"prizeType": 10, "prizeType": 10,
"updateTime": 1596078351428, "updateTime": 1596093227586,
"type": 5,
"properiodfrom": 1,
"activityId": "5f213ff79897b44ce1d2925d",
"ename": "", "ename": "",
"createTime": 1596078351428, "lockStatus": 1,
"name": "实物测试名称过长的啦", "createTime": 1596093227586,
"deleteStatus": 1,
"name": "谢谢参与",
"useStock": 0, "useStock": 0,
"_id": "5f22390fe5c0d7361f1e6b59", "startTime": "",
"_id": "5f22732b738989c8b3f6d7c2",
"endTime": "" "endTime": ""
} }
], ],
"success": true, "success": true,
"message": "成功" "message": "成功"
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
"openId": "AAFgCvE-ALiIWXYsJuSLKdVt", "openId": "AAFgCvE-ALiIWXYsJuSLKdVt",
"createDay": "2020/07/30", "createDay": "2020/07/30",
"avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=XFvSvGH0XmQGOFNWMCQyP08yX8cYPFgLXH*IXFMHvHcT&width=80&height=80&type=sns", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=XFvSvGH0XmQGOFNWMCQyP08yX8cYPFgLXH*IXFMHvHcT&width=80&height=80&type=sns",
"type": 3, "type": 5,
"prizeId": "5f213ff7738989c8b3f46f4b", "prizeId": "5f22732b738989c8b3f6d7c2",
"activityId": "5f213ff79897b44ce1d2925d", "activityId": "5f213ff79897b44ce1d2925d",
"ename": "", "ename": "",
"userNick": "lpf468169313", "userNick": "lpf468169313",
......
...@@ -16784,6 +16784,11 @@ var FailedPanel = (function (_super) { ...@@ -16784,6 +16784,11 @@ var FailedPanel = (function (_super) {
this.tipsTex.textAlign = TEXT_ALIGN.CENTER; this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex.textWidth = 750; this.tipsTex.textWidth = 750;
this.tipsTex.x = 0; this.tipsTex.x = 0;
if (Tools_1.Tools.gameData.currentLevel == 120
&& MapScene_1.MapScene.checkArr && MapScene_1.MapScene.checkArr[120]
&& MapScene_1.MapScene.checkArr[120].checkData.isVisitSuccess) {
this.tipsTex.text = '';
}
}; };
FailedPanel.prototype.start = function (data) { FailedPanel.prototype.start = function (data) {
_super.prototype.start.call(this); _super.prototype.start.call(this);
...@@ -17167,7 +17172,7 @@ var PrizePanel = (function (_super) { ...@@ -17167,7 +17172,7 @@ var PrizePanel = (function (_super) {
this.btnDelay(this.prizeBtn); this.btnDelay(this.prizeBtn);
switch (this.data.type) { switch (this.data.type) {
case 1: case 1:
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.receiveEnamePrize, { id: this.data.id }, function (success, res) { TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.receiveEnamePrize, { _id: this.data._id }, function (success, res) {
if (!success || !res) { if (!success || !res) {
ctrls_1.showToast('奖品发放失败\n请前往我的奖品处进行处理'); ctrls_1.showToast('奖品发放失败\n请前往我的奖品处进行处理');
_this.hidePanel(); _this.hidePanel();
...@@ -17183,7 +17188,7 @@ var PrizePanel = (function (_super) { ...@@ -17183,7 +17188,7 @@ var PrizePanel = (function (_super) {
}, true); }, true);
break; break;
case 3: case 3:
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserAddress, { prizeId: this.data.id }, function (success, res) { TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getUserAddress, { prizeId: this.data._id }, function (success, res) {
if (!success) { if (!success) {
return; return;
} }
...@@ -17637,7 +17642,12 @@ var SuccessNoPrizePanel = (function (_super) { ...@@ -17637,7 +17642,12 @@ var SuccessNoPrizePanel = (function (_super) {
else { else {
this.totalContinueBtn.visible = false; this.totalContinueBtn.visible = false;
} }
if (MapScene_1.MapScene.checkArr && MapScene_1.MapScene.checkArr[this.data.level] && MapScene_1.MapScene.checkArr[this.data.level].sendAwardType) { if (Tools_1.Tools.gameData.currentLevel == 120
&& MapScene_1.MapScene.checkArr && MapScene_1.MapScene.checkArr[120]
&& MapScene_1.MapScene.checkArr[120].checkData.isVisitSuccess) {
this.tipsTex.text = '';
}
else if (MapScene_1.MapScene.checkArr && MapScene_1.MapScene.checkArr[this.data.level] && MapScene_1.MapScene.checkArr[this.data.level].sendAwardType) {
var curLevel_1 = Tools_1.Tools.gameData.currentLevel; var curLevel_1 = Tools_1.Tools.gameData.currentLevel;
var upLevel_1 = 120; var upLevel_1 = 120;
var dLevel_1 = 120; var dLevel_1 = 120;
...@@ -17653,7 +17663,7 @@ var SuccessNoPrizePanel = (function (_super) { ...@@ -17653,7 +17663,7 @@ var SuccessNoPrizePanel = (function (_super) {
} }
} }
}); });
this.tipsTex.text = "\t\t\t\u592A\u5389\u5BB3\u4E86\uFF01\n\u518D\u89E3\u9501" + dLevel_1 + "\u5173\u53EF\u4EE5\u5F00\u7EA2\u5305\u4E86"; this.tipsTex.text = "\t\t\t\u592A\u5389\u5BB3\u4E86\uFF01\n\u518D\u89E3\u9501" + dLevel_1 + "\u5173\u53EF\u4EE5\u62BD\u5956\u4E86";
this.tipsTex.textAlign = TEXT_ALIGN.CENTER; this.tipsTex.textAlign = TEXT_ALIGN.CENTER;
this.tipsTex.textWidth = 750; this.tipsTex.textWidth = 750;
this.tipsTex.x = 0; this.tipsTex.x = 0;
...@@ -18690,7 +18700,7 @@ var LotteryScene = (function (_super) { ...@@ -18690,7 +18700,7 @@ var LotteryScene = (function (_super) {
}; };
LotteryScene.prototype.updatePrizes = function () { LotteryScene.prototype.updatePrizes = function () {
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var prizeList, scroll, p; var prizeList, list, scroll, p;
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: case 0:
...@@ -18698,11 +18708,12 @@ var LotteryScene = (function (_super) { ...@@ -18698,11 +18708,12 @@ var LotteryScene = (function (_super) {
return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getPrizesByLevel, { level: this.data.level })]; return [4, TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.getPrizesByLevel, { level: this.data.level })];
case 1: case 1:
prizeList = (_a.sent()).data; prizeList = (_a.sent()).data;
list = prizeList.slice().filter(function (e) { return e.type != 5; });
scroll = this.addChild(new FYGE.ScrollList(PrizeItem, 122, 140, 345, 152, false)); scroll = this.addChild(new FYGE.ScrollList(PrizeItem, 122, 140, 345, 152, false));
scroll.position.set(195, 1013); scroll.position.set(195, 1013);
scroll.updateData(prizeList || []); scroll.updateData(list || []);
p = [201, 620]; p = [201, 620];
this.lotScroll = this.addChild(new LotteryScroll(prizeList)); this.lotScroll = this.addChild(new LotteryScroll(list));
this.lotScroll.position.set(p[0], p[1]); this.lotScroll.position.set(p[0], p[1]);
return [2]; return [2];
} }
...@@ -18718,12 +18729,18 @@ var LotteryScene = (function (_super) { ...@@ -18718,12 +18729,18 @@ var LotteryScene = (function (_super) {
if (!res.success) if (!res.success)
return; return;
var id; var id;
if (res.data && res.data._id) if (res.data && res.data.prizeId)
id = res.data._id; id = res.data.prizeId;
_this.enableMouseEvt(false); _this.enableMouseEvt(false);
console.log(id);
_this.lotScroll.lot(id, function () { _this.lotScroll.lot(id, function () {
_this.enableMouseEvt(true); _this.enableMouseEvt(true);
ctrls_1.showPanel(id ? PrizePanel_1.PrizePanel : NoPrizePanel_1.NoPrizePanel, id ? res.data : null); if (!id || res.data.type == 5) {
ctrls_1.showPanel(NoPrizePanel_1.NoPrizePanel);
}
else {
ctrls_1.showPanel(PrizePanel_1.PrizePanel, res.data);
}
}); });
}); });
}; };
...@@ -18749,6 +18766,7 @@ var PrizeItem = (function (_super) { ...@@ -18749,6 +18766,7 @@ var PrizeItem = (function (_super) {
PrizeItem.prototype.initData = function (id, data) { PrizeItem.prototype.initData = function (id, data) {
if (id < 0 || !data) if (id < 0 || !data)
return; return;
if (data.image)
this.prizeImage.texture = FYGE.Texture.from(data.image); this.prizeImage.texture = FYGE.Texture.from(data.image);
this.nameTxt.text = data.name; this.nameTxt.text = data.name;
}; };
...@@ -18859,11 +18877,7 @@ var LotteryScroll = (function (_super) { ...@@ -18859,11 +18877,7 @@ var LotteryScroll = (function (_super) {
} }
LotteryScroll.prototype.lot = function (id, callback) { LotteryScroll.prototype.lot = function (id, callback) {
var _this = this; var _this = this;
if (id) { if (id && this.ids.indexOf(id) != -1) {
if (this.ids.indexOf(id) == -1) {
console.error("中奖id不存在");
return;
}
var count_1 = 0; var count_1 = 0;
var countAll_1 = this.scrollItems.length; var countAll_1 = this.scrollItems.length;
this.scrollItems.forEach(function (c, i) { this.scrollItems.forEach(function (c, i) {
...@@ -18885,7 +18899,6 @@ var LotteryScroll = (function (_super) { ...@@ -18885,7 +18899,6 @@ var LotteryScroll = (function (_super) {
arr.splice(_this.ids.indexOf(ids[0]), 1); arr.splice(_this.ids.indexOf(ids[0]), 1);
return arr; return arr;
})())) : ids.push(GTool_1.GTool.randomT(this.ids)); })())) : ids.push(GTool_1.GTool.randomT(this.ids));
console.log(ids);
var count_2 = 0; var count_2 = 0;
var countAll_2 = this.scrollItems.length; var countAll_2 = this.scrollItems.length;
this.scrollItems.forEach(function (c, i) { this.scrollItems.forEach(function (c, i) {
This diff is collapsed.
...@@ -43,7 +43,7 @@ export class PrizePanel extends Panel { ...@@ -43,7 +43,7 @@ export class PrizePanel extends Panel {
this.btnDelay(this.prizeBtn); this.btnDelay(this.prizeBtn);
switch (this.data.type) { switch (this.data.type) {
case 1: // 权益 case 1: // 权益
sendTbNet(TbNetName.receiveEnamePrize, {id: this.data.id}, sendTbNet(TbNetName.receiveEnamePrize, {_id: this.data._id},
(success, res) => { (success, res) => {
if (!success || !res) { if (!success || !res) {
showToast('奖品发放失败\n请前往我的奖品处进行处理'); showToast('奖品发放失败\n请前往我的奖品处进行处理');
...@@ -60,7 +60,7 @@ export class PrizePanel extends Panel { ...@@ -60,7 +60,7 @@ export class PrizePanel extends Panel {
); );
break; break;
case 3: // 实物 case 3: // 实物
sendTbNet(TbNetName.getUserAddress, {prizeId: this.data.id}, sendTbNet(TbNetName.getUserAddress, {prizeId: this.data._id},
(success, res) => { (success, res) => {
if (!success) { if (!success) {
// showToast('奖品发放失败\n请前往我的奖品处进行处理'); // showToast('奖品发放失败\n请前往我的奖品处进行处理');
......
...@@ -73,30 +73,37 @@ export class LotteryScene extends Scene { ...@@ -73,30 +73,37 @@ export class LotteryScene extends Scene {
async updatePrizes() { async updatePrizes() {
showWaiting(); showWaiting();
const { data: prizeList } = await sendTbNet(TbNetName.getPrizesByLevel, { level: this.data.level }); const { data: prizeList } = await sendTbNet(TbNetName.getPrizesByLevel, { level: this.data.level });
//去掉type为5的谢谢参与
var list = prizeList.slice().filter((e) => { return e.type != 5 });
//滚动列表 //滚动列表
// console.log(prizeList)
var scroll = this.addChild(new FYGE.ScrollList(PrizeItem, 122, 140, 345, 152, false)) var scroll = this.addChild(new FYGE.ScrollList(PrizeItem, 122, 140, 345, 152, false))
scroll.position.set(195, 1013); scroll.position.set(195, 1013);
scroll.updateData(prizeList || []) scroll.updateData(list || [])
//摇奖部分 //摇奖部分
var p = [201, 620] var p = [201, 620]
this.lotScroll = this.addChild(new LotteryScroll(prizeList)) this.lotScroll = this.addChild(new LotteryScroll(list))
this.lotScroll.position.set(p[0], p[1]); this.lotScroll.position.set(p[0], p[1]);
} }
lottery() { lottery() {
showWaiting() showWaiting()
sendTbNet(TbNetName.luckyDraw) sendTbNet(TbNetName.luckyDraw, { level: this.data.level })
.then((res) => { .then((res) => {
hideWaiting(); hideWaiting();
//如果是失败 //如果是失败
if (!res.success) return; if (!res.success) return;
let id; let id;//待考虑,谢谢参与要进哪?是否进列表,下面id不存在时当作无奖励,(如果谢谢参与不进列表)
if (res.data && res.data.prizeId) id = res.data.prizeId; if (res.data && res.data.prizeId) id = res.data.prizeId;
this.enableMouseEvt(false); this.enableMouseEvt(false);
console.log(id)
this.lotScroll.lot(id, () => { this.lotScroll.lot(id, () => {
this.enableMouseEvt(true) this.enableMouseEvt(true)
//弹框 //无奖
showPanel(id ? PrizePanel : NoPrizePanel, id ? res.data : null) if (!id || res.data.type == 5) {
showPanel(NoPrizePanel);
} else {
showPanel(PrizePanel, res.data)
}
// showPanel(id ? PrizePanel : NoPrizePanel, id ? res.data : null)
}) })
}) })
} }
...@@ -133,7 +140,7 @@ class PrizeItem extends FYGE.Container implements FYGE.IScrollListItem { ...@@ -133,7 +140,7 @@ class PrizeItem extends FYGE.Container implements FYGE.IScrollListItem {
} }
initData(id: number, data: PrizeInt) { initData(id: number, data: PrizeInt) {
if (id < 0 || !data) return; if (id < 0 || !data) return;
this.prizeImage.texture = FYGE.Texture.from(data.image); if (data.image) this.prizeImage.texture = FYGE.Texture.from(data.image);
this.nameTxt.text = data.name; this.nameTxt.text = data.name;
} }
id; id;
...@@ -260,12 +267,13 @@ class LotteryScroll extends FYGE.Container { ...@@ -260,12 +267,13 @@ class LotteryScroll extends FYGE.Container {
.position.set(0, h) .position.set(0, h)
} }
lot(id?: string, callback?: () => void) { lot(id?: string, callback?: () => void) {
if (id) { //有id且在中奖列表里
if (id && this.ids.indexOf(id) != -1) {
//确保得是ids里的id。否则无效 //确保得是ids里的id。否则无效
if (this.ids.indexOf(id) == -1) { // if (this.ids.indexOf(id) == -1) {
console.error("中奖id不存在") // console.error("中奖id不存在")
return; // return;
} // }
let count = 0; let count = 0;
let countAll = this.scrollItems.length; let countAll = this.scrollItems.length;
this.scrollItems.forEach((c: LotteryScrollItem, i) => { this.scrollItems.forEach((c: LotteryScrollItem, i) => {
...@@ -294,7 +302,7 @@ class LotteryScroll extends FYGE.Container { ...@@ -294,7 +302,7 @@ class LotteryScroll extends FYGE.Container {
return arr return arr
})()) })())
) : ids.push(GTool.randomT(this.ids)); ) : ids.push(GTool.randomT(this.ids));
console.log(ids) // console.log(ids)
let count = 0; let count = 0;
let countAll = this.scrollItems.length; let countAll = this.scrollItems.length;
this.scrollItems.forEach((c: LotteryScrollItem, i) => { this.scrollItems.forEach((c: LotteryScrollItem, i) => {
......
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