Commit 5da0b612 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent d0e88819
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
}, },
{ {
"name": "preload", "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" "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"
} }
], ],
"resources": [ "resources": [
...@@ -1330,6 +1330,46 @@ ...@@ -1330,6 +1330,46 @@
"name": "饲料_满_png", "name": "饲料_满_png",
"type": "image", "type": "image",
"url": "assets/index_scene/ui/饲料_满.png" "url": "assets/index_scene/ui/饲料_满.png"
},
{
"name": "roalightimg_png",
"type": "image",
"url": "assets/exchanged_panel/roalightimg.png"
},
{
"name": "closebtn_png",
"type": "image",
"url": "assets/exchanged_panel/closebtn.png"
},
{
"name": "exd_fail_bg_png",
"type": "image",
"url": "assets/exchanged_panel/exd_fail_bg.png"
},
{
"name": "iknowbtn_png",
"type": "image",
"url": "assets/exchanged_panel/iknowbtn.png"
},
{
"name": "lightdotimg_png",
"type": "image",
"url": "assets/exchanged_panel/lightdotimg.png"
},
{
"name": "roalightbg_png",
"type": "image",
"url": "assets/exchanged_panel/roalightbg.png"
},
{
"name": "奖品1_png",
"type": "image",
"url": "assets/exchange/奖品1.png"
},
{
"name": "我要兑换按钮_png",
"type": "image",
"url": "assets/exchange/我要兑换按钮.png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="541" height="270" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="CreditsTip" width="170" height="241" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="货柜_png" bottom="0" horizontalCenter="0" locked="true"/> <e:Image horizontalCenter="0" source="奖品1_png"/>
<e:Group id="btn" horizontalCenter="0" verticalCenter="-32" width="522" height="206"> <e:Group id="btn" width="170" height="241" horizontalCenter="0" verticalCenter="0">
<e:Image source="shop_goods_bg_png" horizontalCenter="0" verticalCenter="0"/> <e:Image source="shop_goods_bg_png" horizontalCenter="0" verticalCenter="0" visible="false"/>
<e:Image id="icon" width="113" height="113" x="20" y="26"/> <e:Image id="icon" width="113" height="113" x="29" y="71"/>
<e:Label id="title" text="标题" size="26" textColor="0x4a4a4a" x="153" y="26"/> <e:Label id="title" text="标题" size="26" x="0" y="32" width="170" textAlign="center" textColor="0xce5004"/>
<e:Label id="add1" text="+" x="201" y="84.5" textColor="0x855933" size="26" alpha="0.6" visible="false"/>
<e:Label id="add2" text="+" x="281" y="84.5" textColor="0x855933" size="26" alpha="0.6" visible="false"/>
<e:Label id="add3" text="+" x="361" y="84.5" textColor="0x855933" size="26" alpha="0.6" visible="false"/>
<e:Label id="add4" text="+" x="441" y="84.5" textColor="0x855933" size="26" alpha="0.6" visible="false"/>
<e:Label id="add5" text="+" x="521" y="84.5" textColor="0x855933" size="26" alpha="0.6" visible="false"/>
<e:Group id="sp_1_group" x="150" y="64" width="38" height="67" visible="false">
<e:Image y="0" source="shop_goods_egg_png" horizontalCenter="0"/>
<e:Label id="sp_1_label" text="0/0" y="48.8" textColor="0x855933" size="18" horizontalCenter="0"/>
</e:Group>
<e:Group id="sp_2_group" x="230" y="64" width="38" height="67" visible="false">
<e:Image source="shop_goods_wheat_png" y="0" horizontalCenter="0"/>
<e:Label id="sp_2_label" text="0/0" y="48.8" textColor="0x855933" size="18" horizontalCenter="0"/>
</e:Group>
<e:Group id="sp_3_group" x="310" y="64" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="shop_goods_corn_png"/>
<e:Label id="sp_3_label" text="0/0" y="48.8" textColor="0x855933" size="18" horizontalCenter="0"/>
</e:Group>
<e:Group id="sp_4_group" x="390" y="64" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="shop_goods_milk_png"/>
<e:Label id="sp_4_label" text="0/0" y="48.8" textColor="0x855933" size="18" horizontalCenter="0"/>
</e:Group>
<e:Group id="sp_5_group" x="400" y="64" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="shop_goods_potato_png"/>
<e:Label id="sp_5_label" text="0/0" y="48.8" textColor="0x855933" size="18" horizontalCenter="0"/>
</e:Group>
<e:Group id="sp_6_group" x="410" y="64" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="shop_goods_walnut_png"/>
<e:Label id="sp_6_label" text="0/0" y="48.8" textColor="0x855933" size="18" horizontalCenter="0"/>
</e:Group>
<e:Label id="stock_label" text="剩余0份" x="19" y="176" textColor="0xed3330" size="18" bold="true" locked="true"/>
<e:Rect id="mk" anchorOffsetX="0" anchorOffsetY="0" left="0" top="0" right="0" bottom="0" ellipseWidth="22" ellipseHeight="22" fillColor="0x6c3907" fillAlpha="0.6" visible="false"/> <e:Rect id="mk" anchorOffsetX="0" anchorOffsetY="0" left="0" top="0" right="0" bottom="0" ellipseWidth="22" ellipseHeight="22" fillColor="0x6c3907" fillAlpha="0.6" visible="false"/>
<e:Image source="我要兑换按钮_png" horizontalCenter="0" bottom="1"/>
<e:Label id="stock_label" text="剩余0份" x="0" size="18" bold="true" width="171" bottom="-18" textAlign="center" textColor="0xffffff"/>
</e:Group> </e:Group>
</e:Skin> </e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="646" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="CreditsTip" width="750" height="646" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Button id="closeBtn" label="" y="0" x="571" visible="false">
<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:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Image y="0" source="ex_bg_png" touchEnabled="false" x="156"/> <e:Image y="0" source="ex_bg_png" touchEnabled="false" x="156"/>
<e:Group id="propGroup" y="126" anchorOffsetX="0" width="437" horizontalCenter="52.5" visible="false"> <e:Group id="propGroup" y="126" anchorOffsetX="0" width="437" horizontalCenter="52.5" visible="false">
<e:Group id="sp_1_group" x="0" y="0" width="38" height="67" visible="false"> <e:Group id="sp_1_group" x="0" y="0" width="38" height="67" visible="false">
...@@ -42,7 +34,7 @@ ...@@ -42,7 +34,7 @@
</e:Group> </e:Group>
<e:Image id="btn" y="283" source="ex_btn_png" x="186"/> <e:Image id="btn" y="283" source="ex_btn_png" x="186"/>
<e:Image id="btn_1" y="283" x="350" source="ex_buybtn_png"/> <e:Image id="btn_1" y="283" x="350" source="ex_buybtn_png"/>
<e:Image id="btn_2" y="283" x="518" source="ex_close_png"/> <e:Image id="closeBtn" y="283" x="518" source="ex_close_png"/>
<e:Label id="title" text="Title" y="200" size="27" horizontalCenter="0" visible="false"/> <e:Label id="title" text="Title" y="200" size="27" horizontalCenter="0" visible="false"/>
<e:Label id="introduce" text="商品介绍:商品介绍商品介绍商品介绍" y="473" textColor="0xb2ada8" size="20" anchorOffsetX="0" width="468" anchorOffsetY="0" height="73" horizontalCenter="0" visible="false"/> <e:Label id="introduce" text="商品介绍:商品介绍商品介绍商品介绍" y="473" textColor="0xb2ada8" size="20" anchorOffsetX="0" width="468" anchorOffsetY="0" height="73" horizontalCenter="0" visible="false"/>
<e:Label id="stock" text="剩余数量:0" y="555" textColor="0xB2ADA8" size="20" x="140" visible="false"/> <e:Label id="stock" text="剩余数量:0" y="555" textColor="0xB2ADA8" size="20" x="140" visible="false"/>
......
...@@ -3,25 +3,23 @@ ...@@ -3,25 +3,23 @@
<w:Config id="16e64c53e86"/> <w:Config id="16e64c53e86"/>
<e:Group id="group" left="0" right="0" horizontalCenter="0" touchChildren="true" touchEnabled="false" top="0" height="1624"> <e:Group id="group" left="0" right="0" horizontalCenter="0" touchChildren="true" touchEnabled="false" top="0" height="1624">
<e:Group id="shopLayer" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" x="0" y="0" scaleX="1" scaleY="1"> <e:Group id="shopLayer" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624" x="0" y="0" scaleX="1" scaleY="1">
<e:Image source="shop_bg_png" horizontalCenter="0" verticalCenter="0" locked="true"/> <e:Image source="shop_bg_png" horizontalCenter="0" verticalCenter="0"/>
<e:Image id="backBtn" source="返回农场_png" horizontalCenter="-272.5" verticalCenter="-495"/> <e:Image id="backBtn" source="返回农场_png" horizontalCenter="-272" verticalCenter="-561"/>
<e:Group id="goodsGroup" width="541" height="740" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="-0.5" y="524" locked="true"> <e:Group id="goodsGroup" width="541" height="285" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="-0.5" y="708.85">
<e:Group id="none" horizontalCenter="0" verticalCenter="0" top="0" right="0" left="0" bottom="0" visible="false"> <e:Group id="none" horizontalCenter="0" verticalCenter="0" top="0" right="0" left="0" bottom="0">
<e:Label text="补货中,晚点再来看看吧" y="112" scaleX="1" scaleY="1" size="28" horizontalCenter="0"/> <e:Label text="补货中,晚点再来看看吧" y="112" scaleX="1" scaleY="1" size="28" horizontalCenter="0"/>
<e:Image source="货柜_png" y="200" scaleX="1" scaleY="1" horizontalCenter="0"/>
<e:Image source="货柜_png" y="501" scaleX="1" scaleY="1" horizontalCenter="0"/>
</e:Group> </e:Group>
<e:Scroller id="have" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" top="0" left="0" right="0" bottom="0"> <e:Scroller id="have" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" top="0" left="0" right="0" bottom="0">
<e:Group anchorOffsetX="0" width="203.03" anchorOffsetY="0" height="736.12" x="0" y="-74"> <e:Group anchorOffsetX="0" width="1082" anchorOffsetY="0" height="285" x="0" y="-74">
<e:List id="list" left="0" right="0" y="55"> <e:List id="list" y="0" width="541" x="0">
<e:layout> <e:layout>
<e:VerticalLayout gap="37"/> <e:HorizontalLayout/>
</e:layout> </e:layout>
</e:List> </e:List>
</e:Group> </e:Group>
</e:Scroller> </e:Scroller>
</e:Group> </e:Group>
<e:Image id="recordBtn" source="兑换记录_png" verticalCenter="-330.5" horizontalCenter="-272"/> <e:Image id="recordBtn" source="兑换记录_png" verticalCenter="-458.5" horizontalCenter="-272"/>
<e:Image source="前景_png" touchEnabled="false" scaleX="1" scaleY="1" y="662" horizontalCenter="0" locked="true"/> <e:Image source="前景_png" touchEnabled="false" scaleX="1" scaleY="1" y="662" horizontalCenter="0" locked="true"/>
<e:Image source="灯_png" horizontalCenter="0" x="195" y="515" scaleX="1" scaleY="1" touchEnabled="false" locked="true"/> <e:Image source="灯_png" horizontalCenter="0" x="195" y="515" scaleX="1" scaleY="1" touchEnabled="false" locked="true"/>
</e:Group> </e:Group>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="CreditsTip" width="750" height="612" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="CreditsTip" width="750" height="550" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Button id="closeBtn" label="" y="509" horizontalCenter="-3.5"> <e:Button id="closeBtn" label="" right="62" top="-49">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled"> <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="closebtn_png" source.down="closebtn_png" source.disabled="closebtn_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/> <e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Image touchEnabled="false" source="exd_bg_png" horizontalCenter="7" y="0"/> <e:Image id="exd_suc_bg" touchEnabled="false" source="exd_bg_png" horizontalCenter="7" y="0"/>
<e:Image id="exd_fail_bg" touchEnabled="false" horizontalCenter="7" y="0" source="exd_fail_bg_png"/>
<e:Image id="btn" y="373" horizontalCenter="-3.5" source="exd_btn_png"/> <e:Image id="btn" y="373" horizontalCenter="-3.5" source="exd_btn_png"/>
<e:Label id="title" text="name" y="338" textColor="0xb2ada8" size="20" horizontalCenter="-3.5"/> <e:Image id="btn1" y="373" horizontalCenter="-3.5" source="iknowbtn_png"/>
<e:Image id="record" source="exd_record_png" y="127" horizontalCenter="-3.5"/> <e:Label id="title" text="name" y="338" textColor="0xb2ada8" size="20" horizontalCenter="-3.5" visible="false"/>
<e:Image id="prizeImg" y="179" source="" horizontalCenter="-3.5" width="145" height="145"/> <e:Image id="record" source="exd_record_png" y="127" horizontalCenter="-3.5" visible="false"/>
<e:Image id="prizeImg" y="179" source="" horizontalCenter="-3.5" width="145" height="145" visible="false"/>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
<e:Label id="xiaoEIKnow" text="我知道了&gt;" x="315" y="200.04" size="22" bold="true" anchorOffsetX="0" anchorOffsetY="0" textColor="0x785332"/> <e:Label id="xiaoEIKnow" text="我知道了&gt;" x="315" y="200.04" size="22" bold="true" anchorOffsetX="0" anchorOffsetY="0" textColor="0x785332"/>
</e:Group> </e:Group>
<e:Image id="xiaoE1" x="24" source="小E_png" verticalCenter="62.5" visible="false"/> <e:Image id="xiaoE1" x="24" source="小E_png" verticalCenter="62.5" visible="false"/>
<e:Image id="hotballoon" source="hotballoon_png" x="334.12" y="103.03" locked="true"/> <e:Image id="hotballoon" source="hotballoon_png" x="334.12" verticalCenter="-501.5"/>
<e:Group id="xiaoETip" x="180" anchorOffsetX="0" anchorOffsetY="0" touchChildren="false" y="540" visible="false"> <e:Group id="xiaoETip" x="180" anchorOffsetX="0" anchorOffsetY="0" touchChildren="false" y="540" visible="false">
<e:Image id="xiaoETipImg" x="0" y="0" scaleX="1" scaleY="1" source="xiaoETip_get_png"/> <e:Image id="xiaoETipImg" x="0" y="0" scaleX="1" scaleY="1" source="xiaoETip_get_png"/>
</e:Group> </e:Group>
<e:Group id="advertBtn" width="303.03" height="212.13" x="339.15" y="103.21" anchorOffsetX="0" anchorOffsetY="0"/> <e:Group id="advertBtn" width="303.03" height="212.13" x="339.15" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-603"/>
<e:Group id="xiaoE" width="206.06" height="175.77" x="346.12" y="352.6" anchorOffsetX="0" anchorOffsetY="0"/> <e:Group id="xiaoE" width="206.06" height="175.77" x="346.12" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="-371"/>
</e:Group> </e:Group>
</e:Skin> </e:Skin>
\ No newline at end of file
...@@ -7,17 +7,17 @@ ...@@ -7,17 +7,17 @@
<e:Group id="speedGroup" y="-80" width="171" height="62" right="0"> <e:Group id="speedGroup" y="-80" width="171" height="62" right="0">
<e:Image source="道具数量框_png" y="50" x="52"/> <e:Image source="道具数量框_png" y="50" x="52"/>
<e:Image source="加速卡_png" x="66" y="-14" touchEnabled="false"/> <e:Image source="加速卡_png" x="66" y="-14" touchEnabled="false"/>
<e:Label id="speedNum" text="× 0" size="28" scaleX="1" scaleY="1" anchorOffsetX="0" width="95" anchorOffsetY="0" height="34" verticalAlign="middle" touchEnabled="false" textAlign="center" y="50" x="52"/> <e:Label id="speedNum" text="" size="28" scaleX="1" scaleY="1" anchorOffsetX="0" width="190" anchorOffsetY="0" height="34" verticalAlign="middle" touchEnabled="false" textAlign="center" y="54" x="5" textColor="0xffffff"/>
</e:Group> </e:Group>
<e:Group id="foodGroup" y="25" width="170" height="63" touchEnabled="true" touchChildren="false" x="11"> <e:Group id="foodGroup" y="25" width="170" height="63" touchEnabled="true" touchChildren="false" x="11">
<e:Image source="道具数量框_png" x="52" y="50"/> <e:Image source="道具数量框_png" x="52" y="50"/>
<e:Image x="66" y="-14" source="饲料_满_png"/> <e:Image x="66" y="-14" source="饲料_满_png"/>
<e:Label id="foodNum" text="× 0" size="28" scaleX="1" scaleY="1" anchorOffsetX="0" width="95" anchorOffsetY="0" height="34" verticalAlign="middle" x="52" y="50" textAlign="center"/> <e:Label id="foodNum" text="" size="28" scaleX="1" scaleY="1" anchorOffsetX="0" width="190" anchorOffsetY="0" height="34" verticalAlign="middle" x="5" y="54" textAlign="center"/>
</e:Group> </e:Group>
<e:Group id="waterGroup" y="130" touchEnabled="true" touchChildren="false" x="11"> <e:Group id="waterGroup" y="130" touchEnabled="true" touchChildren="false" x="11">
<e:Image source="道具数量框_png" x="52" y="50"/> <e:Image source="道具数量框_png" x="52" y="50"/>
<e:Image x="66" y="-14" source="水_空_png"/> <e:Image x="66" y="-14" source="水_空_png"/>
<e:Label id="waterNum" text="× 0" size="28" scaleX="1" scaleY="1" anchorOffsetX="0" width="95" anchorOffsetY="0" height="34" verticalAlign="middle" x="52" y="50" textAlign="center"/> <e:Label id="waterNum" text="" size="28" scaleX="1" scaleY="1" anchorOffsetX="0" width="190" anchorOffsetY="0" height="34" verticalAlign="middle" x="5" y="54" textAlign="center"/>
</e:Group> </e:Group>
</e:Group> </e:Group>
<e:Group id="avatarPanel" x="26" width="278" height="81" anchorOffsetX="0" y="253"> <e:Group id="avatarPanel" x="26" width="278" height="81" anchorOffsetX="0" y="253">
......
...@@ -4,27 +4,32 @@ import { btnDelay, showToast } from "../comm/UtilsConst"; ...@@ -4,27 +4,32 @@ import { btnDelay, showToast } from "../comm/UtilsConst";
import { NetManager } from "../../libs/tw/manager/NetManager"; import { NetManager } from "../../libs/tw/manager/NetManager";
import PanelCtrl from "../ctrls/panelCtrl"; import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes"; import { ModuleTypes } from "../types/sceneTypes";
import SceneCtrl from "../ctrls/sceneCtrl";
import { getlogItem } from "../comm/getlogItem";
import WareHousePanel from "./WareHousePanel";
export default class ExchangePanel extends Panel { export default class ExchangePanel extends Panel {
public closeBtn:eui.Button; public closeBtn: eui.Button;
public propGroup:eui.Group; public propGroup: eui.Group;
public sp_1_group:eui.Group; public sp_1_group: eui.Group;
public sp_1_label:eui.Label; public sp_1_label: eui.Label;
public add1:eui.Label; public add1: eui.Label;
public sp_2_group:eui.Group; public sp_2_group: eui.Group;
public sp_2_label:eui.Label; public sp_2_label: eui.Label;
public add2:eui.Label; public add2: eui.Label;
public sp_3_group:eui.Group; public sp_3_group: eui.Group;
public sp_3_label:eui.Label; public sp_3_label: eui.Label;
public add3:eui.Label; public add3: eui.Label;
public sp_4_group:eui.Group; public sp_4_group: eui.Group;
public sp_4_label:eui.Label; public sp_4_label: eui.Label;
public btn:eui.Image; public btn: eui.Image;
public title:eui.Label; public btn_1: eui.Image;
public introduce:eui.Label;
public stock:eui.Label; public title: eui.Label;
public titleImg:eui.Image; public introduce: eui.Label;
public titleMask:eui.Image; public stock: eui.Label;
public titleImg: eui.Image;
public titleMask: eui.Image;
constructor(data?) { constructor(data?) {
super(data); super(data);
...@@ -32,37 +37,55 @@ export default class ExchangePanel extends Panel { ...@@ -32,37 +37,55 @@ export default class ExchangePanel extends Panel {
onShowAnim() { onShowAnim() {
// const canvasH = 750 / window.innerWidth * window.innerHeight; // const canvasH = 750 / window.innerWidth * window.innerHeight;
egret.Tween.get(this).set({alpha: 0}).to({alpha: 1}, 233, egret.Ease.quadInOut); egret.Tween.get(this).set({ alpha: 0 }).to({ alpha: 1 }, 233, egret.Ease.quadInOut);
} }
protected getTapEvts(): any[] { protected getTapEvts(): any[] {
return super.getTapEvts().concat([ return super.getTapEvts().concat([
[this.btn, this.onTap, this], [this.btn, this.onTap, this],
[this.btn_1, this.onTap, this],
]) ])
} }
private onTap() { private onTap(e: egret.TouchEvent) {
btnDelay(this.btn); btnDelay(e.target);
if(this.data.stock <= 0) { switch (e.target) {
showToast('商品无库存,耐心等待商品补货后再来吧'); case this.btn:
return; if (this.data.stock <= 0) {
} showToast('商品无库存,耐心等待商品补货后再来吧');
if(!this.canGet()) { return;
showToast('啊哦,合成所需食材不足,快去赚食材吧'); }
return; if (!this.canGet()) {
// showToast('啊哦,合成所需食材不足,快去赚食材吧');
PanelCtrl.instance.show(ModuleTypes.EXCHANGED_PANEL, {
type:"fail"
});
return;
}
NetManager.ins.prizeExchange((success, res) => {
if (!success && res.code == "300061") {
showToast(res.message);
return;
}
if (!success) {
showToast('啊哦...目前无法兑换哦');
return;
}
let paneldata = res.data;
paneldata["type"] = "success";
PanelCtrl.instance.show(ModuleTypes.EXCHANGED_PANEL, paneldata);
}, this.data.strategyId);
break;
case this.btn_1:
console.error("卖掉点击===》");
// this.hidePanel();
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
NetManager.ins.clickLog(getlogItem(5));
PanelCtrl.instance.show(WareHousePanel);
break;
default:
break;
} }
NetManager.ins.prizeExchange((success, res) => {
if(!success && res.code == "300061"){
showToast(res.message);
return;
}
if(!success) {
showToast('啊哦...目前无法兑换哦');
return;
}
PanelCtrl.instance.show(ModuleTypes.EXCHANGED_PANEL, res.data);
}, this.data.strategyId);
} }
protected start() { protected start() {
...@@ -101,12 +124,12 @@ export default class ExchangePanel extends Panel { ...@@ -101,12 +124,12 @@ export default class ExchangePanel extends Panel {
private canGet(): Promise<boolean> { private canGet(): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => { return new Promise<boolean>((resolve, reject) => {
const showList = []; const showList = [];
for(let spk in this.data['spMap']) { for (let spk in this.data['spMap']) {
showList.push(spk); showList.push(spk);
} }
const products: {} = G_GetHomeDataByKey(HOME.PRODUCT); const products: {} = G_GetHomeDataByKey(HOME.PRODUCT);
for(let v of showList) { for (let v of showList) {
if(this.data['spMap'][v] > products[v]) { // 有一项不足,不能合成 if (this.data['spMap'][v] > products[v]) { // 有一项不足,不能合成
reject('ex_btn_dis_png'); reject('ex_btn_dis_png');
return; return;
} }
...@@ -118,7 +141,7 @@ export default class ExchangePanel extends Panel { ...@@ -118,7 +141,7 @@ export default class ExchangePanel extends Panel {
// 显示需要的道具 // 显示需要的道具
private setNeed() { private setNeed() {
let showList = []; let showList = [];
for(let spk in this.data['spMap']) { for (let spk in this.data['spMap']) {
showList.push(spk); showList.push(spk);
} }
// 设置道具下的label // 设置道具下的label
...@@ -139,14 +162,14 @@ export default class ExchangePanel extends Panel { ...@@ -139,14 +162,14 @@ export default class ExchangePanel extends Panel {
label.textFlow = <Array<egret.ITextElement>>[ label.textFlow = <Array<egret.ITextElement>>[
{ {
text: products[v].toString(), text: products[v].toString(),
style: {"textColor": (products[v] < spMap[v]) ? 0xed3330 : 0xffffff} style: { "textColor": (products[v] < spMap[v]) ? 0xed3330 : 0xffffff }
}, },
{text: '/' + spMap[v], style: {"textColor": 0xffffff}} { text: '/' + spMap[v], style: { "textColor": 0xffffff } }
]; ];
}); });
// 显示+号 // 显示+号
for(let i = 1; i < showList.length; i++) { for (let i = 1; i < showList.length; i++) {
this[`add${i}`].visible = true; this[`add${i}`].visible = true;
this[`add${i}`].x += i * 10; this[`add${i}`].x += i * 10;
} }
......
...@@ -10,32 +10,40 @@ export default class ExchangedPanel extends Panel { ...@@ -10,32 +10,40 @@ export default class ExchangedPanel extends Panel {
public record: eui.Image; public record: eui.Image;
public prizeImg: eui.Image; public prizeImg: eui.Image;
exd_suc_bg: eui.Image;
exd_fail_bg: eui.Image;
btn1:eui.Image;
constructor(data?) { constructor(data?) {
super(data); super(data);
} }
onShowAnim() { onShowAnim() {
// const canvasH = 750 / window.innerWidth * window.innerHeight; // const canvasH = 750 / window.innerWidth * window.innerHeight;
egret.Tween.get(this).set({alpha: 0}).to({alpha: 1}, 233, egret.Ease.quadInOut); egret.Tween.get(this).set({ alpha: 0 }).to({ alpha: 1 }, 233, egret.Ease.quadInOut);
} }
protected getTapEvts(): any[] { protected getTapEvts(): any[] {
return super.getTapEvts().concat([ return super.getTapEvts().concat([
[this.btn, this.onTap, this], [this.btn, this.onTap, this],
[this.record, this.onTap, this], [this.record, this.onTap, this],
[this.btn1, this.onTap, this],
]) ])
} }
private onTap(e: egret.TouchEvent) { private onTap(e: egret.TouchEvent) {
btnDelay(e.target); btnDelay(e.target);
switch(e.target) { switch (e.target) {
case this.btn: case this.btn:
this.onTouchClose(); window.location.href = window['record'];
// this.onTouchClose();
break; break;
case this.record: case this.record:
window.location.href = window['record']; window.location.href = window['record'];
break; break;
case this.btn1:
this.onTouchClose();
break;
default: default:
break; break;
...@@ -50,10 +58,17 @@ export default class ExchangedPanel extends Panel { ...@@ -50,10 +58,17 @@ export default class ExchangedPanel extends Panel {
private initUI(): void { private initUI(): void {
this.y = 750 / window.innerWidth * window.innerHeight * 0.2; this.y = 750 / window.innerWidth * window.innerHeight * 0.2;
NetManager.ins.queryPrizeInfo((success, res) => { NetManager.ins.queryPrizeInfo((success, res) => {
if(!success) { if (!success) {
return; return;
} }
const data = res.data[0]; const data = res.data[0];
let _v = this.data.type == "success";
this.exd_suc_bg.visible = _v;
this.exd_fail_bg.visible = !_v;
this.btn.visible = _v;
this.btn1.visible = !_v;
this.title.text = data.name; this.title.text = data.name;
let title = data.name.split('_@_'); let title = data.name.split('_@_');
this.title.text = title[0]; this.title.text = title[0];
......
...@@ -85,16 +85,15 @@ export default class ExchangeScene extends Scene { ...@@ -85,16 +85,15 @@ export default class ExchangeScene extends Scene {
G_UpdateHomeData().then(() => { G_UpdateHomeData().then(() => {
this.getGoodsInfo().then(() => { this.getGoodsInfo().then(() => {
const _d = []; const _d = [];
for (let k in this.prizeData) { for (let k in this.prizeData) {
_d.push(this.prizeData[k]); _d.push(this.prizeData[k]);
} }
this.none.visible = (_d.length <= 0); this.none.visible = (_d.length <= 0);
this.have.visible = !(_d.length <= 0); this.have.visible = !(_d.length <= 0);
this.list.useVirtualLayout = false; this.list.useVirtualLayout = false;
this.list.itemRenderer = ExchangeItem; this.list.itemRenderer = ExchangeItem;
this.list.dataProvider = new eui.ArrayCollection(_d); this.list.dataProvider = new eui.ArrayCollection(_d);
console.error("我的奖励数据==》",_d);
}).catch(() => { }).catch(() => {
this.none.visible = true; this.none.visible = true;
this.have.visible = false; this.have.visible = false;
...@@ -213,21 +212,21 @@ class ExchangeItem extends eui.ItemRenderer { ...@@ -213,21 +212,21 @@ class ExchangeItem extends eui.ItemRenderer {
public btn: eui.Group; public btn: eui.Group;
public icon: eui.Image; public icon: eui.Image;
public title: eui.Label; public title: eui.Label;
public add1: eui.Label; // public add1: eui.Label;
public add2: eui.Label; // public add2: eui.Label;
public add3: eui.Label; // public add3: eui.Label;
public sp_1_group: eui.Group; // public sp_1_group: eui.Group;
public sp_1_label: eui.Label; // public sp_1_label: eui.Label;
public sp_2_group: eui.Group; // public sp_2_group: eui.Group;
public sp_2_label: eui.Label; // public sp_2_label: eui.Label;
public sp_3_group: eui.Group; // public sp_3_group: eui.Group;
public sp_3_label: eui.Label; // public sp_3_label: eui.Label;
public sp_4_group: eui.Group; // public sp_4_group: eui.Group;
public sp_4_label: eui.Label; // public sp_4_label: eui.Label;
public sp_5_group: eui.Group; // public sp_5_group: eui.Group;
public sp_5_label: eui.Label; // public sp_5_label: eui.Label;
public sp_6_group: eui.Group; // public sp_6_group: eui.Group;
public sp_6_label: eui.Label; // public sp_6_label: eui.Label;
public stock_label: eui.Label; public stock_label: eui.Label;
public mk: eui.Rect; public mk: eui.Rect;
...@@ -245,6 +244,7 @@ class ExchangeItem extends eui.ItemRenderer { ...@@ -245,6 +244,7 @@ class ExchangeItem extends eui.ItemRenderer {
this.setNeed(); this.setNeed();
this.setBtn(); this.setBtn();
console.error("item定位===》",this.x,this.y);
} }
// 设置按钮 // 设置按钮
...@@ -270,6 +270,7 @@ class ExchangeItem extends eui.ItemRenderer { ...@@ -270,6 +270,7 @@ class ExchangeItem extends eui.ItemRenderer {
// 显示需要的道具 // 显示需要的道具
private setNeed() { private setNeed() {
return;
const showList = []; const showList = [];
const spMap = this.data.spMap; const spMap = this.data.spMap;
for (let spk in spMap) { for (let spk in spMap) {
......
...@@ -238,11 +238,24 @@ export default class MainUI extends ComponentBase { ...@@ -238,11 +238,24 @@ export default class MainUI extends ComponentBase {
this[`${propData['sp_food_2'].name}Group`].visible = true; this[`${propData['sp_food_2'].name}Group`].visible = true;
this.setPropInfoByBI(); this.setPropInfoByBI();
} }
//新道具数量显示
public setPropInfoByBI() { public setPropInfoByBI() {
const data = G_GetHomeDataByKey(HOME.PROP); const data = G_GetHomeDataByKey(HOME.PROP);
for (let k in propData) { for (let k in propData) {
this[`${propData[k].name}Num`].text = '× ' + data[k]; let maxcount = 100;
let textflow = [];
if(data[k]>100){
textflow = [
{text:"100/",style:{textColor:0xFFFFFF}},
{text:data[k],style:{textColor:0xff0000}},
];
}else{
textflow = [
{text:data[k]+"/100",style:{textColor:0xFFFFFF}},
];
}
this[`${propData[k].name}Num`].textFlow = textflow;
// this[`${propData[k].name}Num`].text = '× ' + data[k];
DataManager.ins.updateData(propData[k].name, data[k]); DataManager.ins.updateData(propData[k].name, data[k]);
} }
this[`${propData['sp_prop_1'].name}Group`].visible = data['sp_prop_1'] > 0; this[`${propData['sp_prop_1'].name}Group`].visible = data['sp_prop_1'] > 0;
......
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