Commit cd28d80c authored by haiyoucuv's avatar haiyoucuv

wareHouse

parent fd82aa6b
This diff is collapsed.
...@@ -131,17 +131,17 @@ ...@@ -131,17 +131,17 @@
"atlas": "rulePanel.json" "atlas": "rulePanel.json"
}, },
{ {
"keys": "shop_icon.png", "keys": "shop_icon.png,shop_item_bg.png,shop_mask.png",
"name": "shopPanel", "name": "shopPanel",
"atlas": "shopPanel.json" "atlas": "shopPanel.json"
}, },
{ {
"keys": "task_chat_icon.png,task_collection_icon.png,task_done.png,task_friend_icon.png,task_go.png,task_icon.png,task_item_bg.png,task_shop_icon.png,task_sign_icon.png", "keys": "task_buy_icon.png,task_chat_icon.png,task_done.png,task_friend_icon.png,task_go.png,task_icon.png,task_item_bg.png,task_shop_icon.png,task_sign_icon.png,task_vip_icon.png",
"name": "taskPanel", "name": "taskPanel",
"atlas": "taskPanel.json" "atlas": "taskPanel.json"
}, },
{ {
"keys": "wareHouse_icon.png", "keys": "wareHouse_icon.png,wareHouse_item_bg.png,wareHouse_山核桃.png,wareHouse_板栗.png,wareHouse_腰果.png,wareHouse_花生.png",
"name": "wareHouse", "name": "wareHouse",
"atlas": "wareHouse.json" "atlas": "wareHouse.json"
} }
......
{ {
"shop_icon.png": { "shop_icon.png": {
"x": 2, "x": 657,
"y": 2, "y": 2,
"w": 135, "w": 135,
"h": 185, "h": 185,
...@@ -9,5 +9,27 @@ ...@@ -9,5 +9,27 @@
"sw": 135, "sw": 135,
"sh": 185, "sh": 185,
"ro": false "ro": false
},
"shop_item_bg.png": {
"x": 2,
"y": 2,
"w": 653,
"h": 207,
"ox": 0,
"oy": 0,
"sw": 653,
"sh": 207,
"ro": false
},
"shop_mask.png": {
"x": 2,
"y": 211,
"w": 653,
"h": 206,
"ox": 0,
"oy": 0,
"sw": 653,
"sh": 206,
"ro": false
} }
} }
\ No newline at end of file
{ {
"task_chat_icon.png": { "task_buy_icon.png": {
"x": 558, "x": 697,
"y": 184, "y": 176,
"w": 137, "w": 137,
"h": 137, "h": 137,
"ox": 0, "ox": 0,
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
"sh": 137, "sh": 137,
"ro": false "ro": false
}, },
"task_collection_icon.png": { "task_chat_icon.png": {
"x": 419, "x": 558,
"y": 184, "y": 184,
"w": 137, "w": 137,
"h": 137, "h": 137,
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
"ro": false "ro": false
}, },
"task_done.png": { "task_done.png": {
"x": 765, "x": 836,
"y": 176, "y": 133,
"w": 71, "w": 71,
"h": 24, "h": 24,
"ox": 29, "ox": 29,
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
"ro": true "ro": true
}, },
"task_friend_icon.png": { "task_friend_icon.png": {
"x": 280, "x": 419,
"y": 184, "y": 184,
"w": 137, "w": 137,
"h": 137, "h": 137,
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
"ro": false "ro": false
}, },
"task_go.png": { "task_go.png": {
"x": 697, "x": 790,
"y": 176, "y": 2,
"w": 129, "w": 129,
"h": 66, "h": 66,
"ox": 0, "ox": 0,
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
"ro": false "ro": false
}, },
"task_shop_icon.png": { "task_shop_icon.png": {
"x": 141, "x": 280,
"y": 184, "y": 184,
"w": 137, "w": 137,
"h": 137, "h": 137,
...@@ -88,6 +88,17 @@ ...@@ -88,6 +88,17 @@
"ro": false "ro": false
}, },
"task_sign_icon.png": { "task_sign_icon.png": {
"x": 141,
"y": 184,
"w": 137,
"h": 137,
"ox": 0,
"oy": 0,
"sw": 137,
"sh": 137,
"ro": false
},
"task_vip_icon.png": {
"x": 2, "x": 2,
"y": 184, "y": 184,
"w": 137, "w": 137,
......
{ {
"wareHouse_icon.png": { "wareHouse_icon.png": {
"x": 2, "x": 316,
"y": 2, "y": 2,
"w": 149, "w": 149,
"h": 178, "h": 178,
...@@ -9,5 +9,60 @@ ...@@ -9,5 +9,60 @@
"sw": 149, "sw": 149,
"sh": 178, "sh": 178,
"ro": false "ro": false
},
"wareHouse_item_bg.png": {
"x": 2,
"y": 2,
"w": 312,
"h": 328,
"ox": 0,
"oy": 0,
"sw": 312,
"sh": 328,
"ro": false
},
"wareHouse_灞辨牳妗�.png": {
"x": 2,
"y": 332,
"w": 140,
"h": 164,
"ox": 0,
"oy": 0,
"sw": 140,
"sh": 164,
"ro": true
},
"wareHouse_鏉挎牀.png": {
"x": 316,
"y": 182,
"w": 140,
"h": 152,
"ox": 0,
"oy": 0,
"sw": 140,
"sh": 152,
"ro": true
},
"wareHouse_鑵版灉.png": {
"x": 168,
"y": 332,
"w": 133,
"h": 164,
"ox": 0,
"oy": 0,
"sw": 133,
"sh": 164,
"ro": true
},
"wareHouse_鑺辩敓.png": {
"x": 334,
"y": 324,
"w": 140,
"h": 148,
"ox": 0,
"oy": 0,
"sw": 140,
"sh": 148,
"ro": false
} }
} }
\ No newline at end of file
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
"name": "taskPanel" "name": "taskPanel"
}, },
{ {
"keys": "wareHouse_icon.png", "keys": "wareHouse_icon.png,wareHouse_item_bg.png,wareHouse_山核桃.png,wareHouse_开心果.png,wareHouse_板栗.png,wareHouse_瓜子.png,wareHouse_腰果.png,wareHouse_花生.png",
"name": "wareHouse" "name": "wareHouse"
} }
], ],
......
...@@ -113,7 +113,7 @@ export const ResJson = { ...@@ -113,7 +113,7 @@ export const ResJson = {
"name": "taskPanel" "name": "taskPanel"
}, },
{ {
"keys": "wareHouse_icon.png", "keys": "wareHouse_icon.png,wareHouse_item_bg.png,wareHouse_山核桃.png,wareHouse_开心果.png,wareHouse_板栗.png,wareHouse_瓜子.png,wareHouse_腰果.png,wareHouse_花生.png",
"name": "wareHouse" "name": "wareHouse"
} }
], ],
......
...@@ -124,7 +124,7 @@ class TaskItem extends Container implements IScrollListItem { ...@@ -124,7 +124,7 @@ class TaskItem extends Container implements IScrollListItem {
// type: 'buy', // type: 'buy',
// name: '购买指定商品', // name: '购买指定商品',
// tips: '今日完成下单即可领水滴', // tips: '今日完成下单即可领水滴',
// num: '60', // count: '60',
// done: false, // done: false,
// }, // },
if (!data) return; if (!data) return;
......
...@@ -4,6 +4,8 @@ import Sprite = FYGE.Sprite; ...@@ -4,6 +4,8 @@ import Sprite = FYGE.Sprite;
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import Tween = FYGE.Tween; import Tween = FYGE.Tween;
import Ease = FYGE.Ease; import Ease = FYGE.Ease;
import { Container, TextField } from "fyge";
import { PLANT_TYPE, s_PlantData } from "../const/staticData";
export default class WareHousePanel extends Panel { export default class WareHousePanel extends Panel {
get groupNames() { get groupNames() {
...@@ -21,6 +23,8 @@ export default class WareHousePanel extends Panel { ...@@ -21,6 +23,8 @@ export default class WareHousePanel extends Panel {
this.closeBtn = this.addChild(Tool.getSprite('closeBtn.png')); this.closeBtn = this.addChild(Tool.getSprite('closeBtn.png'));
this.closeBtn.position.set(670, -50); this.closeBtn.position.set(670, -50);
this.addChild(new WareHouseItem(PLANT_TYPE.Cashew))
} }
public showAni() { public showAni() {
...@@ -49,3 +53,36 @@ export default class WareHousePanel extends Panel { ...@@ -49,3 +53,36 @@ export default class WareHousePanel extends Panel {
} }
} }
class WareHouseItem extends Container {
private countLabel: TextField;
private _count: number = 0;
public get count(): number {
return this._count;
}
public set count(count: number) {
this._count = count;
this.countLabel && (this.countLabel.text = `数量:${this._count}`);
}
constructor(type: PLANT_TYPE) {
super();
this.count = 0;
this.addChild(Tool.getSprite('wareHouse_item_bg.png'));
const plantIcon = this.addChild(Tool.getSprite(`wareHouse_${s_PlantData[type].name}.png`));
plantIcon.position.set((this.width - plantIcon.width) / 2, 35);
const nameLabel = this.addChild(Tool.getText(s_PlantData[type].name, 28, '#a65310'));
nameLabel.position.set((this.width - nameLabel.textWidth) / 2, 212);
this.countLabel = this.addChild(Tool.getText('数量:0', 22, '#9a9a9a'));
this.countLabel.position.set(111, 258);
}
}
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