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"?>
<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 id="propGroup" y="126" anchorOffsetX="0" width="437" horizontalCenter="52.5" visible="false">
<e:Group width="750" height="646" x="-180" y="170" scaleX="1.3" scaleY="1.3">
<e:Image y="0" source="ex_bg_png" touchEnabled="false" x="156" scaleX="1" scaleY="1"/>
<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:Label id="sp_1_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xffffff"/>
......@@ -32,14 +33,15 @@
<e:Label id="sp_6_label" text="0/0" y="48.8" size="18" horizontalCenter="0" textColor="0xFFFFFF"/>
</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: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:Skin>
\ No newline at end of file
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 { NetManager } from "../../libs/tw/manager/NetManager";
import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import SceneCtrl from "../ctrls/sceneCtrl";
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 {
public closeBtn: eui.Button;
......@@ -82,9 +84,17 @@ export default class ExchangePanel extends Panel {
case this.btn_1:
console.error("卖掉点击===》");
// this.hidePanel();
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
// SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
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;
default:
break;
......@@ -92,12 +102,19 @@ export default class ExchangePanel extends Panel {
}
protected start() {
this.titleMask.visible = false;
this.titleImg.visible = false;
this.y = 750 / window.innerWidth * window.innerHeight * 0.2;
super.start();
this.initUI();
this.getHouseInfo();
GDispatcher.addEvent('updateExchangePanel',this.getHouseInfo,this)
}
private async initUI() {
this.titleMask.visible = true;
this.titleImg.visible = true;
this.y = 750 / window.innerWidth * window.innerHeight * 0.2;
this.titleImg.mask = this.titleMask;
this.titleImg.source = this.data.icon;
......@@ -127,13 +144,23 @@ export default class ExchangePanel extends Panel {
productData[k].price = data[k];
}
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 {
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() {
//TODO 不需要设置btn了! 2021-05-10
// this.canGet().then(
......
......@@ -36,7 +36,7 @@ export default class ExchangedPanel extends Panel {
switch (e.target) {
case this.btn:
window.location.href = window['record'];
// this.onTouchClose();
this.onTouchClose();
break;
case this.record:
window.location.href = window['record'];
......@@ -75,6 +75,7 @@ export default class ExchangedPanel extends Panel {
this.prizeImg.source = data.icon;
}, this.data.prizeId);
GDispatcher.dispatchEvent('shopUpdate');
}
destroy() {
......
......@@ -133,5 +133,4 @@ export default class SellPanel extends Panel {
// this.numBar.destroy();
super.destroy();
}
}
import Panel from "../views/Panel";
import { MainDispatcher, MainIns } from "../Scenes/MainScene/MainScene";
import { GDispatcher } from "../../libs/tc/util/GDispatcher";
export default class SelledPanel extends Panel {
public closeBtn: eui.Image;
......@@ -21,7 +22,7 @@ export default class SelledPanel extends Panel {
onShowAnim() {
// 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() {
......@@ -29,11 +30,14 @@ export default class SelledPanel extends Panel {
this.initUI();
this.okBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchClose, this);
if (MainDispatcher)
MainDispatcher.dispatchEvent('updateWareHouse');
GDispatcher.dispatchEvent('updateExchangePanel');
}
onTouchClose(): any {
// MainDispatcher.dispatchEvent('closeWareHouse');
if (MainIns())
MainIns().mainUI.addGold(); // 收豆子的动画
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