Commit 8955d8ca authored by haiyoucuv's avatar haiyoucuv

1

parent 8c8afcdd
No preview for this file type
......@@ -3,11 +3,34 @@
<component name="ChangeListManager">
<list default="true" id="9464afa6-0efb-46c2-9cfd-05475acd81df" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/SelledPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/SelledPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/egret/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/index1.html" beforeDir="false" afterPath="$PROJECT_DIR$/egret/index1.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/libs/tw/enum/NetName.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/libs/tw/enum/NetName.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/option/feeding.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/option/option_panel.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/option/option_panel.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/option/watering.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/default.res.json" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/default.res.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/default.thm.json" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/default.thm.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/Component/BarSkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/Component/BarSkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/MainSceneSkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/MainSceneSkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/MainUISkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/MainUISkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/skins/Objs/OptionPanelSkin.exml" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/skins/Objs/OptionPanelSkin.exml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/RulePanel/RulePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/RulePanel/RulePanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Panels/WareHousePanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Panels/WareHousePanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/MainScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/MainScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/MainUI.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/MainUI.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Land.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Land.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/OptionPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/OptionPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/ProgressMgr.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Scenes/IndexScene/ProgressMgr.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/components/Bar.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/components/Bar.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/types/Scenes.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/types/Scenes.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/types/sceneTypes.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/types/sceneTypes.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mock/config.js" beforeDir="false" afterPath="$PROJECT_DIR$/mock/config.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mock/joyousManor/getLandInfo.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/joyousManor/getLandInfo.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mock/projectX/getUserSpList.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/projectX/getUserSpList.json" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -21,14 +44,18 @@
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="JsonFile" />
<option value="TypeScript File" />
<option value="JavaScript File" />
<option value="JsonFile" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts" root0="SKIP_INSPECTION" />
</component>
<component name="ProjectId" id="1UXly4q8gNrBULeFyi6ZvdvwPDo" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="1" id="Add" />
......@@ -42,7 +69,7 @@
<property name="Git.Branch.Popup.ShowAllRemotes" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/egret/src/Panels" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/egret/src/Scenes/ShopScene" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="prettierjs.PrettierConfiguration.Package" value="$PROJECT_DIR$/node_modules/prettier" />
......@@ -50,15 +77,16 @@
<property name="ts.external.directory.path" value="$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/jsLanguageServicesImpl/external" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/egret/src/Scenes/IndexScene" />
<recent name="$PROJECT_DIR$/egret/src/Panels" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/egret/src/Scenes/ShopScene" />
<recent name="$PROJECT_DIR$/egret/src/Panels" />
<recent name="$PROJECT_DIR$/egret/src/components" />
<recent name="$PROJECT_DIR$/egret/src/Panels/toastPanel" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/egret/src/Scenes/IndexScene" />
<recent name="$PROJECT_DIR$/egret/src/Panels" />
</key>
</component>
<component name="ServiceViewManager">
<option name="viewStates">
......@@ -107,7 +135,8 @@
<workItem from="1576573375140" duration="43000" />
<workItem from="1576582493871" duration="170000" />
<workItem from="1576582917243" duration="1805000" />
<workItem from="1576806980182" duration="5227000" />
<workItem from="1576806980182" duration="7591000" />
<workItem from="1577069181480" duration="12845000" />
</task>
<servers />
</component>
......@@ -143,10 +172,22 @@
<screen x="36" y="23" width="1644" height="1027" />
</state>
<state x="586" y="160" key="refactoring.ChangeSignatureDialog/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575965663028" />
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="1576812228455">
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="1577094437096">
<screen x="36" y="23" width="1644" height="1027" />
</state>
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1576812228455" />
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1577094437096" />
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup/36.23.1644.1027@36.23.1644.1027" timestamp="1576573315855" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="javascript">
<url>file://$PROJECT_DIR$/egret/src/components/Bar.ts</url>
<line>10</line>
<properties lambdaOrdinal="-1" />
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
\ No newline at end of file
No preview for this file type
......@@ -125,7 +125,27 @@
<script src="https://assets.geilicdn.com/v-components/jsbridge/1.0.1/index.min.js"></script>
<script src="https://yun.duiba.com.cn/db_games/hybrid_app2.js"></script>
<script type="text/javascript">
window['rule'] = '规则规则规则规则\n规则规则规则规则\n规则规则规则规则\n规则规则规则规则\n规则规则规则规则\n';
window['rule'] = '活动时间: \n' +
'即日起\n' +
'\n' +
'活动对象: \n' +
'工银e生活用户\n' +
'\n' +
'活动规则:\n' +
'1.点击对应的土地,选择你想种的作物开始种植或者喂养吧!\n' +
'2.浇灌或者喂养作物成长,作物成熟后可出售成欢趣豆或者兑换好礼。\n' +
'\n' +
'农场玩法:\n' +
'1.水的用途:用以浇灌小麦/玉米等农作物;\n' +
'2.饲料的用途:用以喂养鸡/牛等动物;\n' +
'3.水和饲料怎么来:每天签到和首次分享可获得,完成制定任务也可获得哦;\n' +
'4.作物成熟时间:作物每隔8小时就需要浇水,其中小麦/玉米等农作物需浇水3次,鸡/牛等动物需喂养4次可成熟;\n' +
'5.收获食材:小麦收获后可获得4袋小麦,鸡收获后可获得4个鸡蛋,牛收获后可获得4瓶牛奶,玉米收获后可获得4袋玉米;\n' +
'6.收获的食材将储存在仓库中,点击食材即可出售成欢趣豆哦~\n' +
'其他说明:\n' +
'1.领奖说明:中奖用户请根据中奖页面提示录入对应兑奖信息,具体兑换信息以奖品详情页为准,实物商品将在客户领取成功后15个工作日内发出;\n' +
'2.用户如果违反诚实守信原则或出现违规行为(包括但不限于侵犯第三人合法权益、作弊、扰乱系统、实施网络攻击、恶意套取、批量注册、用机器注册账户、用机器模拟客户端等方式),一经发现我行有权终止该用户参与活动并取消其领奖资格;\n' +
'3.本活动与苹果公司无关。';
function share() {
/******************** demo ********************
......
<head>
<meta charset="utf-8">
<title>欢趣庄园</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<script>var __startTime__ = Date.now()</script>
<meta CONTENT="no-cache">
</head>
<body>
<script type="text/javascript"
src="https://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/vconsole/3.0.0/vconsole.min.js"></script>
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main"
data-orientation="auto" data-scale-mode="showAll" data-frame-rate="60" data-content-width="750"
data-content-height="1624" data-multi-fingered="2" data-show-fps="false" data-show-log="false"
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
</div>
<style>
html,
body {
-ms-touch-action: none;
background: #888888;
padding: 0;
border: 0;
overflow: hidden;
margin: 0;
height: 100%;
}
* {
box-sizing: inherit !important;
}
</style>
<script src="https://assets.geilicdn.com/v-components/jsbridge/1.0.1/index.min.js"></script>
<script src="https://yun.duiba.com.cn/db_games/hybrid_app2.js"></script>
<script>
function share() {
/******************** demo ********************
调用分享交互需要传入的参数如下
******************** demoend ******************/
//pngUrl:分享后链接显示的图片地址
var pngUrl = "https://yun.duiba.com.cn/db_games/qx/joyousManor.jpg";
//shareUrl:分享后点击链接需要跳转的地址
var shareUrl = "https://gonghang.activity-1.m.duiba.com.cn/projectx/pb7d5ade5/f3c09cf32.html";
//title:分享后链接显示的标题
var title = "种菜养鸡 兑换欢趣豆";
//content:分享后链接显示的内容
var content = "来欢趣农场一键开启田园生活";
//封装需要分享的对象
var shareInfo = {
PNGUrl: pngUrl,
ShareUrl: shareUrl,
Title: title,
Content: content
};
// 将对象转为字符串
shareInfo = JSON.stringify(shareInfo);
hybrid_app.share(shareInfo);
}
</script>
<script>
var recordUrl = "//activity.m.duiba.com.cn/crecord/record" //发布皮肤时注意确认
var resPath = "https://yun.duiba.com.cn/db_games/activity/typfzq-20190903/1576482931/";
function resolve(a) {
var b = eval(a);
return b;
}
</script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/lib2_game.min.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/svga.egret.min2.js"></script>
<script crossorigin="anonymous"
src="//yun.duiba.com.cn/db_games/activity/typfzq-20190903/1576584575/output.js"></script>
<script crossorigin="anonymous"
src="//yun.duiba.com.cn/db_games/activity/typfzq-20190903/1576482931/resource/default.thm.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
</script>
<script>
egret.ImageLoader.crossOrigin = "anonymous";
/**
* {
* "renderMode":, //Engine rendering mode, "canvas" or "webgl"
* "audioType": 0 //Use the audio type, 0: default, 2: web audio, 3: audio
* "antialias": //Whether the anti-aliasing is enabled in WebGL mode, true: on, false: off, defaults to false
* "calculateCanvasScaleFactor": //a function return canvas scale factor
* }
**/
setTimeout(function(){
egret.runEgret({
renderMode: "webgl", audioType: 0, calculateCanvasScaleFactor: function (context) {
var backingStore = context.backingStorePixelRatio ||
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;
return (window.devicePixelRatio || 1) / backingStore;
}
});
},400)
</script>
\ No newline at end of file
......@@ -139,5 +139,10 @@ export enum NetName {
DO_TASK,
GET_TASKINFO,
Get_CONSUMERINFO,
PRIZE_EXCHANGE,
GET_PRIZEINFO,
PROP_EXCHANGE,
PROPINFO,
USER_PROP,
}
\ No newline at end of file
......@@ -1535,7 +1535,7 @@ export class NetManager extends ABNetManager {
public toyExchange_xc(callback: Function, activityId: number, petId: number, toyId: number, count: number): void {
const net: INetData = {
name: NetName.TOY_EXCHANGES_DATA_XC,
uri: '/sign/addition/toy/exchange',
uri: '/sign/addition/toy/prizeExchange',
type: 'post',
dataType: 'json',
param: {
......@@ -2040,7 +2040,7 @@ export class NetManager extends ABNetManager {
public exchangeResult(callback: Function, activityId: number, petId: number, orderId: number, pollingCheck: Function, pollingCount = 10): void {
const net: INetData = {
name: NetName.EXCHANGE_RECSULT,
uri: '/sign/addition/toy/exchange/result',
uri: '/sign/addition/toy/prizeExchange/result',
type: 'get',
dataType: 'json',
param: {
......@@ -2656,6 +2656,75 @@ export class NetManager extends ABNetManager {
};
this.send(net);
}
public prizeExchange(callback: Function, strategyId) {
const net: INetData = {
name: NetName.PRIZE_EXCHANGE,
uri: '/projectx/{projectId}/join_6/join.do',
type: 'post',
dataType: 'json',
param: {
strategyId: strategyId
},
callback: callback
};
this.send(net);
}
public prizeInfo(callback: Function, prizeIds) {
const net: INetData = {
name: NetName.GET_PRIZEINFO,
uri: '/projectx/{projectId}/join_6/prizeInfo.do',
type: 'get',
dataType: 'json',
param: {
prizeIds: prizeIds
},
callback: callback
};
this.send(net);
}
public propExchange(callback: Function, ticket) {
const net: INetData = {
name: NetName.PROP_EXCHANGE,
uri: '/projectx/{projectId}/join_7/join.do',
type: 'post',
dataType: 'json',
param: {
ticket: ticket
},
callback: callback
};
this.send(net);
}
public propInfo(callback: Function) {
const net: INetData = {
name: NetName.PROPINFO,
uri: '/projectx/{projectId}/join_7/propInfo.do',
type: 'get',
dataType: 'json',
param: {},
callback: callback
};
this.send(net);
}
public userProp(callback: Function, spId, landId) {
const net: INetData = {
name: NetName.USER_PROP,
uri: '/projectx/{projectId}/join_8/join.do',
type: 'post',
dataType: 'json',
param: {
spId: spId,
landId: landId
},
callback: callback
};
this.send(net);
}
}
var regular = "(\\S+)//(\\S+)/(\\S+)/(\\S+)/(\\S+)";
......
No preview for this file type
......@@ -21,7 +21,7 @@
"name": "main_ui"
},
{
"keys": "篱笆_png,plant_cattle_1_png,plant_cattle_2_png,plant_chicken_1_png,plant_chicken_2_png,plant_corn_1_png,plant_corn_2_png,plant_land_active_png,plant_land_animal_png,plant_land_none_png,plant_land_plant_png,plant_wheat_1_png,plant_wheat_2_png,食槽_png,_DS_Store,feed_png,feeding_png,hand_png,option_chicken_png,option_panel_png,option_wheat_png,water_png,watering_png,plant_cattle_3_png,plant_cattle_4_png,plant_chicken_3_png,plant_chicken_4_png,plant_corn_3_png,plant_wheat_3_png,麦粉_png,鸡蛋_png",
"keys": "篱笆_png,plant_cattle_1_png,plant_cattle_2_png,plant_chicken_1_png,plant_chicken_2_png,plant_corn_1_png,plant_corn_2_png,plant_land_active_png,plant_land_animal_png,plant_land_none_png,plant_land_plant_png,plant_wheat_1_png,plant_wheat_2_png,食槽_png,_DS_Store,feed_png,hand_png,option_chicken_png,option_panel_png,option_wheat_png,water_png,plant_cattle_3_png,plant_cattle_4_png,plant_chicken_3_png,plant_chicken_4_png,plant_corn_3_png,plant_wheat_3_png,麦粉_png,鸡蛋_png,option_cattle_png,light_png",
"name": "index_plant"
},
{
......@@ -47,6 +47,10 @@
{
"keys": "bar_bg_png,规则_png,路径 2_png",
"name": "bar"
},
{
"keys": "道具b_png,返回农场_png,货柜_png,商品b_png,shop_bg_png,商品w_png,道具w_png,灯_png,前景_png",
"name": "shop"
}
],
"resources": [
......@@ -200,11 +204,6 @@
"type": "image",
"name": "feed_png"
},
{
"url": "assets/index_scene/planting/option/feeding.png",
"type": "image",
"name": "feeding_png"
},
{
"url": "assets/index_scene/planting/option/hand.png",
"type": "image",
......@@ -230,11 +229,6 @@
"type": "image",
"name": "water_png"
},
{
"url": "assets/index_scene/planting/option/watering.png",
"type": "image",
"name": "watering_png"
},
{
"url": "assets/task_panel/task_bg.png",
"type": "image",
......@@ -474,6 +468,61 @@
"url": "assets/warehouse_panel/sell_panel/sell_hand.png",
"type": "image",
"name": "sell_hand_png"
},
{
"url": "assets/index_scene/planting/option/option_cattle.png",
"type": "image",
"name": "option_cattle_png"
},
{
"url": "assets/index_scene/planting/option/option_corn.png",
"type": "image",
"name": "option_corn_png"
},
{
"url": "assets/shop/道具b.png",
"type": "image",
"name": "道具b_png"
},
{
"url": "assets/shop/返回农场.png",
"type": "image",
"name": "返回农场_png"
},
{
"url": "assets/shop/货柜.png",
"type": "image",
"name": "货柜_png"
},
{
"url": "assets/shop/商品b.png",
"type": "image",
"name": "商品b_png"
},
{
"url": "assets/shop/shop_bg.png",
"type": "image",
"name": "shop_bg_png"
},
{
"url": "assets/shop/商品w.png",
"type": "image",
"name": "商品w_png"
},
{
"url": "assets/shop/道具w.png",
"type": "image",
"name": "道具w_png"
},
{
"url": "assets/shop/灯.png",
"type": "image",
"name": "灯_png"
},
{
"url": "assets/shop/前景.png",
"type": "image",
"name": "前景_png"
}
]
}
\ No newline at end of file
......@@ -4,8 +4,10 @@
"exmls": [
"resource/skins/MainSceneSkin.exml",
"resource/skins/MainUISkin.exml",
"resource/skins/ShopSkin.exml",
"resource/skins/LoadingSceneSkin.exml",
"resource/skins/LoadingSkin.exml",
"resource/skins/MedalPanelSkin.exml",
"resource/skins/RulePanelSkin.exml",
"resource/skins/SellPanelSkin.exml",
"resource/skins/SellRecordItemSkin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="Bar" width="750" height="91" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="bar_bg_png" horizontalCenter="0" verticalCenter="0"/>
<e:Image id="back" source="路径 2_png" x="36" y="30"/>
<e:Image id="rule" source="规则_png" x="666" y="31.5"/>
<e:Group id="rule" width="63" height="69" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="0" right="30">
<e:Image source="规则_png" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" touchEnabled="false"/>
</e:Group>
<e:Label id="title" text="工行卡中心" y="31.5" textColor="0x333333" horizontalCenter="0"/>
<e:Group id="back" width="63" height="69" anchorOffsetX="0" anchorOffsetY="0" verticalCenter="0" left="30">
<e:Image source="路径 2_png" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" touchEnabled="false"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -4,10 +4,6 @@
<e:Group id="group" horizontalCenter="0" width="750" top="0" height="1624">
<e:Image id="bg" source="index_bg_png" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0"/>
<e:Group id="gameLayer" left="0" right="0" horizontalCenter="0" verticalCenter="0" height="1624">
<e:Component y="664" x="190" skinName="Land" visible="false"/>
<e:Component y="768" x="406" skinName="Land" visible="false"/>
<e:Component y="846" x="58" skinName="Land" visible="false"/>
<e:Component y="962" x="298" skinName="Land" visible="false"/>
</e:Group>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -3,9 +3,9 @@
<w:Config id="16e64c53e86"/>
<e:Group id="uiLayer" left="0" right="0" horizontalCenter="0" touchChildren="true" touchEnabled="false" top="0" height="1624">
<e:Group id="propPanel" width="182" height="198" right="0" verticalCenter="452" touchChildren="true" touchEnabled="false">
<e:Group id="speedGroup" x="11" y="0" width="171" height="62" visible="false">
<e:Image source="加速卡_png" x="0" y="0"/>
<e:Label id="speedNum" text="× 2" size="28" scaleX="1" scaleY="1" right="0" anchorOffsetX="0" width="108" anchorOffsetY="0" height="50" verticalAlign="middle" verticalCenter="4"/>
<e:Group id="speedGroup" x="11" y="0" width="171" height="62">
<e:Image source="加速卡_png" x="0" y="0" touchEnabled="false"/>
<e:Label id="speedNum" text="× 2" size="28" scaleX="1" scaleY="1" right="0" anchorOffsetX="0" width="108" anchorOffsetY="0" height="50" verticalAlign="middle" verticalCenter="4" touchEnabled="false"/>
</e:Group>
<e:Group id="foodGroup" x="12" y="71" width="170" height="63" touchEnabled="true" touchChildren="false">
<e:Image source="饲料_png" x="0" y="0"/>
......@@ -25,7 +25,7 @@
<e:Label id="userGold" text="欢趣豆:23" x="78" y="41" size="20"/>
<e:Image id="medal" source="勋章_png" x="44" y="49" visible="false"/>
</e:Group>
<e:Button id="warehouseBtn" label="" verticalCenter="484.5" horizontalCenter="17.5" anchorOffsetX="53.5" anchorOffsetY="60.5">
<e:Button id="warehouseBtn" label="" verticalCenter="484.5" horizontalCenter="-89.5" anchorOffsetX="53.5" anchorOffsetY="60.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="仓库_btn_png" source.down="仓库_btn_png" source.disabled="仓库_btn_png"/>
......@@ -33,7 +33,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="taskBtn" label="" verticalCenter="484.5" horizontalCenter="-199.5">
<e:Button id="taskBtn" label="" verticalCenter="484.5" horizontalCenter="-258.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="任务_png" source.down="任务_png" source.disabled="任务_png"/>
......@@ -42,7 +42,7 @@
</e:skinName>
</e:Button>
<e:Group id="houseBtn" width="299" height="346" x="-1" y="365" anchorOffsetX="0" anchorOffsetY="0"/>
<e:Button id="recordBtn" label="" verticalCenter="-531.5" horizontalCenter="260" visible="false">
<e:Button id="recordBtn" label="" verticalCenter="-500" horizontalCenter="260">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="兑换记录_png" source.down="兑换记录_png" source.disabled="兑换记录_png"/>
......@@ -50,7 +50,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="shopBtn" label="" verticalCenter="484.5" horizontalCenter="139.5" visible="false">
<e:Button id="shopBtn" label="" verticalCenter="484.5" horizontalCenter="79.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="商店_png" source.down="商店_png" source.disabled="商店_png"/>
......
<?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="" y="996.52" horizontalCenter="0.5">
<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:Label text="活动说明" y="140" bold="true" horizontalCenter="0"/>
<e:Scroller y="205.97" anchorOffsetX="0" anchorOffsetY="0" height="750" width="628" horizontalCenter="0">
<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="OptionPanel" width="271" height="171" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Skin class="OptionPanel" width="542" height="171" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="option_panel_png" horizontalCenter="0" verticalCenter="0"/>
<e:Image id="chickBtn" source="option_chicken_png" y="71" x="199" anchorOffsetX="41" anchorOffsetY="56"/>
<e:Image id="wheatBtn" source="option_wheat_png" y="74" left="25" anchorOffsetX="43" anchorOffsetY="59"/>
<e:Image id="chickBtn" source="option_chicken_png" y="72" x="338" anchorOffsetX="41" anchorOffsetY="56"/>
<e:Image id="wheatBtn" source="option_wheat_png" y="74" anchorOffsetX="43" anchorOffsetY="59" x="68"/>
<e:Image id="cattleBtn" source="option_cattle_png" y="71" anchorOffsetX="48.5" anchorOffsetY="58.5" x="468.5"/>
<e:Image id="cornBtn" source="option_corn_png" x="199" y="67" anchorOffsetX="47.5" anchorOffsetY="65"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="LoadingSceneSkin" width="750" height="1624" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*">
<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="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"/>
<e:Image id="backBtn" source="返回农场_png" x="39.39" y="248.27"/>
<e:Group x="151" y="430">
<e:Image id="goodsBtn" source="商品w_png" x="0" y="0"/>
<e:Image id="propBtn" source="道具b_png" x="224" y="0"/>
</e:Group>
<e:Group id="goodsGroup" width="539.39" height="662.12" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0" verticalCenter="118">
<e:Scroller scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" top="0" left="0" right="0" bottom="0">
<e:Group anchorOffsetX="0" width="203.03">
<e:List id="list" left="0" right="0" y="0"/>
</e:Group>
</e:Scroller>
</e:Group>
<e:Group id="propGroup" width="539.39" height="662.12" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0" verticalCenter="118" visible="false">
<e:Image source="货柜_png" y="200" scaleX="1" scaleY="1" horizontalCenter="0"/>
<e:Image source="货柜_png" y="500" scaleX="1" scaleY="1" horizontalCenter="0"/>
</e:Group>
</e:Group>
<e:Image source="前景_png" y="662" horizontalCenter="0" touchEnabled="false" x="0" scaleX="1" scaleY="1"/>
<e:Image source="灯_png" verticalCenter="-172.5" horizontalCenter="0" x="195" y="599" scaleX="1" scaleY="1" touchEnabled="false"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -11,6 +11,7 @@ export default class RulePanel extends Panel {
public get skinKey() {
return 'RulePanel'
}
constructor(data?) {
super(data);
......@@ -26,27 +27,7 @@ export default class RulePanel extends Panel {
private initUI(): void {
// let rule = DataManager.ins.getData(NetName.GET_RULE).data || '';
let rule = '活动时间: \n' +
'即日起-2019年12月30日\n' +
'\n' +
'活动对象: \n' +
'工银e生活用户\n' +
'\n' +
'活动规则:\n' +
'1.点击对应的土地,选择你想种的作物开始种植或者喂养吧!\n' +
'2.浇灌或者喂养作物成长,作物成熟后可出售成欢趣豆或者兑换好礼。\n' +
'\n' +
'农场玩法:\n' +
'1.水的用途:用以浇灌小麦/玉米等农作物;\n' +
'2.饲料的用途:用以喂养鸡/牛等动物;\n' +
'3.水和饲料怎么来:每天签到和首次分享可获得,完成制定任务也可获得哦;\n' +
'4.作物成熟时间:作物每隔8小时就需要浇水,其中小麦/玉米等农作物需浇水3次,鸡/牛等动物需喂养4次可成熟;\n' +
'5.收获食材:小麦收获后可获得4袋小麦,鸡收获后可获得4个鸡蛋,牛收获后可获得4瓶牛奶,玉米收获后可获得4袋玉米;\n' +
'6.收获的食材将储存在仓库中,点击食材即可出售成欢趣豆哦~\n' +
'其他说明:\n' +
'1.领奖说明:中奖用户请根据中奖页面提示录入对应兑奖信息,具体兑换信息以奖品详情页为准,实物商品将在客户领取成功后15个工作日内发出;\n' +
'2.用户如果违反诚实守信原则或出现违规行为(包括但不限于侵犯第三人合法权益、作弊、扰乱系统、实施网络攻击、恶意套取、批量注册、用机器注册账户、用机器模拟客户端等方式),一经发现我行有权终止该用户参与活动并取消其领奖资格;\n' +
'3.本活动与苹果公司无关。';
let rule = window['rule'];
this.ruleLabel.textFlow = new HtmlTextParser().parser(rule);
}
}
\ No newline at end of file
......@@ -96,7 +96,8 @@ export default class WareHousePanel extends Panel {
}
private initUI(): void {
this.getWareHouseInfo();
console.log(this.data);
this.setUI(this.data);
MainDispatcher.addEvent('updateWareHouse', this.getWareHouseInfo, this);
MainDispatcher.addEvent('closeWareHouse', this.onTouchClose, this);
}
......@@ -111,46 +112,53 @@ export default class WareHousePanel extends Panel {
MainDispatcher.removeEvent('closeWareHouse', this.onTouchClose, this);
}
private getWareHouseInfo() {
NetManager.ins.queryUserSpList((success, res) => {
if(!success) {
return;
}
const data = res.data;
private setUI(res) {
if(!res.success) {
this.cropGroup.visible = false;
this.noneImg.visible = true;
return;
}
/// TODO 0库存隐藏的临时低效方案,待优化
if(data.sp_1 <= 0 && data.sp_2 <= 0) {
this.cropGroup.visible = false;
this.noneImg.visible = true;
} else {
this.noneImg.visible = false;
if(data.sp_1 <= 0) {
this[`${spData.sp_1.name}_group`].visible = false;
this[`${spData.sp_2.name}_group`].x = this[`${spData.sp_1.name}_group`].x;
}
if(data.sp_2 <= 0) {
this[`${spData.sp_2.name}_group`].visible = false;
}
if(!this.isShow) {
this.isShow = true;
NetManager.ins.showLog(getlogItem(16));
NetManager.ins.showLog(getlogItem(17));
}
const data = res.data;
/// TODO 0库存隐藏的临时低效方案,待优化
if(data.sp_1 <= 0 && data.sp_2 <= 0) {
this.cropGroup.visible = false;
this.noneImg.visible = true;
} else {
this.noneImg.visible = false;
if(data.sp_1 <= 0) {
this[`${spData.sp_1.name}_group`].visible = false;
this[`${spData.sp_2.name}_group`].x = this[`${spData.sp_1.name}_group`].x;
}
for(let k in spData) {
this[`${spData[k].name}_label`].text = `数量:${data[k]}`;
this[`${spData[k].name}_sell_btn`].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(16));
PanelCtrl.instance.btnDelay(this[`${spData[k].name}_sell_btn`]);
TopLayerCtrl.instance.show(ModuleTypes.SELL_PANEL, {key: k, total: data[k]}, .4);
});
this[`${spData[k].name}_ex_btn`].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(17));
PanelCtrl.instance.btnDelay(this[`${spData[k].name}_ex_btn`]);
showToast('欢趣商店待开放,过段日子再来吧~');
});
if(data.sp_2 <= 0) {
this[`${spData.sp_2.name}_group`].visible = false;
}
if(!this.isShow) {
this.isShow = true;
NetManager.ins.showLog(getlogItem(16));
NetManager.ins.showLog(getlogItem(17));
}
}
for(let k in spData) {
this[`${spData[k].name}_label`].text = `数量:${data[k]}`;
this[`${spData[k].name}_sell_btn`].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(16));
PanelCtrl.instance.btnDelay(this[`${spData[k].name}_sell_btn`]);
TopLayerCtrl.instance.show(ModuleTypes.SELL_PANEL, {key: k, total: data[k]}, .4);
});
this[`${spData[k].name}_ex_btn`].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(17));
PanelCtrl.instance.btnDelay(this[`${spData[k].name}_ex_btn`]);
showToast('欢趣商店待开放,过段日子再来吧~');
});
}
}
private getWareHouseInfo() {
NetManager.ins.queryUserSpList((success, res) => {
this.setUI(res);
});
}
}
......@@ -50,11 +50,14 @@ export default class LandMgr {
}
public destroy() {
for(let i = 0; i < this.lands.length; i++) {
this.lands[i].destroy();
this.lands[i] = null;
}
MainDispatcher.removeEvent(M_EVENT.HIDE_OPTION, this.reActiveAll, this);
GDispatcher.removeEvent('docVisible', this.updateLandInfo, this);
MainDispatcher.removeEvent(M_EVENT.UPDATE_LANDS, this.updateLandInfo, this);
MainDispatcher.removeEvent(M_EVENT.PLANT, this.plant, this);
this.lands.forEach(v => v.destroy());
}
private plant(data) {
......
......@@ -100,11 +100,12 @@ export default class MainScene extends Scene {
destroy() {
super.destroy();
/// TODO 可能的需要清除的东西
DestroyMainInstance(); // 清除单例
DestroyMainDispatcher(); // 删除局部收发器
OptionPanel.destroy();
this.mainUI.destroy();
this.landMgr.destroy();
this.progressMgr.destroy();
DestroyMainDispatcher(); // 删除局部收发器
DestroyMainInstance(); // 清除单例
}
protected getTapEvts(): any[] {
......
......@@ -3,16 +3,18 @@ import { M_HideOption } from "./Objs/OptionPanel";
import PanelCtrl from "../../ctrls/panelCtrl";
import { ModuleTypes } from "../../types/sceneTypes";
import { btnDelay, showToast } from "../../comm/UtilsConst";
import { MainDispatcher, MainIns } from "./MainScene";
import { MainIns } from "./MainScene";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { loadSvga } from "../../comm/loadSvga";
import { getSvga } from "../../utils";
import { getlogItem } from "../../comm/getlogItem";
import SceneCtrl from "../../ctrls/sceneCtrl";
export let propData = {
sp_food_1: {name: 'food',},
sp_food_2: {name: 'water',},
sp_prop_1: {name: 'speed',},
};
export default class MainUI extends ComponentBase {
......@@ -68,8 +70,8 @@ export default class MainUI extends ComponentBase {
showToast('点击渴了的植物才能浇水哦');
break;
case this.speedGroup:
showToast('点击植物/动物去加速成长时间');
break;
case this.houseBtn:
showToast('小屋正在建设中,过段日子再来吧~');
break;
......@@ -89,7 +91,9 @@ export default class MainUI extends ComponentBase {
case this.warehouseBtn: // 仓库按钮
NetManager.ins.clickLog(getlogItem(4));
PanelCtrl.instance.show(ModuleTypes.WAREHOUSE_PANEL);
NetManager.ins.queryUserSpList((success, res) => {
PanelCtrl.instance.show(ModuleTypes.WAREHOUSE_PANEL, res);
});
break;
case this.avatarImg: // 头像
......@@ -102,7 +106,8 @@ export default class MainUI extends ComponentBase {
break;
case this.shopBtn: // 商店
NetManager.ins.clickLog(getlogItem(5));
NetManager.ins.clickLog(getlogItem(5)); // 商店点击埋点
SceneCtrl.instance.change(ModuleTypes.SHOP_SCENE);
break;
default:
break;
......@@ -126,10 +131,10 @@ export default class MainUI extends ComponentBase {
// 埋点
NetManager.ins.showLog(getlogItem(1)); // 头像曝光
// NetManager.ins.showLog(getlogItem(2)); // 兑换记录
NetManager.ins.showLog(getlogItem(2)); // 兑换记录
NetManager.ins.showLog(getlogItem(3)); // 任务按钮
NetManager.ins.showLog(getlogItem(4)); // 仓库按钮
// NetManager.ins.showLog(getlogItem(5)); // 商店按钮
NetManager.ins.showLog(getlogItem(5)); // 商店按钮
NetManager.ins.showLog(getlogItem(6)); // 饲料区域
NetManager.ins.showLog(getlogItem(7)); // 水区域
......@@ -173,6 +178,9 @@ export default class MainUI extends ComponentBase {
this[`${propData[k].name}Num`].text = '× ' + data[k];
DataManager.ins.updateData(propData[k].name, data[k]);
}
if(data['sp_prop_1'] <= 0) {
this[`${propData['sp_prop_1'].name}Group`].visible = false;
}
});
}
......
import { getSkinPath, getSvga } from "../../../utils";
import TimeProgressBar from "../TimeProgressBar";
import { MainDispatcher, MainIns, M_SetGameLayerUpdate } from "../MainScene";
import { MainIns, M_SetGameLayerUpdate } from "../MainScene";
import { loadSvga } from "../../../comm/loadSvga";
import { NetManager } from "../../../../libs/tw/manager/NetManager";
import { showToast } from "../../../comm/UtilsConst";
......@@ -109,7 +109,6 @@ export default class Crop extends eui.Component {
this.removeChild(mv);
M_SetGameLayerUpdate(true);
M_UpdateLand();
// MainDispatcher.dispatchEvent('updateIndex');
}, this);
}
)
......@@ -122,8 +121,23 @@ export default class Crop extends eui.Component {
}
public destroy() {
this.cropMv && this.removeChild(this.cropMv) && (this.cropMv = null);
this.optionMv && this.removeChild(this.optionMv) && (this.optionMv = null);
this.cropMv && function() {
egret.Tween.removeTweens(this.cropMv);
this.removeChild(this.cropMv);
this.cropMv = null;
}.bind(this)();
this.optionMv && function() {
egret.Tween.removeTweens(this.optionMv);
this.removeChild(this.optionMv);
this.optionMv = null;
}.bind(this)();
this.progressBar && function() {
egret.Tween.removeTweens(this.progressBar);
this.progressBar.destroy();
MainIns().progressMgr.removeProgress(this.index);
}.bind(this)();
}
private initUI() {
......@@ -164,7 +178,7 @@ export default class Crop extends eui.Component {
egret.Tween.removeTweens(this.progressBar);
egret.Tween.get(this.progressBar).wait(3000).to({alpha: 0}, 200, egret.Ease.quartInOut);
} else {
this.progressBar.alpha = 0;
this.progressBar && (this.progressBar.alpha = 0);
}
this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.dOp, this);
return;
......@@ -185,13 +199,6 @@ export default class Crop extends eui.Component {
this.touchEnabled = true;
this.addOption(petData[this.petId]['optionSvga']);
break;
// case OPTION.PROGRESS:
// this.touchEnabled = true;
// this.addProgress(this.data.data.feedLeftSeconds);
// this.progressBar.alpha = 0;
// // egret.Tween.removeTweens(this.progressBar);
// // egret.Tween.get(this.progressBar).wait(3000).to({alpha: 0}, 200, egret.Ease.quartInOut);
// break;
case OPTION.NONE:
this.touchChildren = false;
this.touchEnabled = false;
......@@ -395,7 +402,7 @@ export default class Crop extends eui.Component {
} else {
label = (this.state == 3) ? '收获' : '浇水';
}
this.progressBar = MainIns().progressMgr.addProgress({
MainIns() && (this.progressBar = MainIns().progressMgr.addProgress({
index: this.data.index,
x: this.data.x + 88,
y: this.data.y + 193,
......@@ -404,7 +411,7 @@ export default class Crop extends eui.Component {
sTime: 8 * 60 * 60,
nTime: nTime,
eTime: 0
})
}));
}
// 改变状态积
......
......@@ -2,8 +2,7 @@ import { getSkinPath } from "../../../utils";
import Crop from "./Crop";
import { NetManager } from "../../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../../comm/getlogItem";
import { M_HideOption, M_ShowOption } from "./OptionPanel";
import { M_ShowOption } from "./OptionPanel";
enum LAND_STATE {
NONE = 'none', // 无
......@@ -73,6 +72,7 @@ export default class Land extends eui.Component {
public destroy() {
this.land.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
this.crop && this.crop.destroy();
this.crop = null;
}
/**
......
......@@ -20,8 +20,10 @@ export { M_HideOption, M_ShowOption };
* 操作面板
*/
export default class OptionPanel extends eui.Component {
public chickBtn: eui.Image;
public wheatBtn: eui.Image;
public chickBtn:eui.Image;
public wheatBtn:eui.Image;
public cattleBtn:eui.Image;
public cornBtn:eui.Image;
private data = null;
......@@ -36,7 +38,6 @@ export default class OptionPanel extends eui.Component {
this._instance.removeEvents();
this._instance = null;
}
////////////////////// 单例 //////////////////////
constructor(data?) {
......@@ -49,15 +50,17 @@ export default class OptionPanel extends eui.Component {
}
private initEvents() {
this.wheatBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
this.chickBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
[this.wheatBtn, this.chickBtn, this.cattleBtn, this.cornBtn].forEach((v)=>{
v.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
});
MainDispatcher.addEvent(M_EVENT.SHOW_OPTION, this.showOption, this);
MainDispatcher.addEvent(M_EVENT.HIDE_OPTION, this.hideOption, this);
}
private removeEvents() {
this.wheatBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
this.chickBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
[this.wheatBtn, this.chickBtn, this.cattleBtn, this.cornBtn].forEach((v)=>{
v.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
});
MainDispatcher.removeEvent(M_EVENT.SHOW_OPTION, this.showOption, this);
MainDispatcher.removeEvent(M_EVENT.HIDE_OPTION, this.hideOption, this);
}
......@@ -123,7 +126,8 @@ export default class OptionPanel extends eui.Component {
}
private initUI() {
this.hideOption();
this.visible = false;
// this.hideOption();
this.x = 100;
this.y = 200;
this.anchorOffsetX = this.width / 2;
......
......@@ -29,4 +29,12 @@ export default class ProgressMgr {
delete this.progressBars[index];
}
}
public destroy() {
for(let k in this.progressBars) {
this.progressBars[k].destroy();
this.removeProgress(k);
}
this.progressBars = {};
}
}
\ No newline at end of file
import Scene from "../../views/Scene";
import SceneCtrl from "../../ctrls/sceneCtrl";
import { ModuleTypes } from "../../types/sceneTypes";
export default class ShopScene extends Scene {
public group:eui.Group;
public shopLayer:eui.Group;
public backBtn:eui.Image;
public goodsBtn:eui.Image;
public propBtn:eui.Image;
public goodsGroup:eui.Group;
public list:eui.List;
public propGroup:eui.Group;
constructor(data?) {
super(data);
}
protected start() {
super.start();
this.initUI();
}
private initUI(): void {
this.group.height = 750 / window.innerWidth * window.innerHeight;
}
destroy() {
super.destroy();
}
protected getTapEvts(): any[] {
return super.getTapEvts().concat([
[this.backBtn, this.onTouchTap, this],
[this.goodsBtn, this.onTouchTap, this],
[this.propBtn, this.onTouchTap, this],
]);
}
private onTouchTap(e: egret.TouchEvent) {
switch(e.target) {
case this.backBtn:
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE);
break;
case this.goodsBtn:
this.goodsBtn.source = '商品w_png';
this.propBtn.source = '道具b_png';
this.goodsGroup.visible = true;
this.propGroup.visible = false;
break;
case this.propBtn:
this.goodsBtn.source = '商品b_png';
this.propBtn.source = '道具w_png';
this.goodsGroup.visible = false;
this.propGroup.visible = true;
break;
default:
break;
}
}
protected async preLoadRes() {
}
public get skinKey() {
return 'Shop'
}
public get groupName() {
return 'shop'
}
}
\ No newline at end of file
......@@ -4,9 +4,9 @@ import { ModuleTypes } from "../types/sceneTypes";
import { btnDelay } from "../comm/UtilsConst";
export default class Bar extends eui.Component {
public back: eui.Image;
public rule: eui.Image;
public title: eui.Label;
public rule:eui.Group;
public title:eui.Label;
public back:eui.Group;
private data = null;
......
......@@ -9,10 +9,12 @@ import TaskToast from "../Panels/TaskToast";
import SellRecord from "../Panels/SellRecord";
import SellPanel from "../Panels/SellPanel";
import SelledPanel from "../Panels/SelledPanel";
import ShopScene from "../Scenes/ShopScene/ShopScene";
let Scenes = [
[ModuleTypes.LOADING_SCENE, LoadingScene],
[ModuleTypes.MAIN_SCENE, MainScene],
[ModuleTypes.SHOP_SCENE, ShopScene],
];
let Panels = [
......
......@@ -13,4 +13,5 @@ export enum ModuleTypes {
SELL_RECORD,
SELL_PANEL,
SELLED_PANEL,
SHOP_SCENE,
}
\ No newline at end of file
......@@ -314,6 +314,21 @@ const config = {
'/projectx/{projectId}/join_4/priceInfo.do': {
data: './joyousManor/priceInfo.json'
},
'/projectx/{projectId}/join_6/join.do': {
data: './joyousManor/prizeExchange.json'
},
'/projectx/{projectId}/join_6/prizeInfo.do':{
data:'./joyousManor/prizeInfo.json'
},
'/projectx/{projectId}/join_7/join.do':{
data:'./joyousManor/propExchange.json'
},
'/projectx/{projectId}/join_7/propInfo.do':{
data:'./joyousManor/propInfo.json'
},
'/projectx/{projectId}/join_8/join.do':{
data:'./joyousManor/userProp.json'
}
};
......
......@@ -7,7 +7,7 @@
"feedLeftSeconds": 100,
"id": 1,
"level": 1,
"petId": 1,
"petId": 0,
"feedNum": 889
},
{
......
{
"success": true,
"message": "",
"code": "",
"data": {
"prizeType": "coupon",
"prizeId": "sss_1",
"optionId": "oc14da371",
"url": "https://www.baidu.com"
}
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": {
"sss_1": 2000,
"sss_2": 1000,
"sss_3": 1400
}
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": null
}
{
"success": true,
"message": "",
"code": "",
"data": [
{
"spId": "sp_1",
"stock": 1000,
"price": 888
},
{
"spId": "sp_2",
"stock": 500,
"price": 700
}
]
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": null
}
\ No newline at end of file
......@@ -7,6 +7,7 @@
"sp_2": 5,
"sp_food_1": 100,
"sp_food_2": 100,
"sp_prop_1": 100,
"sp_task_1": 10,
"sp_task_2": 100
}
......
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