wuwangdong 4 роки тому
батько
коміт
8690bbba03

Різницю між файлами не показано, бо вона завелика
+ 3265 - 214
assets/resources/game/prefab/game.prefab


BIN
assets/resources/game/texture/main/bg1.png


+ 36 - 0
assets/resources/game/texture/main/bg1.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "3bc62a14-4210-47fd-af1a-988c58f662a7",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 486,
+  "height": 154,
+  "platformSettings": {},
+  "subMetas": {
+    "bg1": {
+      "ver": "1.0.4",
+      "uuid": "cc0a06a5-c8da-4009-bce9-866e58d64796",
+      "rawTextureUuid": "3bc62a14-4210-47fd-af1a-988c58f662a7",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 486,
+      "height": 154,
+      "rawWidth": 486,
+      "rawHeight": 154,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/game/texture/main/bg2.png


+ 36 - 0
assets/resources/game/texture/main/bg2.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "0c30d114-ea86-4c28-b240-cbcb5bdc2aea",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 109,
+  "height": 122,
+  "platformSettings": {},
+  "subMetas": {
+    "bg2": {
+      "ver": "1.0.4",
+      "uuid": "bb96797f-a651-41e3-ab7f-cceb4747352a",
+      "rawTextureUuid": "0c30d114-ea86-4c28-b240-cbcb5bdc2aea",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 109,
+      "height": 122,
+      "rawWidth": 109,
+      "rawHeight": 122,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/game/texture/main/bg3.png


+ 36 - 0
assets/resources/game/texture/main/bg3.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "1fab6436-aa21-4f60-8cb0-d54da3689428",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 97,
+  "height": 26,
+  "platformSettings": {},
+  "subMetas": {
+    "bg3": {
+      "ver": "1.0.4",
+      "uuid": "9b019288-0df7-4f5b-9faf-c27aea78e948",
+      "rawTextureUuid": "1fab6436-aa21-4f60-8cb0-d54da3689428",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 97,
+      "height": 26,
+      "rawWidth": 97,
+      "rawHeight": 26,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/game/texture/main/bg4.png


+ 36 - 0
assets/resources/game/texture/main/bg4.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "d9489091-87e2-4833-8f58-9b150be52ee1",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 304,
+  "height": 70,
+  "platformSettings": {},
+  "subMetas": {
+    "bg4": {
+      "ver": "1.0.4",
+      "uuid": "aa6b0e5b-6f90-4dfc-8309-f0e8af548ade",
+      "rawTextureUuid": "d9489091-87e2-4833-8f58-9b150be52ee1",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 304,
+      "height": 70,
+      "rawWidth": 304,
+      "rawHeight": 70,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/game/texture/main/gou.png


+ 36 - 0
assets/resources/game/texture/main/gou.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "dc213c34-4690-4556-ad1a-68d73c8f2ef3",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 30,
+  "height": 27,
+  "platformSettings": {},
+  "subMetas": {
+    "gou": {
+      "ver": "1.0.4",
+      "uuid": "b30df4d5-116b-40ae-b30e-f826be09e5cd",
+      "rawTextureUuid": "dc213c34-4690-4556-ad1a-68d73c8f2ef3",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 30,
+      "height": 27,
+      "rawWidth": 30,
+      "rawHeight": 27,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/game/texture/main/gou1.png


+ 36 - 0
assets/resources/game/texture/main/gou1.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "2df7f6e8-5b8b-4478-b108-12ee5ea2f279",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 43,
+  "height": 43,
+  "platformSettings": {},
+  "subMetas": {
+    "gou1": {
+      "ver": "1.0.4",
+      "uuid": "0cfd27d7-1f80-4ee9-b1ae-91c08fea5e0f",
+      "rawTextureUuid": "2df7f6e8-5b8b-4478-b108-12ee5ea2f279",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 43,
+      "height": 43,
+      "rawWidth": 43,
+      "rawHeight": 43,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/game/texture/main/hb5.png


+ 36 - 0
assets/resources/game/texture/main/hb5.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "439f722e-3428-4a23-9b44-9ca319e8862d",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 29,
+  "height": 32,
+  "platformSettings": {},
+  "subMetas": {
+    "hb5": {
+      "ver": "1.0.4",
+      "uuid": "0c05d35e-1ee3-41ee-8749-1bbaa1f16142",
+      "rawTextureUuid": "439f722e-3428-4a23-9b44-9ca319e8862d",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 29,
+      "height": 32,
+      "rawWidth": 29,
+      "rawHeight": 32,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/resources/game/texture/main/icon_rewu.png


+ 36 - 0
assets/resources/game/texture/main/icon_rewu.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "430f0337-3ac7-4c23-a0d7-c9f9d2a42e99",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 76,
+  "height": 72,
+  "platformSettings": {},
+  "subMetas": {
+    "icon_rewu": {
+      "ver": "1.0.4",
+      "uuid": "526bcf93-ff77-4008-b749-cbc96cd2dc5f",
+      "rawTextureUuid": "430f0337-3ac7-4c23-a0d7-c9f9d2a42e99",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 76,
+      "height": 72,
+      "rawWidth": 76,
+      "rawHeight": 72,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 14 - 2
assets/script/game/data/GameData.ts

@@ -210,6 +210,7 @@ export class GameData {
         this.playerProp.userFarmTaskInfo = res_data.userFarmTaskInfo;
         this.playerProp.speedUpLeftTimes = res_data.speedUpLeftTimes;
         this.playerProp.completeFarmTaskTimes = res_data.completeFarmTaskTimes;
+        this.playerProp.orderData = res_data.userOrderTaskInfo;
 
         mk.data.setTAUserID(gData.loginData.uin);
         mk.data.setTAEventUser(0, 'logindays_total', this.playerProp.loginDays);
@@ -1168,9 +1169,17 @@ export class GameData {
     }
 
     /** 更新最大可种植产品到服务器 */
-    updateMaxProduct() {
+    async updateMaxProduct() {
         if (this.maxProductToServer) {
-            mk.http.sendData('updateMaxProduct', this._maxProduct);
+            let data = {"unLockProductList": []};      
+            for(let i = 0; i != this._maxProduct.length; ++i)
+            {
+                let dataE = this._maxProduct[i];
+                let d = {id: dataE.productID, tab: dataE.tab};
+                data.unLockProductList.push(d);
+            }
+            let respone =await mk.http.sendData('orderTask/updateUnlockProduct', data);
+            console.log("------");
         }
     }
 }
@@ -1373,6 +1382,9 @@ class PlayerProp {
 
     /** 农场任务完成次数 */
     completeFarmTaskTimes = 0;
+
+    /** 订单数据 */
+    orderData = null;
 }
 
 /**

+ 168 - 14
assets/script/game/game/Game.ts

@@ -1,5 +1,6 @@
 import Util from "../../before/util/Util";
 import JsbSystem from "../../mk/system/JsbSystem";
+import SetGray from "../component/SetGray";
 import { AdFun, RateConfig } from "../data/AdData";
 import { DataEventId, GameProp, ProductType, VideoAdType } from "../data/GameData";
 
@@ -92,7 +93,21 @@ export default class Game extends cc.Component {
     lbl_value: cc.Label[] = [];
 
     //订单部分
-    
+    @property({ displayName: '农作物图标', type: cc.Sprite })
+    sp_cropIcon: cc.Sprite[] = [];
+    @property({ displayName: '农作物名字', type: cc.Label })
+    lbl_cropName: cc.Label[] = [];
+    @property({ displayName: '农作物进度', type: cc.Label })
+    lbl_progress: cc.Label[] = [];
+    @property({ displayName: '进度完成对勾', type: cc.Sprite })
+    sp_mark: cc.Sprite[] = [];
+
+    @property({ displayName: '订单红包币数字组', type: cc.Label })
+    lbl_redMoneyValue: cc.Label[] = [];
+    @property({ displayName: '领奖按钮', type: SetGray })
+    node_getOrderReward: SetGray = null;
+
+
     posY = 0;
     /** 是否开始增加次数倒计时 */
     private lastTimeSpan = 0;
@@ -123,6 +138,7 @@ export default class Game extends cc.Component {
 
         this.initRefreshEvent();
 
+        this.initOrderUI();
     }
 
     start() {
@@ -201,7 +217,7 @@ export default class Game extends cc.Component {
         if (!this.isShowAddProductTimesUI) {
             this.isShowAddProductTimesUI = true;
             if (add > 0) {
-                add = add > gData.gameData.maxTimes ? gData.gameData.maxTimes :add;
+                add = add > gData.gameData.maxTimes ? gData.gameData.maxTimes : add;
                 gData.gameData.restoreProductTimes = add;
                 mk.ui.openPanel('module/speedUpUI/restoreProductTimes');
             }
@@ -719,11 +735,20 @@ export default class Game extends cc.Component {
     showChangePart() {
         //this.changePart.active = true
         let len = this.lbl_value.length;
+        let len2 = this.lbl_redMoneyValue.length;
         this.schedule(() => {
+            //图鉴部分
             for (var i = 0; i < len; i++) {
                 let ran = Util.rnd(0, 9);
                 this.lbl_value[i].string = `${ran}`;
             }
+
+            //订单部分
+            for (var i = 0; i < len2; i++) {
+                let ran = Util.rnd(0, 9);
+                this.lbl_redMoneyValue[i].string = `${ran}`;
+            }
+
         }, 0.1)
     }
 
@@ -835,20 +860,149 @@ export default class Game extends cc.Component {
 
     //订单部分
 
-    async doCropFlyLogic(plantId:number, farmNode: cc.Node)
-    {
-        let crop = await mk.pool.getPrefab('game/prefab/crop');
-        let sf = await mk.loader.load("game/coregame/texture/plant_icons/plantIcon_" + plantId, cc.SpriteFrame);
-        crop.getComponent(cc.Sprite).spriteFrame = sf;
-        mk.fly.playFlyAniExtra(farmNode, this.node_taskHb, crop, 1);
+    private orderPicIdArray = [];
+    private isGray = true;
+    public async initOrderUI() {
+        let productJson = gData.gameData.configs.Product;
+        let data = gData.gameData.playerProp.orderData;
+        if (data) {
+            let len = data.orderTaskList.length;
+            if (len == 3) {
+                let completeCount = 0;
+                for (let i = 0; i != len; ++i) {
+                    let dataE = data.orderTaskList[i];
+                    if (dataE.Id <= productJson.length) {
+                        let productData = productJson[dataE.Id - 1];
+
+                        let plantPath = '';
+                        let namePath = '';
+                        if (productData.tab == ProductType.nzw) {
+                            plantPath = 'game/coregame/texture/plant_icons/plantIcon_';
+                            namePath = 'game/coregame/texture/plant_icons/nameIcon/plant_name_';
+                        }
+                        else {
+                            plantPath = 'game/coregame/texture/factory_icons/factory_';
+                            namePath = 'game/coregame/texture/factory_icons/factoryNams/factory_name_icon_';
+                        }
+
+                        if (dataE.completeCount == dataE.taskCount) {
+                            this.lbl_progress[i].node.active = false;
+                            this.sp_mark[i].node.active = true;
+                            ++completeCount;
+                        } else {
+                            this.lbl_progress[i].node.active = true;
+                            this.sp_mark[i].node.active = false;
+                            this.lbl_progress[i].string = `${dataE.completeCount}/${dataE.taskCount}`;
+                        }
+
+                        this.orderPicIdArray.push({ "ID": dataE.Id, "picID": productData.picture });
+                        this.lbl_cropName[i].string = productData.name;
+                        this.sp_cropIcon[i].spriteFrame = await mk.loader.load(plantPath + productData.picture, cc.SpriteFrame);
+
+                    } else {
+                        console.log('订单数据错误');
+                        return;
+                    }
+                }
+
+                if (completeCount >= 3) {
+                    this.isGray = false;
+                    this.node_getOrderReward.setGray(false, true);
+                } else {
+                    this.isGray = true;
+                    this.node_getOrderReward.setGray(true, true);
+                }
+            } else {
+                console.log('订单数据错误');
+            }
+
+        } else {
+            console.log('订单数据错误');
+        }
+    }
+
+    public clickGetOrderRewardBtn() {
+        if (this.isGray) {
+            mk.tip.pop("订未完成");
+        } else {
+            this.getOrderReward();
+        }
+    }
+
+    public async getOrderReward() {
+        let data = {};
+        let response = await mk.http.sendData('orderTask/receiveReward', data);
+        if (response.errcode != 0) {
+            return null;
+        }
+
+    }
+
+    async doCropFlyLogic(plantId: number, farmNode: cc.Node, isNzw = false) {
+        for (let i = 0; i != this.orderPicIdArray.length; ++i) {
+            if (plantId == this.orderPicIdArray[i].picID) {
+                let data = gData.gameData.playerProp.orderData.orderTaskList[i];
+                if (data.completeCount < data.taskCount) {
+                    let plantPath = '';
+                    if (isNzw) {
+                        plantPath = 'game/coregame/texture/plant_icons/plantIcon_';
+                    }
+                    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;
+                    mk.fly.playFlyAniExtra(farmNode, this.node_taskHb, crop, 1, () => {
+                        this.updataOrderProgress(this.orderPicIdArray[i].ID, i);
+                    });
+                }
+                break;
+            }
+        }
     }
 
-    async cloneCropFuc(plantId: number)
-    {
-       
-        //iconPath = "game/coregame/texture/plant_icons/plantIcon_";
-        
-        //this.icon_plantName.spriteFrame = await mk.loader.load(namePath + gData.gameData.nextCanProduct.picture, cc.SpriteFrame);
+    public async updataOrderProgress(id, index) {
+        let data = { "id": id };
+        let response = await mk.http.sendData('orderTask/updateUserOrderTaskInfo', data);
+        if (response.errcode != 0) {
+            return null;
+        }
+
+        gData.gameData.playerProp.orderData = response.data.userOrderTaskInfo;
+
+        let orderData = gData.gameData.playerProp.orderData;
+        if (orderData) {
+            let isComplete = true;
+            let len = orderData.orderTaskList.length;
+            for (let i = 0; i != len; ++i) {
+                let dataE = orderData.orderTaskList;
+                if (dataE[i].completeCount < dataE[i].taskCount) {
+                    isComplete = false;
+                    break;
+                }
+            }
+
+            if (isComplete) {
+                this.isGray = false;
+                this.node_getOrderReward.setGray(false, true);
+            } else {
+                let dataE = orderData.orderTaskList[index];
+                if(dataE)
+                {       
+                    if(dataE.completeCount == dataE.taskCount)
+                    {
+                        this.lbl_progress[index].node.active = false;
+                        this.sp_mark[index].node.active = true;
+                    }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.2 }).to(0.05, { scale: 1 }).start();
+                    }
+                }
+            }
+        }
     }
 }
 

BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/caches/build_file_checksums.ser


Деякі файли не було показано, через те що забагато файлів було змінено