Commit e5975944 authored by Edwise's avatar Edwise 🍷

暂存,修改商城皮肤与逻辑

parent 5da0b612
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -102,7 +102,7 @@
},
{
"name": "preload",
"keys": "option_left_png,option_right_png,option_scrollbar_png,ex_panda_png,ex_buybtn_png,ex_close_png,hotballoon_png,道具数量框_png,光线_png,水_半_png,水_空_png,水_满_png,饲料_半_png,饲料_空_png,饲料_满_png,roalightimg_png,closebtn_png,exd_fail_bg_png,iknowbtn_png,lightdotimg_png,roalightbg_png,奖品1_png,我要兑换按钮_png"
"keys": "option_left_png,option_right_png,option_scrollbar_png,ex_panda_png,ex_buybtn_png,ex_close_png,hotballoon_png,道具数量框_png,光线_png,水_半_png,水_空_png,水_满_png,饲料_半_png,饲料_空_png,饲料_满_png,roalightimg_png,closebtn_png,exd_fail_bg_png,iknowbtn_png,lightdotimg_png,roalightbg_png,奖品1_png,我要兑换按钮_png,奖品12_png,我要兑换按钮2_png,ex_buybtn2_png,ex_close2_png,ex_panda2_png,closebtn2_png,exd_fail_bg2_png,iknowbtn2_png,lightdotimg2_png,roalightbg2_png,roalightimg2_png,hotballoon2_png,option_left2_png,option_right2_png,option_scrollbar2_png,规则背景_png,规则关闭_png,introduce_bg_new_png,introduce_btn_close_png,introduce_btn_new_png,shopPanel_close_png,shop_btn_-_png,shop_btn_+_png,shop_item_bg_big_png,shop_item_cntBg_png,prop_apple_png,prop_papaya_png,shopBuy_close_btn_png"
}
],
"resources": [
......@@ -1370,6 +1370,146 @@
"name": "我要兑换按钮_png",
"type": "image",
"url": "assets/exchange/我要兑换按钮.png"
},
{
"name": "奖品12_png",
"type": "image",
"url": "assets/exchange/奖品1.png"
},
{
"name": "我要兑换按钮2_png",
"type": "image",
"url": "assets/exchange/我要兑换按钮.png"
},
{
"name": "ex_buybtn2_png",
"type": "image",
"url": "assets/exchange_panel/ex_buybtn.png"
},
{
"name": "ex_close2_png",
"type": "image",
"url": "assets/exchange_panel/ex_close.png"
},
{
"name": "ex_panda2_png",
"type": "image",
"url": "assets/exchange_panel/ex_panda.png"
},
{
"name": "closebtn2_png",
"type": "image",
"url": "assets/exchanged_panel/closebtn.png"
},
{
"name": "exd_fail_bg2_png",
"type": "image",
"url": "assets/exchanged_panel/exd_fail_bg.png"
},
{
"name": "iknowbtn2_png",
"type": "image",
"url": "assets/exchanged_panel/iknowbtn.png"
},
{
"name": "lightdotimg2_png",
"type": "image",
"url": "assets/exchanged_panel/lightdotimg.png"
},
{
"name": "roalightbg2_png",
"type": "image",
"url": "assets/exchanged_panel/roalightbg.png"
},
{
"name": "roalightimg2_png",
"type": "image",
"url": "assets/exchanged_panel/roalightimg.png"
},
{
"name": "hotballoon2_png",
"type": "image",
"url": "assets/index_scene/hotballoon.png"
},
{
"name": "option_left2_png",
"type": "image",
"url": "assets/index_scene/planting/option/option_left.png"
},
{
"name": "option_right2_png",
"type": "image",
"url": "assets/index_scene/planting/option/option_right.png"
},
{
"name": "option_scrollbar2_png",
"type": "image",
"url": "assets/index_scene/planting/option/option_scrollbar.png"
},
{
"name": "规则背景_png",
"type": "image",
"url": "assets/rule_panel/规则背景.png"
},
{
"name": "规则关闭_png",
"type": "image",
"url": "assets/rule_panel/规则关闭.png"
},
{
"name": "introduce_bg_new_png",
"type": "image",
"url": "assets/introduce_panel/introduce_bg_new.png"
},
{
"name": "introduce_btn_close_png",
"type": "image",
"url": "assets/introduce_panel/introduce_btn_close.png"
},
{
"name": "introduce_btn_new_png",
"type": "image",
"url": "assets/introduce_panel/introduce_btn_new.png"
},
{
"name": "shopPanel_close_png",
"type": "image",
"url": "assets/shop/shopPanel_close.png"
},
{
"name": "shop_btn_-_png",
"type": "image",
"url": "assets/shop/shop_btn_-.png"
},
{
"name": "shop_btn_+_png",
"type": "image",
"url": "assets/shop/shop_btn_+.png"
},
{
"name": "shop_item_bg_big_png",
"type": "image",
"url": "assets/shop/shop_item_bg_big.png"
},
{
"name": "shop_item_cntBg_png",
"type": "image",
"url": "assets/shop/shop_item_cntBg.png"
},
{
"name": "prop_apple_png",
"type": "image",
"url": "assets/common/prop_apple.png"
},
{
"name": "prop_papaya_png",
"type": "image",
"url": "assets/common/prop_papaya.png"
},
{
"name": "shopBuy_close_btn_png",
"type": "image",
"url": "assets/shop/shopBuy_close_btn.png"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="light_png" y="261" horizontalCenter="0.5"/>
<e:Image source="light_png" y="261" horizontalCenter="0.5" visible="false"/>
<e:Image y="421" horizontalCenter="0" source="introduce_bg_png"/>
<e:Button id="closeBtn" label="" y="327" x="531">
<e:skinName>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="1335" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Button id="closeBtn" label="" horizontalCenter="0.5" bottom="100">
<e:Label text="活动说明" y="140" bold="true" horizontalCenter="0" visible="false"/>
<e:Image source="规则背景_png" x="70" y="250"/>
<e:Scroller anchorOffsetX="0" anchorOffsetY="0" width="512" horizontalCenter="0" top="400" bottom="364">
<e:Group anchorOffsetX="0" anchorOffsetY="0">
<e:Label id="ruleLabel" text="" anchorOffsetX="0" anchorOffsetY="0" scaleX="1" scaleY="1" width="512" y="0" lineSpacing="25" verticalAlign="justify" textColor="0x535353" x="0"/>
</e:Group>
</e:Scroller>
<e:Button id="closeBtn" label="" x="630" y="213">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/>
<e:Image width="100%" height="100%" source="规则关闭_png" source.down="规则关闭_png" source.disabled="规则关闭_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label text="活动说明" y="140" bold="true" horizontalCenter="0"/>
<e:Scroller anchorOffsetX="0" anchorOffsetY="0" width="628" horizontalCenter="0" top="200" bottom="230">
<e:Group anchorOffsetX="0" anchorOffsetY="0">
<e:Label id="ruleLabel" text="" anchorOffsetX="0" anchorOffsetY="0" scaleX="1" scaleY="1" width="628" y="0" lineSpacing="25" horizontalCenter="0" verticalAlign="justify"/>
</e:Group>
</e:Scroller>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="1010" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image y="114" source="shopBuy_bg_png" horizontalCenter="0"/>
<e:Image id="closeBtn" source="closeBtn_png" x="649" y="0"/>
<e:Button id="buyBtn" label="" horizontalCenter="7" y="559">
<e:Image id="closeBtn" x="323.5" y="704" source="shopBuy_close_btn_png"/>
<e:Button id="buyBtn" label="" horizontalCenter="0" y="559">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="shopBuy_btn_png" source.down="shopBuy_btn_png" source.disabled="shopBuy_btn_png"/>
......@@ -10,7 +10,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="buyBtn1" label="" horizontalCenter="7" y="559">
<e:Button id="buyBtn1" label="" horizontalCenter="7" y="559" visible="false" locked="true">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="shopBuy_btn1_png" source.down="shopBuy_btn1_png" source.disabled="shopBuy_btn1_png"/>
......@@ -18,7 +18,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="nameTxt" text="0" y="378.5" size="24" textAlign="center" anchorOffsetX="0" width="312" textColor="0x66492F" horizontalCenter="7"/>
<e:Image id="img" source="prop_food_png" top="218" horizontalCenter="7"/>
<e:Label id="tipTxt" text="所需欢趣豆:0" y="487" size="22" textAlign="center" anchorOffsetX="0" width="400" horizontalCenter="7" textColor="0xd98600"/>
<e:Label id="nameTxt" text="0" y="395" size="24" textAlign="center" anchorOffsetX="0" width="312" textColor="0x66492F" horizontalCenter="1"/>
<e:Image id="img" source="prop_food_png" top="190" horizontalCenter="0" width="327" height="195"/>
<e:Label id="tipTxt" text="所需欢趣豆:0" y="487" size="33" textAlign="center" anchorOffsetX="0" width="400" horizontalCenter="7" textColor="0xf88112"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="312" height="379" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image horizontalCenter="0" source="shop_item_bg_png" y="0"/>
<e:Button id="subBtn" label="" verticalCenter="106.5" horizontalCenter="-111">
<e:Skin class="CreditsTip" width="312" height="396" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="imgBg" horizontalCenter="0" source="shop_item_bg_png" y="0"/>
<e:Image id="imgBigBg" source="shop_item_bg_big_png" x="0" y="0"/>
<e:Button id="subBtn" label="" verticalCenter="91" horizontalCenter="-96">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" scaleX.down="0.9" scaleY.down="0.9" source="common_-_en_png" source.down="common_-_en_png" source.disabled="common_-_dis_png"/>
<e:Image width="100%" height="100%" source="shop_btn_-_png" source.down="shop_btn_-_png" source.disabled="shop_btn_-_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="addBtn" label="" verticalCenter="106.5" horizontalCenter="-15.5">
<e:Button id="addBtn" label="" verticalCenter="91" horizontalCenter="90">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" scaleX.down="0.9" scaleY.down="0.9" source="common_+_en_png" source.down="common_+_en_png" source.disabled="common_+_dis_png"/>
<e:Image width="100%" height="100%" source="shop_btn_+_png" source.down="shop_btn_+_png" source.disabled="shop_btn_+_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="buyBtn" label="" horizontalCenter="80.5" verticalCenter="104.5">
<e:Button id="buyBtn" label="" horizontalCenter="-2" verticalCenter="167">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="shop_item_btn_png" source.down="shop_item_btn_dis_png" source.disabled="shop_item_btn_dis_png"/>
<e:Image width="100%" height="100%" source="shop_item_btn_png" source.down="shop_item_btn_png" source.disabled="shop_item_btn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="numTxt" text="0" x="62.5" y="285" size="22" textAlign="center" anchorOffsetX="0" width="60" textColor="0xd19666"/>
<e:Label id="nameTxt" text="0" x="0" y="182" size="24" textAlign="center" anchorOffsetX="0" width="312" textColor="0x66492f"/>
<e:Image id="img" source="prop_food_png" left="29.5" top="22"/>
<e:Label id="tipTxt" text="购买价格:0欢趣豆" x="0" y="230" size="22" textAlign="center" anchorOffsetX="0" width="312" textColor="0x9a9a9a"/>
<e:Rect id="line" width="60" height="2" x="62.5" y="308" anchorOffsetX="0" anchorOffsetY="0" fillColor="0xd19666"/>
<e:Label id="nameTxt" text="0" x="0" y="176" size="24" textAlign="center" anchorOffsetX="0" width="312" textColor="0x66492f"/>
<e:Image id="img" left="38" top="25" source="prop_chicken_png" horizontalCenter="0"/>
<e:Label id="tipTxt" text="购买价格:0欢趣豆" x="0" y="230" size="22" textAlign="center" anchorOffsetX="0" width="312" textColor="0xcd752e"/>
<e:Image id="cntBg" source="shop_item_cntBg_png" x="99.5" y="271"/>
<e:Label id="numTxt" text="0" x="124" y="278" size="22" textAlign="center" anchorOffsetX="0" width="60" textColor="0xd19666"/>
<e:Rect id="line" width="60" height="2" x="62.5" y="308" anchorOffsetX="0" anchorOffsetY="0" fillColor="0xd19666" visible="false"/>
<e:Button id="propBuyBtn" label="" y="269.68" horizontalCenter="0.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="shop_prop_buy_png" source.down="shop_prop_buy_png" source.disabled="shop_prop_none_png"/>
<e:Image width="100%" height="100%" source="shop_item_btn_png" source.down="shop_item_btn_png" source.disabled="shop_prop_none_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="1100" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Skin class="CreditsTip" width="750" height="1211" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image y="114" horizontalCenter="0" source="shopPanel_bg_png" locked="true"/>
<e:Button id="closeBtn" label="" y="47" x="637" locked="true">
<e:Button id="closeBtn" label="" y="127" x="658">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeBtn_png" source.down="closeBtn_png" source.disabled="closeBtn_png"/>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="shopPanel_close_png" source.down="shopPanel_close_png" source.disabled="shopPanel_close_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="tableSeed" label="" x="149" y="284.5" enabled="true" locked="true">
<e:Button id="tableSeed" label="" x="170" y="402" enabled="true">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="shopPanel_table_seed_dis_png" source.down="shopPanel_table_seed_dis_png" source.disabled="shopPanel_table_seed_png"/>
......@@ -17,7 +17,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="tableProp" label="" x="369" y="284.5" locked="true">
<e:Button id="tableProp" label="" x="361" y="402">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="shopPanel_table_prop_dis_png" source.down="shopPanel_table_prop_dis_png" source.disabled="shopPanel_table_prop_png"/>
......@@ -25,10 +25,10 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Scroller id="seedGroup" height="729" y="370" width="664" anchorOffsetY="0" x="43">
<e:Scroller id="seedGroup" height="700" y="482" width="664" anchorOffsetY="0" x="43">
<e:Group y="-74.24"/>
</e:Scroller>
<e:Scroller id="propGroup" height="729" y="370" width="664" anchorOffsetY="0" x="43">
<e:Scroller id="propGroup" height="700" y="482" width="664" anchorOffsetY="0" x="43" locked="true">
<e:Group y="-74.24"/>
</e:Scroller>
</e:Skin>
\ No newline at end of file
......@@ -24,7 +24,7 @@ export {MainStage};
class Main extends eui.UILayer {
protected createChildren(): void {
super.createChildren();
2
egret.lifecycle.addLifecycleListener((context) => {
// custom lifecycle plugin
});
......
......@@ -10,7 +10,7 @@ import {Tools} from "../Tools";
export default class ShopBuyPanel extends Panel {
public closeBtn: eui.Image;
public buyBtn: eui.Button;
public buyBtn1: eui.Button;
// public buyBtn1: eui.Button;
public nameTxt: eui.Label;
public img: eui.Image;
public tipTxt: eui.Label;
......@@ -40,16 +40,16 @@ export default class ShopBuyPanel extends Panel {
this.img.source = `prop_${this.data.key}_png`;
this.nameTxt.text = this.data.name;
this.tipTxt.text = `所需欢趣豆:${this.data.needGold}欢趣豆`;
this.tipTxt.text = `所需欢趣豆:${this.data.needGold}`;
if (this.data.type == 'prop') {
this.buyBtn.visible = false;
} else {
this.buyBtn1.visible = false;
}
// if (this.data.type == 'prop') {
// this.buyBtn.visible = false;
// } else {
// this.buyBtn1.visible = false;
// }
this.buyBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.buy, this);
this.buyBtn1.addEventListener(egret.TouchEvent.TOUCH_TAP, this.buy, this);
// this.buyBtn1.addEventListener(egret.TouchEvent.TOUCH_TAP, this.buy, this);
}
private buy(e) {
......
......@@ -50,7 +50,7 @@ const seedData = [
},
{
key: 'wheat',
name: '水稻',
name: '水稻种子',
spId: 'sp_seed_2',
price: 0,
stock: 0,
......@@ -58,7 +58,7 @@ const seedData = [
},
{
key: 'corn',
name: '玉米',
name: '玉米种子',
spId: 'sp_seed_3',
price: 0,
stock: 0,
......@@ -74,7 +74,7 @@ const seedData = [
},
{
key: 'potato',
name: '土豆',
name: '土豆种子',
spId: 'sp_seed_5',
price: 0,
stock: 0,
......@@ -82,12 +82,28 @@ const seedData = [
},
{
key: 'walnut',
name: '核桃',
name: '核桃种子',
spId: 'sp_seed_6',
price: 0,
stock: 0,
bid: 25,
},
{
key:'apple',
name:'苹果种子',
spId:'sp_seed_7',
price:0,
stock:0,
bid:0,
},
{
key:'papaya',
name:'木瓜种子',
spId:'sp_seed_8',
price:0,
stock:0,
bid:0,
}
];
export default class ShopPanel extends Panel {
......@@ -151,7 +167,7 @@ export default class ShopPanel extends Panel {
// @ts-ignore
const item = this.seedGroup.viewport.addChild(new ShopItem({...v, type: 'seed'}));
item.x = (i % 2) * 351;
item.y = ~~(i / 2) * 369;
item.y = ~~(i / 2) * 409;
});
}
......@@ -238,9 +254,12 @@ class ShopItem extends Component {
public nameTxt: eui.Label;
public img: eui.Image;
public tipTxt: eui.Label;
public line: eui.Rect;
public propBuyBtn: eui.Button;
public cntBg:eui.Image;
public imgBigBg:eui.Image;
public imgBg:eui.Image;
public tipImg:eui.Image;
......@@ -270,13 +289,17 @@ class ShopItem extends Component {
this.addBtn.visible = false;
this.subBtn.visible = false;
this.buyBtn.visible = false;
this.line.visible = false;
this.numTxt.visible = false;
this.cntBg.visible = false;
this.imgBigBg.visible = false;
this.num = 1;
this.nameTxt.y = 186;
this.propBuyBtn.enabled = (this.data.stock > 0);
} else {
this.propBuyBtn.visible = false;
this.imgBg.visible = false;
this.nameTxt.y = 176;
}
NetManager.ins.showLog(getlogItem(this.data.bid));
......
......@@ -61,6 +61,14 @@
{
"spId": "sp_seed_6",
"price": 300
},
{
"spId": "sp_seed_7",
"price": 200
},
{
"spId": "sp_seed_8",
"price": 500
}
]
}
This diff is collapsed.
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