lgh vor 8 Monaten
Ursprung
Commit
a90e9525ad

BIN
assets/res/texture/fight/bg_pop.png


+ 8 - 8
assets/res/texture/fight/bg_pop.png.meta

@@ -41,14 +41,14 @@
         "trimType": "auto",
         "trimThreshold": 1,
         "rotated": false,
-        "offsetX": 8.5,
-        "offsetY": -4,
-        "trimX": 17,
-        "trimY": 8,
-        "width": 597,
-        "height": 576,
-        "rawWidth": 614,
-        "rawHeight": 584,
+        "offsetX": 5.5,
+        "offsetY": -2,
+        "trimX": 11,
+        "trimY": 4,
+        "width": 296,
+        "height": 288,
+        "rawWidth": 307,
+        "rawHeight": 292,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,

BIN
assets/res/texture/fight/bg_pop1.png


+ 4 - 4
assets/res/texture/fight/bg_pop1.png.meta

@@ -45,10 +45,10 @@
         "offsetY": 0,
         "trimX": 0,
         "trimY": 0,
-        "width": 582,
-        "height": 568,
-        "rawWidth": 582,
-        "rawHeight": 568,
+        "width": 291,
+        "height": 306,
+        "rawWidth": 291,
+        "rawHeight": 306,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,

BIN
assets/res/texture/fight/btn1.png


+ 4 - 4
assets/res/texture/fight/btn1.png.meta

@@ -45,10 +45,10 @@
         "offsetY": 0,
         "trimX": 0,
         "trimY": 0,
-        "width": 374,
-        "height": 96,
-        "rawWidth": 374,
-        "rawHeight": 96,
+        "width": 187,
+        "height": 48,
+        "rawWidth": 187,
+        "rawHeight": 48,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,

BIN
assets/res/texture/fight/btn2.png


+ 4 - 4
assets/res/texture/fight/btn2.png.meta

@@ -45,10 +45,10 @@
         "offsetY": 0,
         "trimX": 0,
         "trimY": 0,
-        "width": 374,
-        "height": 96,
-        "rawWidth": 374,
-        "rawHeight": 96,
+        "width": 187,
+        "height": 48,
+        "rawWidth": 187,
+        "rawHeight": 48,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,

BIN
assets/res/texture/fight/img_xiushi.png


+ 6 - 6
assets/res/texture/fight/img_xiushi.png.meta

@@ -41,12 +41,12 @@
         "trimType": "auto",
         "trimThreshold": 1,
         "rotated": false,
-        "offsetX": 1.5,
-        "offsetY": 0,
-        "trimX": 24,
-        "trimY": 21,
-        "width": 389,
-        "height": 386,
+        "offsetX": -1,
+        "offsetY": -0.5,
+        "trimX": 39,
+        "trimY": 40,
+        "width": 354,
+        "height": 349,
         "rawWidth": 434,
         "rawHeight": 428,
         "borderTop": 0,

BIN
assets/res/texture/fight/index.png


+ 1 - 1
assets/res/texture/fight/index.png.meta

@@ -67,7 +67,7 @@
     }
   },
   "userData": {
-    "hasAlpha": true,
+    "hasAlpha": false,
     "type": "sprite-frame",
     "redirect": "250d5186-874f-450d-9441-53b0f2cf8cef@f9941"
   }

+ 1 - 1
assets/resources/i18n/zh.ts

@@ -9,7 +9,7 @@ export const languages = {
     },
     "gamePanel": {
         "freeGold": "免费金币",
-        'shortGold': '币不足',
+        'shortGold': '游戏币不足',
     },
     "settingPanel": {
         "title": "设置",

+ 2 - 2
assets/resources/prefab/ui/common/tips.prefab

@@ -292,8 +292,8 @@
     "_color": {
       "__type__": "cc.Color",
       "r": 255,
-      "g": 0,
-      "b": 0,
+      "g": 255,
+      "b": 255,
       "a": 255
     },
     "_string": "x100000000",

+ 43 - 36
assets/scripts/game/HttpHelp.ts

@@ -1,6 +1,8 @@
 
 import { _decorator, Component, Node } from 'cc';
 import { gameManager } from './gameManager';
+import { uiManager } from '../framework/uiManager';
+
 const { ccclass, property } = _decorator;
 
 @ccclass('HttpHelp')
@@ -14,7 +16,7 @@ export class HttpHelp {
     /**
      * 请求地址的域名配置
      */
-    static HttpsUrlRelpse: string = "http://testapi.mstardance.com/api/"; //屏蔽掉,正式的也是测试//"http://star.mstardance.com/api/";
+    static HttpsUrlRelpse: string = "http://api.mstardance.com/api/"; //屏蔽掉,正式的也是测试//"http://star.mstardance.com/api/";
 
     static httpGet(url: string, callback: Function, token: string = null!, bind: any = null) {
         url = (gameManager.Instance.golabMemory.isReplse?HttpHelp.HttpsUrlRelpse:HttpHelp.HttpsUrlTest) + url;
@@ -59,47 +61,52 @@ export class HttpHelp {
     static httpPost(url: string, params: any, callback: Function, token: string = null!, bind: any = null) {
         url = (gameManager.Instance.golabMemory.isReplse?HttpHelp.HttpsUrlRelpse:HttpHelp.HttpsUrlTest)  + url;
         let xhr = new XMLHttpRequest();
-        xhr.onreadystatechange = function () {
-            //  console.log('xhr.readyState=' + xhr.readyState + '  xhr.status=' + xhr.status);
-            if (xhr.readyState === 4) {
-                let respone = xhr.responseText;
-                if (xhr.status == 200) {
-                    try {
-                        if (bind != null) {
-                            callback.call(bind, respone);
-                        } else {
-                            callback(respone);
+        // try{
+            xhr.onreadystatechange = function () {
+                //  console.log('xhr.readyState=' + xhr.readyState + '  xhr.status=' + xhr.status);
+                if (xhr.readyState === 4) {
+                    let respone = xhr.responseText;
+                    if (xhr.status == 200) {
+                        try {
+                            if (bind != null) {
+                                callback.call(bind, respone);
+                            } else {
+                                callback(respone);
+                            }
+                        } catch (error2) {
+                            
                         }
-                    } catch (error2) {
-                        
-                    }
-                   
-
-                } else {
+                    
+                    } else {
 
-                    try {
-                        if (bind != null) {
-                            callback.call(bind, "-1");
-                        } else {
-                            callback("-1");
+                        try {
+                            if (bind != null) {
+                                callback.call(bind, "-1");
+                            } else {
+                                callback("-1");
+                            }
+                        } catch (error1) {
+                            
                         }
-                    } catch (error1) {
-                        
+                    
                     }
-                  
                 }
+            };
+            xhr.timeout = 5000;// 5 seconds for timeout
+            xhr.open('POST', url, true);
+            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
+            xhr.setRequestHeader('Access-Control-Allow-Methods', 'POST');
+        // xhr.setRequestHeader('Access-Control-Allow-Headers', 'x-requested-with,content-type');
+            xhr.setRequestHeader("Content-type", "application/json");
+            if (token && token.length > 3) {
+                xhr.setRequestHeader("accessToken", token);
             }
-        };
-        xhr.timeout = 5000;// 5 seconds for timeout
-        xhr.open('POST', url, true);
-        xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
-        xhr.setRequestHeader('Access-Control-Allow-Methods', 'POST');
-       // xhr.setRequestHeader('Access-Control-Allow-Headers', 'x-requested-with,content-type');
-        xhr.setRequestHeader("Content-type", "application/json");
-        if (token && token.length > 3) {
-            xhr.setRequestHeader("accessToken", token);
-        }
-        xhr.send(params);
+            xhr.send(params);
+        // } catch (error1) {           
+        //     uiManager.instance.showTips('网络异常,请稍微再试!data==-2');
+
+            
+        // }
     }
 
 }

+ 36 - 29
assets/scripts/ui/game/gamePanel.ts

@@ -93,8 +93,9 @@ export class GamePanel extends Component {
     show() {
         clientEvent.dispatchEvent(gameConstants.EVENT_LIST.TOUCH_HIDE_TOUCHPLANE, true);
         if(gameManager.Instance.golabMemory.Chagnci?.endTime){
-            const enTime:number = Date.parse(gameManager.Instance.golabMemory.Chagnci?.endTime);
-            const xx=(enTime-Date.now())/1000;
+            const newEndTime = gameManager.Instance.golabMemory.Chagnci?.endTime.replace(/-/g, '/')
+            const enTime:number = Date.parse(newEndTime);
+            const xx=(enTime-Date.now()) / 1000;
             if(xx<=0){
                 console.error("caonima:",xx);
             }
@@ -158,7 +159,6 @@ export class GamePanel extends Component {
     }
 
     update(dt: number) {
-       
         if(this._countdownTime>0){
             this._countdownTime -= dt;
             this._time+=dt;
@@ -197,39 +197,46 @@ export class GamePanel extends Component {
      * 请求投币
      */
     HttpSendGold() {
-        let url = "coins/manage/coinFlip";
+        let url = "coins/manage/coinFlip"; 
         HttpHelp.httpPost(url, null, this.HttpSendGoldBack, gameManager.Instance.golabMemory.Token, this);
     }
 
     HttpSendGoldBack(data: any) {
         try {
-            if(data==-1)return;
-        // console.log('HttpSendGoldBack:  ',data);
-        var obj: ResponseBase = JSON.parse(data);
-        if (obj.code != 1) {
-            console.error("获取服务器信息出错", data);
-            return;
-        }
-        let coin: CoinFlipVo = obj.data;
-        if (!coin) {
-            console.error("推币返回的数据有误", obj);
-            return;
-        }
-        playerData.instance.setPlayMoney(coin.gameCurrcy);
-        clientEvent.dispatchEvent(gameConstants.EVENT_LIST.GOLD_SHOW_UPDATE);
-        if (coin.awardList && coin.awardList.length > 0) {
-            let len=coin.awardList.length;
-            if(len>gameConstants.MaxAwardCount){
-                len=gameConstants.MaxAwardCount;
+            if(data==-1){
+                // this.btnTuiBi.interactable = false;
+                uiManager.instance.showTips('网络异常,请重新加载!');                
+                // this.btnTuiBi.interactable = true;
+                return;
             }
-            for (let i = 0; i < len; i++) {
-                let key = coin.awardList[i].uuid;
-                if (!key) continue;
-                gameManager.Instance._createPresent(coin.awardList[i]); //创建一个礼物
-                gameManager.Instance.golabMemory.AwardInfos?.set(key, coin.awardList[i]);
+            // console.log('HttpSendGoldBack:  ',data);
+            var obj: ResponseBase = JSON.parse(data);
+            if (obj.code != 1) {
+                console.error("获取服务器信息出错", data);
+                uiManager.instance.showTips('网络异常,请重新加载!');
+                // this.btnTuiBi.interactable = true;
+                return;
             }
-        }
-        this.btnTuiBi.interactable = true;
+            let coin: CoinFlipVo = obj.data;
+            if (!coin) {
+                console.error("推币返回的数据有误", obj);
+                return;
+            }
+            playerData.instance.setPlayMoney(coin.gameCurrcy);
+            clientEvent.dispatchEvent(gameConstants.EVENT_LIST.GOLD_SHOW_UPDATE);
+            if (coin.awardList && coin.awardList.length > 0) {
+                let len=coin.awardList.length;
+                if(len>gameConstants.MaxAwardCount){
+                    len=gameConstants.MaxAwardCount;
+                }
+                for (let i = 0; i < len; i++) {
+                    let key = coin.awardList[i].uuid;
+                    if (!key) continue;
+                    gameManager.Instance._createPresent(coin.awardList[i]); //创建一个礼物
+                    gameManager.Instance.golabMemory.AwardInfos?.set(key, coin.awardList[i]);
+                }
+            }
+            this.btnTuiBi.interactable = true;
         } catch (errorx) {
             console.error("投币回包err:",errorx);
             this.btnTuiBi.interactable = true;

+ 9 - 2
settings/v2/packages/builder.json

@@ -1,8 +1,15 @@
 {
   "__version__": "1.2.9",
   "splash-setting": {
+    "url": "C:\\ProgramData\\cocos\\editors\\Creator\\3.3.2\\resources\\app.asar\\static\\logo.png",
+    "displayRatio": 0.1,
     "totalTime": 0,
-    "displayWatermark": false,
-    "displayRatio": 0.1
+    "clearColor": {
+      "x": 0.88,
+      "y": 0.88,
+      "z": 0.88,
+      "w": 1
+    },
+    "displayWatermark": false
   }
 }