|
|
@@ -19,51 +19,46 @@ export default class ProductReward extends cc.Component {
|
|
|
@property({ type: cc.Node, displayName: '未完成节点' })
|
|
|
node_Uncomplete: cc.Node = null;
|
|
|
|
|
|
- @property({type: cc.Node, displayName: '节点1'})
|
|
|
+ @property({ type: cc.Node, displayName: '节点1' })
|
|
|
node_1: cc.Node = null;
|
|
|
- @property({type: cc.Node, displayName: '节点2'})
|
|
|
+ @property({ type: cc.Node, displayName: '节点2' })
|
|
|
node_2: cc.Node = null;
|
|
|
|
|
|
onEnable() {
|
|
|
- this.scheduleOnce(() => {
|
|
|
- mk.guide.open(4);
|
|
|
- }, 0.5)
|
|
|
-
|
|
|
this.lbl_times.string = `生产次数+${gData.gameData.configs.ServerConfig.ProductionAd}`;
|
|
|
|
|
|
gData.gameData.init_productTask = false;
|
|
|
if (gData.gameData.playerProp.userFarmTaskInfo) {
|
|
|
let com = gData.gameData.playerProp.userFarmTaskInfo.completeCount;
|
|
|
let count = gData.gameData.playerProp.userFarmTaskInfo.taskCount;
|
|
|
- if(count <= 10)
|
|
|
- {
|
|
|
+ if (count <= 10) {
|
|
|
if (count > com) {
|
|
|
this.lbl_taskTimes.string = (count - com).toString();
|
|
|
this.node_Uncomplete.active = true;
|
|
|
this.node_complete.active = false;
|
|
|
- // this.node_Uncomplete.scale = 2;
|
|
|
- // let posY = this.node_Uncomplete.y;
|
|
|
- // this.node_Uncomplete.y = posY + 200;
|
|
|
- // cc.tween(this.node_Uncomplete).delay(0.2).to(0.4, {scale: 1, y: posY}).start();
|
|
|
+
|
|
|
+ this.scheduleOnce(() => {
|
|
|
+ mk.guide.curDes = `<color=8A4312>再<color=ff0000>生产${count - com}次</color>,即可<color=ff0000>提现</color>,\n快领取次数吧!</color>`;
|
|
|
+ mk.guide.open(2);
|
|
|
+ }, 0.5)
|
|
|
} else {
|
|
|
this.node_Uncomplete.active = false;
|
|
|
this.node_complete.active = true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
let per = com / count;
|
|
|
cc.tween(this.sp_taskProgress).delay(0.2).to(0.3, { fillRange: per }, {
|
|
|
onUpdate: () => {
|
|
|
let num = Math.round(this.sp_taskProgress.fillRange * count);
|
|
|
this.lbl_progress.string = `${num}/${count}`;
|
|
|
}
|
|
|
- }).call(()=>{
|
|
|
+ }).call(() => {
|
|
|
this.lbl_progress.string = `${com}/${count}`;
|
|
|
}).start();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.node_1.active = false;
|
|
|
this.node_2.active = false;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -72,8 +67,7 @@ export default class ProductReward extends cc.Component {
|
|
|
if (gData.gameData.playerProp.userFarmTaskInfo) {
|
|
|
let com = gData.gameData.playerProp.userFarmTaskInfo.completeCount;
|
|
|
let count = gData.gameData.playerProp.userFarmTaskInfo.taskCount;
|
|
|
- if(count <= 10)
|
|
|
- {
|
|
|
+ if (count <= 10) {
|
|
|
if (count > com) {
|
|
|
this.lbl_taskTimes.string = (count - com).toString();
|
|
|
this.node_Uncomplete.active = true;
|
|
|
@@ -84,7 +78,7 @@ export default class ProductReward extends cc.Component {
|
|
|
}
|
|
|
this.lbl_progress.string = `${com}/${count}`;
|
|
|
this.sp_taskProgress.fillRange = com / count;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
gData.gameData.init_productTask = false;
|