Commit fffaa963 authored by haiyoucuv's avatar haiyoucuv

1

parent 3aa2ed92
...@@ -3,16 +3,26 @@ ...@@ -3,16 +3,26 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9464afa6-0efb-46c2-9cfd-05475acd81df" name="Default Changelist" comment=""> <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$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/egret/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/libs/tc/manager/ABNetManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/libs/tc/manager/ABNetManager.ts" 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/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/libs/tw/manager/NetManager.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/Main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/Main.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_cattle_0.png" beforeDir="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/resource/assets/index_scene/planting/plant_cattle_1.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_cattle_1.png" 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/resource/assets/index_scene/planting/plant_cattle_2.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_cattle_2.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/comm/onNotSuccess.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/comm/onNotSuccess.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_chicken_0.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/egret/src/ctrls/topLayerCtrl.ts" beforeDir="false" afterPath="$PROJECT_DIR$/egret/src/ctrls/topLayerCtrl.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_chicken_1.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_chicken_1.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_chicken_2.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_chicken_2.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_corn_0.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_corn_1.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_corn_1.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_corn_2.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_corn_2.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_wheat_0.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_wheat_1.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_wheat_1.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_wheat_2.png" beforeDir="false" afterPath="$PROJECT_DIR$/egret/resource/assets/index_scene/planting/plant_wheat_2.png" afterDir="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/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$/mock/config.js" beforeDir="false" afterPath="$PROJECT_DIR$/mock/config.js" 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" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -31,7 +41,9 @@ ...@@ -31,7 +41,9 @@
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="ProjectId" id="1UXly4q8gNrBULeFyi6ZvdvwPDo" /> <component name="ProjectId" id="1UXly4q8gNrBULeFyi6ZvdvwPDo" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" /> <component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="1" id="Add" />
</component>
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" /> <option name="showExcludedFiles" value="true" />
...@@ -84,7 +96,7 @@ ...@@ -84,7 +96,7 @@
<workItem from="1575511358993" duration="626000" /> <workItem from="1575511358993" duration="626000" />
<workItem from="1575511989902" duration="370000" /> <workItem from="1575511989902" duration="370000" />
<workItem from="1575512375307" duration="22831000" /> <workItem from="1575512375307" duration="22831000" />
<workItem from="1575602130550" duration="10069000" /> <workItem from="1575602130550" duration="14450000" />
</task> </task>
<servers /> <servers />
</component> </component>
...@@ -108,13 +120,13 @@ ...@@ -108,13 +120,13 @@
<screen x="36" y="23" width="1644" height="1027" /> <screen x="36" y="23" width="1644" height="1027" />
</state> </state>
<state x="367" y="174" key="SettingsEditor/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575512357486" /> <state x="367" y="174" key="SettingsEditor/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575512357486" />
<state x="659" y="460" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1575600813535"> <state x="659" y="460" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1575620245218">
<screen x="36" y="23" width="1644" height="1027" /> <screen x="36" y="23" width="1644" height="1027" />
</state> </state>
<state x="659" y="460" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575600813535" /> <state x="659" y="460" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027" timestamp="1575620245218" />
<state x="523" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="1575616551360"> <state x="523" y="250" width="670" height="676" key="search.everywhere.popup" timestamp="1575621174703">
<screen x="36" y="23" width="1644" height="1027" /> <screen x="36" y="23" width="1644" height="1027" />
</state> </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="1575616551360" /> <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="1575621174703" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -129,4 +129,13 @@ export enum NetName { ...@@ -129,4 +129,13 @@ export enum NetName {
QUERY_RECORDS, QUERY_RECORDS,
GET_PROJECTUSERINFO, GET_PROJECTUSERINFO,
GET_LANDINFO,
DO_PLANT,
DO_FEED,
DO_HARVEST,
DO_SELL,
GET_SELLINFO,
DO_TASK,
GET_TASKINFO,
} }
\ No newline at end of file
...@@ -2450,9 +2450,13 @@ export class NetManager extends ABNetManager { ...@@ -2450,9 +2450,13 @@ export class NetManager extends ABNetManager {
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
//// 工行欢趣庄园 //// 工行欢趣庄园
/**
* 获取地块信息
* @param callback
*/
public getLandInfo(callback: Function) { public getLandInfo(callback: Function) {
const net: INetData = { const net: INetData = {
name: NetName.GET_PROJECTUSERINFO, name: NetName.GET_LANDINFO,
uri: '/projectx/{projectId}/join_1/landInfo.do', uri: '/projectx/{projectId}/join_1/landInfo.do',
type: 'get', type: 'get',
dataType: 'json', dataType: 'json',
...@@ -2462,6 +2466,110 @@ export class NetManager extends ABNetManager { ...@@ -2462,6 +2466,110 @@ export class NetManager extends ABNetManager {
this.send(net); this.send(net);
} }
/**
* 种植
* @param callback
* @param landId 地块Id
* @param petId 植物Id
*/
public doPlant(callback: Function, landId, petId) {
const net: INetData = {
name: NetName.DO_PLANT,
uri: '/projectx/{projectId}/join_1/join.do',
type: 'post',
dataType: 'json',
param: {
landId: landId,
petId: petId
},
callback: callback
};
this.send(net);
}
public doFeed(callback: Function, landId) {
const net: INetData = {
name: NetName.DO_FEED,
uri: '/projectx/{projectId}/join_2/join.do',
type: 'post',
dataType: 'json',
param: {
landId: landId,
},
callback: callback
};
this.send(net);
}
public doHarvest(callback: Function, landId) {
const net: INetData = {
name: NetName.DO_HARVEST,
uri: '/projectx/{projectId}/join_3/join.do',
type: 'post',
dataType: 'json',
param: {
landId: landId,
},
callback: callback
};
this.send(net);
}
public doSell(callback: Function, spId, count) {
const net: INetData = {
name: NetName.DO_SELL,
uri: '/projectx/{projectId}/join_4/join.do',
type: 'post',
dataType: 'json',
param: {
spId: spId,
count: count
},
callback: callback
};
this.send(net);
}
public getSellInfo(callback: Function, spId, count) {
const net: INetData = {
name: NetName.GET_SELLINFO,
uri: '/projectx/{projectId}/join_4/saleinfo.do',
type: 'get',
dataType: 'json',
param: {
spId: spId,
count: count
},
callback: callback
};
this.send(net);
}
public doTask(callback: Function, taskId) {
const net: INetData = {
name: NetName.DO_TASK,
uri: '/projectx/{projectId}/join_5/join.do',
type: 'post',
dataType: 'json',
param: {
taskId: taskId,
},
callback: callback
};
this.send(net);
}
public getTaskInfo(callback: Function) {
const net: INetData = {
name: NetName.GET_TASKINFO,
uri: '/projectx/{projectId}/join_5/taskInfo.do',
type: 'post',
dataType: 'json',
param: {},
callback: callback
};
this.send(net);
}
} }
var regular = "(\\S+)//(\\S+)/(\\S+)/(\\S+)/(\\S+)"; var regular = "(\\S+)//(\\S+)/(\\S+)/(\\S+)/(\\S+)";
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"name": "index_ui" "name": "index_ui"
}, },
{ {
"keys": "篱笆_png,plant_cattle_1_png,plant_cattle_2_png,plant_chicken_0_png,plant_chicken_1_png,plant_chicken_2_png,plant_corn_0_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_0_png,plant_wheat_1_png,plant_wheat_2_png,plant_cattle_0_png,食槽_png,_DS_Store,feed_png,feeding_png,hand_png,option_chicken_png,option_panel_png,option_wheat_png,water_png,watering_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,feeding_png,hand_png,option_chicken_png,option_panel_png,option_wheat_png,water_png,watering_png",
"name": "index_plant" "name": "index_plant"
}, },
{ {
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
{ {
"keys": "selled_btn_png,selled_bg_png", "keys": "selled_btn_png,selled_bg_png",
"name": "selled_panel" "name": "selled_panel"
},
{
"name": "preload",
"keys": "plant_chicken_4_png,plant_chicken_3_png,plant_cattle_4_png,plant_cattle_3_png,plant_corn_3_png,plant_wheat_3_png"
} }
], ],
"resources": [ "resources": [
...@@ -136,11 +140,6 @@ ...@@ -136,11 +140,6 @@
"type": "image", "type": "image",
"name": "plant_cattle_2_png" "name": "plant_cattle_2_png"
}, },
{
"url": "assets/index_scene/planting/plant_chicken_0.png",
"type": "image",
"name": "plant_chicken_0_png"
},
{ {
"url": "assets/index_scene/planting/plant_chicken_1.png", "url": "assets/index_scene/planting/plant_chicken_1.png",
"type": "image", "type": "image",
...@@ -151,11 +150,6 @@ ...@@ -151,11 +150,6 @@
"type": "image", "type": "image",
"name": "plant_chicken_2_png" "name": "plant_chicken_2_png"
}, },
{
"url": "assets/index_scene/planting/plant_corn_0.png",
"type": "image",
"name": "plant_corn_0_png"
},
{ {
"url": "assets/index_scene/planting/plant_corn_1.png", "url": "assets/index_scene/planting/plant_corn_1.png",
"type": "image", "type": "image",
...@@ -186,11 +180,6 @@ ...@@ -186,11 +180,6 @@
"type": "image", "type": "image",
"name": "plant_land_plant_png" "name": "plant_land_plant_png"
}, },
{
"url": "assets/index_scene/planting/plant_wheat_0.png",
"type": "image",
"name": "plant_wheat_0_png"
},
{ {
"url": "assets/index_scene/planting/plant_wheat_1.png", "url": "assets/index_scene/planting/plant_wheat_1.png",
"type": "image", "type": "image",
...@@ -201,11 +190,6 @@ ...@@ -201,11 +190,6 @@
"type": "image", "type": "image",
"name": "plant_wheat_2_png" "name": "plant_wheat_2_png"
}, },
{
"url": "assets/index_scene/planting/plant_cattle_0.png",
"type": "image",
"name": "plant_cattle_0_png"
},
{ {
"url": "assets/index_scene/planting/食槽.png", "url": "assets/index_scene/planting/食槽.png",
"type": "image", "type": "image",
...@@ -410,6 +394,36 @@ ...@@ -410,6 +394,36 @@
"url": "assets/common/light.png", "url": "assets/common/light.png",
"type": "image", "type": "image",
"name": "light_png" "name": "light_png"
},
{
"name": "plant_chicken_4_png",
"type": "image",
"url": "assets/index_scene/planting/plant_chicken_4.png"
},
{
"name": "plant_chicken_3_png",
"type": "image",
"url": "assets/index_scene/planting/plant_chicken_3.png"
},
{
"name": "plant_cattle_4_png",
"type": "image",
"url": "assets/index_scene/planting/plant_cattle_4.png"
},
{
"name": "plant_cattle_3_png",
"type": "image",
"url": "assets/index_scene/planting/plant_cattle_3.png"
},
{
"name": "plant_corn_3_png",
"type": "image",
"url": "assets/index_scene/planting/plant_corn_3.png"
},
{
"name": "plant_wheat_3_png",
"type": "image",
"url": "assets/index_scene/planting/plant_wheat_3.png"
} }
] ]
} }
\ No newline at end of file
import { getSkinPath } from "../../../utils"; import { getSkinPath } from "../../../utils";
import TimeProgressBar from "../TimeProgressBar";
enum CROP_TYPE { enum CROP_TYPE {
NONE = -1, // 啥也没有 NONE = -1, // 啥也没有
...@@ -9,10 +10,11 @@ enum CROP_TYPE { ...@@ -9,10 +10,11 @@ enum CROP_TYPE {
} }
enum CROP_STATE { enum CROP_STATE {
NONE = -1, // 啥也没有 NONE = 0, // 啥也没有
BABY = 0, // 刚种 LEVEL1 = 1,
HALF = 1, // 半成熟 LEVEL2 = 2,
DONE = 2, // 成熟 LEVEL3 = 3, // 植物成熟
LEVEL4 = 4, // 动物成熟
} }
const CROP_X = 53.5; const CROP_X = 53.5;
...@@ -22,13 +24,15 @@ const CROP_Y = -18; ...@@ -22,13 +24,15 @@ const CROP_Y = -18;
* 作物类 * 作物类
*/ */
export default class Crop extends eui.Component { export default class Crop extends eui.Component {
public cropImg:eui.Image; public cropImg: eui.Image;
public optionImg:eui.Image; public optionImg: eui.Image;
private progressBar: TimeProgressBar;
private data = null; private data = null;
private _type: CROP_TYPE; private _type: CROP_TYPE;
public get type(){ public get type() {
return this._type; return this._type;
} }
...@@ -40,13 +44,26 @@ export default class Crop extends eui.Component { ...@@ -40,13 +44,26 @@ export default class Crop extends eui.Component {
this.data = data || null; this.data = data || null;
this.x = CROP_X; this.x = CROP_X;
this.y = CROP_Y; this.y = CROP_Y;
this.changeType(CROP_TYPE.NONE);
this.changeState(CROP_STATE.NONE);
this.initUI() this.initUI()
} }
private initUI() { private initUI() {
// petId 1:鸡,2:小麦
// level 当前鸡或小麦的等级
// canFeed 是否能喂食(浇水)
// feedLeftSeconds 下次喂食时间倒计时,单位秒
// canGather 是否可收获
let {petId, level, canFeed, feedLeftSeconds, canGather} = this.data;
/// TODO 根据数据添加Crop 初始化状态 /// TODO 根据数据添加Crop 初始化状态
this.changeType(CROP_TYPE.NONE); if(petId == 1) {
this.changeState(CROP_STATE.NONE); this.changeType(CROP_TYPE.CHICKEN);
} else if(petId == 2) {
this.changeType(CROP_TYPE.WHEAT);
}
// this.changeType()
this.changeState(level);
} }
...@@ -59,20 +76,22 @@ export default class Crop extends eui.Component { ...@@ -59,20 +76,22 @@ export default class Crop extends eui.Component {
this.state = state; // 设置状态 this.state = state; // 设置状态
this._type != -1 && this.state != -1 && (this.cropImg.source = `plant_${this._type}_${this.state}_png`); this._type != -1 && this.state != -1 && (this.cropImg.source = `plant_${this._type}_${this.state}_png`);
this.optionImg.visible = (this.state==CROP_STATE.DONE);
/// TODO 定义详细的状态积 /// TODO 定义详细的状态积
switch(this.state) { switch(this.state) {
case CROP_STATE.NONE: // 啥也没有 case CROP_STATE.NONE: // 啥也没有
break; break;
case CROP_STATE.BABY: // 刚种 case CROP_STATE.LEVEL1: // 刚种
break;
case CROP_STATE.LEVEL2: // 半成熟
break; break;
case CROP_STATE.HALF: // 半成熟 case CROP_STATE.LEVEL3: // 植物成熟
break; break;
case CROP_STATE.DONE: // 成熟 case CROP_STATE.LEVEL4: // 动物成熟
break; break;
default: default:
......
...@@ -24,7 +24,6 @@ export default class Land extends eui.Component { ...@@ -24,7 +24,6 @@ export default class Land extends eui.Component {
public state: LAND_STATE; public state: LAND_STATE;
private crop: Crop; private crop: Crop;
private progressBar: TimeProgressBar;
constructor(data?) { constructor(data?) {
super(); super();
...@@ -37,13 +36,7 @@ export default class Land extends eui.Component { ...@@ -37,13 +36,7 @@ export default class Land extends eui.Component {
this.setTouchOption(); // 设置点击参数 this.setTouchOption(); // 设置点击参数
this.initEvents(); // 注册事件 this.initEvents(); // 注册事件
this.changeState(LAND_STATE.NONE);
/// TODO 根据数据改变状态
if(this.index == 0 || this.index == 3) {
this.changeState(LAND_STATE.ANIMAL);
} else {
this.changeState(LAND_STATE.NONE);
}
this.initUI(); // 设置显示 this.initUI(); // 设置显示
} }
...@@ -81,8 +74,22 @@ export default class Land extends eui.Component { ...@@ -81,8 +74,22 @@ export default class Land extends eui.Component {
} }
private initUI() { private initUI() {
// petId 1:鸡,2:小麦
// level 当前鸡或小麦的等级
// canFeed 是否能喂食(浇水)
// feedLeftSeconds 下次喂食时间倒计时,单位秒
// canGather 是否可收获
/// TODO 根据数据改变状态
console.log(this.data);
const landData = this.data.data;
/// TODO 根据数据添加Crop 初始化状态 /// TODO 根据数据添加Crop 初始化状态
this.crop = new Crop(); if(landData.petId == 1) {
this.changeState(LAND_STATE.ANIMAL);
} else {
this.changeState(LAND_STATE.PLANT);
}
this.crop = new Crop(landData);
this.addChildAt(this.crop, 2); this.addChildAt(this.crop, 2);
} }
...@@ -121,10 +128,10 @@ export default class Land extends eui.Component { ...@@ -121,10 +128,10 @@ export default class Land extends eui.Component {
break; break;
case LAND_STATE.PLANT: // 植物 case LAND_STATE.PLANT: // 植物
this.addProgress();
break; break;
case LAND_STATE.ANIMAL: // 动物 case LAND_STATE.ANIMAL: // 动物
this.addProgress();
break; break;
default: default:
break; break;
......
...@@ -77,15 +77,15 @@ export default class OptionPanel extends eui.Component { ...@@ -77,15 +77,15 @@ export default class OptionPanel extends eui.Component {
/// TODO 定义详细的操作 /// TODO 定义详细的操作
private onTap(e: egret.TouchEvent) { private onTap(e: egret.TouchEvent) {
const target = e.target; const target = e.target;
let petId;
switch(target) { switch(target) {
case this.wheatBtn: case this.chickBtn: // 鸡
console.log('点击了小麦'); petId = 1;
break; break;
case this.chickBtn: case this.wheatBtn: // 小麦
console.log('点击了鸡'); petId = 2;
break; break;
default: default:
break; break;
} }
......
...@@ -269,9 +269,32 @@ const config = { ...@@ -269,9 +269,32 @@ const config = {
'/hdtool/rank/rankInfo': { '/hdtool/rank/rankInfo': {
data: './json/rankInfo.json' data: './json/rankInfo.json'
}, },
'/projectx/{projectId}/join_1/landInfo.do':{
data:'./joyousManor/getLandInfo.json' // 欢趣庄园
} '/projectx/{projectId}/join_1/landInfo.do': { // 土地信息
data: './joyousManor/getLandInfo.json'
},
'/projectx/{projectId}/join_1/join.do': { // 种植
data: './joyousManor/doPlant.json'
},
'/projectx/{projectId}/join_2/join.do': { // 浇水
data: './joyousManor/doFeed.json'
},
'/projectx/{projectId}/join_3/join.do': { // 收获
data: './joyousManor/doHarvest.json'
},
'/projectx/{projectId}/join_4/join.do': { // 出售
data: './joyousManor/doSell.json'
},
'/projectx/{projectId}/join_4/saleinfo.do': { // 售卖记录
data: './joyousManor/saleInfo.json'
},
'/projectx/{projectId}/join_5/join.do': { // 完成任务
data: './joyousManor/doTask.json'
},
'/projectx/{projectId}/join_5/taskInfo.do': { // 任务信息
data: './joyousManor/taskInfo.json'
},
}; };
......
{
"success": true,
"message": "",
"code": "",
"data": null
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": null
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": null
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": null
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": null
}
\ No newline at end of file
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
}, },
{ {
"id": 4, "id": 4,
"petId": 2, "petId": 1,
"level": 4, "level": 4,
"canFeed": false, "canFeed": false,
"feedLeftSeconds": 0, "feedLeftSeconds": 0,
......
{
"success":true,
"message":"",
"code":"",
"data":[
{
"date":1575516908485,
"sp":"sp_1",
"spCount":100,
"credits":500
},
{
"date":1575516799097,
"sp":"sp_2",
"spCount":50,
"credits":200
}
]
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": [
{
"id": 1,
"type": 0,
"sp1RewardCount": 50,
"sp2RewardCount": 50,
"status": 0
},
{
"id": 2,
"type": 1,
"sp1RewardCount": 60,
"sp2RewardCount": 50,
"status": 1
}
]
}
\ No newline at end of file
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