Commit aebd3ff3 authored by haiyoucuv's avatar haiyoucuv

背包奖品高亮

parent 1add4ae7
This diff is collapsed.
......@@ -25,20 +25,20 @@
"_active": true,
"_components": [
{
"__id__": 108
"__id__": 112
},
{
"__id__": 110
"__id__": 114
},
{
"__id__": 112
"__id__": 116
},
{
"__id__": 114
"__id__": 118
}
],
"_prefab": {
"__id__": 119
"__id__": 123
},
"_lpos": {
"__type__": "cc.Vec3",
......@@ -97,14 +97,14 @@
"_active": true,
"_components": [
{
"__id__": 103
"__id__": 107
},
{
"__id__": 105
"__id__": 109
}
],
"_prefab": {
"__id__": 107
"__id__": 111
},
"_lpos": {
"__type__": "cc.Vec3",
......@@ -1714,7 +1714,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 12.5,
"y": 0,
"z": 0
},
"_lrot": {
......@@ -1754,8 +1754,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 820,
"height": 425
"width": 880,
"height": 400
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1780,11 +1780,11 @@
"__prefab": {
"__id__": 70
},
"_alignFlags": 20,
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 84,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -1794,8 +1794,8 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_originalWidth": 820,
"_originalHeight": 425,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
......@@ -2068,7 +2068,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 820,
"width": 880,
"height": 400
},
"_anchorPoint": {
......@@ -2094,11 +2094,11 @@
"__prefab": {
"__id__": 86
},
"_alignFlags": 20,
"_alignFlags": 21,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_top": 180,
"_bottom": 20,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -2109,7 +2109,7 @@
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_originalHeight": 400,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
......@@ -2151,15 +2151,21 @@
},
{
"__id__": 100
},
{
"__id__": 102
},
{
"__id__": 104
}
],
"_prefab": {
"__id__": 102
"__id__": 106
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -77.5,
"y": -87.5,
"z": 0
},
"_lrot": {
......@@ -2252,8 +2258,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 820,
"height": 425
"width": 846,
"height": 424
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2278,11 +2284,11 @@
"__prefab": {
"__id__": 93
},
"_alignFlags": 20,
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 84,
"_left": 27,
"_right": 27,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -2292,8 +2298,8 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_originalWidth": 820,
"_originalHeight": 425,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
......@@ -2314,7 +2320,7 @@
"__prefab": {
"__id__": 95
},
"mask": true,
"mask": false,
"scrollEnabled": true,
"scrollDirection": 1,
"mode": 0,
......@@ -2335,7 +2341,7 @@
{
"__type__": "_yx_editor_register_cell_info",
"prefab": {
"__uuid__": "8fb09e0b-1eb3-4b77-99fd-784445492b24",
"__uuid__": "5420d619-9574-4e5e-806a-f2c54d4c1af7",
"__expectedType__": "cc.Prefab"
},
"identifier": "cell",
......@@ -2368,8 +2374,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 820,
"height": 425
"width": 900,
"height": 424
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2394,12 +2400,12 @@
"__prefab": {
"__id__": 101
},
"_alignFlags": 20,
"_alignFlags": 44,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 10,
"_bottom": 0.5,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
......@@ -2408,7 +2414,7 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalWidth": 850,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
......@@ -2418,6 +2424,74 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "08cNJIoHRGT5pDcV12mg1Y"
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 88
},
"_enabled": true,
"__prefab": {
"__id__": 103
},
"_type": 0,
"_inverted": false,
"_segments": 64,
"_alphaThreshold": 0.1,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d6wtnJVHxDZqpE4Zq2fO5D"
},
{
"__type__": "cc.Graphics",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 88
},
"_enabled": true,
"__prefab": {
"__id__": 105
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_lineWidth": 1,
"_strokeColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_lineJoin": 2,
"_lineCap": 0,
"_fillColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 0
},
"_miterLimit": 10,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "63GDoWejtED6vZ972naZRo"
},
{
"__type__": "cc.PrefabInfo",
"root": {
......@@ -2441,7 +2515,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 104
"__id__": 108
},
"_contentSize": {
"__type__": "cc.Size",
......@@ -2469,7 +2543,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 106
"__id__": 110
},
"_customMaterial": null,
"_srcBlendFactor": 2,
......@@ -2527,7 +2601,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 109
"__id__": 113
},
"_contentSize": {
"__type__": "cc.Size",
......@@ -2555,7 +2629,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 111
"__id__": 115
},
"_alignFlags": 18,
"_target": null,
......@@ -2591,7 +2665,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 113
"__id__": 117
},
"closeBtn": {
"__id__": 3
......@@ -2615,13 +2689,13 @@
"__id__": 32
},
"Prize_List": {
"__id__": 94
"__id__": 71
},
"None_list": {
"__id__": 75
},
"Tool_List": {
"__id__": 71
"__id__": 94
},
"_id": ""
},
......@@ -2639,17 +2713,17 @@
},
"_enabled": true,
"__prefab": {
"__id__": 115
"__id__": 119
},
"skinNodeArr": [
{
"__id__": 116
"__id__": 120
},
{
"__id__": 117
"__id__": 121
},
{
"__id__": 118
"__id__": 122
}
],
"_genSkinNode": true,
......
......@@ -61,8 +61,8 @@ export class MyBagPanel extends Panel {
this.tab = TAB.PRIZE;
this.closeBtn.on(Button.EventType.CLICK, this.clickClose, this);
this.prize_btn.on(Button.EventType.CLICK, this.clickSheng, this);
this.tool_btn.on(Button.EventType.CLICK, this.clickSingle, this);
this.prize_btn.on(Button.EventType.CLICK, this.clickPrize, this);
this.tool_btn.on(Button.EventType.CLICK, this.clickTool, this);
}
......@@ -73,46 +73,46 @@ export class MyBagPanel extends Panel {
}
this.Prize_List.numberOfItems = () => this.prizeDate.length;
this.Prize_List.onCellDisplay = this.onShengCellDisplay;
this.Prize_List.onCellDisplay = this.onPrizeCellDisplay;
const shengLayout = new YXFlowLayout();
shengLayout.itemSize = new Size(820, 160);
this.Prize_List.layout = shengLayout;
const prizeLayout = new YXFlowLayout();
prizeLayout.itemSize = new Size(880, 200);
prizeLayout.verticalSpacing = -30;
this.Prize_List.layout = prizeLayout;
this.Prize_List.reloadData();
this.Tool_List.numberOfItems = () => this.toolDate.length;
this.Tool_List.onCellDisplay = this.onSingleCellDisplay;
this.Tool_List.onCellDisplay = this.onToolCellDisplay;
const singleLayout = new YXFlowLayout();
singleLayout.itemSize = new Size(820, 160);
this.Tool_List.layout = singleLayout;
const toolLayout = new YXFlowLayout();
toolLayout.itemSize = new Size(280, 368);
toolLayout.priority = YXFlowLayout.Priority.LEFT;
toolLayout.verticalSpacing = -20;
this.Tool_List.layout = toolLayout;
this.Tool_List.reloadData();
showWaiting(true);
await Promise.all([
this.updateSheng(),
this.updateSingle(),
this.updateTool(),
this.updatePrize(),
]);
hideWaiting();
}
update(deltaTime: number) {
}
clickClose = () => {
this.hidePanel();
};
// 点击奖品
clickSheng() {
clickPrize() {
this.tab = TAB.PRIZE;
// this.Prize.getChildByName(`goCheck`).active = true;
}
// 道具
clickSingle() {
clickTool() {
if (!store.checkActTime()) return;
this.tab = TAB.TOOL;
......@@ -120,20 +120,20 @@ export class MyBagPanel extends Panel {
/****** 数据 ******/
// 刷新道具
async updateSheng() {
async updateTool() {
const { success, data } = await sendWebNet(WebNetName.queryGameItem);
if (!success) return;
this.prizeDate = data.spInfo;
this.Prize_List.reloadData();
this.toolDate = data.spInfo;
this.Tool_List.reloadData();
this.Prize_List.node.active = this.prizeDate.length > 0;
this.Tool_List.node.active = this.toolDate.length > 0;
}
prizeIdType = {};
// 刷新奖品
async updateSingle() {
async updatePrize() {
const { success, data = [] } = await sendWebNet(WebNetName.prizeDetail);
const { success: suc, data: d } = await sendWebNet(WebNetName.prizeType);
......@@ -172,19 +172,19 @@ export class MyBagPanel extends Panel {
this.None_list.active = true;
}
this.toolDate = records;
this.Tool_List.reloadData();
this.prizeDate = records;
this.Prize_List.reloadData();
this.Tool_List.node.active = this.toolDate.length > 0;
this.Prize_List.node.active = this.prizeDate.length > 0;
}
// 给每个cell设置数据
onShengCellDisplay = (cell: Node, indexPath: YXIndexPath, collectionView: YXCollectionView) => {
const data = this.prizeDate[indexPath.item];
onToolCellDisplay = (cell: Node, indexPath: YXIndexPath, collectionView: YXCollectionView) => {
const data = this.toolDate[indexPath.item];
this.onCellDisplay(cell, data, TAB.TOOL);
};
onSingleCellDisplay = (cell: Node, indexPath: YXIndexPath, collectionView: YXCollectionView) => {
const data = this.toolDate[indexPath.item];
onPrizeCellDisplay = (cell: Node, indexPath: YXIndexPath, collectionView: YXCollectionView) => {
const data = this.prizeDate[indexPath.item];
this.onCellDisplay(cell, data, TAB.PRIZE);
};
......@@ -200,7 +200,8 @@ export class MyBagPanel extends Panel {
prizeId = "",
spNum = 0,
spImg = "",
dressingStatus = 0
dressingStatus = 0,
lightFlag = false,
} = data;
const isPrize = type == TAB.PRIZE;
......@@ -224,6 +225,9 @@ export class MyBagPanel extends Panel {
cell.getChildByName(`name`).getComponent(Label).string = strFormat(name || spName, 32);
cell.getChildByName(`time`).getComponent(Label).string = gmtCreate ? dateFormatter(gmtCreate, "yyyy.MM.dd hh:mm") : "剩余数量:" + spNum;
cell.getChildByName("img").getComponent(Sprite).spriteFrame = icon || spImg;
cell.getChildByName("light").active = !!lightFlag;
};
clickToCheck = (url, id, prizeId) => {
......
......@@ -138,7 +138,7 @@ class GameStore {
}
if (score >= this.startInfo.slideScore) {
param.slideValue = await startNecCaptcha("1ee4615751874cbeaea4dd4681930f61", 3).catch(() => {
param.slideValue = await startNecCaptcha("1ee4615751874cbeaea4dd4681930f61", 10).catch(() => {
showToast("校验失败");
changeScene(HomeScene);
return false;
......
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