|
|
@@ -1,5 +1,6 @@
|
|
|
import Util from "../../before/util/Util";
|
|
|
import JsbSystem from "../../mk/system/JsbSystem";
|
|
|
+import TimeUtil from "../../mk/utils/TimeUtil";
|
|
|
import SetGray from "../component/SetGray";
|
|
|
import { AdFun, RateConfig } from "../data/AdData";
|
|
|
import { DataEventId, GameProp, ProductType, VideoAdType } from "../data/GameData";
|
|
|
@@ -87,8 +88,8 @@ export default class Game extends cc.Component {
|
|
|
@property({ type: cc.Node, displayName: '图鉴种植节点' })
|
|
|
node_farmMapProduct: cc.Node = null;
|
|
|
|
|
|
- @property({ type: cc.Label, displayName: '描述' })
|
|
|
- lbl_farmMapDes: cc.Label = null;
|
|
|
+ @property({ type: cc.RichText, displayName: '描述' })
|
|
|
+ lbl_farmMapDes: cc.RichText = null;
|
|
|
@property({ displayName: '数字组', type: cc.Label })
|
|
|
lbl_value: cc.Label[] = [];
|
|
|
|
|
|
@@ -107,6 +108,9 @@ export default class Game extends cc.Component {
|
|
|
@property({ displayName: '领奖按钮', type: SetGray })
|
|
|
node_getOrderReward: SetGray = null;
|
|
|
|
|
|
+ @property({ displayName: '手指', type: cc.Node })
|
|
|
+ node_orderHand: cc.Node = null;
|
|
|
+
|
|
|
|
|
|
posY = 0;
|
|
|
/** 是否开始增加次数倒计时 */
|
|
|
@@ -281,8 +285,7 @@ export default class Game extends cc.Component {
|
|
|
this.lbl_addHb.string = "+" + add.toString();
|
|
|
gData.gameData.addHb = 0;
|
|
|
|
|
|
- if(add > 0)
|
|
|
- {
|
|
|
+ if (add > 0) {
|
|
|
cc.Tween.stopAllByTarget(this.node_addHb);
|
|
|
this.node_addHb.active = true;
|
|
|
this.node_addHb.scale = 0;
|
|
|
@@ -620,13 +623,26 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
mk.event.register("initFarmMapUi", this.initFarmMapUi.bind(this), this);
|
|
|
mk.event.register("refreshFarmMapUI", this.refreshFarmMapUI.bind(this), this);
|
|
|
-
|
|
|
+ mk.event.register("moveUpAndDownFarmMapUI", this.moveUpAndDownFarmMapUI.bind(this), this);
|
|
|
|
|
|
this.initFarmMapUi();
|
|
|
|
|
|
this.showChangePart();
|
|
|
}
|
|
|
|
|
|
+ public moveUpAndDownFarmMapUI(isMoveUp) {
|
|
|
+ cc.Tween.stopAllByTarget(this.node_farmMapUI);
|
|
|
+ if (isMoveUp) {
|
|
|
+ cc.tween(this.node_farmMapUI).to(0.2, { y: 540 }).start();
|
|
|
+ } else {
|
|
|
+ cc.tween(this.node_farmMapUI).to(0.2, { y: 240 }).start();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public clickFarmMapUIBtn() {
|
|
|
+ gData.plantData.openPanel(this.productType, 1, this.productIndex - 1);
|
|
|
+ }
|
|
|
+
|
|
|
private uiShowType = 3;
|
|
|
private productType = ProductType.nzw;
|
|
|
private productIndex = 0;
|
|
|
@@ -673,7 +689,7 @@ export default class Game extends cc.Component {
|
|
|
let times = gData.gameData.getProductMakeTimesById(data.picture - 1);
|
|
|
let plantName = gData.gameData.getProductMap(data.picture - 1).name;
|
|
|
let des = this.getDesByType(data);
|
|
|
- this.lbl_farmMapDes.string = `${des}${data.value}次${plantName}(${times}/${data.value})`;
|
|
|
+ this.lbl_farmMapDes.string = `<color=#7E411F>${des}<color=#FF0000>${data.value}</c>次${plantName} <color=#FF0000>${times}</c>/${data.value}</color>`;
|
|
|
//this.sp_farmMapIcon.spriteFrame = await mk.loader.load('module/farmMap/texture/gift', cc.SpriteFrame);
|
|
|
return;
|
|
|
}
|
|
|
@@ -694,7 +710,7 @@ export default class Game extends cc.Component {
|
|
|
let times = gData.gameData.getProductMakeTimesById(data.picture - 1);
|
|
|
let plantName = gData.gameData.getProductMap(data.picture - 1).name;
|
|
|
let des = this.getDesByType(data);
|
|
|
- this.lbl_farmMapDes.string = `${des}${data.value}次${plantName}(${times}/${data.value})`;;
|
|
|
+ this.lbl_farmMapDes.string = `<color=#7E411F>${des}<color=#FF0000>${data.value}</c>次${plantName} <color=#FF0000>${times}</c>/${data.value}</color>`;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -911,9 +927,13 @@ export default class Game extends cc.Component {
|
|
|
if (completeCount >= 3) {
|
|
|
this.isGray = false;
|
|
|
this.node_getOrderReward.setGray(false, true);
|
|
|
+ this.node_getOrderReward.getComponent(cc.Animation).play();
|
|
|
+ this.node_orderHand.active = true;
|
|
|
} else {
|
|
|
this.isGray = true;
|
|
|
this.node_getOrderReward.setGray(true, true);
|
|
|
+ this.node_getOrderReward.getComponent(cc.Animation).stop();
|
|
|
+ this.node_orderHand.active = false;
|
|
|
}
|
|
|
} else {
|
|
|
console.log('订单数据错误');
|
|
|
@@ -941,7 +961,7 @@ export default class Game extends cc.Component {
|
|
|
gData.gameData.playerProp.orderData = response.data.userOrderTaskInfo;
|
|
|
gData.gameData.cloneOrderData(true);
|
|
|
|
|
|
- gData.reward.adData = {videoRedMoney: {videoRewardList:null}};
|
|
|
+ gData.reward.adData = { videoRedMoney: { videoRewardList: null } };
|
|
|
gData.reward.adData.videoRedMoney.videoRewardList = [{ rewardType: 1, rewardNum: response.data.redMoneyAddition }]
|
|
|
//gData.reward.adData = response.data.redMoneyAddition;
|
|
|
mk.ui.openPanel('module/reward/reward');
|
|
|
@@ -961,21 +981,26 @@ export default class Game extends cc.Component {
|
|
|
else {
|
|
|
plantPath = 'game/coregame/texture/factory_icons/factory_';
|
|
|
}
|
|
|
- let crop = await mk.pool.getPrefab('game/prefab/crop');
|
|
|
- let sf = await mk.loader.load(plantPath + plantId, cc.SpriteFrame);
|
|
|
- crop.getComponent(cc.Sprite).spriteFrame = sf;
|
|
|
await this.updataOrderProgress(this.orderPicIdArray[i].ID);
|
|
|
- mk.fly.playFlyAniExtra(farmNode, this.sp_cropIcon[i].node, crop, 0.6, ()=>{
|
|
|
- this.doFlyOrderAni(i);
|
|
|
- });
|
|
|
+ //await mk.time.WaitForSeconds(1);
|
|
|
+ for (let index = 0; index != 3; ++index) {
|
|
|
+ let crop = await mk.pool.getPrefab('game/prefab/crop');
|
|
|
+ let sf = await mk.loader.load(plantPath + plantId, cc.SpriteFrame);
|
|
|
+ crop.getComponent(cc.Sprite).spriteFrame = sf;
|
|
|
+ mk.fly.playFlyAniExtra(farmNode, this.sp_cropIcon[i].node, crop, 0.6, index * 0.2, () => {
|
|
|
+ if(index == 1)
|
|
|
+ {
|
|
|
+ this.doFlyOrderAni(i);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public doFlyOrderAni(index)
|
|
|
- {
|
|
|
+ public doFlyOrderAni(index) {
|
|
|
let orderData = gData.gameData.playerProp.orderData;
|
|
|
if (orderData) {
|
|
|
let isComplete = true;
|
|
|
@@ -991,18 +1016,23 @@ export default class Game extends cc.Component {
|
|
|
if (isComplete) {
|
|
|
this.isGray = false;
|
|
|
this.node_getOrderReward.setGray(false, true);
|
|
|
- }
|
|
|
-
|
|
|
+ this.node_getOrderReward.getComponent(cc.Animation).play();
|
|
|
+ this.node_orderHand.active = true;
|
|
|
+ mk.ui.closeAllUI();
|
|
|
+ let isGuide = mk.guide.open(3);
|
|
|
+ if (!isGuide) {
|
|
|
+ mk.tip.pop("订单已完成,快领奖吧!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
{
|
|
|
let dataE = orderData.orderTaskList[index];
|
|
|
- if(dataE)
|
|
|
- {
|
|
|
- if(dataE.completeCount == dataE.taskCount)
|
|
|
- {
|
|
|
+ if (dataE) {
|
|
|
+ if (dataE.completeCount == dataE.taskCount) {
|
|
|
this.lbl_progress[index].node.active = false;
|
|
|
this.sp_mark[index].node.active = true;
|
|
|
- }else{
|
|
|
-
|
|
|
+ } else {
|
|
|
+
|
|
|
this.lbl_progress[index].string = `${dataE.completeCount}/${dataE.taskCount}`;
|
|
|
cc.Tween.stopAllByTarget(this.lbl_progress[index].node);
|
|
|
cc.tween(this.lbl_progress[index].node).to(0.1, { scale: 1.4 }).to(0.05, { scale: 1 }).start();
|
|
|
@@ -1021,5 +1051,19 @@ export default class Game extends cc.Component {
|
|
|
|
|
|
gData.gameData.playerProp.orderData = response.data.userOrderTaskInfo;
|
|
|
}
|
|
|
+
|
|
|
+ public clickOrderUIBtn() {
|
|
|
+ let data = gData.gameData.playerProp.orderData;
|
|
|
+ let orderData = data.orderTaskList;
|
|
|
+ let copyData = gData.gameData.playerProp.copyOrderData;
|
|
|
+ if (data && orderData && copyData) {
|
|
|
+ let num = 0;
|
|
|
+ for (let i = 0; i != orderData.length; ++i) {
|
|
|
+ num += (orderData[i].taskCount - copyData[i])
|
|
|
+ }
|
|
|
+ mk.guide.curDes = `<color=8A4312>继续生产${num}次,很快就\n可以提现了!</color>`;
|
|
|
+ //mk.guide.open(2, curDes);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|