Commit 4f69388d authored by Edwise's avatar Edwise 🍷

搞定

parent 4e0b8f5c
No preview for this file type
No preview for this file type
No preview for this file type
<?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:Image y="0" source="ex_bg_png" touchEnabled="false" x="156"/> <e:Group width="750" height="646" x="-180" y="170" scaleX="1.3" scaleY="1.3">
<e:Group id="propGroup" y="126" anchorOffsetX="0" width="437" horizontalCenter="52.5" visible="false"> <e:Image y="0" source="ex_bg_png" touchEnabled="false" x="156" scaleX="1" scaleY="1"/>
<e:Group id="sp_1_group" x="0" y="0" width="38" height="67" visible="false"> <e:Group id="propGroup" y="126" anchorOffsetX="0" width="437" horizontalCenter="52.5" x="209" scaleX="1" scaleY="1" visible="false">
<e:Group id="sp_1_group" x="0" y="0" width="38" height="67" visible="false">
<e:Image y="0" anchorOffsetX="0" width="-78.58" horizontalCenter="0" source="ex_sp1_png"/> <e:Image y="0" anchorOffsetX="0" width="-78.58" horizontalCenter="0" source="ex_sp1_png"/>
<e:Label id="sp_1_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/> <e:Label id="sp_1_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/>
</e:Group> </e:Group>
<e:Label id="add1" text="+" x="51" y="20.5" size="26" alpha="0.6" textColor="0xffffff" visible="false"/> <e:Label id="add1" text="+" x="51" y="20.5" size="26" alpha="0.6" textColor="0xffffff" visible="false"/>
<e:Group id="sp_2_group" x="80" y="0" width="38" height="67" visible="false"> <e:Group id="sp_2_group" x="80" y="0" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="ex_sp2_png"/> <e:Image y="0" horizontalCenter="0" source="ex_sp2_png"/>
<e:Label id="sp_2_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/> <e:Label id="sp_2_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/>
</e:Group> </e:Group>
<e:Label id="add2" text="+" x="131" y="20.5" size="26" alpha="0.6" textColor="0xffffff" visible="false"/> <e:Label id="add2" text="+" x="131" y="20.5" size="26" alpha="0.6" textColor="0xffffff" visible="false"/>
<e:Group id="sp_3_group" x="160" y="0" width="38" height="67" visible="false"> <e:Group id="sp_3_group" x="160" y="0" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="ex_sp3_png"/> <e:Image y="0" horizontalCenter="0" source="ex_sp3_png"/>
<e:Label id="sp_3_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/> <e:Label id="sp_3_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/>
</e:Group> </e:Group>
<e:Label id="add3" text="+" x="211" y="20.5" size="26" alpha="0.6" textColor="0xffffff" visible="false"/> <e:Label id="add3" text="+" x="211" y="20.5" size="26" alpha="0.6" textColor="0xffffff" visible="false"/>
<e:Group id="sp_4_group" x="240" y="0" width="38" height="67" visible="false"> <e:Group id="sp_4_group" x="240" y="0" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="ex_sp4_png"/> <e:Image y="0" horizontalCenter="0" source="ex_sp4_png"/>
<e:Label id="sp_4_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/> <e:Label id="sp_4_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/>
</e:Group> </e:Group>
<e:Label id="add4" text="+" x="291" y="20.5" size="26" alpha="0.6" textColor="0xFFFFFF" visible="false"/> <e:Label id="add4" text="+" x="291" y="20.5" size="26" alpha="0.6" textColor="0xFFFFFF" visible="false"/>
<e:Group id="sp_5_group" x="320" y="0" width="38" height="67" visible="false"> <e:Group id="sp_5_group" x="320" y="0" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="ex_sp5_png"/> <e:Image y="0" horizontalCenter="0" source="ex_sp5_png"/>
<e:Label id="sp_5_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xFFFFFF"/> <e:Label id="sp_5_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xFFFFFF"/>
</e:Group> </e:Group>
<e:Label id="add5" text="+" x="371" y="20.5" size="26" alpha="0.6" textColor="0xFFFFFF" visible="false"/> <e:Label id="add5" text="+" x="371" y="20.5" size="26" alpha="0.6" textColor="0xFFFFFF" visible="false"/>
<e:Group id="sp_6_group" x="400" y="0" width="38" height="67" visible="false"> <e:Group id="sp_6_group" x="400" y="0" width="38" height="67" visible="false">
<e:Image y="0" horizontalCenter="0" source="ex_sp6_png"/> <e:Image y="0" horizontalCenter="0" source="ex_sp6_png"/>
<e:Label id="sp_6_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xFFFFFF"/> <e:Label id="sp_6_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xFFFFFF"/>
</e:Group>
</e:Group> </e:Group>
<e:Image id="btn" y="283" source="ex_btn_png" x="186" scaleX="1" scaleY="1"/>
<e:Image id="btn_1" y="283" x="350" source="ex_buybtn_png" scaleX="1" scaleY="1"/>
<e:Image id="closeBtn" y="283" x="518" source="ex_close_png" scaleX="1" scaleY="1"/>
<e:Label id="title" text="Title" y="200" size="27" horizontalCenter="0" x="350" scaleX="1" scaleY="1" visible="false"/>
<e:Label id="introduce" text="商品介绍:商品介绍商品介绍商品介绍" y="473" textColor="0xb2ada8" size="20" anchorOffsetX="0" width="468" anchorOffsetY="0" height="73" horizontalCenter="0" x="141" scaleX="1" scaleY="1" visible="false"/>
<e:Label id="stock" text="剩余数量:0" y="555" textColor="0xB2ADA8" size="20" x="140" scaleX="1" scaleY="1" visible="false"/>
<e:Image id="titleImg" source="ex_titleImg_png" y="10" height="100" width="100" x="389" scaleX="1" scaleY="1"/>
<e:Image id="titleMask" source="ex_titleImg_png" y="10" horizontalCenter="64" width="100" height="100" x="389" scaleX="1" scaleY="1"/>
<e:Image source="ex_panda_png" left="0" bottom="0" x="0" y="397" scaleX="1" scaleY="1" visible="false"/>
<e:Label id="newextxt" text="今天我需要「300」袋跟你换实物哦, 或者直接卖给我,每袋可以得「20」欢趣豆。 考虑看看呢?" x="184" y="141" textColor="0x333333" size="24" width="487" textAlign="left" lineSpacing="10" scaleX="1" scaleY="1"/>
</e:Group> </e:Group>
<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="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="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:Image id="titleImg" source="ex_titleImg_png" y="10" height="100" width="100" x="389"/>
<e:Image id="titleMask" source="ex_titleImg_png" y="10" horizontalCenter="64" width="100" height="100"/>
<e:Image source="ex_panda_png" left="0" bottom="0"/>
<e:Label id="newextxt" text="今天我需要「300」袋跟你换实物哦, 或者直接卖给我,每袋可以得「20」欢趣豆。 考虑看看呢?" x="184" y="141" textColor="0x333333" size="24" width="487" textAlign="left" lineSpacing="10"/>
</e:Skin> </e:Skin>
\ No newline at end of file
import Panel from "../views/Panel"; import Panel from "../views/Panel";
import { G_GetHomeDataByKey, HOME } from "../Scenes/Home"; import { G_GetHomeDataByKey, G_UpdateHomeData, HOME } from "../Scenes/Home";
import { btnDelay, showToast } from "../comm/UtilsConst"; 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 SceneCtrl from "../ctrls/sceneCtrl";
import { getlogItem } from "../comm/getlogItem"; import { getlogItem } from "../comm/getlogItem";
import WareHousePanel, { productData } from "./WareHousePanel"; import WareHousePanel, { productData, seedData } from "./WareHousePanel";
import TopLayerCtrl from "../ctrls/topLayerCtrl";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
export default class ExchangePanel extends Panel { export default class ExchangePanel extends Panel {
public closeBtn: eui.Button; public closeBtn: eui.Button;
...@@ -82,9 +84,17 @@ export default class ExchangePanel extends Panel { ...@@ -82,9 +84,17 @@ export default class ExchangePanel extends Panel {
case this.btn_1: case this.btn_1:
console.error("卖掉点击===》"); console.error("卖掉点击===》");
// this.hidePanel(); // this.hidePanel();
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE); // SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
NetManager.ins.clickLog(getlogItem(5)); NetManager.ins.clickLog(getlogItem(5));
PanelCtrl.instance.show(WareHousePanel); // PanelCtrl.instance.show(WareHousePanel);
let key = Object.keys(this.data.spMap)[0];
let total = productData[key].total
if(total<=0){
showToast('暂无农作物可出售')
}else{
TopLayerCtrl.instance.show(ModuleTypes.SELL_PANEL, {key: key, total: total}, .4);
}
break; break;
default: default:
break; break;
...@@ -92,12 +102,19 @@ export default class ExchangePanel extends Panel { ...@@ -92,12 +102,19 @@ export default class ExchangePanel extends Panel {
} }
protected start() { protected start() {
this.titleMask.visible = false;
this.titleImg.visible = false;
this.y = 750 / window.innerWidth * window.innerHeight * 0.2;
super.start(); super.start();
this.initUI(); this.getHouseInfo();
GDispatcher.addEvent('updateExchangePanel',this.getHouseInfo,this)
} }
private async initUI() { private async initUI() {
this.titleMask.visible = true;
this.titleImg.visible = true;
this.y = 750 / window.innerWidth * window.innerHeight * 0.2; this.y = 750 / window.innerWidth * window.innerHeight * 0.2;
this.titleImg.mask = this.titleMask; this.titleImg.mask = this.titleMask;
this.titleImg.source = this.data.icon; this.titleImg.source = this.data.icon;
...@@ -127,13 +144,23 @@ export default class ExchangePanel extends Panel { ...@@ -127,13 +144,23 @@ export default class ExchangePanel extends Panel {
productData[k].price = data[k]; productData[k].price = data[k];
} }
iprice = productData[key0].price; iprice = productData[key0].price;
this.newextxt.text = `今天我需要「${changespnum}${danwei}${name}跟你换${this.data.name}哦, 或者直接卖给我,每可以得「${iprice}」欢趣豆。 考虑看看呢?`; this.newextxt.text = `今天我需要「${changespnum}${danwei}${name}跟你换${this.data.name}哦, 或者直接卖给我,每${danwei}可以得「${iprice}」欢趣豆。 考虑看看呢?`;
}); });
} else { } else {
this.newextxt.text = `今天我需要「${changespnum}${danwei}${name}跟你换${this.data.name}哦, 或者直接卖给我,每袋可以得「${iprice}」欢趣豆。 考虑看看呢?`; this.newextxt.text = `今天我需要「${changespnum}${danwei}${name}跟你换${this.data.name}哦, 或者直接卖给我,每袋可以得「${iprice}」欢趣豆。 考虑看看呢?`;
} }
} }
private async getHouseInfo() {
await G_UpdateHomeData();
const product = G_GetHomeDataByKey(HOME.PRODUCT);
for (let k in product) {
productData[k].total = product[k];
}
console.log('testhsuju--->>',product)
this.initUI();
}
private setBtn() { private setBtn() {
//TODO 不需要设置btn了! 2021-05-10 //TODO 不需要设置btn了! 2021-05-10
// this.canGet().then( // this.canGet().then(
......
...@@ -36,7 +36,7 @@ export default class ExchangedPanel extends Panel { ...@@ -36,7 +36,7 @@ export default class ExchangedPanel extends Panel {
switch (e.target) { switch (e.target) {
case this.btn: case this.btn:
window.location.href = window['record']; window.location.href = window['record'];
// this.onTouchClose(); this.onTouchClose();
break; break;
case this.record: case this.record:
window.location.href = window['record']; window.location.href = window['record'];
...@@ -75,6 +75,7 @@ export default class ExchangedPanel extends Panel { ...@@ -75,6 +75,7 @@ export default class ExchangedPanel extends Panel {
this.prizeImg.source = data.icon; this.prizeImg.source = data.icon;
}, this.data.prizeId); }, this.data.prizeId);
GDispatcher.dispatchEvent('shopUpdate'); GDispatcher.dispatchEvent('shopUpdate');
} }
destroy() { destroy() {
......
...@@ -133,5 +133,4 @@ export default class SellPanel extends Panel { ...@@ -133,5 +133,4 @@ export default class SellPanel extends Panel {
// this.numBar.destroy(); // this.numBar.destroy();
super.destroy(); super.destroy();
} }
} }
import Panel from "../views/Panel"; import Panel from "../views/Panel";
import { MainDispatcher, MainIns } from "../Scenes/MainScene/MainScene"; import { MainDispatcher, MainIns } from "../Scenes/MainScene/MainScene";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
export default class SelledPanel extends Panel { export default class SelledPanel extends Panel {
public closeBtn: eui.Image; public closeBtn: eui.Image;
...@@ -21,7 +22,7 @@ export default class SelledPanel extends Panel { ...@@ -21,7 +22,7 @@ export default class SelledPanel 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 start() { protected start() {
...@@ -29,12 +30,15 @@ export default class SelledPanel extends Panel { ...@@ -29,12 +30,15 @@ export default class SelledPanel extends Panel {
this.initUI(); this.initUI();
this.okBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchClose, this); this.okBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchClose, this);
MainDispatcher.dispatchEvent('updateWareHouse'); if (MainDispatcher)
MainDispatcher.dispatchEvent('updateWareHouse');
GDispatcher.dispatchEvent('updateExchangePanel');
} }
onTouchClose(): any { onTouchClose(): any {
// MainDispatcher.dispatchEvent('closeWareHouse'); // MainDispatcher.dispatchEvent('closeWareHouse');
MainIns().mainUI.addGold(); // 收豆子的动画 if (MainIns())
MainIns().mainUI.addGold(); // 收豆子的动画
super.onTouchClose(); super.onTouchClose();
} }
......
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