完整版首次更新

This commit is contained in:
YZ\249929363
2024-08-02 17:23:01 +08:00
parent d231d65e05
commit c8c06da1dd
305 changed files with 86777 additions and 80872 deletions
File diff suppressed because one or more lines are too long
@@ -44,6 +44,10 @@ window.initMgr = function() {
changeMap: "10005", //改变那地图
nextWater: "10006" , //传递执行下一个格子洪水流过
addEnd: "10007" , //添加结束点
setData: "10008" , //上传分数
guideNext: "10009" , //引导进入下一步
showResult: "10010", //展示治水结果
removeTip: "10011" //执行撤回或者后退动作,移除提示
}
/*
+4 -4
View File
@@ -8,16 +8,16 @@ export default class ItemRender extends cc.Component {
/**数据 */
public data:any = null;
/**索引 0表示第一项*/
public itemIndex:number = 0;
public itemIndex:number = 0;
/**数据改变时调用 */
public dataChanged(){
cc.fx.GameTool.subName(this.data.name,6);
this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "%";
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total;
let timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time);
this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
// this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
this.node.getChildByName("rank").getChildByName("one").active = false;
this.node.getChildByName("rank").getChildByName("two").active = false;
this.node.getChildByName("rank").getChildByName("three").active = false;
@@ -56,7 +56,7 @@ export default class ItemRender extends cc.Component {
}
})
.catch(error => {
console.error('Error fetching X-Info:', error);
// console.error('Error fetching X-Info:', error);
});
cc.assetManager.loadRemote(url, {ext:'.png'},(err, texture:cc.Texture2D) => {
if(texture){
+9 -84
View File
@@ -33,7 +33,7 @@ var GameTool = {
"data": data
};
console.log("上传数据:");
console.log("上传数据:",data);
cc.fx.HttpUtil.uploadUserLogData(postData,function(){})
},
//上传排行榜 type为1
@@ -43,8 +43,8 @@ var GameTool = {
"gameId":cc.fx.GameConfig.GM_INFO.gameId,
"userId":cc.fx.GameConfig.GM_INFO.userId,
"type":1,
"totleTimes": data.totleTimes,
"accuracy": data.accuracy,
"score": data.score,
"accuracy": data.date,
"success": cc.fx.GameConfig.GM_INFO.success
};
cc.fx.HttpUtil.rankData(1,function(){},postData);
@@ -136,10 +136,10 @@ var GameTool = {
}
})
.catch(error => {
console.error('Error fetching X-Info:', error);
// console.error('Error fetching X-Info:', error);
});
}, 100);
cc.assetManager.loadRemote(url, {ext:'.jpg'},(err, texture:cc.Texture2D) => {
cc.assetManager.loadRemote(url, {ext:'.png'},(err, texture:cc.Texture2D) => {
if(texture){
node.active = true;
node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
@@ -158,7 +158,7 @@ var GameTool = {
let self = false;
cc.fx.GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"),target.selfData.pic);
for(let i=0;i<=target.listData.length-1;i++){
rankData.push({rank:(i+1), name:target.listData[i].nickName, total:target.listData[i].accuracy,time:target.listData[i].totleTimes, pic:target.listData[i].pic});
rankData.push({rank:(i+1), name:target.listData[i].nickName, total:target.listData[i].score,time:null, pic:target.listData[i].pic});
if(cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId){
self = true;
target.rankNumber = i;
@@ -171,9 +171,9 @@ var GameTool = {
}
cc.fx.GameTool.subName(target.selfData.nickName,nameLength);
target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName;
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.accuracy + "%";
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.score;
let timeTemp = cc.fx.GameTool.getTimeShenNong(target.selfData.totleTimes);
target.selfNode.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
// target.selfNode.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
switch(target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string){
case "1":
target.selfNode.getChildByName("rank").getChildByName("one").active = true;
@@ -232,81 +232,6 @@ var GameTool = {
cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom,arrayList);
},
getFoodName(food){
var name = "葡萄";
switch(food){
case "baishao":
name = "白芍";
break;
case "jingjie":
name = "荆芥";
break;
case "renshen":
name = "人参";
break;
case "danshen":
name = "丹参";
break;
case "danggui":
name = "当归";
break;
case "gouqi":
name = "枸杞";
break;
case "mudan":
name = "牡丹";
break;
case "mulan":
name = "木兰";
break;
case "pugongying":
name = "蒲公英";
break;
case "moli":
name = "茉莉";
break;
case "jinju":
name = "金桔";
break;
case "dazao":
name = "大枣";
break;
case "lizi":
name = "李子";
break;
case "lizhi":
name = "荔枝";
break;
case "taozi":
name = "桃子";
break;
case "putao":
name = "葡萄";
break;
case "muchai":
name = "木柴";
break;
case "ganjiang":
name = "干姜";
break;
case "zhuye":
name = "竹叶";
break;
case "longyan":
name = "龙眼";
break;
case "chixiaodou":
name = "赤小豆";
break;
case "gancao":
name = "甘草";
break;
case "cha":
name = "茶";
break;
}
return name;
},
getSetScreenResolutionFlag: function () {
let size = cc.winSize;
@@ -387,7 +312,7 @@ var GameTool = {
//获取时间戳
getTime(){
const timestamp = new Date().getTime();
const timestamp = Math.floor((new Date().getTime()) / 1000)
return timestamp;
},
pushLister:function () {