模板更新

This commit is contained in:
YZ\249929363 2024-08-02 17:23:26 +08:00
parent 0444e975d9
commit 8c55ee1950
5 changed files with 203 additions and 2645 deletions

File diff suppressed because one or more lines are too long

View File

@ -91,8 +91,8 @@ function responseHandler(response: { data: any }) {
// 响应拦截器
// Rq.interceptors.response.use(responseHandler)
const config = {
gameId: "100010",
secretKey: "wozrGKsL",
gameId: "100012",
secretKey: "onnfPKJW",
EK:"hui231%1"
};

View File

@ -36,6 +36,20 @@ window.initMgr = function() {
queryId : -1 //分享id
};
cc.fx.Message = {
control: "10001", //传递操作控制
startGame:"10002", //传递开始建筑
next: "10003" , //传递执行下一个格子洪水流过
changePath: "10004", //传递操作控制
changeMap: "10005", //改变那地图
nextWater: "10006" , //传递执行下一个格子洪水流过
addEnd: "10007" , //添加结束点
setData: "10008" , //上传分数
guideNext: "10009" , //引导进入下一步
showResult: "10010", //展示治水结果
removeTip: "10011" //执行撤回或者后退动作,移除提示
}
/*
*
*/
@ -90,30 +104,5 @@ window.initMgr = function() {
tipErrLast: '之前确实看到过{植物},但最近一次似乎不是看到的呢',
});
//暂时不用
// cc.fx.clickStatEventType = {
// clickStatEventTypeVideoAD : 20173201,//视频播放完成
// clickStatEventTypeClickAdVideo : 20173202,//视频播放为完成
// clickStatEventTypeBannerAD : 20173203,//banner播放为完成
// clickStatEventTypeUserFrom : 99990001,//用户来源
// clickStatEventTypeShare : 99990002,//用户分享
// clickStatEventTypeClickAdBtn : 99990007,//点击分流icon
// clickStatEventTypeBannerAD2 : 67890033, // banner广告干预
// clickStatEventTypeSubmitVersionInfo : 9999, //上报微信版本及基础库信息
// clickStatEventTypeClickFirstAd : 99990003, //分流icon显示
// clickStatEventTypeClickSecondAd : 99990004, //玩家点击分流按钮
// clickStatEventTypeWxLoginStart : 10001,//微信登录开始
// clickStatEventTypeWxLoginSuccess : 10002,//微信登录成功
// clickStatEventTypeWxLoginFailed : 10003,//微信登录失败
// clickStatEventTypeAuthorizationStart : 10003,//授权开始
// clickStatEventTypeAuthorizationSuccess : 10004,//授权成功
// clickStatEventTypeAuthorizationFailed : 10005,//授权失败
// clickStatEventTypeLoginSDKStart : 10007,//登录SDK开始
// clickStatEventTypeLoginSDKSuccess : 10008,//登录SDK成功
// clickStatEventTypeLoginSDKFailed : 10009,//登录SDK时失败
// clickStatEventTypeTCP_Start : 10009,//TCP连接开始
// clickStatEventTypeTCP_Success : 10010,//TCP连接成功
// clickStatEventTypeTCP_Failed : 10011,//TCP连接失败
// };
};

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){

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 () {