wuwangdong 4 年 前
コミット
947df294ed

+ 73 - 51
assets/resources/module/speedUpUI/productReward.prefab

@@ -24,9 +24,6 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 83
-      },
-      {
         "__id__": 84
       },
       {
@@ -34,10 +31,13 @@
       },
       {
         "__id__": 86
+      },
+      {
+        "__id__": 87
       }
     ],
     "_prefab": {
-      "__id__": 87
+      "__id__": 88
     },
     "_opacity": 255,
     "_color": {
@@ -101,7 +101,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 82
+      "__id__": 83
     },
     "_opacity": 255,
     "_color": {
@@ -183,11 +183,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 80
+        "__id__": 81
       }
     ],
     "_prefab": {
-      "__id__": 81
+      "__id__": 82
     },
     "_opacity": 255,
     "_color": {
@@ -1618,16 +1618,16 @@
         "__id__": 44
       },
       {
-        "__id__": 56
+        "__id__": 57
       },
       {
-        "__id__": 66
+        "__id__": 67
       }
     ],
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 79
+      "__id__": 80
     },
     "_opacity": 255,
     "_color": {
@@ -1698,10 +1698,13 @@
     "_components": [
       {
         "__id__": 54
+      },
+      {
+        "__id__": 55
       }
     ],
     "_prefab": {
-      "__id__": 55
+      "__id__": 56
     },
     "_opacity": 255,
     "_color": {
@@ -2107,6 +2110,25 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Animation",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 44
+    },
+    "_enabled": true,
+    "_defaultClip": {
+      "__uuid__": "1c7cfdae-7b6c-46a5-9085-2fa8aa684ac7"
+    },
+    "_clips": [
+      {
+        "__uuid__": "1c7cfdae-7b6c-46a5-9085-2fa8aa684ac7"
+      }
+    ],
+    "playOnLoad": true,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -2126,20 +2148,20 @@
     },
     "_children": [
       {
-        "__id__": 57
+        "__id__": 58
       },
       {
-        "__id__": 60
+        "__id__": 61
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 64
+        "__id__": 65
       }
     ],
     "_prefab": {
-      "__id__": 65
+      "__id__": 66
     },
     "_opacity": 255,
     "_color": {
@@ -2193,17 +2215,17 @@
     "_name": "进度条",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 56
+      "__id__": 57
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 58
+        "__id__": 59
       }
     ],
     "_prefab": {
-      "__id__": 59
+      "__id__": 60
     },
     "_opacity": 255,
     "_color": {
@@ -2257,7 +2279,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 57
+      "__id__": 58
     },
     "_enabled": true,
     "_materials": [
@@ -2300,20 +2322,20 @@
     "_name": "进度文本",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 56
+      "__id__": 57
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 61
+        "__id__": 62
       },
       {
-        "__id__": 62
+        "__id__": 63
       }
     ],
     "_prefab": {
-      "__id__": 63
+      "__id__": 64
     },
     "_opacity": 255,
     "_color": {
@@ -2367,7 +2389,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 60
+      "__id__": 61
     },
     "_enabled": true,
     "_materials": [
@@ -2377,8 +2399,8 @@
     ],
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
-    "_string": "10/15",
-    "_N$string": "10/15",
+    "_string": "",
+    "_N$string": "",
     "_fontSize": 26,
     "_lineHeight": 40,
     "_enableWrapText": true,
@@ -2400,7 +2422,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 60
+      "__id__": 61
     },
     "_enabled": true,
     "_color": {
@@ -2429,7 +2451,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 56
+      "__id__": 57
     },
     "_enabled": true,
     "_materials": [
@@ -2476,16 +2498,16 @@
     },
     "_children": [
       {
-        "__id__": 67
+        "__id__": 68
       },
       {
-        "__id__": 70
+        "__id__": 71
       }
     ],
     "_active": false,
     "_components": [],
     "_prefab": {
-      "__id__": 78
+      "__id__": 79
     },
     "_opacity": 255,
     "_color": {
@@ -2539,17 +2561,17 @@
     "_name": "描述2",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 66
+      "__id__": 67
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 68
+        "__id__": 69
       }
     ],
     "_prefab": {
-      "__id__": 69
+      "__id__": 70
     },
     "_opacity": 255,
     "_color": {
@@ -2603,7 +2625,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 67
+      "__id__": 68
     },
     "_enabled": true,
     "_materials": [
@@ -2647,27 +2669,27 @@
     "_name": "New Sprite",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 66
+      "__id__": 67
     },
     "_children": [
       {
-        "__id__": 71
+        "__id__": 72
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 74
-      },
-      {
         "__id__": 75
       },
       {
         "__id__": 76
+      },
+      {
+        "__id__": 77
       }
     ],
     "_prefab": {
-      "__id__": 77
+      "__id__": 78
     },
     "_opacity": 255,
     "_color": {
@@ -2721,17 +2743,17 @@
     "_name": "New Sprite",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 70
+      "__id__": 71
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 72
+        "__id__": 73
       }
     ],
     "_prefab": {
-      "__id__": 73
+      "__id__": 74
     },
     "_opacity": 255,
     "_color": {
@@ -2785,7 +2807,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 71
+      "__id__": 72
     },
     "_enabled": true,
     "_materials": [
@@ -2828,7 +2850,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 70
+      "__id__": 71
     },
     "_enabled": true,
     "_materials": [
@@ -2860,7 +2882,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 70
+      "__id__": 71
     },
     "_enabled": true,
     "_defaultClip": {
@@ -2879,7 +2901,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 70
+      "__id__": 71
     },
     "_enabled": true,
     "panel_name": "module/redBagTask/redBagTask",
@@ -3057,13 +3079,13 @@
       "__id__": 49
     },
     "lbl_progress": {
-      "__id__": 61
+      "__id__": 62
     },
     "sp_taskProgress": {
-      "__id__": 58
+      "__id__": 59
     },
     "node_complete": {
-      "__id__": 66
+      "__id__": 67
     },
     "node_Uncomplete": {
       "__id__": 44

+ 9 - 6
assets/script/game/data/GameData.ts

@@ -480,7 +480,7 @@ export class GameData {
                 this.setNextProduct(false);
                 gData.adData.checkPopRed();
 
-                await this.updateNewTaskProgress();
+                flyRed = await this.updateNewTaskProgress();
                 break;
             case 2:
                 gData.pastureSystem.btnMake();
@@ -488,7 +488,7 @@ export class GameData {
                 this.setNextProduct(false);
                 gData.adData.checkPopRed();
 
-                await this.updateNewTaskProgress();
+                flyRed = await this.updateNewTaskProgress();
                 break;
             case 3:
                 gData.factorySystem.btnMake();
@@ -496,7 +496,7 @@ export class GameData {
                 this.setNextProduct(false);
                 gData.adData.checkPopRed();
 
-                await this.updateNewTaskProgress();
+                flyRed = await this.updateNewTaskProgress();
                 break;
         }
         return flyRed;
@@ -512,14 +512,17 @@ export class GameData {
             let count = this.playerProp.userFarmTaskInfo.taskCount;
 
             if (com >= count)
-                return;
+            {
+                return false;
+            }
+                
         }
 
         let data = {};
         let response = await mk.http.sendData('farmTask/updateUserFarmTaskInfo', data);
         mk.console.logSingle('refrehTask=>', response);
         if (response.errcode != 0) {
-            return null;
+            return false;
         }
         
         this.playerProp.userFarmTaskInfo = response.data.userFarmTaskInfo;
@@ -529,7 +532,7 @@ export class GameData {
         if (isNeedRefresh) {
             gData.gameData.init_task = true;
         }
-
+        return true;
     }
 
     public setFarmDataMap(id, data, sendToServer = true) {

+ 0 - 8
assets/script/game/game/Game.ts

@@ -433,14 +433,6 @@ export default class Game extends cc.Component {
         //     mk.tip.pop('生产次数+1');
         // }
 
-        if (gData.gameData.playerProp.userFarmTaskInfo) {
-            let com = gData.gameData.playerProp.userFarmTaskInfo.completeCount;
-            let count = gData.gameData.playerProp.userFarmTaskInfo.taskCount;
-
-            if (com >= count)
-                return;
-        }
-
         if (flyRed) {
             //mk.audio.playEffect('redmoney');
             let pos = this.node_taskHb.parent.convertToWorldSpaceAR(this.node_taskHb.getPosition());

+ 13 - 4
assets/script/game/module/speedUpUI/ProductReward.ts

@@ -34,15 +34,24 @@ export default class ProductReward extends cc.Component {
                 this.lbl_taskTimes.string = (count - com).toString();
                 this.node_Uncomplete.active = true;
                 this.node_complete.active = false;
-                this.node_Uncomplete.scale = 2;
-                cc.tween(this.node_Uncomplete).to(0.3, {scale: 1}).start();
+                // 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();
             } else {
                 this.node_Uncomplete.active = false;
                 this.node_complete.active = true;
             }
-            this.lbl_progress.string = `${com}/${count}`;
+            
             let per = com / count;
-            cc.tween(this.sp_taskProgress).to(0.2, {fillRange: per}).start();
+            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(()=>{
+                this.lbl_progress.string = `${com}/${count}`;
+            }).start();
             //this.sp_taskProgress.fillRange = 
         }
     }